View Single Post
  #4 (permalink)  
Old 08-07-2007, 07:24 AM
TeraTask's Avatar
TeraTask TeraTask is offline
PT Admin
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 3
Join Date: Jun 2007
Location: Reno, NV
Posts: 440
iTrader: (0)
TeraTask is a splendid one to beholdTeraTask is a splendid one to beholdTeraTask is a splendid one to beholdTeraTask is a splendid one to beholdTeraTask is a splendid one to beholdTeraTask is a splendid one to behold
$_GET is for when the variable is in the URL.
$_POST is for when the variable is posted.

Had you done
PHP Code:
<form action="<?php echo ($_SERVER['PHP_SELF']); ?>" method="POST">
<input type="hidden" name="p" value="submitted" />
Admin Username: <input type="text" name="adminuser" accesskey="u" /><br />
Admin Password: <input type="text" name="adminpass" accesskey="p" />
</form>
You would have had to use $_POST

Note also that had you done

PHP Code:
<form action="<?php echo ($_SERVER['PHP_SELF']); ?>" method="GET">
<input type="hidden" name="p" value="submitted" />
Admin Username: <input type="text" name="adminuser" accesskey="u" /><br />
Admin Password: <input type="text" name="adminpass" accesskey="p" />
</form>
That all variables would be in the URL when the form was submitted and subsequently they'd all be available via $_GET (not too bright for a username/password, but I am trying to give an example)

BTW: It doesn't hurt to give people a submit button. Few will realize that they can just hit enter.

__________________
Jeremy Miller
Content Farmer - Optimized Automated Blog Posting

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
The Following User Says Thank You to TeraTask For This Useful Post:
HelloWorld (08-09-2007)