Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

$_GET problem - empty array

Status
Not open for further replies.

KempCGDR

Programmer
Jan 10, 2003
445
GB
Hi, I am attempting to write a login script (the first one I've had to do), and I have a problem. The username and password information is passed to another page via GET, but the $_GET array on that page appears to be empty.

The form on the first page is below:

<form method=&quot;GET&quot; action=&quot;checklogin.php&quot;>
Name: <input type=&quot;text&quot; name=&quot;Name&quot; size=&quot;20&quot;><br>
Password: <input type=&quot;password&quot; name=&quot;Password&quot; size=&quot;20&quot;><br>
<br>
<input type=&quot;submit&quot; value=&quot;Login&quot; name=&quot;Login&quot;>
</form>

and the entire contents of checklogin.php are:

<?php

echo &quot;Name entered was: &quot;;
echo $_GET['Name'];

?>

I am using the above until I can actually get the info to use and hence be able to write the script.

The output from checklogin.php is:

Name entered was:

Is there something wrong with how I am using $_GET?
 
After a bit of playing around, I've switched to POST, but problem is still there. Now the password isn't displayed in the address, which is always handy.
 
Problem vanished with the change to POST, any explaination anyone?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top