You need to set the title before you output the page, like this:
<?php
$title = "This should be the first header you see";
if(isset($_GET['submit']))
{
switch( $_GET['submit'] )
{
case "H1":
$title = "You pressed the first button";
break;
case "H2":
$title = "Please don't press this button, it hurts";
break;
default:
$title = "Something went wrong, here";
break;
}
}
?>
<html>
<head>
<title><?php echo $title; ?></title>
</head>
<form><input type ="submit" name="submit" value="H1"></form>
<form><input type ="submit" name="submit" value="H2"></form>
</body>
</html>
[Non-text portions of this message have been removed]
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/