SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2001
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php cookie form save user details

    Hello, i have a website that offers email on disirable domains, i have over 100 domains and would like to set a cookie so it saves the username and the email domain of a user, so they don't have to re-enter them everytime they come to site, i not worried about password, they can use the browsers save password for that id they want password saved.

  2. #2
    SitePoint Member
    Join Date
    Jan 2002
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    You can do the folloowing to set the cooke:

    PHP Code:
    // Setthe cookie vartiables
    $cookie_val "$username;$email;$domain";

    // Set the cookie change the +3600 to a higher number
    // to have the cookie expire at a longer time
    setcookie('cookiename',$cookie_val,(mktime()+3600),'/','',0);


    // Use this to get the cookie information
    // and set them to variables
    $cookie_var split(";"$cookiename);
    $ck_username $cookie_var[0];
    $ck_email $cookie_var[1];
    $ck_domain $cookie_var[2];

    // Noe you can use the variables $ck_username, $ck_email
    // $ck_domain to populate the form. 
    Hope this helps.
    Ray
    http://cwdhost.com/
    Plans from $9.50/mo.
    Reseller Plans from: $35/mo. - Host Unlimited Domains


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •