php5 header ERROR!
Collapse
X
-
i also had the same problem but....
i wanted 2 add some our letters 2 my script (šđčćž) but without entering it as HTML characters.... so 2 do tht i had 2 save tht *.php file as UTF-8 encoding... soon as i did tht i had error Cannot modify header information -headers already sent by bla bla bla bla
sooooo i gave up LoL
i just enter those letters as HTML characters.... f#$k it was a job 2 do but i WOULD still want 2 know how 2 avoid tht bcuz i use hangman script without šđčćž letters and its sumkind confusing 2 play without those letters...
Leave a comment:
-
try thisOriginally posted by doriann View PostIM USE THIS SCRIPT FOR DOWNLOAD
<?php
include("config.php");
include("core.php");
connectdb();
$id = $_GET['id'];
$action = $_GET["action"];
$sid = $_GET["sid"];
$downloads = mysql_fetch_array(mysql_query("SELECT downloads FROM ibwf_vault WHERE id='".$id."'"));
$incresedownload = $downloads[0] + 1;
mysql_query("UPDATE ibwf_vault SET downloads='".$incresedownload."' WHERE id='".$id."'");
$link = mysql_fetch_array(mysql_query("SELECT itemurl FROM ibwf_vault WHERE id='".$id."'"));
header("Location:$link[0]");
?>
more when access the page to download the file shows the following error
Warning: Cannot modify header information -headers already sent by (output started at /home/....
how to solve this problem? What could I pass the correct script I use php5 on pages
PHP Code:<? $SERVERmysql = "localhost"; $DB = ""; $DB_USER = ""; $DB_PASS = ""; $link = mysql_connect($SERVERmysql, $DB_USER, $DB_PASS) or die("Could not connect"); $db_id = mysql_select_db($DB, $link) or die("Could not db"); $id = $_GET['id']; $d = mysql_fetch_assoc(mysql_query("SELECT itemurl FROM `ibwf_vault` WHERE `id` = '".$id."'")); if(file_exists($d['itemurl'])) { $load_write = mysql_query("UPDATE ibwf_vault SET downloads=`downloads` + 1 WHERE id='".$id."'"); $dpath = trim($d['itemurl']); header('Location: '.$dpath.''); } ?>
Leave a comment:
-
To remove this error follow this
<?php
ob_start();
///php code and html code
ob_end_flush();
?>
Leave a comment:
-
should be place above youre header or after <?phpCode:header("Location:$link[0]");
Code:<?php header("Location:$link[0]"); ?> <-- HEADER --> <?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><title>Some Title Here</title> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/> <style type="text/css"> #some css here </style></head><body>
Leave a comment:
-
ive seen this problem before, give us the whole warning message. It usually happens when your page header("Location:....."); is set above all your code. you r then running your script executing code below this and outputing to a location. This being said you are sending header info once and then trying to send it again.
im not sure if this would work but try and put your location near the code you want to execute. also clean up on white space.
Leave a comment:
-
in config php check the start <?php change it to <? do this also on corephp i found thats why i couldnt get my page to vallidate i think the <?php is sending the headers
Leave a comment:
-
php5 header ERROR!
IM USE THIS SCRIPT FOR DOWNLOAD
<?php
include("config.php");
include("core.php");
connectdb();
$id = $_GET['id'];
$action = $_GET["action"];
$sid = $_GET["sid"];
$downloads = mysql_fetch_array(mysql_query("SELECT downloads FROM ibwf_vault WHERE id='".$id."'"));
$incresedownload = $downloads[0] + 1;
mysql_query("UPDATE ibwf_vault SET downloads='".$incresedownload."' WHERE id='".$id."'");
$link = mysql_fetch_array(mysql_query("SELECT itemurl FROM ibwf_vault WHERE id='".$id."'"));
header("Location:$link[0]");
?>
more when access the page to download the file shows the following error
Warning: Cannot modify header information -headers already sent by (output started at /home/....
how to solve this problem? What could I pass the correct script I use php5 on pagesTags: None
Leave a comment: