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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bizzare URL arguments problem

Status
Not open for further replies.

awingnut

Programmer
Joined
Feb 24, 2003
Messages
759
Location
US
I have a php page that has me stumped. Under what circumstances will php not recognized URL arguments and create the appropriate variables?

I have the following URL (created by a form using "GET"):


When this page is executed, my server log says:
&quot;Undefined variable: first_name in <blah-blah> on line 10&quot;
&quot;Undefined variable: last_name in <blah-blah> on line 12&quot;

How can these variables be undefined since they are clearly in the URL? TIA.
 
Thanks for the suggestion. You had my hopes up but all that did was change the error message from &quot;Undefined variable&quot; to &quot;Undefined index&quot;.
 
Ugh! The HTTP server is 4D WebSTAR on OS X. PHP is pre-installed with the product.
 
Thanks. Sure:
Code:
echo $_POST[&quot;first_name&quot;].&quot; &quot;.$_POST[&quot;last_name&quot;].&quot; has been added to list.<br>&quot;;
FWIW, here is the code that generates the &quot;Undefined variable&quot;:
Code:
echo $first_name.&quot; &quot;.$last_name.&quot; has been added to list.<br>&quot;;
 
That was it, thanks. I suggest the FAQ be modified to clarify that distinction. That is where I got the $_POST format.
 
I started editing the FAQ right after I replied to your post. It now explains the uses of $_GET, $_COOKIE, and $_SERVER.

The new version is available. Would you take a look at it and tell me what you think? I'd prefer you not post your critique in the forum, but there is an &quot;email the FAQ author&quot; feature of the FAQ system.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
I tried sending a comment via the link in your FAQ but the comment window has a problem. The comment text box is only 1 pixel wide and not expandable.

In any case it looks fine and thanks for the effort.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top