|
-
Oct 13th, 2012, 06:47 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] PHP: Header Code Not Work When Website is Uploaded
Hi guys.
I get this error:
Warning: Cannot modify header information - headers already sent by (output started at /home/janrapha/public_html/UpdateToday/includes/overall/header.php:7) in /home/janrapha/public_html/UpdateToday/register.php on line 116
line 116 is this code.
Code:
header('location: register.php?success');
I got no error when I'm running the site in my localhost. But when I upload the files online, I got errors saying headers are already sent.
Please help.
Manny Pacquiao once posted in his twitter:
It doesn't matter if the grammar is wrong, what matter is that you get the message
-
Oct 13th, 2012, 10:23 PM
#2
Thread Starter
Fanatic Member
Re: PHP: Header Code Not Work When Website is Uploaded
I've decided to replace the php code:
Code:
header('location: register.php?success');
with a javascript code:
Code:
<script type="text/javascript">
<!--
window.location = "http://www.google.com/"
//-->
</script>
Problem solve
Manny Pacquiao once posted in his twitter:
It doesn't matter if the grammar is wrong, what matter is that you get the message
-
Oct 14th, 2012, 05:26 AM
#3
Re: [RESOLVED] PHP: Header Code Not Work When Website is Uploaded
You are supposed to use the header function before echoing anything on the page. Means it should be used before the output.
Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP.
Read more in here: http://php.net/manual/en/function.header.php
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|