Notice: Undefined index: username in C:\wamp\www\advance php\submit.php on line 13
<?php
if(isset($_POST[‘clientname’]))
{
$client=$_POST[‘clientname’];
setcookie(‘username’,$client,time()+120);
}
?>
<html>
<head>
<title>submit page</title>
</head>
<body> <h1>Thank’s Mr.<?php echo $_COOKIE[‘username’]; ?> For the intrest we will get back to u soon</h1>
</body>
</html>
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.