Redirecting to a page depending on value in field.
I want to do redirect a user to a certain page after they register. Here's the part of the code:
<?php
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "WAATKRegistrationForm")) {
$insertSQL = sprintf("INSERT INTO company (CompName, CompStreet1, CompStreet2, CompCity, CompState, CompZip, MailStreetAddress, MailCity, MailState, MailZipcode, CompPhone, CompFax, CompMobile, DERPhone, CompFirstName, CompLastName, CompEmail, CompUserName, CompPassword, CompMiddleINt, ActiveFlag, CompanyType) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['CompName'], "text"),
GetSQLValueString($_POST['CompStreet1'], "text"),
GetSQLValueString($_POST['CompStreet2'], "text"),
GetSQLValueString($_POST['CompCity'], "text"),
GetSQLValueString($_POST['CompState'], "text"),
GetSQLValueString($_POST['CompZip'], "text"),
GetSQLValueString($_POST['MailStreetAddress'], "text"),
GetSQLValueString($_POST['MailCity'], "text"),
GetSQLValueString($_POST['MailState'], "text"),
GetSQLValueString($_POST['MailZipcode'], "text"),
GetSQLValueString($_POST['CompPhone'], "text"),
GetSQLValueString($_POST['CompFax'], "text"),
GetSQLValueString($_POST['CompMobile'], "text"),
GetSQLValueString($_POST['DERPhone'], "text"),
GetSQLValueString($_POST['CompFirstName'], "text"),
GetSQLValueString($_POST['CompLastName'], "text"),
GetSQLValueString($_POST['CompEmail'], "text"),
GetSQLValueString($_POST['CompUserName'], "text"),
GetSQLValueString($_POST['CompPassword'], "text"),
GetSQLValueString($_POST['CompMiddleINt'], "text"),
GetSQLValueString($_POST['ActiveFlag'], "text"),
GetSQLValueString($_POST['CompanyType'], "text"));
mysql_select_db($database_dotweb, $dotweb);
$Result1 = mysql_query($insertSQL, $dotweb) or die(mysql_error());
if (!session_id()) session_start();
if(!isset($_SESSION["CompId"]))
{
$_SESSION["CompId"] = mysql_insert_id();
}
if($CompanyType == "Owner")
{
header("Location: productpaypal_company.php");
}
else
{
header("Location: productpaypal_owner.php");
}
?>
The php section seems to be fine. When I go to display the page in the browser I get the following parse error.
Parse error: parse error in C:\wamp\www\dotweb\company_Registration.php on line 598
This is the happens to be the line after the </html> tag. It worked find before I added the if else statement on $CompanyType. Can someone tell me what I did wrong? Thanks