Debt Consolidation - Bad Credit Mortgages - Consolidation Loans - Payday Loan - Mobile Phone

PDA

View Full Version : Problems including via php method


buyoffit
Dec 11th 2004, 1:09 pm
hiya,
Got a bit of a problem, got the file on the route dir, but when you go down a certain amount of levels it fails to include it, is there a way of setting it to include

i.e: http://www.domain.com/file.php

rather than all the :
("include_path") . ':../:../../:../../../:../../../../');

Tried this :

<?php
include('http://www.domain.co.uk/file.php');
echo "<div><p>Some other internet browsing ideas:</p></div>";
echo '<p>'.$ad_network[0].' / '.$ad_network[1].' / '.$ad_network[2].' / '.$ad_network[3].' / '.$ad_network[4].'</p>';

?>

but it brings back no results. no parse errors etc..

Any ideas?

Edit : To illaborate, is there a fixed path method? that appears to be where the problem is, i tried modifying it to use a fixed path my self, but then it doesnt return anything, it returns the slashes and anything else i manually pu t there so it is executing it properly, just not using it properly since theres no include error.

Cheers

chachi
Dec 11th 2004, 1:52 pm
you are on the right track. You need the full server path to the file. So, if you are in the directory where the ads file is, type pwd . That will give you the present working directory and the full path to that directory. Enter that path in before the file name rather than the http:// example you did earlier.

buyoffit
Dec 11th 2004, 2:09 pm
nice one Chachi, working perfect now, buyoffit.co.uk if ya interested. (live links not available till 10 posts so umm :) )

For those wishing to do the same thing, make a whatever.php page, put in it: <?phpinfo()?> only, nothing else, run the php file and scroll down prolly about half way to find the server path.

Then in the include ya using do:

<div style="width: 350px;"><?php
include ('/your/server/path/ad_network.php');
echo "<div><p>Some other internet browsing ideas:</p></div>";
echo '<p>'.$ad_network[0].' / '.$ad_network[1].' / '.$ad_network[2].' / '.$ad_network[3].' / '.$ad_network[4].'</p>';

?></div>

Or if you want to display only one ad use:

echo '<p>'.$ad_network[0].'</p>';

=)