Jump to content

[SOLVED] Header Function won't redirect!!!


contraboybish

Recommended Posts

This has to be one of the most annoying errors ever!!!!!

 

I have the following code.....


<?php

 

require_once('testconnection.php');

 

$query = "DELETE FROM subscription WHERE subId = {$_POST['id']}";

odbc_exec($odbc, $query) or die (odbc_errormsg());

 

odbc_close($odbc);

 

header("Location: register_results.php");

?>


 

The above deletes a reat but i get the follwing error.....

 

Warning: Cannot modify header information - headers already sent by (output started at d:\inetpub\logisticsbusiness.com\web\content\library\testconnection.php:2) in d:\inetpub\logisticsbusiness.com\web\content\library\register_delete.php on line 10

 

Any thoughts anyone :-)

 

Bish

Link to comment
https://forums.phpfreaks.com/topic/51175-solved-header-function-wont-redirect/
Share on other sites

headers wont work if there is anything output to screen before they happen, it is saying that an output occured on line 2 in testconnection.php

 

if there is no output there try removing all white space from above the opening <?php tag if there is any

Tried this as below.....

 

<?php

require_once('testconnection.php');

$query = "DELETE FROM subscription WHERE subId = {$_POST['id']}";

odbc_exec($odbc, $query) or die (odbc_errormsg());

odbc_close($odbc);

          #header("Location: recorddeleted.php");

<meta http-equiv="refresh" content="0;www.logisticsbusiness.com/library/recorddeleted.php" />

?>

I get the following error........

 

Parse error: parse error, unexpected '<' in d:\inetpub\logisticsbusiness.com\web\content\library\register_delete.php on line 7

 

I can't believe how difficult it is to redirect!!!

 

BIsh

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.