I'm new to php started with aspx then was lead here. Anyways my pc was setup for aspx http://localhost and although I can view the simplest php files I can't seem to get the forms talking.
Also tried loading direct on server with php
I'm sure my code is right.
form_test.htm
Code:
<html>
<head>
<title>form_test.htm</title>
</head>
<body>
<h2>Please Send me your Comments on my Form Tutorial</h2>
<form method="post" action="form_result.php">
<input type="text" name="first_name">First Name:<br>
<input type="text" name="last_name">Last Name: <br>
<input type="text" name="email_address">E-mail Address:<br>
<textarea name="comments" cols="26" rows="4"></textarea>Comments<br>
<input name="submit" type="submit" value="Submit">
<input type="button" value="Reset">
</form>
</body>
</html>
form_result.php file
Code:
<html>
<head>
<title>form_result.php</title>
</head>
<body>
<h2>Below are the results from form_test.htm</h2>
<?php
// send input data to a new web page and thank user
print "<h2>Thankyou $first_name we received the following information</h2>";
print "First Name: $first_name <br>\n";
print "Last Name: $last_name <br>\n";
print "E-mail address: $email_address <br>\n";
print "Comments: $comments <br>\n";
?>
</body>
</html>
I can load the first page which appears to load the second but says
Notice: Undefined variable: first_name in c:\inetpub\wwwroot\x\y\form_result.php on line 14
First Name: ....
I think I'm getting the local and server confused. The x & y relate to the server and when loading the file it's bringing up the local inetpub\wwwroot. Is that correct?
I have tried placing the files in inetpup/wwwroot where I've setup my personal server and loaded the files from there and I get the following error
Below are the results from Form_test.htm
First Name: $first_name\n"); print("
Last Name: $last_name\n"); print("
Phone: $phone\n"); ?>
I'm really anxious to start absorbing the php code but without this initial stage I feel distraught.
Any takers to solve my problem.
Sorry I've been long winded but perhaps with all the details you can better advise.
Ta!