I am just starting to learn php, so Im not sure how to make this work. Im not sure if this is something to do with my server or not. Any ways, here is my problem.
I have this code for my html portion:
[code]
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
“http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<title>Untitled Document</title>
</head>
<body>
<form action=”welcome.php” method=”GET”>
Enter your name: <input type=”text” name=”name” /><br>
Enter your age: <input type=”text” name=”age” />
<input type=”submit” />
</form>
</body>
</html>
And I have this code for my php portion:
[code]
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<title>Untitled Document</title>
</head>
<body>
Welcome <?php echo $_GET[“name”]; ?>.<br />
You are <?php echo $_GET[“age”]; ?> years old!
</body>
</html>
As you should know it should print something like this:
Welcome John.
You are 28 years old!
But this is what it actually prints:
Welcome .
You are years old!
Anyone know how to fix this problem?
By the way I used Post and Get