Jump to content

Redirect/cookie problem


kiowa_jackson

Recommended Posts

I'm trying to set it so people who have signed up at my opt-in page never see that page again and get taken to the sales letter.

 

What I'm trying to do is set their cookie once they filled out their registration. That is I put

 

<?php
setcookie("optin","true",time()+60*60*24*60);
?> 

 

on the confimartion page for the opt-in list.

 

Then I have on the actual landing page

 

<?php
if($_COOKIE["optin"] == "true"){
header("location: http://www.mydomain.com/salespage.php"); }
?>

 

Which I was hoping would mean that if they have opted in once, they will automatically be redirected to the sales page...

 

However I get the message:

'Notice: Undefined index: optin in C:\htdocs\panicmastery\index.php on line 2'

 

Note that i found this php code online so there's probably something worng with how I apply it. If anyone knows...

Link to comment
https://forums.phpfreaks.com/topic/43599-redirectcookie-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.