Jump to content

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

 

<?php
// <meta> tag is html, you need to echo it!
echo '<meta http-equiv="refresh" content="0;www.logisticsbusiness.com/library/recorddeleted.php" />';
?>

 

If you post your testconnection.php script, we can then see where  the header already sent problem is.

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.