Why does the PHP tags and all display in browser

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • afrigo
    New Member
    • May 2013
    • 1

    Why does the PHP tags and all display in browser

    Hi, Ive got wamp, did a simple php code, put it in the www folder. then double click testpage.php for example. A pop up window comes up and says what do you want to do.
    Search the Web for software that can open your file.
    or Open using already installed software.
    I click second option then click ok.
    Another pop up window comes up, says choose the program you want to use to open this file.
    shows Internet Explorer. I click ok.
    Then the php tag and everything opens in the browser, not the output. Is that correct.
    How can I see the output without the Tags showing.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi.

    WAMP is server software. It's important to understand that, because if you don't you will face all kinds of problems when you start learning PHP. - The "A" in WAMP stands for "Apache", which is the common name for the popular HTTP server. It is used to turn a computer into a web host, allowing browsers to connect to the computer and request web documents. When you request PHP documents through a web host, the HTTP server will execute the PHP code and return the resulting output to the browser.

    Normally when you connect to a web host, you do it through a domain name like "byes.com". However, for local development of websites it is common to set up a localhost, which is what WAMP is mostly used for. - The difference is that a localhost doesn't have a real domain name. So in order to connect to the localhost, you need to use the special "localhost" domain instead of a real domain.

    So, in order to use the WAMP server, open your browser and type in: http://localhost/. Then add then name of the PHP file you want to execute to that URL.

    Double clicking the file and opening it in a browser like you would a Word document or a MP3 file won't work. It needs to be executed through the web host, or it won't be executed at all.

    Comment

    Working...