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!

PHP beginner here, any and all help would be appreciated.

Status
Not open for further replies.

vcherubini

Programmer
May 29, 2000
527
US
Hello. I am a Perl Programmer, and am recently getting into PHP because I have seen its powers. After all, the creator of Perl, Larry Wall, is stopping Perl to learn PHP, so it must be pretty powerful.<br><br>My question is how would you collect data from a form on a webpage? Does anyone have a script that does this (I would imagine that they are quite popular) or does anyone know where I can go to download a script that would do that.<br><br>I know how to do it in Perl, thats easy, but now I would like to learn how to do it in PHP.<br><br>Any help would be greatly appreciated.<br><br>Thanks a lot.<br><br>-Vic
 
It's very easy, When you create your form add a action like <br>&quot;print.php3&quot;. When you will submit your form the information will be send as parameter in the address. For exemple, if you have a form with a text input called surname. When you submit this the address requested to the server will be &quot;print.php3?surname=aDomf&quot;<br><br>In you php3 file, you can use this data calling $surname.<br><br>So you give a name to your element in the form and when you submit you can use the same name (adding $ at the begining) in your php3 file to use the data.<br><br>
 
Dear vikter,<br><br>aDomf is correct. You do so by using (for example) $name for an input field called &quot;name&quot;.<br><br>However 2 points that aDomf forgot to mention. 1 this works on all input fields, not just textfields (eg: Hidden fields, selection fields ... etc).<br><br>The other point is that this methodology will work whether you use get (which aDomf used in his example), or post. With post, you will not see the fields on the end of the URL string, but be assured that the fields are there!<br><br>Yours Sincerely,<br>&nbsp;&nbsp;Terry F. Jones
 
What's this about Larry Wall stopping Perl to learn PHP?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top