Re: form variables

From: Date: Thu, 09 Nov 2000 10:54:28 +0000
Subject: Re: form variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-24475@lists.php.net to get a copy of this message
Thanks a lot for your help. I have found the solution : the register_global setting was mentioned as OFF in the php.ini file. after setting it ON the script runs successfully Thanks again Anand ----- 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:43 PM Subject: Re: [PHP] form variables > 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 >

« previous php.general (#24475) next »