Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
June 17, 2005, 2:55 pm
rate this thread
You can use POST or GET to "send variables" to the next page.
GET is what you have listed in your question.
POST is when you use a form. From the PHP web site:
When a form is submitted to a PHP script, the information from that
form is automatically made available to the script. There are many ways
to access this information, for example:
Example 12-8. A simple HTML form
<form action="foo.php" method="post">
Name: <input type="text" name="username" /><br />
Email: <input type="text" name="email" /><br />
<input type="submit" name="submit" value="Submit me!" />
You may get the POST 'username' variable (from the form above) by using
You may retrieve the GET variable 'a' (from index2.php?a=0&b=1&c=2)
by the using these
PHP stuff :
June 17, 2005, 12:24 pm
*** Sentinel wrote/escribió (Fri, 17 Jun 2005 09:55:59 +0000 (UTC)):
I suggest that you get a basic PHP tutorial rather than trying to figure
out how things work, it'll be less frustrating.
About your question, you can generate HTML just typing it outside the PHP
// This is PHP
?> This is HTML
Or you can use echo or print statements:
echo 'This is HTML dynamically generated from PHP';
You read URL parameters from the $_GET associative array:
echo 'Param a=' . $_GET['a'];
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group