Forum Moderators: coopster
None of the variables passed thru the HTML files once filled are displayed in the process.php
I checked my PHP.ini file it says register_globals=On
Any help please?
I have following 2 files
____________________________________________
TEST.HTM
<form action="process.php" method="post">
Name: <input type="text" name="name" size="20" maxlength="20"><br />
Email: <input type="text" name="email" size="30" maxlength="30"><br />
Subject: <input type="text" name="subject" size="30" maxlength="30"><br />
Text: <textarea name="text" cols="50" rows="10"> </textarea><br />
<input type="submit" name="submit" value="Send">
</form>
_____________________________
Process .PHP
echo $HTTP_POST_VARS['name'] . "-1 line<br>";
echo $_POST['name'] . "-2 line<br>";
echo $_GET['name'] . "-3 line<br>";
_____________________________
What it displays is
-1 line
-2 line
-3 line
whya are the form fields that has been inputed not displayed?
First, have you considered turning register_globals off if at all possible? The PHP manual explains implications best -- Using Register Globals [php.net]. Besides, you aren't using your variables in that manner anyhow, at least not in this example you have provided.
Next, those variables should indeed be populated. Are you certain you have typed something into the "name" input type? Try checking the $_POST superglobal at the top of your "process" script after a filled in form submittal. The reason I tell you to check the $_POST superglobal is because that is the form method you are using -- <form method="post">.
<?php
if (isset [php.net]($_POST['submit'])) {
print '<pre>';
print_r [php.net]();
print '</pre>';
exit [php.net];
}
?>
I implemented it.. its still giving me blank .
My ini files have following variables set
magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
max_execution_time 30 30
max_input_time -1 -1
memory_limit 8M 8M
open_basedir /home/httpd/vhosts/testme.com/httpdocs:/tmp no value
output_buffering no value no value
output_handler no value no value
post_max_size 8M 8M
precision 14 14
register_argc_argv On On
register_globals On On
At the top of process.php, put in a line like
echo "We are here: " . __FILE__;
Usually if I add debugging and I get no output, it's because I've gotten confused using my FTP client. That happens to other people, right? Right?
Anyway, if you are in the right file, somehow the form is not getting submitted. Get rid of the condition that tests for $_POST['submit'] and add in a
print_r($_GET);
and see what you get for output. If nothing else, you can test by calling
http://example.com/process.php?param=test
so that you can verify that it's sending output.