php_learner — 2013-06-19T10:20:34-04:00 — #1
Notice: Undefined index: username in C:\wamp\www\advance php\submit.php on line 13
<h1>Thank's Mr.<?php echo $_COOKIE['username']; ?> For the intrest we will get back to u soon</h1>
please tell me why its happening ..........help me out
kylewolfe — 2013-06-19T10:28:58-04:00 — #2
At the beginning of the script, do var_dump($_POST); to see if clientname is present and that you are actually setting the cookie.
Side note, use sessions over cookies whenever you can.
php_learner — 2013-06-19T10:37:01-04:00 — #3
Thank'x sir for the help it really helped me ...now error is fixed
spikez — 2013-06-19T11:43:50-04:00 — #4
Just for information and future reference;
A cookie can't be set and then used on the same page. You would need to refresh the page before the cookie is set and readable.
php_learner — 2013-06-19T13:05:34-04:00 — #5
yeah sir u r write . will u plz tell me what better i thing i can do .
kylewolfe — 2013-06-19T14:37:14-04:00 — #6
Sessions. http://php.net/manual/en/ref.session.php. They are more secure anyway as they are stored on the server rather than on the client machine.
php_learner — 2013-06-19T23:18:13-04:00 — #7