开发者

Any way to make image (gd lib) show only on specific page only?

I'm trying to figure out the logistics for a new site that I'm creating, and one of the main issues is to get verification working correctly. One of the verification methods i'd like to incorporate is for a specific image (created via gdlib on the fly) to only work on a web page that is specified in a database field. If the image is shown on the EXACT page that is specified, then it shows the correct image, and if the link is incorrect, then it shows a different image (set by admin). The 开发者_C百科fields will be created on the admin side, and I'm trying to figure out how to get multiple instances of this working correctly. I'm using PHP and using a tag like [img src="something_here.php"] to show my images. Any suggestions on how to set the coding to verify the site that the image is embedded into?

Update So I got it working, but the request_URI command only works for the extension "ex. login.php", as opposed to adding in the absolute domain also. Any suggestions on how to make it factor in the whole domain address?


If you create an image with gd, you can put any PHP code on the page. for example: if ($_SERVER['REQUEST_URI'] == '/specialWebPage.php') { ... }.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜