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 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> 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 variable names and array index names are case sensitive. firstName is the not same as firstname Link to comment https://forums.phpfreaks.com/topic/277025-saving-variables-in-cookies/#findComment-1425215 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.