PHP input array for adding cookies

Enter Your Name
DEMO of adding single data as Cookies
HTML code
<form method=post action=cookies_redirect_array.php>
<div class='row'> <div class='col-md-4'>Enter Your Name </div> <div class='col-md-4'><input type=text name=name class='form-control'> </div> </div>
<div class='row'> <div class='col-md-4'>City </div> <div class='col-md-4'><input type=text name=city class='form-control'> </div> </div>
<div class='row'> <div class='col-md-4'>State </div> <div class='col-md-4'><input type=text name=state class='form-control'> </div> </div>
<div class='row'> <div class='col-md-4'>Zip </div> <div class='col-md-4'><input type=text name=zip class='form-control'> </div> </div>
<div class='row'> <div class='col-md-4'> </div> <div class='col-md-4'><input type=submit value=Next class='btn btn-danger'> </div> </div>
Code for page cookies_redirect_array.php

if(isset($name) and strlen($name) > 1){
setcookie ("Plus2netCookie[name]", $name);
setcookie ("Plus2netCookie[city]", $city);
setcookie ("Plus2netCookie[state]", $state);
setcookie ("Plus2netCookie[zip]", $zip);
header ("Location: cookies_t2_array.php"); 
echo " Input your name first and then click NEXT button 
<input type='button' value='Back' onclick='window.history.back()' />";

Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here .

    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 All rights reserved worldwide Privacy Policy Disclaimer