Re: form variables
| From: | Brian Clark | Date: | Thu, 09 Nov 2000 10:13:01 +0000 |
| Subject: | Re: form variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-24473@lists.php.net to get a copy of this message | ||
Anand Manik wrote:
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); ?>Above, you're not echoing $loginname, but you know that. Do you get _anything_ printed with the above block of code? Any error message? You should at least get 'Sorry your name does not exist' -- if not anything from the die() calls. -Brian
Hence i tried to display the form variable 'loginname' but it is not displayed. Thanks for your response Anand Manik