header('Location: '.$HTTP_SERVER_VARS['HTTP_REFERER']) ???
Posted: Wed Jan 05, 2005 9:02 am
Im having trouble getting my script to do what i want it to do. I upload a file to a newsboard. when i select upload a script does some sql and then i want to return back to that page. the code i use is
this isn't working is there an alternative for what i want to do?
the error i get is
code is:
Code: Select all
header('Location: '.$HTTP_SERVER_VARSї'HTTP_REFERER']);
exit;the error i get is
Code: Select all
Cannot modify header information - headers already sentcode is:
Code: Select all
<?php
//script written with the help of chapter 26 PHP & Web Development by Luke Welling 04/02/2005
require('page.inc');
require_once('news_fns.php');
$link_id = db_connect();
$now = time();
$story = $_GET['story'];
$query = "update stories set published = $now
where story_id = $story";
$result = mysql_query($query, $link_id);
header('Location: '.$HTTP_SERVER_VARS['HTTP_REFERER']);
exit;
?>