1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Exclude some JS code on another page?

Discussion in 'HTML & JavaScript' started by Roparadise, Jul 5, 2012.

  1. Roparadise

    Roparadise BANNED BANNED

    Joined:
    May 25, 2011
    Messages:
    786
    Likes Received:
    1,417
    I have a image hosting website where after I upload the images it directs me to the uploaded page which uses the code from view.php file. I put a adbrite code on the view.php file So when someone looks at a picture an ad is displayed. How can I exclude the ad from displaying on the uploaded page?
     
  2. HostStage

    HostStage Jr. VIP Jr. VIP Premium Member UnGagged Attendee

    Joined:
    May 20, 2010
    Messages:
    1,770
    Likes Received:
    1,729
    Occupation:
    BHW - CEO of Webhosting Company
    Location:
    BWH from France
    Home Page:
    A little php code should do the trick.

    Something like if page title = view then JS.

    Let's wait for jazzc to give his input :p
     
  3. blacknight9

    blacknight9 Newbie

    Joined:
    Jan 1, 2009
    Messages:
    44
    Likes Received:
    37
    Home Page:
    Do you mean the view.php is included in image page and uploaded page? If so

    on image page

    view.php
    So the ad will show only when the $display variable is set to true.
     
  4. Roparadise

    Roparadise BANNED BANNED

    Joined:
    May 25, 2011
    Messages:
    786
    Likes Received:
    1,417
    I tried setting that code up,but it doesn't work for some reason.
     
  5. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,143
    Post the code that 's responsible for the ad showing up so that we can provide you with a fix :)
     
  6. Roparadise

    Roparadise BANNED BANNED

    Joined:
    May 25, 2011
    Messages:
    786
    Likes Received:
    1,417
    The red x's are ID numbers I censored out. thanks in advance
     
  7. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,143
    I didn't mean the ad code, the view.php code around it. I.e. what we want to see is how this adbrite code is served, so that we can make you a proper if/else loop. Please upload view.php to pastebin and let us know how the page you do not want the ad to display is called (e.g. upload.php).
     
  8. Roparadise

    Roparadise BANNED BANNED

    Joined:
    May 25, 2011
    Messages:
    786
    Likes Received:
    1,417
    This is the code of the page I want ads on http://pastebin.com/cT2UsFk6
    And this is the code of the page I dont want ads on http://pastebin.com/YVGjPcvN
     
  9. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,143
    Thanks Roparadise. Please also upload the code of view.php.
     
  10. Roparadise

    Roparadise BANNED BANNED

    Joined:
    May 25, 2011
    Messages:
    786
    Likes Received:
    1,417
    the first link is the code to view.php the second one is the code to uploaded.php