close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


Redirecting to a page depending on value in field.

Thread began 3/08/2009 5:21 pm by kmlohr221718 | Last modified 3/09/2009 8:32 am by kmlohr221718 | 2195 views | 2 replies |


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:

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();
$_SESSION["CompId"] = mysql_insert_id();

if($CompanyType == "Owner")
header("Location: productpaypal_company.php");
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

Sign in to reply to this post

Ray BorduinWebAssist

you are missing a "}" at the end.

Sign in to reply to this post
Did this help? Tips are appreciated...



That did the trick.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...