Alright so what I am doing is I have a Text box and submit button that posts to the current page. The user can put their name in it. It creates a cookie and that cookie will echo out their name on the page after they pressed submit.
But I can't seem to do this in one page refresh.
Here is what I have so far:
<?php
error_reporting(E_ALL ^ E_NOTICE);
?>
<form action="#" method="post">
Name: <input type="text" name="fname">
<input type="submit">
</form>
<?php
$post = $_POST["fname"];
$expire=time()+60*60*24*30;
setcookie("user", $post, $expire);
echo $_COOKIE["user"];
?>
Thanks!