Reply to Re: Passing Variables

Your name:

Reply:


Posted by ZeldorBlat on 11/17/05 17:30

>I'm trying to pass variables, and can do so just fine with a URL, and $_GET.
>What I would like to learn, and be very adept at using is the Form functions
>and how you pass through that.
>
>The problem in my comprehending this, is how does the original page know how
>to post the data to the new page? Or do you create the form on the original
>page, and somehow, magically, the new page can read from it?

Yes -- you create the form on the original page and specify where the
form should be submitted. Suppose on page1.php you had something like
this:

<form action="page2.php" method="post">
<input type="text" name="foo"/>
<input type="submit" name="submit" value="Submit"/>
</form>

So when someone fills in this form and hits submit, the browser will
post the form data to page2.php. On page2.php you can access foo and
submit through the $_POST superglobal (in exactly the same way you get
to the GET variables). Also note that there is nothing that prevents
you from putting the current page into the "action" attribute -- that
is, it is perfectly valid (and often quite useful) to have a page with
a form post to itself.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация