Posted by Jerim79 on 11/17/06 17:08
I have created a verification script to verify information and redirect
the customer to the appropriate error page. For example:
if ($FName=""){
header('Location:/verify_fname.htm');
}
else{
if ($LName=""){
header('Location:/verify_lname.htm');
}
else{
if ($Company=""){
header('Location:/verify_company.htm');
}
else{
if ($Title=""){
header('Location:/verify_title.htm');
}
}
}
}
The intent of the code is to check a variable. If an error is found in
the variable, it redirects to the correct error page. Otherwise, it
continues on through the else statement which then checks another
variable and so and so on. The final else statement redirects to a
process script that takes all the information writes it to a table. I
am getting this error message:
Cannot modify header information - headers already sent by
I can't put the redirect before the HTML as I want the redirect to be
conditional. Any help would be appreciated.
Navigation:
[Reply to this message]
|