Viewing my PHP files.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nomad
    Recognized Expert Contributor
    • Mar 2007
    • 664

    Viewing my PHP files.

    I'm using Dreamweaver mx2004 and XAMPP.
    When I write a php in Dreamweaver and I want to view it in my Broswer it does not show.
    Under Dreamweaver Management I have saved by php file in these directory.
    Local info
    Local Root folder C:\Program Files\xampp\htd ocs

    Romote info
    Access Local/Network
    Remote Folder: C:\testing

    Testing Server
    Server model: PHP MySQL
    Access Local/Network
    Testing sever Folder: C:\Program Files\xampp\htd ocs

    Are these setting right?

    thanks
    nomad
    PS here is my php code.
    [PHP]
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitl ed Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <?php
    $mood ="sad";
    if ($mood == "happy") {
    echo "hooray, !";
    }
    ?>
    </body>
    </html>
    [/PHP]
  • epots9
    Recognized Expert Top Contributor
    • May 2007
    • 1352

    #2
    u get a blank page cuz your not printing/echo-ing anything.

    your condition says if $mood equals happy echo blah, but u declared $mood to be sad so that condition return false and doesn't go.

    try:[PHP]$mood="happy";[/PHP] or (NOT BOTH) [PHP]if($mood != "happy")[/PHP]

    **make sure your service is running too.

    Comment

    • nomad
      Recognized Expert Contributor
      • Mar 2007
      • 664

      #3
      Originally posted by epots9
      u get a blank page cuz your not printing/echo-ing anything.

      your condition says if $mood equals happy echo blah, but u declared $mood to be sad so that condition return false and doesn't go.

      try:[PHP]$mood="happy";[/PHP] or (NOT BOTH) [PHP]if($mood != "happy")[/PHP]

      **make sure your service is running too.
      thanks epots9 that was it I forgot to add another echo for the sad part.

      nomad

      Comment

      Working...