i have a php code here and wondering how can this display what you have wrote in the box:
i did this and it did display this one: “$input”; ?> “
<html>
<head></head>
<body>
<form action="message.php" method="post">
Enter your message: <input type="text" name="msg" size="30">
<input type="submit" value="Send">
</form>
</body>
</html>
===============
this is my message.php
<html>
<head></head>
<body>
<?php
// retrieve form data
$input = $_POST['msg'];
// use it
echo "You said: <i>$input</i>";
?>
</body>
</html>
=======
This is what i get as view page source:
<html>
<head></head>
<body>
<?php
// retrieve form data
$input = $_POST['msg'];
// use it
echo "You said: <i>$input</i>";
?>
</body>
</html>
If you view a html file from Notepad++, it will open in the browser from its location on the disk. Then the link in the form points to your php file on the disk. (The address field will read
file:///and the php won’t be parsed.)Notepad++ doesn’t know that the same file can be reached via http://localhost/namedform.htm so you’ll have to access it via localhost in order to get the php parsing for message.php to work. Now your address field should start with
http://. Later you can just hit “reload” in your browser after you made and !saved! any changes.edit:
Although reloading php pages after edit & save seems to me like the natural thing even after years of php programming, here are some solutions that let you preview your file from notepad++ via the web server:
http://orfile:///. If it is the latter, reload the file fromhttp://localhost.