Displaying ads on HTML pages...

Discussion in 'Co-op Advertising Network' started by AfterHim.com, Dec 5, 2005.

  1. #1
    Ok, here is what I have so far...and yes I have read the two other threads about how to set this up on HTML pages :)

    ad_network_ads_460.txt
    chmodded to 666 (writeable)

    ad_network_460.php
    newest version as of last night

    passthru.php
    changed the line to include ad_network_460.php

    .htaccess with this in it:

    AddType application/x-httpd-php .php .htm .html
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} ^(.*)\.htm [NC,OR]
    RewriteCond %{REQUEST_FILENAME} ^(.*)\.html [NC]
    RewriteRule ^(.*) /passthru.php?file=$1
    </IfModule>
    Code (apache):
    This is what I have in the footer area of my index.html page:

    <?php
    	ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    	include ('ad_network_460.php');
    	echo $ad_network;
    ?>
    PHP:
    Nothing displays.

    However, if I change the code in my footer to something like ('ad_network_461.php') I get this error which tells me it is close to working :)

    Warning: main(ad_network_461.php): failed to open stream: No such file or directory in /home/mysite/public_html/index.html on line 696
    
    Warning: main(): Failed opening 'ad_network_461.php' for inclusion
    Code (markup):
    I know I am missing something obvious and can usually figure it out, but I spent about 4 hours last night and a couple today and can't get it.

    Thanks,

    Brandon
     
    AfterHim.com, Dec 5, 2005 IP
  2. jazzylee77

    jazzylee77 Peon

    Messages:
    578
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't know if this would cause the blank page, but you have both passthru.php and your footer code trying to display the adnetwork. I would expect it to just show up twice...But you may want to try removing your footer code.
     
    jazzylee77, Dec 5, 2005 IP
  3. AfterHim.com

    AfterHim.com Peon

    Messages:
    1,923
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    0
    #3
    JL,

    No change, still just black down there...It is really strange...I have the coop running on like 7 other sites and was able to figure out all of those...

    Any other ideas?
     
    AfterHim.com, Dec 5, 2005 IP
  4. jazzylee77

    jazzylee77 Peon

    Messages:
    578
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #4
    black down there? Not sure what this means. Black at the footer? Can you view the source code?


    is it parsing php?

    try a file like test.php

    <?php
    print "Hello World!";
    ?>
     
    jazzylee77, Dec 5, 2005 IP
  5. AfterHim.com

    AfterHim.com Peon

    Messages:
    1,923
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    0
    #5
    JL,

    That was supposed to say "blank", not "black" :)

    when I view source, my PHP is not there...

    Using the test.php i got this error:

    Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/mysite/public_html/test.php on line 1
     
    AfterHim.com, Dec 5, 2005 IP
  6. jazzylee77

    jazzylee77 Peon

    Messages:
    578
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Others with more php experience may know whats going on. I would keep messing with .htaccess and checking with the server administrator till that test.php page works.
     
    jazzylee77, Dec 6, 2005 IP
  7. AfterHim.com

    AfterHim.com Peon

    Messages:
    1,923
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Does this mean PHP isn't enabled?
    
    Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/mysite/public_html/test.php on line 1
    PHP:
     
    AfterHim.com, Dec 6, 2005 IP
  8. AfterHim.com

    AfterHim.com Peon

    Messages:
    1,923
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Can anyone help? Shawn? This new site will hopefully generate about 10-15k of coop weight and I'd really like to use it :)
     
    AfterHim.com, Dec 6, 2005 IP
  9. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #9
    What's line 1 of test.php?
     
    digitalpoint, Dec 6, 2005 IP
  10. AfterHim.com

    AfterHim.com Peon

    Messages:
    1,923
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Here is all I have in test.php

    <?php
    print "Hello World!";
    ?>

    Line 1 just opens php.

    Brandon
     
    AfterHim.com, Dec 6, 2005 IP
  11. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #11
    I bet you have something else in there (maybe hidden characters from your text editor??). But it IS parsing PHP, otherwise you wouldn't get the error.
     
    digitalpoint, Dec 6, 2005 IP
  12. AfterHim.com

    AfterHim.com Peon

    Messages:
    1,923
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    0
    #12
    I use smultron (for mac) and it is pretty straightforward...very nice and basic.

    Ok, just saved and reuploaded it and it now shows the right "Hello World" like it should.

    Where to from here?
     
    AfterHim.com, Dec 6, 2005 IP
  13. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #13
    I would just follow the normal setup instructions.
     
    digitalpoint, Dec 6, 2005 IP
  14. AfterHim.com

    AfterHim.com Peon

    Messages:
    1,923
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Shawn,

    I have set up the coop on at least 8 sites, but this one is my first with all HTML and I am doing something wrong...can you check out my first post in this thread for me?

    Thanks
     
    AfterHim.com, Dec 6, 2005 IP
  15. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #15
    Try using the full file path to the ad_network PHP file.
     
    digitalpoint, Dec 6, 2005 IP
  16. AfterHim.com

    AfterHim.com Peon

    Messages:
    1,923
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Shawn,

    Put the full path in my index.html and in the passthru.php...still nothing appears..anywhere else I could put it?
     
    AfterHim.com, Dec 6, 2005 IP
  17. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #17
    What if you echo something out in your passthru.php file, like this:
    echo 'Blah';
    PHP:
    does it appear on your page?
     
    digitalpoint, Dec 6, 2005 IP
  18. AfterHim.com

    AfterHim.com Peon

    Messages:
    1,923
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    0
    #18
    Yes it does appear.

    Brandon
     
    AfterHim.com, Dec 6, 2005 IP
  19. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #19
    If you look in your ad_network .txt file, does it have any ads (like is it getting a new ad each page view even though it's not being output)?
     
    digitalpoint, Dec 7, 2005 IP
  20. AfterHim.com

    AfterHim.com Peon

    Messages:
    1,923
    Likes Received:
    51
    Best Answers:
    0
    Trophy Points:
    0
    #20
    Shawn,

    It is set to 666 but is not gathering anything...still 0 bytes.

    Seems like it is stuck there maybe?
     
    AfterHim.com, Dec 7, 2005 IP