<?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>";
}
}
?>
and shows the output....
please use this:
if($result==true){
echo "<script type='text/javascript'>window.location.href='index.php?page=content_edit'
</script>";
}
Alternatively you can use php header function to redirect, but don't forget to remove print_r from the top.
instead of
die('<script type="text/javascript">window.location.href="' . $url . '";</script>');
use
header('location : '.$url);