edwardda Posted April 16, 2013 Share Posted April 16, 2013 Hello all wondering if someone can help > I’m fairly new to php and while work on a training I ran into the following problem>> in trying to write code to capture the values 'first name' and 'last name' in cookies the code im using is <?php setcookie('firstName', $_GET['firstName'], time() + (60*60*24)); setcookie('lastName', $_GET['lastName'], time() + (60*60*24)); ?> Can any tell me what I’m doing wrong so confused Quote Link to comment https://forums.phpfreaks.com/topic/277025-saving-variables-in-cookies/ Share on other sites More sharing options...
edwardda Posted April 16, 2013 Author Share Posted April 16, 2013 in the result page i have <p>hi <?php echo $_COOKIE['firstname']; ?> <?php echo $_COOKIE['lastname']; ?></p> Quote Link to comment https://forums.phpfreaks.com/topic/277025-saving-variables-in-cookies/#findComment-1425213 Share on other sites More sharing options...
mac_gyver Posted April 16, 2013 Share Posted April 16, 2013 (edited) variable names and array index names are case sensitive. firstName is the not same as firstname Edited April 16, 2013 by mac_gyver Quote Link to comment https://forums.phpfreaks.com/topic/277025-saving-variables-in-cookies/#findComment-1425215 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.