<?php session_start();

include "../../conf/conn.php";

if(!isset($_POST['submit'])){
	exit('Fail!');
}
$sql="UPDATE `orders` SET 
`recipient name` = '".htmlspecialchars($_POST["recipient_name"])."'
,`phone` = '".htmlspecialchars($_POST["phone"])."' 
,`email` = '".htmlspecialchars($_POST["email"])."' 
,`email` = '".preg_replace("/\r\n/", '<br>',htmlspecialchars($_POST["remarks"]))."' 
,`address` = '".preg_replace("/\r\n/", '<br>',htmlspecialchars($_POST["address"]))."'
WHERE `orders`.`record` = ".$_POST["record"];

$_SESSION["page"]=9;

echo "<script language='javascript' 
type='text/javascript'>";  
echo "window.location.href='../e-shop.php';";  

if($query=mysqli_query($conn,$sql)){echo 'alert("edit success.");</script>';}
?>