Your question is a little hard to understand, but it sounds to me that you want to have a form that once submitted sets a cookie and then on the same page reflects what you typed in.
If that is a correct assesment of what you are trying to do then consider this code:
<?php
if($_POST['submit']) {
setcookie("test",$_POST['name']);
header("Location:" . $_SERVER['PHP_SELF']);
}
if($_COOKIE['test']) {
$name = $_COOKIE['test'];
} else {
$name = '';
}
?>
<html>
<head>
<title>Test</title>
</head>
<body>
<form method="post">
<input type="text" name="name" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
</body>