SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2007
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    So simple, but can't remember - looks like comments in source

    Ok, so I haven't used php in such a looong time ... I think I've forgotten most of what I knew

    So I'm trying to get the page name of the current page - here's the page from the start up to the <head> tag:

    Code:
    <?php echo "Server:".$_SERVER['REQUEST_URI']."<HR>";?>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    Now, when I type the url in, what displays (before the rest of the page) is this:

    ";?>

    What have I forgotten????
    I know it's gotta be the simplest thing ....

    Cheers for indulging me!

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    That looks like the page was not processed as PHP. If you right click the page then "view source", I'll bet you see the PHP code. Did you not name the page with a .php extension?

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2007
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Dan,

    That was my first thought too ... and yes, I can see the php code in the pafge source.

    But I'm running apache and php on my local box ... I've tried restarting it but still n o luck ..

    Oh, the page is called index.php, so it's got the correct ext...

  4. #4
    SitePoint Zealot
    Join Date
    Dec 2007
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wierd ... I can run other php scripts on my localhost but it doesnt seem to want to parse this particular one - or a coupla others I've just set up.

    should I post in the apache thread??


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •