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
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.
Thank'x sir for the help it really helped me ...now error is fixed
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.
yeah sir u r write . will u plz tell me what better i thing i can do .
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.
This topic is now closed. New replies are no longer allowed.