I cannot get my output.

May 6, 2011 at 18:15:22
Specs: Windows XP, 896MB of RAM
I want to do this:
my html form is like below:
I have written code below in a notepad text file and I have saved the file as Test.html using a .html extension and output of the form is appearing very well but when I am submitting the form to get my output the output is not coming at all only just opening the Welcome.php file in the browser.
-----------------------------
<html>
<body>

<form action="welcome.php" method="post">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>

</body>
</html>
---------------------------
I have created the Welcome.php file using a notepad in this way:
I have Opened Notepad: By default I have usually found Notepad by choosing Start > All Programs > Accessories > Notepad from my start menu.

I have entered my PHP code into Notepad.

Then I have Saved my work: Choosing Save As from the File menu.
I have entered the file name as Welcome.php being sure to include the .php extension.
Then I have set the "Save As Type" to All Files.
Finally, hit the Save button.
and the Welcome.php file is like below:
-------------------------------
<html>
<body>

Welcome <?php echo $_POST["fname"]; ?>!<br />
You are <?php echo $_POST["age"]; ?> years old.

</body>
</html>
-----------------------------------
using the above HTML form and the Welcome.php file
I want to get the output like below:
----------------------------
Welcome John!
You are 28 years old.
---------------------------------------------

I cannot get the result.
When I am submitting the form (input Name: John Years: 28) I get the result like below:
Welcome.
Your are years old.
But I want to get result like below:
Welcome John!
You are 28 years old.
What is the wrong in my doing?

Please tell me step by step how to create a Welcome.php file and where to create it.
Is it proper to create a Welcome.php file using notepad or any other way. Please tell me step by step.
How do I write the programme to get the output in HTML programming?


See More: I cannot get my output.

Report •

#1
May 7, 2011 at 16:47:57
This post should be here for more help: http://www.computing.net/forum/webd...

Report •
Related Solutions


Ask Question