![]() |
php include() alternative?
hi
i want to include a file (it's just a bit of javascript) from domainA into a php page on domainB (all on the same server). to do this i have to have allow_url_include = on in my php.ini which i believe is a big security risk. has anyone got any alternative solutions that are safer,? the include is just so i can test various popups over 100's of sites by just changing the javacript in the one file. so i would be grateful for any other simple solutions too. thanks in advance |
iframes?
|
Why are you including it with php? just use a script tag with src='xxxxx'...
|
Not sure about: require_once();
|
Quote:
|
Quote:
|
using curl?
Code:
$ch = curl_init(); |
Quote:
|
You want to include the server path to the file, not the URL. So something like:
include ('../../othersite.com/public_html/stuff.inc'); Symlinks on the server can simplify that. If suexec is preventing you from doing the include, suexec a more serious security hole than fopen_url, as bad as fopen_url is. The above is if you have to include() instead of doing: script type="text/javascript" src="http://somesite.com/cool.js" |
Quote:
Quote:
2. readfile("/full/path/to/whereever/u/put/thefile/file.js"); |
Quote:
|
thanks guys for the help it's appreciated, i'm off out now, but i'll have a play around with those tomorrow and report back.
thanks again |
| All times are GMT -7. The time now is 12:47 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123