PHP help
I have a question about PHP and HTML forms. If I have a form and post it to a PHP script, it passes the input names as varibles. So I don't have to declare them in the script? Are the varibles Global to that script?
Chris
Web Development
I have a question about PHP and HTML forms. If I have a form and post it to a PHP script, it passes the input names as varibles. So I don't have to declare them in the script? Are the varibles Global to that script?
Chris
by danielk
by vze2f6h6
by sachinp78
Yes the variables are global.
You can retreive all the variables using a single while loop.Script as follows
************************************
if (isset($HTTP_POST_VARS)){
//body Stores all the form inputs
$body = '';
//Iterate through all the Posted variables, and add them to the message body.
while (list($key, $value) = each($HTTP_POST_VARS)){
$body .= $key . ' = ' . $value . "\r\n";
}
by vze2f6h6
by vze2f6h6
This discussion is closed to new replies.
Sort by Trending