My server doesn't show my php webpage

Discussion in 'Programming' started by dbj_us, Sep 19, 2008.

  1. #1
    Hello,

    i am kind of new in programming and now i have a question. I tried to figure it out on my own, but... :(

    I created my webpage solely with html. Since i don't want to change my navbar on every page when i have some minor changes, i tried to implement it with php.

    I did the navbar kind of like this:

    <div>
    <ul>
    <li>link1</li>
    <li>link2</li>
    </ul>
    </div>
    HTML:
    In the body of my page i wrote this :

    <?php include('navbar.html);?>
    PHP:

    I changed my page from default.html to default.php. But when i now upload my webpage to the server, it will not get online.

    Where is the mistake? Is there a fault in my code or does it have to do with my server? My server definitely supports php...is there anything i have to change before i can make php pages visible..like a database or sth.????

    Sorry for this probably easy question, but just started learning php.

    Thanks a lot,
    Maurizio
     
    dbj_us, Sep 19, 2008 IP
  2. Panzer

    Panzer Active Member

    Messages:
    381
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #2
    You missed a '
    Make sure the file is in the same directory as the navbar, and make sure navbar is .html, not .htm

    <?php include('navbar.html');?> 
    Code (markup):
     
    Panzer, Sep 19, 2008 IP
  3. dbj_us

    dbj_us Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for this fast response Panzer. I will try it again like you said.
     
    dbj_us, Sep 19, 2008 IP
  4. dbj_us

    dbj_us Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I added the ' but i still have the same problem. The weird thing is that the whole page is not visible and i just get a "page not found". Do I have to change any settings in my server menu?

    i.e. My directory is called html. Within this directory there is a folder called php_uploads. Do i have to save my php pages in this folder?

    Before i did everything in html and it worked perfectly. When i change my pages to php they will not be visible anymore :confused:


    Thanks to everyone who can give me some helpful hints!

    Maurizio
     
    dbj_us, Sep 19, 2008 IP
  5. serialCoder

    serialCoder Guest

    Best Answers:
    0
    #5
    hmm, i wonder what the name of your file is though and if you have successfuly set up php/apache
     
    serialCoder, Sep 19, 2008 IP
  6. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #6
    er, this may be an obvious thing to try but humour me... are whereas it used to be that the default directory index was default.html / htm, it does not follow that the php equivalent is also default.php

    have you tried actually going to hxxp://yourdomain/default.php? or renaming to index.php? :)

    but yeah, if PHP has not been compiled correctly / crashes / application type handler for .php not setup, you'd see blank pages. But: you won't see 'page not found' - which leads me to believe you are not trying the correct filename.
     
    dimitar christoff, Sep 19, 2008 IP
  7. Panzer

    Panzer Active Member

    Messages:
    381
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    58
    #7
    Your html file needs to be in the same folder/directory as your PHP file. Not a different one.
     
    Panzer, Sep 19, 2008 IP
  8. ApotikoS

    ApotikoS Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Make sure you have installed an apache server, that's the result to having no apache active..
    Good luck
     
    ApotikoS, Sep 19, 2008 IP
  9. chmdznr

    chmdznr Active Member

    Messages:
    417
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    78
    #9
    I think your server uses IIS as webserver, that's not quite good for PHP.
     
    chmdznr, Sep 19, 2008 IP