I'm trying to get my page to redirect back to another page after the form has been submitted to its self via $_SERVER[PHP_SELF] . I've tried using the header(Location) script but to no avail. Anyone know of an easy way to do this?
Right now.. when my page is submitted all the action and everything is done properly but I'm left with a blank white page.
Here's the code..
Thanks in advance.
<!DOCTYPE html PUBLIC "-//D XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<?php
include('../inc/storeinfo.php');
include('../database.php');
$noteid=$_POST["noteid"];
?>
<head>
<Title><? print $storename?> - <? print $sitename?> - Home</Title>
<link rel="stylesheet" href="/fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link href="../css/viewtickets.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="editNotesContainer">
<?
$result = mysql_query("SELECT * FROM info WHERE ticket='$noteid'");
while($row = mysql_fetch_array($result))
{
echo "<div id=\"editNotesHeader\">Editing Notes for Ticket #$noteid</div>" .
"<div id=\"editNotes\">" .
"<form method=\"post\" action=\"$_SERVER[PHP_SELF]\">" .
"<textarea name=\"newnote\" rows=\"10\" cols=\"48\">{$row['notes']}</textarea>" .
"<input type=\"hidden\" value=\"$noteid\" name=\"newnoteid\">" .
"<br /><input type=\"submit\" value=\"Update\">" .
"</form>" .
"</div>" ;
}
if(isset($_POST)){
$newnote=$_POST["newnote"];
$newnoteid=$_POST["newnoteid"];
mysql_query("UPDATE info SET notes = '$newnote' WHERE ticket = '$newnoteid'");
echo "testing";
}
?>
</div>
</body>
</html>
<?
mysql_close($con);
?>