Click to See Complete Forum and Search --> : argument passing problem


Anon
06-26-2002, 03:49 PM
i am using php v4.2.1

i face a problem when run the code below (test.php)

<?php

if($name){
echo("$name");
}
else{
echo("<form name='asdf' method=\"post\" action=\"test.php\">please input your name<input name=\"name\" type=\"text\"><input name=\"enter\" type=\"submit\" value=\"enter\">");
}

?>

it seem that the file didn't receive the var passed to itself after the user submit their name, i wonder what is the problem, could it be a configuration problem? i run php as a service of Apache v 1.3 on windows 2000 server, can anyone help me? thanks

Anon
06-26-2002, 07:16 PM
PHP no longer has global variables on by default so you might want to turn them on in the php.ini file. Or you can access form variables using $_POST[variable_name] and $_GET[variable_name]

Anon
06-27-2002, 12:43 AM
thanks a lot, it really solve the problem.