I have the following code for a page where i am using a header function :
<?php
if (!defined('pagescope')) die('Please Try your Luck Somewhere else! Your IP Address has been logged!');
define('pagescope', 'true');
require'config.php';
*some Query processing with no echo command
//$query1 = "select * from users";
if($query_run = mysql_query($query))
{
$id=mysql_insert_id();
header("Location: http://www.pingcampus.com/mysql/cropupload/jquery_upload_cropv1.2/upload_dp.php?id=$id&email=$contact_email&gender=$gender");
} else {
echo mysql_error();
}
?>
*I Have made sure that there are no echo statements on the page, also there are no errors given! But it just doesn’t redirects! Also it works fine on my Localhost but not on my hosting *
try this
UPDATE :
your error states that header is already being sent, do a proper check in other part of script. or what you can do is use output buffering.
place
ob_start();on top of your script.more information here. http://php.net/ob_start