I have PHP4.2.1 on PWS ISAPI version. I have the following script in HTML; <form action="send.php" method="post"> <input type="text" name="firstname"> <input type="text" name="lastname"> <input type="submit" value="submit"> </form> I want to pass the variables of $firstname and $lastname. I have register_globals=off as that is recommended and I have tried to use $POST in the receiving php script that would post the users entered text from "firstname" and "lastname". I am doing something wrong as the php does not recognize the variable. Nothing comes up. What am I doing wrong and what should my php script look like? LIke this????? <? $POST['firstname'];
on the send page all ou should need is $lastname, $firstname to work...
I might be overly simplifying it but try <? echo $_POST['firstname']; ?> You didn't have that echo statement so nothing was being done with the variable.
Also, try var_dump($_POST); to get all the post values.
write the following in "send.php":
<? echo $POST['firstname']; echo $POST['lastname']; ?>
do you see your variables?
that won't work, register_globals is OFF
I did do that but the receiving page did not show the variable - it was blank. I'm wondering if It is something with PWS as that is my only choice for a web server right now. I am having the same problem with a similar page and I have tried every possible way with syntax. Would you recommend dumping PWS and installing another server? Thanks so much for all your help and replies.
try
<? print_r ($_REQUEST); ?>
what do you see?
Tried that and it said it was an undefined variable. I tried doing this same page on my computer at home which has older PHP version but is CGI with globals=off and it works! I don't understand. Under PWS and the latests version of PHP 4.2.1 no variables are being passed. What's wrong??