Yes, but you must describe in more detail what you're trying to accomplish.
Are you posting some vars from a form to a script? Or will you make some vars sticky, so that they remains even when the post-var is empty?
Your first post indicates the latter, but I'm not sure 😃
If you want them to be sticky, one method is to use cookies, like this:
<?PHP
if(empty($_COOKIE['uname']) && empty($_GET['uname'])) {
$the_name = "hank";
setcookie("uname", $the_name);
header("Location:".$_SERVER['PHP_SELF']."?uname=$the_name");
}
?>
On the header redirect, the cookie-value should be set (if the browser support cookies), and you may print the name like this:
<?PHP
if(!empty($_GET['uname'])) {
if(!empty($_COOKIE['uname'])) {
$printname = $_COOKIE['uname'];
echo "You are $printname and your browser support cookies!";
} else {
$printname = $_GET['uname'];
echo "You are $printname but your browser don't support cookies!";
}
}
?>
With a bit of luck, this code should not produce any parse-errors :p
[edit]Well, nearly... 😃 [/edit]
[edit2]And you'll need to specify php-self in CAPITAL letters, else Opera 6 won't understand a thing... Ah - poor, poor Opera...[/edit2]
knutm