PHP script code is displayed instead of executed
Posted: Tue Nov 08, 2005 3:20 am
Hello everybody,
I am a newbie in php and this is my first post to the php community.
I installed Apache 1.3 and php 4 (I got both of them on a CD together with a book about MySQL and php) on Win XP and started to learn php.
The installation of php has been tested with the command http://localhost/info.php and the known php configuration text was displayed.
This means that a php installation was successful. Whenever I start a php script directly in form http://localhost/xxx.php the script works fine.
The problem appears when I want to use a form together with a php script. I prepared a simple form with one text field and submit button:
<form action="action.php" method="post">
<p>Your name: <input type="text" name="name" /></p>
<p><input type="submit" /></p>
</form>
The action.php is:
Hello <?php echo $_POST['name']; ?>.
If I submit the name (for example "kekec", then the browser shoes the above mentioned source code of the php script instead of "Hello kekec".
Any idea or advice is very appreciated.
kekec
I am a newbie in php and this is my first post to the php community.
I installed Apache 1.3 and php 4 (I got both of them on a CD together with a book about MySQL and php) on Win XP and started to learn php.
The installation of php has been tested with the command http://localhost/info.php and the known php configuration text was displayed.
This means that a php installation was successful. Whenever I start a php script directly in form http://localhost/xxx.php the script works fine.
The problem appears when I want to use a form together with a php script. I prepared a simple form with one text field and submit button:
<form action="action.php" method="post">
<p>Your name: <input type="text" name="name" /></p>
<p><input type="submit" /></p>
</form>
The action.php is:
Hello <?php echo $_POST['name']; ?>.
If I submit the name (for example "kekec", then the browser shoes the above mentioned source code of the php script instead of "Hello kekec".
Any idea or advice is very appreciated.
kekec