zoukankan      html  css  js  c++  java
  • 初学php:cookie

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>cookie</title>
    <meta name="Generator" content="">
    <meta name="Author" content="czh">
    <meta name="Keywords" content="php date">
    <meta name="Description" content="">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    </head>
    <body>
    <script type="text/javascript">
    function writeCookie()
    {
        var d=new Date();
        d.setTime(d.getTime()+24*60*60*365*1000);
        document.cookie="UserName="+mF.name.value+";expires="+d.toGMTString();
        document.cookie="UserSex="+mF.sex.value+";expires="+d.toGMTString();
        document.cookie="UserProvince="+mF.province.value+";expires="+d.toGMTString();
        document.cookie="UserEmail="+mF.email.value+";expires="+d.toGMTString();
        document.mF.submit();
    }
    </script>
    </body>
    pls input your infomation:
    <form name="mF" method="post" action="./cookie_creat.php">
        <table>
            <tr>
                <td>name:</td>
                <td><input name="name" type="text" size=15></td>
            </tr>
            <tr>
                <td>sex :</td>
                <td><input name="sex" type="text" size=15></td>
            </tr>
            <tr>
                <td>prov:</td>
                <td>
                    <select name="province">
                        <option value="1">1
                        <option value="2">2
                        <option value="3">3
                        <option value="4">4
                        <option value="5">5
                        <option value="6">6
                        <option value="7">7
                        <option value="8">8
                    </select>
                </td>
            </tr>
            <tr>
                <td>E-mail:</td>
                <td><input name="email" type="text" size=25></td>
            </tr>
            <tr align="center">
                <td><input type="button" value="ok" onclick="writeCookie()"></td>
            </tr>
        </table>
    </form>
    </html>
    <?php 
    echo '<pre>';
    print_r($_COOKIE);
    ?>

    vinson
  • 相关阅读:
    技术人生:墨菲定律
    Ioc:Autofac Registration Concepts
    Ioc:autofac lifetime scope.
    Ioc:The basic pattern for integrating Autofac into your application
    Logstash filter 插件之 date
    配置 Elasticsearch 集群
    Linux 命名管道
    Linux 管道
    Golang 入门 : channel(通道)
    Golang 入门 : 竞争条件
  • 原文地址:https://www.cnblogs.com/vinsonLu/p/3042938.html
Copyright © 2011-2022 走看看