Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2010
    Posts
    20
    Thanks
    3
    Thanked 0 Times in 0 Posts

    check php http referrer code

    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 urli'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/......7&?jjz#/../../ you know!

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,849
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    You can't rely on the variable $_SERVER['HTTP_REFERER'], because it's easy to block or modify this from the browser for users.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Jan 2010
    Posts
    20
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by abduraooft View Post
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •