Re: form variables
| From: | Kurth Bemis | Date: | Thu, 09 Nov 2000 10:18:29 +0000 |
| Subject: | Re: form variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-24464@lists.php.net to get a copy of this message | ||
At 03:44 PM 11/9/2000 +0530, Anand Manik wrote:
i'm going to point out that you should never connect to a db as root to do routine things (querries, simple inserts, etc...)
ofcourse I Did Actually the real problem is the below code is not working : <? $connection=mysql_connect("localhost","root","krishna") or die ("Couldn't connect to server"); $db1=mysql_select_db("isp",$connection) or die ("Couldn't connect to database"); $q1="select * from user where username='$loginname'"; $result1=mysql_query($q1,$connection) or die ("Couldn't execute query"); $num=mysql_num_rows($result1); $row=mysql_fetch_array($result1); if ($num!=0){ if ($password==$row["password"]){ echo ("Login Successful"); } else echo ("Sorry your password is wrong"); } else echo ("Sorry your name does not exist"); mysql_free_result($result1); mysql_close($connection); ?> Hence i tried to display the form variable 'loginname' but it is not displayed. Thanks for your response Anand Manik ----- Original Message ----- From: "Brian Clark" <brianj@fusionwerks.com> To: "Anand Manik" <amanik@im.eth.net> Cc: <php-general@lists.php.net> Sent: Thursday, November 09, 2000 3:17 PM Subject: Re: [PHP] form variables Anand Manik wrote: after submitting a form i cannot access the form variables in the next php file. i have tried displaying : echo ($loginname); but it does not work I'm guessing that you *did* wrap the above in <? ?> right? As in: <?php echo $loginname; ?> -Brian please help Thanks Anand ManikKurth Bemis - Network/Systems Administrator, USAExpress.net/Ozone Computer There is no sin except stupidity. -- Oscar Wilde kurth@usaexpress.net | http://www.usaexpress.net/kurth PGP key available - http://www.usaexpress.net/kurth/pgp Fight Weak Encryption! Donate your wasted CPU cycles to Distributed.net (http://www.distributed.net)