<?php
error_reporting(0);
include("../../php/open.php");// db-connection
print_r($_REQUEST);
if(isset($_REQUEST['form1']))
{
if(!empty($_POST['description'])){
$id=$_REQUEST['id'];
$field_name = $_REQUEST['field_name'];
$paragraph1=$_REQUEST['description'];
$text = $paragraph1;
$query ="UPDATE website_data SET field_value = '$text', field_name= '$field_name' WHERE id = '$id';";
$result=mysql_query($query);
if($result==true){
$url="index.php?page=content_edit";
die('<script type="text/javascript">window.location.href="' . $url . '";</script>');
}
}
else{
echo "<script>alert('page body can not be empty')</script>";
}
}
?>
并显示输出....
答案 0 :(得分:1)
或者你可以使用php header函数重定向,但不要忘记从顶部删除print_r。
而不是
die('<script type="text/javascript">window.location.href="' . $url . '";</script>');
使用
header('location : '.$url);
答案 1 :(得分:0)
请使用此:
if($result==true){
echo "<script type='text/javascript'>window.location.href='index.php?page=content_edit'
</script>";
}