http://php.flashwebhost.com/stefin/set_cookie.php
Code:<?php if (isset($_COOKIE['flipkartCustomer'])) { echo $_COOKIE['flipkartCustomer'] . ',Welcome to flipkart, SPECIAL OFFER- 50% OFF ON ALL GAMES'; exit; } if (isset($_POST['flipkartCustomer']) && strlen($_POST['flipkartCustomer']) > 5) { setcookie('flipkartCustomer', $_POST['flipkartCustomer'], time()+3600); echo 'COOKIE Set. Close the browser. Revisit this page, I will remember your name'; } else { echo' Enter your name ? <form method="post" action=""> <input type="text" name="flipkartCustomer"> <button type="submit" name="whatever">Enter Name</button> '; }




Reply With Quote

Bookmarks