Reputation: 67
I am starting with PHP and read this page from w3schools: http://www.w3schools.com/php/php_forms.asp
There is a code example to enter your name and e-mail and below it there is another code example that can echo the inputs of the form. The problem is that my inputs are not displayed on the second page.
The code of the form:
<!DOCTYPE HTML>
<html>
<body>
<form action='welcome.php' method='post'>
Name: <input type='text' name='name'><br>
E-mail: <input type='text' name='email'><br>
<input type='submit'>
</form>
</body>
</html>
The code of the output page (welcome.php):
<html>
<body>
Welcome <?php echo $_POST['name']; ?><br>
Your email address is: <?php echo $_POST['email']; ?>
</body>
</html>
Why are my inputs not displayed on the welcome page? Thank you for your help
11.02.2015
I have xampp and it should run fine
I also put my sourcefile in the correct folder htdocs
I followed this tutorial (its German sorry :( ) http://www.php-einfach.de/php-tutorial/php-erste-schritte.php
Do you know what am I missing?
Upvotes: 0
Views: 77
Reputation: 443
you can't open PHP by double-click it like you are opening HTML files, it can't run on c:\ you should access it like http://localhost/test2/welcome.php
and you need PHP interpreter too.
Upvotes: 2