Hi
I would like to load a page dynamically dependant upon the choice made(submit value). The following script seems to work the second time it's run and not the first.
Basically when the script runs it displays the 'which page.php' and echoes 'which page.php'
If I click OK it displays the 'which page.php' and echoes OK.php'
If I click OK again then it displays the OK.php page. Likewise for finish.php
I am sure it must be down to when the code runs. Can somebody please help me out here. Many Thnaks in advance
<?php //which page.php. test script for dynamically loading pages
$submit = $_POST['submit'];
switch($submit) {
case 'OK':
$page = "'ok.php'";
break;
case 'finish':
$page = "'finish.php'";
break;
default:
$page = "'which page.php'";
}
echo $page;
?>
<html>
<head>
<title></title>
</head>
<body>
<form action=<?php echo $page ?> method ='POST'>
<td width="14%" style="border-style: none; border-width: medium" height="74"><align="right"><input type="submit" name = 'submit' value="OK" /></td>
</br>
</br>
</td>
<td width="14%" style="border-style: none; border-width: medium" height="62"><align="right"><input type="submit" name = 'submit'value="finish" /></td>
</td>
</form>
</body>
</html>