homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

Very strange Browser output
godfrey tan2001

 2:00 pm on Jun 5, 2013 (gmt 0)


Here are my codes:

<!doctype html>

<html lang="en">


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


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

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

Browser URI

I am running XAMPP with Apache server. Seems like parameters from form not passed to welcome.php file.

Do you know what is the matter?



 2:31 pm on Jun 5, 2013 (gmt 0)


You're accessing the file directly instead of through your Apache server. You need to access via http:// and point it at your server, otherwise no server side processing can happen.

godfrey tan2001

 2:53 pm on Jun 5, 2013 (gmt 0)

Hi Fotiman,

If my XAMPP default directory is c:\xampp\htdocs. How do I convert this to http for welcome.php?

Can you just give me an example?


godfrey tan2001

 3:05 pm on Jun 5, 2013 (gmt 0)

Hi Fotiman,

Thank you very much for your reply. Much appreciated...



 3:19 pm on Jun 5, 2013 (gmt 0)

So, if it's running as a server, then you would probably do something like
http://localhost/test1.html (depends on how you've configured it and if you're in a subdirectory, etc.)


 8:49 pm on Jun 5, 2013 (gmt 0)

If it behaves approximately the same as MAMP, you need to go into its preferences --or whatever your platform calls them-- and select a default directory.

You can never open the file directly from your desktop; it has to be done within the browser. Make a "WAMP site" or similar bookmark and you won't have to memorize the URL. (Mine's http:/ /localhost:8888/ That's the free version, where you can only use one domain at a time. I think the fancier version comes with a pseudo-DNS so you can do multiple domains.)

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved