1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

need help with a php script

Discussion in 'Hire a Freelancer' started by webdy, Mar 6, 2013.

  1. webdy

    webdy Registered Member

    Joined:
    Jan 20, 2012
    Messages:
    67
    Likes Received:
    21
    Home Page:
    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.
     
  2. KrypTiK-PS

    KrypTiK-PS Newbie

    Joined:
    Jan 21, 2013
    Messages:
    11
    Likes Received:
    0
    Pretty sure I know what you're saying. Skype me, kryptik-ps I'll be happy to help.
     
  3. littlewebdragon

    littlewebdragon Jr. VIP Jr. VIP

    Joined:
    Dec 30, 2007
    Messages:
    875
    Likes Received:
    229
    Occupation:
    Occupation
    Location:
    Location
    Well would something like this work?

    $value = "Any Cookie Value";
    setcookie("TestCookie", $value, time()+3600, "/~samplefolder/", "example.com", 1);
     
  4. vikasvyas47

    vikasvyas47 Power Member

    Joined:
    Dec 6, 2011
    Messages:
    523
    Likes Received:
    4
    hello please add me on skype i have sended you request