😕 help!
I am using simple code to test if my variables(lastname, firstname) can pass from the HTML page(myvars.htm) to the PHP code(variables.php) and display those variables. It seems as though there is no connection between the HTML code to PHP since it doesn' t pick anything up to display.
This is the HTML page i am using(myvars.htm):
<html>
<head>
<title>My Variables HTML Form</title>
</head>
<body>
<h4>My HTML Form</h4>
<form name="myform" method="post" action="variables.php">
Enter Firstname: <input type="text" name="firstname"><br>
Enter Lastname: <input type="text" name="lastname"><br><br>
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
The is the PHP code that just displays the lastname and firstname form the HTML form:
<html>
<head>
<title>My Variables PHP Script</title>
</head><body>
<p>The query string is: <?php echo($QUERY_STRING); ?></p>
<p>Firstname: <?php echo($firstname); ?></p>
<p>Lastname: <?php echo($lastname); ?></p>
</body>
</html>
when i hit submit, this is what i see in the next page, it doesn't output what i type in the fields:
The query string is:
Firstname:
Lastname
can this be a problem due to the way PHP was compiled on the system??
I have no idea why the variables aren't being displayed. I desperately need someone's help...
Thanks in advance,
Sara