Connecting HTML from to PHP?

  • SaraPHP
  • Born
  • Born
  • SaraPHP
  • Posts: 1

Post 3+ Months Ago

I created a HTML form and connect the file to PHP for retrieving the data. Although both files are on the same directory but when I open the HTML file (copy and past the file address on the Firefox or IE) after getting the info, my PHP doesn’t read the info and just giving me the variable name instead of correct entered info (like: Hello $userName) Although my codes are correct in both PHP and HTML ( I copy and past a code from a book to test it.) but no response. This makes me crazy that why it doesn’t work. I even tried to copy HTML and PHP on my hdoc for XMAPP but no luck. The same thing I tested on phpdesigner 7 but no response. Even I opened the book CD to read the file but nothing work!
Please help me!

55 minutes ago - 4 days left to answer.

Additional Details:
HTML Code: [ Select ]
<form action="welcome.php" method="post">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" />
  1. <html>
  2. <body>
  4. <form action="welcome.php" method="post">
  5. Name: <input type="text" name="fname" />
  6. Age: <input type="text" name="age" />
  7. <input type="submit" />
  8. </form>
  10. </body>
  11. </html>

Here is my PHP code:

PHP Code: [ Select ]
Welcome <?php echo $_POST["fname"]; ?>!
You are <?php echo $_POST["age"]; ?> years old.
  1. <html>
  2. <body>
  4. Welcome <?php echo $_POST["fname"]; ?>!
  6. You are <?php echo $_POST["age"]; ?> years old.
  8. </body>
  9. </html>

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 28 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.