473,387 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

redirecting in the middle of a code

if ($email != VALID_email)
{
header("Location: create3.php?error=invalid_email");
} else if (!empty($db_email)) {
header("Location: create3.php?error=already_email");
} else {
if($password != VALID_PASSWORD)
{
header("Location: create3.php?error=invalid_password");
} else if (!empty($db_password)) {
header("Location: create3.php?error=already_password");
} else {
mysql_query('INSERT INTO `accounts` VALUES (``, $email,
$password)');
header("Location: index.php");
}
}
mysql_close();
Warning: Cannot modify header information - headers already sent by
(output started at C:\AppServ\www\opinionsofamateurs\accounts
\create2.php:12) in C:\AppServ\www\opinionsofamateurs\accounts
\create2.php on line 32
How to solve?
Jun 2 '08 #1
3 1137
Raistlin Majere wrote:
if ($email != VALID_email)
{
header("Location: create3.php?error=invalid_email");
} else if (!empty($db_email)) {
header("Location: create3.php?error=already_email");
} else {
if($password != VALID_PASSWORD)
{
header("Location: create3.php?error=invalid_password");
} else if (!empty($db_password)) {
header("Location: create3.php?error=already_password");
} else {
mysql_query('INSERT INTO `accounts` VALUES (``, $email,
$password)');
header("Location: index.php");
}
}
mysql_close();
Warning: Cannot modify header information - headers already sent by
(output started at C:\AppServ\www\opinionsofamateurs\accounts
\create2.php:12) in C:\AppServ\www\opinionsofamateurs\accounts
\create2.php on line 32
How to solve?
It is a 5 step process:

1) Go to groups.google.com
2) In the search box put Warning: Cannot modify header information
3) Click on the first article at the top of the page (it is an article in
this group)
4) Read
5) Think to yourself, why didn't I do that at the start.
Jun 2 '08 #2
Paul Lautman wrote:
Raistlin Majere wrote:
> if ($email != VALID_email)
{
header("Location: create3.php?error=invalid_email");
} else if (!empty($db_email)) {
header("Location: create3.php?error=already_email");
} else {
if($password != VALID_PASSWORD)
{
header("Location: create3.php?error=invalid_password");
} else if (!empty($db_password)) {
header("Location: create3.php?error=already_password");
} else {
mysql_query('INSERT INTO `accounts` VALUES (``, $email,
$password)');
header("Location: index.php");
}
}
mysql_close();
Warning: Cannot modify header information - headers already sent by
(output started at C:\AppServ\www\opinionsofamateurs\accounts
\create2.php:12) in C:\AppServ\www\opinionsofamateurs\accounts
\create2.php on line 32
How to solve?

It is a 5 step process:

1) Go to groups.google.com
2) In the search box put Warning: Cannot modify header information
3) Click on the first article at the top of the page (it is an article in
this group)
4) Read
5) Think to yourself, why didn't I do that at the start.

Very good, Paul, and normally I would not have written anything after
laughing (the way I did). However, on examining the code, I don't see
any print or echo statement to have caused this. So, to Raistlin, don't
look at THIS piece of code. It is not causing your problem. Look,
instead, at the piece where you have already done and echo or a print.

Hint: Do what Paul said.
Jun 2 '08 #3
sheldonlg wrote:
Paul Lautman wrote:
>Raistlin Majere wrote:
>> if ($email != VALID_email)
{
header("Location: create3.php?error=invalid_email");
} else if (!empty($db_email)) {
header("Location: create3.php?error=already_email");
} else {
if($password != VALID_PASSWORD)
{
header("Location: create3.php?error=invalid_password");
} else if (!empty($db_password)) {
header("Location: create3.php?error=already_password");
} else {
mysql_query('INSERT INTO `accounts` VALUES (``, $email,
$password)');
header("Location: index.php");
}
}
mysql_close();
Warning: Cannot modify header information - headers already sent by
(output started at C:\AppServ\www\opinionsofamateurs\accounts
\create2.php:12) in C:\AppServ\www\opinionsofamateurs\accounts
\create2.php on line 32
How to solve?

It is a 5 step process:

1) Go to groups.google.com
2) In the search box put Warning: Cannot modify header information
3) Click on the first article at the top of the page (it is an
article in this group)
4) Read
5) Think to yourself, why didn't I do that at the start.


Very good, Paul, and normally I would not have written anything after
laughing (the way I did). However, on examining the code, I don't see
any print or echo statement to have caused this.
Correct, the post that I referred him to talks about the whitespace which
usually causes this problem.

Mind you, not that there are no php tags here either. He has obviously
posted only a small portion of the code and the offending echo or whitespace
occurs somewhere else.
So, to Raistlin,
don't look at THIS piece of code. It is not causing your problem. Look,
instead, at the piece where you have already done and echo or a
print.
Hint: Do what Paul said.


Jun 2 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Luis | last post by:
set RS = conn.Execute("SELECT * FROM TblName") do while not RS.eof if X = "Blah" then 'do something RS.close set RS = nothing response.redirect "report.asp" end if RS.movenext loop
0
by: Christophe HELFER | last post by:
hi, I have some problem with redirecting input and output from a process. I can only use VB language (sorry...) Situation: I have to use the Cisco Network Registrar (DNS And DHCP server) ...
3
by: lozd | last post by:
Would appreciate any solutions people could offer for this. Basically I wan't to use a frameset with an aspx page as the contents rather than a htm page and I'd like to be able to redirect the...
7
by: Adam Clauss | last post by:
I am trying to work-around a firewall which limits me to only being able to accept inbound connections on port 80. Unfortunately, I need to two different applications to be able to accept...
2
by: Paul M | last post by:
hi there, i have an <asp:button> control on my webpage that when clicked, i want to redirect the HTTP request to an EXE file, but instead of actually directing the browser and address bar to...
6
by: Christophe Helfer | last post by:
hi, I have some problem with redirecting input and output from a process. Situation: I have to use the Cisco Network Registrar (DNS And DHCP server) command line utility as redirecting its...
8
by: Morpheus | last post by:
I am trying to test a function that outputs text to the standard output, presumably using a cout call. I do not have access to the source, but need to test the output. Is this possible? I can...
17
by: mansb2002 | last post by:
Hi, We recently moved our webserver from Win2K to Win2003. The application works fine. Only problem is that when user views a report as a PDF, IE does not show it. The following code is used to...
41
by: amygdala | last post by:
Hello all, I have posted a similar question in comp.lang.php in the past, but haven't had any response to it then. I kinda swept the problem under the rug since then. But I would really like to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.