<?php
if (isset($POST["url"])) {
header("Location: ".$POST["url"]);
exit;
}
$location1="bobs.html";
$location2="addrecord.php";
?>
<html>
<body bgcolor="#6699FF">
<form method=Post Action="editpage.php"><?php echo "<input name=\"url\" Type=\"hidden\" value=\"".$location1."\">";?><input type="submit" value="Update Lectures" ></form>
<form method=Post Action="editpage.php"><?php echo "<input name=\"url\" Type=\"hidden\" value=\"".$location2."\">";?><input type="submit" value="Add to Lectures"></form>
</body>
</html>
I have tested the code and it works.
Firstly,
$url might not work properly becuase POST variables are stored as $POST[..], if ou have register_globals (i.e. global variables) in your code on it will transfer all $GET[..] , $_POST[..] etc to their corresponding variable as you were using above. But uding register_globals is a security risk and bad programming technique and should be avoided.
The isset fucntion will simply check if the value of the variable has been set.
Now after yesterday's changes which you made from my suggestions it was now redirecting you to a file whose name is stored in $POST["url"]. At the moment it was storing the string "location1" not the value of the variable $location1. So I simply changed the code to print the value of variable $location1 and $location2 in the code. Now $post["url"] was directily storing the filenames. And that does the trick.
For more on :
isset : http://www.php.net/isset
$_post : http://www.freewebmasterhelp.com/tutorials/php/6
register_globals and variable scope : http://www.zend.com/manual/language.variables.scope.php
Let me know if you need help understanding something.