im trying to create a page when you enter data review it and deside if you want to go back and edit it or save it.
When i click on the edit bar the forms should be filed with the previous data. but for some reason its not working. it must be my lack of understanding of php of course can someone help me.
in this code i was trying just to get the title to come back before i tried any other.
Can someone please hlep me
<!-- This file creates new publications -->
<?php
//include("../include/connect.inc.php");
?>
<html>
<head>
<title>Seagrant</title>
</head>
<body>
<!-- All data is checked for accuracy before saving it in this section -->
<?php
if($_POST["submit"])
{
$title = $_POST["title"];
$auther = $_POST["auther"];
$description = $_POST["description"];
$publication = $_POST["publication"];
$date = $_POST["date"];
$abstract = $_POST["abstract"];
$keywords = $_POST["keywords"];
$affiliation = $_POST["affiliation"];
echo "<p><b>Title</b>: " . $title . "</p>";
echo "<p><b>Auther</b>: " . $auther . "</p>";
echo "<b>Description</b>: " . $description . "</p>";
echo "<p><b>Publication</b>: " . $publication . "</p>";
echo "<p><b>Date</b>: " . $date . "</p>";
echo "<p><b>Abstract</b>: " . $abstract . "</p>";
echo "<p><b>keywords</b>: " . $keywords . "</p>";
echo "<p><b>affiliation</b>: " . $affiliation . "</p>";
?>
<form>
<p><input type="button" onClick ="window.location='publications.php'" value="Edit" /></p>
<p><input type="button" onClick ="window.location='publications.php?status=save'" value="Save" /></p>
</form>
<?php
}elseif($_GET["status"] == "save"){
mysql_query('" . $title . "', '" . $auther . "', '" . $publication . "', '" . $date . "', '" . $abstract . "',
'" . $keywords . "', '" . $affiliation . "');
echo "Have added the publication to the database.";
}else{
?>
<!--- All data for the publication is entered in this section --->
<form action ="" method = "POST">
<p>Title: <input type="text" name ="title" value="<?php echo $title; ?>"/></p>
<p>Auther: <input type="text" name="auther" /></p>
Description:
<p><textarea name="description" cols ="50" rows="10"></textarea></p>
<p>Publication: <input type="text" name="publication" /></p>
<p>Date(MM/DD/YYYY): <input type="text" name="date" /></p>
<p>Abstract: <input type="text" name="abstract" /></p>
<p>Keywords: <input type="text" name="keywords" /></p>
<p>Affiliation: <input type="text" name="affiliation" /></p>
<p><input type="submit" name="submit" value="Submit" /></p>
</form>
<?php
}
?>
</body>
</html>