This was a checkout script for an ecommerce site originally written in ASP.
Was automatically converted using ASP2PHP.
A user submits the form and gets directed to this script in a separate PHP file. This script is supposed to redirect to several different URL's.
When I run the file, i get this error;
Warning: Cannot modify header information - headers already sent by (output started at......
I am not very familiar with PHP, so it would be great if someone could make out the errors in this script, and help me fix them.
Note that header replaced response.redirect.
<?
$paytype=${"button"};
$payselect=${"payselect"};
// ---------------------------------------------
if ($paytype=="")
{
if ($payselect=="lifetime")
{
if ($_POST["OPTIN"]=="ON")
{
if ($_POST["OPTIN1"]=="ON")
{
// --------------------------------------------
header("Location: "."http://insert redirect link here");
}
else
{
// --------------------------------------------
header("Location: "."http://insert redirect link here");
}
}
else
{
if ($_POST["OPTIN1"]=="ON")
{
// --------------------------------------------
header("Location: "."http://insert redirect link here");
}
else
{
// --------------------------------------------
header("Location: "."http://insert redirect link here");
}
}
}
else
if ($payselect=="2yr")
{
if ($_POST["OPTIN"]=="ON")
{
if ($_POST["OPTIN1"]=="ON")
{
// --------------------------------------------
header("Location: "."http://insert redirect link here");
}
else
{
// --------------------------------------------
header("Location: "."http://insert redirect link here");
}
}
else
{
if ($_POST["OPTIN1"]=="ON")
{
// --------------------------------------------
header("Location: "."http://insert redirect link here");
}
else
{
// --------------------------------------------
header("Location: "."http://insert redirect link here");
}
}
}
else
if ($payselect=="1yr")
{
if ($_POST["OPTIN"]=="ON")
{
if ($_POST["OPTIN1"]=="ON")
{
// --------------------------------------------
header("Location: "."http://http://insert redirect link here");
}
else
{
// --------------------------------------------
header("Location: "."http://insert redirect link here");
}
}
else
{
if ($_POST["OPTIN1"]=="ON")
{
// --------------------------------------------
header("Location: "."http://insert redirect link here");
}
else
{
// --------------------------------------------
header("Location: "."http://insert redirect link here");
}
}
}
else
{
header("Location: "."http://insert redirect link here");
}
}
?>
<form name="paymethod" action="<? echo $_SERVER["PHP_SELF"];?>" method="post"></strong>