Hello. I need some quick help with randomizing a URL..

Discussion in 'Programming' started by Pizzaman1123, Sep 9, 2011.

  1. #1
    I've planned out a website and I'm stuck at this one objective. I need to send users to a link after a lead is completed, but I need the link to only be available to them that one time. So they can't send the link to a friend and have them pull up the page.


    example: After completing a task I want to send the user to a "WIN" page or "LOST" page but.. I DON't want to have friends sending their friends the "WIN" page URL etc..


    Is this possible? I don't know much PHP, So I was just hoping there would be a script out there thats similar.


    Thanks guys!
     
    Pizzaman1123, Sep 9, 2011 IP
  2. mmerlinn

    mmerlinn Prominent Member

    Messages:
    3,197
    Likes Received:
    819
    Best Answers:
    7
    Trophy Points:
    320
    #2
    You can't stop anyone from going to a page that you have sent someone else to. All they need to do is to copy and paste the link you give them.

    However, the solution is to serve up a DIFFERENT page every time someone goes to that link. That would effectively stop the wrong people from viewing the page in question.
     
    mmerlinn, Sep 10, 2011 IP
  3. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #3
    Send them to a page that requires a POST variable. Create that variable as a GUID when you send it to them, and save it in a database. Once someone uses that GUID, have that page mark the particular GUID in the database as being used. When the page first opens, check the database to see if the GUID is used and if it is, send them to a page that says, "Sorry, someone already used that link".

    (If you don't understand how to write all that code, hire someone who does.)
     
    Rukbat, Sep 10, 2011 IP
  4. Rising_Star

    Rising_Star Active Member

    Messages:
    39
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    63
    #4
    its pretty easy, as explained above u can add some random data with ur url and then add this random data to the database.. again when someone else accessess the page check the random data in database and if it matches then throw the error message...
     
    Rising_Star, Sep 11, 2011 IP