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

Does PHP use something like ASP query strings

Status
Not open for further replies.

rizza

Programmer
Jul 16, 2002
66
US
I'm a ASP developer, and am having trouble getting the hang of PHP, but then again my brain is so fried today.

I'm trying to make a page that will allow me to add a link to my DB. I wanted to use one page for all operations and just send it a query string and use the querystring in a case statemnt to determine whether to process the form or display the add link form.

My second question is does anyone have any good examples of form processing and or case statements that i can refrence.

Thanks in advance,

Rizza
 
Here is a very simple example.
Code:
<?php
if (!empty($_GET['name'])) // if $_GET['name'] has any contents...
{
    echo &quot;Hello &quot; . $_GET['name'] . &quot;<br />&quot;;
}
else // else...
{
    echo &quot;Submit a name.<br />&quot;;
}
?>
<form action=&quot;<?=$_SERVER['PHP_SELF']?>&quot; method=&quot;GET&quot;>
<input type=&quot;text&quot; name=&quot;name&quot; /><br />
<input type=&quot;submit&quot; value=&quot;Send&quot; />
<form>
This script only works with PHP 4.2.0 or later, but I think you get the point. //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top