View Full Version : Resolved Php Referer code issue.

01-16-2010, 03:14 PM
i plan to sell products and my customers should be redirected to a page when purchase is approved.And i would like this page accessible if the referrer url is the payment gateway one.I try this code but it's not working.could you help me sort that issue in the script.i'll really appreciate that.
here below is the script i try :

<?php if($_SERVER['HTTP_REFERER'] = https://www.gatewayurl.com/)
echo 'Thanks For buying here!....';
else{echo'<font color=red>Ooops! You have been taken onto this page because your purchase may not have been approved. </a></font>';}

01-16-2010, 04:03 PM
<?php if($_SERVER['HTTP_REFERER'] = https://www.gatewayurl.com/)

you are using the assignment operator, you want comparison:

<?php if($_SERVER['HTTP_REFERER'] == "https://www.gatewayurl.com/")

also don't forget to wrap the link in quotes as it's a string

01-16-2010, 11:26 PM
You're all right!thanks