Two pages in different folders, won't work!?

Discussion in 'Co-op Advertising Network' started by fut, Jul 15, 2005.

  1. #1
    Hello,

    I am comepltely new to this so spare me.

    I installed everything flawlessely and put the links in a page called catalog/affiliates.php

    So I try doing this but now on my index page. I copy and pasted the same code to my footer.php which was located in a different folder (catalog/includes/footer.php) and it does not work.

    It states "You must set the ad network .txt file to be writable (or file is not within path)"

    So I copy the .txt and .php file that digital point provides into catalog/includes and set the proper permissions and it still does not work and shows the same error.

    What am I doing wrong here?

    Thank you.
     
    fut, Jul 15, 2005 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    You may need to put the full file path (not URL) to the ad_network PHP file within the include statement.
     
    digitalpoint, Jul 15, 2005 IP
  3. fut

    fut Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    the .php and .txt file from DP was inserted in /catalog

    I then entered the code
    <?php
    	ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    	include ('ad_network_318.php');
    	echo $ad_network;
    ?>
    Code (markup):
    into /catalog/affiliates.php - Everything worked fine.

    Now I want to enter the same code into catalog/includes/index_footer.php

    I tried but it said that either the .txt file didnt have correct permissions or the pathw as not right.

    I tried copying the .txt file and .php that came from DP into catalog/includes and setting the permissions right again but it still did not work.

    Any suggestions?
     
    fut, Jul 15, 2005 IP
  4. fut

    fut Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for the help - but i'm afraid that did not do the trick. Maybe i'm changing it incorrectly. I changed
    if (!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS;
    
    	$ad_file = 'ad_network_ads_314.txt';
    Code (markup):
    to
    if (!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS;
    
    	$ad_file = 'includes/ad_network_ads_314.txt';
    Code (markup):
    and still got the same error.
     
    fut, Jul 15, 2005 IP
  5. fut

    fut Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The /catalog was unneccesary, that is just for reference terms. It is actaully linked to root.
     
    fut, Jul 15, 2005 IP
  6. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #6
    It would need to be the full path to the file. For example one of my servers would be something like:

    /home/sites/www.digitalpoint.com/web/includes/ad_network.php

    Another thing you could try is just to put the ad_network.php file in the root of your site, because the code will automatically go up levels to look for it if it's not in the current directory.
     
    digitalpoint, Jul 15, 2005 IP
  7. fut

    fut Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    That's the weird thing. the ad_network.php file was in the root already - it worked fine for .com/affiliates.php

    I tried putting in the full path like this
    	if (!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS;
    
    	$ad_file = 'www.crazyjordans.com/public_html/includes/ad_network_ads_314.txt';
    Code (markup):
    and still got the same problem. I then tried also changing the given code to
    <?php
    	ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    	include ('www.crazyjordans.com/public_html/includes/ad_network_318.php');
    	echo $ad_network;
    ?>
    Code (markup):
    and it still didn't work.

    index_footer.php is in /includes but my acutal index is in the root - maybe that has something to do with it - I don't know. I'm lost =|
     
    fut, Jul 15, 2005 IP
  8. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #8
    You would need to put the FULL path (from the root of the server). So you would need to find what that is.
     
    digitalpoint, Jul 15, 2005 IP
  9. fut

    fut Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thank you for your time. It still does not work. This time only it does not come up with any error:

    I changed
    	$ad_file = 'ad_network_ads_314.txt';
    	for ($i = 0; $i <= 11; $i++) {
    		$p = substr ('../../../../../../../../../../', 0, $i * 3);
    Code (markup):
    to
    	$ad_file = '/home/crazyj61/public_html/includes/ad_network_ads_314.txt';
    	for ($i = 0; $i <= 11; $i++) {
    		$p = substr ('../../../../../../../../../../', 0, $i * 3);
    Code (markup):
    in ad_network_314.php and added
    <?php
    	ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    	include ('/home/crazyj61/public_html/includes/ad_network_319.php');
    	echo $ad_network;
    ?>
    Code (markup):
    to my footer.php file - now this is starting to frutrate me. Any other suggestions?
     
    fut, Jul 16, 2005 IP
  10. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #10
    Are you sure that's the full file path?
     
    digitalpoint, Jul 16, 2005 IP
  11. fut

    fut Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Yes, I e-mailed my hosting company to find out.
     
    fut, Jul 16, 2005 IP
  12. fut

    fut Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Got it to work, thank you!
     
    fut, Jul 16, 2005 IP