note 20321 deleted from function.setcookie by philip

From: Date: Tue, 16 Jul 2002 16:58:50 +0000
Subject: note 20321 deleted from function.setcookie by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-33151@lists.php.net to get a copy of this message
This code adds a user name to your page. It will display "Welcome back username" every time that user returns to your site using the same computer. Code <?php if (0 != count($user2)){ echo("<html><body><a>Welcome Back $user2"); } elseif (isset($name) and $name != "") { $rated = $name; setcookie(user2, $rated); echo("<html><body><a>Hello $rated"); } ?> <form action='test.php' method=post name=message> <table> <tr> <td colspan ="2"> <input type="text" size="40" value="" name =name maxlength=50> </td> <tr> <td> <input type=submit value='Submit' name='submit' onclick='call_user_func('test','$name)'> <td> <input type='reset' value='Clear'> </td> </tr> </table> </body> </html>

« previous php.notes (#33151) next »