SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Wizard subnet_rx's Avatar
    Join Date
    Aug 2001
    Location
    Hattiesburg, MS
    Posts
    1,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Weird Firefox/PHP problem

    Does anyone else have problems viewing the source in Firefox? I've got database output going to a php page that I'm viewing through Firefox. The page looks fine, the images and information are there, but when I hit view source, the source stops where the PHP starts and gives a notice of a missing variable. It's almost as if the source and the actual page are two different entities.

  2. #2
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Link? Also, PHP is server side - which browser you use won't have an effect on the output.

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2004
    Location
    Madison, WI
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what page are you viewing? things like this usually happen to me when the notice occurs in a dropdown menu...the whole page will look normal, but you'll only see the notice in the source

  4. #4
    SitePoint Enthusiast bind727's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Alberta
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To expand on "Someonewhois"... Any code in between <?php and ?> will not show up in source code in a browser unless it is echoed or printed

    echo('test'); or print('test');

    The notice is usually a variable that is being used that isn't defined. To test if the variable you have the error on exists use a test statement like

    if(isset($myTroubleVariable) ) {
    // Use variable
    } else {
    // variable not set and in my case the variable is usually $_GET['trouble']
    }

    If you dont want to handle the case of it being not set you can also add an @ before the variable in question.

    ie:
    <?php echo(@$myTroubleVariable); ?>
    +---------------------------+
    Joel Pittet | Web Developer
    www.JoelPittet.com
    +---------------------------+

  5. #5
    SitePoint Wizard subnet_rx's Avatar
    Join Date
    Aug 2001
    Location
    Hattiesburg, MS
    Posts
    1,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes, I realize that PHP is server side code. But, if an image is on a page, shouldn't you see an <img> tag? I see it in IE, but not Firefox.

  6. #6
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by subnet_rx
    But, if an image is on a page, shouldn't you see an <img> tag?
    Yep, you will.

    Show us a link to your problem page.

    Douglas
    Hello World

  7. #7
    SitePoint Wizard subnet_rx's Avatar
    Join Date
    Aug 2001
    Location
    Hattiesburg, MS
    Posts
    1,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    actually, i can't, it's a script that I'm writing that I'm hosting locally. I just wanted to know if anyone else has had this problem. It's very strange.


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
  •