Jump to content

Enter a session to start a form from an email link URL


hugeness

Recommended Posts

Hello

 

I have set-up a very long form for someone, but they want it filled in by sending a link to their friends, who then click on the link, going straight to the form, avoiding the login page.. all pages have session_start() was wondering if its possible to send a url to get them through the session protection?

I suppose its like when a person forgets their password and a special link gets sent out, but not sure how this is done.. is this straightforward?

 

thanks!

Link to comment
Share on other sites

One such method would be to send it to a link that is not protected by the session security, but that link creates the session variables, and then redirects to the form that is secured by the session.

 

The other method would be to adjust your security that checks for sessions and creates an exception.  Although I would suggest the first route.

Link to comment
Share on other sites

The best route would be to not use session's at all and more importantingly not allow impersonation. Instead use a db table in which you store the values for the form:

 

friends_forms (id, uniqid, data)

 

Then using PHP:

 

if (submit) {
    $hash = sha1(uniqid());
    $data = serialize($_POST);
    $sql = "INSERT INTO friends_forms (uniqid, data) VALUES ('$hash', '$data')";
    // send an e-mail to the user containing form.php?unique=$hash
    // when the friend clicks the link, load the data using hash from friends_forms and fill the form (don't forget to unserialize())
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.