Jump to content

Cookies and a Self-Submitting Form

- - - - -

  • Please log in to reply
No replies to this topic

#1
makamo66

makamo66

    Newbie

  • Members
  • PipPip
  • 18 posts
I am using setcookie in a self-submitting form. Once the form is submitted, it sends an email and then it redirects to the next page by using a header. The problem is that the cookies aren't set for the email even though they are set (and displayed) on the next page. I've tried using the following code to reload the page before I send the email but to no avail:

setcookie("survey_username", $_POST['yourname'], time() + 31536000, '/survey/', $_SERVER['SERVER_NAME'], 0);
header("Location: ". $_SERVER['PHP_SELF']);
exit;




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users