PDA

View Full Version : Need php/cgi help..


Jizar ll
04-17-2002, 04:00 PM
HI i need help with a small script, that makes it possiple to link the src of my banner to a php script or cgi, instead of to the fixed picture url.. the script needs to be very small and fast, so if i link to:<br />&lt;img src="bla.com/cgi-bin/bannerA.php"&gt;<br />it will show the banner i have defined in the script :-) This script will be requested 10-15times pr sec. so i donīt know if a normal dedicated server can handle this? or maybe its no stress at all? <img border="0" alt="[Help]" title="" src="graemlins/help.gif" />

howlingwulf
04-17-2002, 05:00 PM
If you have SSI, just add<br />&lt;!--#include file="banner.txt" --&gt;<br /><br />where banner.txt would contain your html line:<br />&lt;img src="banner.jpg"&gt;

linkbook
04-18-2002, 12:01 AM
If you're trying to keep people from hotlinking your banners, just use htaccess but I'll tell you how to do what you're asking anyways. :-)<br /><br />Use what you wanted as the SRC (whatever.php);<br /><br />In the php file, put in a:<br /><br />header("Location:http://www.domain.com/path/to/banner.jpg");<br /><br />That should do it, if your server is picky it may throw and error about non-matching content types, if it does that, post back here and I'll show you something else. :-) Hope this helps you out. <br /><br />Good luck everyone... <img border="0" alt="[Hi]" title="" src="graemlins/hi.gif" />

Jizar ll
04-18-2002, 06:00 AM
Linkbook : thanks alot it works fine :-) Im not doing this to prevent hotlinking but to be able to change the url to the banner, without needing to contact the places i advertise :-) So i need to be sure that this way of doing it is the most effecient, because the php will get alot requests maybe up to 1 million pr day! <br /><br />Regards<br /><br />Jizar

zergtant
04-18-2002, 06:34 AM
you can use your datebase to do this job <br />i will tell you<br />icq:126954332<br />odigo: 3281532 <br /> <img border="0" alt="[Spam]" title="" src="graemlins/spam.gif" />