php woild not pass values

Valery1

Registered
Hello,everybody!
I installed MAMP om my Mac ( running MACOSX 10.3.9),it works ok,but php 5.0 would not pass values.
In case of values to go from a form to php page for processing I am totally lost.IT IS a deadlock. Values entered do not stay.

Page 1.
<html>
<head>
<title>hello</title>

</head>
<body>
<center>

<form method = "post"
action = "process.php">
<h1> please enter your name:</h1>
<input type = "text"
name = "userName"
value = "">
<br>
<input type = "submit">

</center>
</body>
</html>

So here I input something and go to

Page2 (process.php)

<html>
<head>
<title>hello</title>

</head>
<body>
<center>
<h1>Greeting</h1>
<?
print "<h2>Hello,$userName!</h2>";
?>

</center>
</body>
</html>
The result is "Hello,!"
- and no nothing, the name entered in page 1 in gets kicked.
Maybe someone knows what is wrong.
Thanks.
Valery.
 
Cmcdonal1, HURRAH. You are helpful. Because your tip helped. Now the pages happily communicate.
You know what? For me this is half of the puzzle.
The school book I have says as HTML page with a form in it goes to PHP page for processing , PHP automatically turns all elements of the form into variables.So in our case userName is turned into $userName. And the value entered in userName is supposed to stay in $userName.
AND IT DOES.If we test the above pages on PC. Everything works fine on my PC with W2K on it.
Whereas on Mac variable userName needs to be specified twice:pHP does it by default, then you enhance with $userName = $_POST['userName'];
And if you don't,it does not work.
 
The newer versions of PHP disabled the direct $varname access to POST variables for security reasons.
 
Back
Top