need help with a php script

Status
Not open for further replies.

webdy

Registered Member
Joined
Jan 20, 2012
Messages
67
Reaction score
21
I have the following script submitted once with a form.
Once submitted the form places a cookies and when the visitor returns he is redirected directly on the checkout page.
Right now I had to change it a bit how it works and use a dinamic link to monitor all the visitors.
Until then the link never changed and the cookie worked.

This is the old script

$fp = fopen("email".$email2.".txt", 'w');
fwrite($fp, $con);
fclose($fp);

setcookie('email/',$email2,time()+3600*24*5);

This is the new one I tried:

$fp = fopen("../old/email/".$email2.".txt", 'w');
fwrite($fp, $con);
fclose($fp);

setcookie('email',$email2,time()+3600*24*5);

Basically
I want it to place the cookie in a folder from another directory and I can`t make it to work.
 
Pretty sure I know what you're saying. Skype me, kryptik-ps I'll be happy to help.
 
Well would something like this work?

$value = "Any Cookie Value";
setcookie("TestCookie", $value, time()+3600, "/~samplefolder/", "example.com", 1);
 
Status
Not open for further replies.
This thread has been auto closed due to the forum's thread age policy. Read more.
Back
Top