PDA

View Full Version : check php http referrer code



costaryan
01-24-2010, 02:31 PM
Hello i want you to check this code and answer to the question below:
<?php if ($_SERVER['HTTP_REFERER'] == "https://www.gateurl.com/")
{
echo ' ';
}
else{echo'';}
?>
i set up a small business on my site.and i want my customers to be directed to a page only if their purchase has been successfully processed and approved by my Ecommerce service provider.So i put the code above onto the return page.i just want to know if the gateway home url is appropriate for this or if i need to specify the exact url:eek::mad:i'm asking this because when you click the buy button from my site you're taken to their purchase page and the relevant url may change like https://www.gateway.com/purchase/.../565727&?jjz#/../../ you know!

abduraooft
01-24-2010, 02:51 PM
You can't rely on the variable $_SERVER['HTTP_REFERER'], because it's easy to block or modify this from the browser for users.

costaryan
01-24-2010, 03:51 PM
You can't rely on the variable $_SERVER['HTTP_REFERER'], because it's easy to block or modify this from the browser for users.
What do you suggest for preventing fraud then?