How can I automatically add cookies to the form?

Source: Internet
Author: User
How can I automatically add cookies to the form? Every time I log on to a website with a cookie, I will automatically enter the cookie into the form and stop it on the login page. how can I directly jump to the Cookie and automatically enter the cookie into the form?
When there is a cookie upon login, the cookie will be automatically entered into the form and will be parked on the login page. how can this problem be solved? I can only jump directly to the Cookie login page to share it:
------ Solution --------------------
         
        if(empty($_COOKIE["username"]))
        {
           $_COOKIE["username"]="kobe_chen" ;
        }
        
            if($_SERVER["REQUEST_METHOD"]=="GET")
            {?>
                
                         }?>

------ Solution --------------------
This function is also easy to implement using php.
We now set a check box on the logon page. if this box is selected, the user name is saved.
First, we write this on the front-end page.



Background program loginProcess. php

If (! Empty ($ keep )){
Setcookie ('id', $ id, time () + 3600*24*30 );


} Else {
If (! Empty ($ _ COOKIE ['id']) {
Setcookie ('id', $ id, time ()-100 );
}
}
You can. For details, refer to the php video tutorial 114th on cookie. This usage is described.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.