GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 13-Oct-2005, 16:09
blckspder blckspder is offline
New Member
 
Join Date: Oct 2005
Posts: 1
blckspder is on a distinguished road

Newbie Here Parse Error Please Help!


Hello,
I keep getting this parse error. I got the script from PHPFreaks.com.. Im new to PHP and Ive been trying to get it to work. But to no avail. Please help, Thanks.

Code:
Error:Parse error: parse error, unexpected T_VARIABLE in C:\Domains\sousaink.com\wwwroot\contact.php on line 90

Code:
PHP Code:

<html> 
<head> 
</head> 
<body> 

<?php 
/* grabs the POST variables and puts them into variables that we can use */ 
$firstName=$_POST['firstName']; 
$lastName=$_POST['lastName']; 
$company=$_POST['company']; 
$email=$_POST['email']; 
$website=$_POST['website']; 
$countryCode=$_POST['countryCode']; 
$phone=$_POST['phone']; 
$phoneExt=$_POST['phoneExt']; 
$mobile=$_POST['mobile']; 
$fax=$_POST['fax']; 
$address=$_POST['address']; 
$city=$_POST['city']; 
$state=$_POST['state']; 
$country=$_POST['country']; 
$zipCode=$_POST['zipCode']; 
$heardAbout=$_POST['heardAbout']; 
$inquiring=$_POST['inquiring']; 

//---------VALIDATION--------> 
    if($firstName){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your first name<br>\n";//----> ERROR if no input 
            } 

    if($lastName){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your last name<br>\n";//----> ERROR if no input 
            } 

    if($email){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your e-mail address<br>\n";//----> ERROR if no input 
            } 

    if($phone){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your phone number<br>\n";//----> ERROR if no input 
            } 

    if($address){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your mailing address<br>\n";//----> ERROR if no input 
            } 

    if($city){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your city name<br>\n";//----> ERROR if no input 
            } 

    if($zipCode){//----> CHECK input 
        } 
        else{ 
            $error.="Please, go back and fill out your zip code<br>\n";//----> ERROR if no input 
            } 
//-------->ERROR FREE?? 
    if($error==""){ 
        echo "Thank you for inquiring about us! A receipt of your submission will be e-mailed to you almost immediately."; 
//---------------------------------- 
$mailContent="--------CONTACT--------\n" 
            ."First Name: ".$firstName."\n" 
            ."Last Name: ".$lastName."\n" 
            ."Company: ".$company."\n" 
            ."E-mail: ".$email."\n" 
            ."Website: ".$website."\n\n--------PHONE--------\n" 
            ."Phone: ".$countryCode." ".$phone."\n" 
            ."Extension: ".$phoneExt."\n" 
            ."Fax: ".$fax."\n" 
            ."Mobile: ".$mobile."\n\n--------ADDRESS--------\n" 
            ."Street Address: ".$address."\n" 
            ."City: ".$city."\n" 
            ."State: ".$state."\n" 
            ."Country: ".$country."\n" 
            ."Zip Code: ".$zipCode."\n\n--------INFO--------\n" 
            ."Where did you hear about us? ".$heardAbout."\n" 
            ."Inquiring about: ".$inquiring."\n" 
//---------------------------------- 
$toAddress="blckspder@gmail.com"; /* change this! */ 
$subject="MyWebSite.com's Products'"; /* change this! */ 
$recipientSubject="MyWebSite.com's Contact Form"; /* change this! */ 
$receiptMessage = "Thank you ".$firstName." for inquiring about MyWebSite.com's Products!\n\n\nHere is what you submitted to us:\n\n" 
            ."--------CONTACT--------\n" 
            ."First Name: ".$firstName."\n" 
            ."Last Name: ".$lastName."\n" 
            ."Company: ".$company."\n" 
            ."E-mail: ".$email."\n" 
            ."Website: ".$website."\n\n--------PHONE--------\n" 
            ."Phone: ".$countryCode." ".$phone."\n" 
            ."Extension: ".$phoneExt."\n" 
            ."Fax: ".$fax."\n" 
            ."Mobile: ".$mobile."\n\n--------ADDRESS--------\n" 
            ."Street Address: ".$address."\n" 
            ."City: ".$city."\n" 
            ."State: ".$state."\n" 
            ."Country: ".$country."\n" 
            ."Zip Code: ".$zipCode."\n\n--------INFO--------\n" 
            ."Where did you hear about us? ".$heardAbout."\n" 
            ."Inquiring about: ".$inquiring."\n" 
//---------------------------------- 
mail($email, $subject, $receiptMessage,"From:$toAddress"); 
//---------------------------------- 
mail($toAddress,$recipientSubject,$mailContent,"From:$email"); 
//--->echo $mailContent; 

////////////////////////////////////////  CONNECT TO MYSQL DB  //////////////////// 
// OPEN CONNECTION ---> 
$connection=mysql_connect("localhost","username", "password") or die("Unable to connect!"); /* change this! */ 

mysql_select_db("mywebsite_com") or die("Unable to select database!"); /* change this! */ 

//  EXECUTE QUERY ---> 
$query="INSERT INTO generalContact ( 
            firstName, 
            lastName, 
            company, 
            email, 
            website, 
            countryCode, 
            phone, 
            phoneExt, 
            mobile, 
            fax, 
            address, 
            city, 
            state, 
            country, 
            zipCode, 
            heardAbout, 
            inquiringOn) 
        VALUES( 
            '".$firstName."', 
            '".$lastName."', 
            '".$company."', 
            '".$email."', 
            '".$website."', 
            '".$countryCode."', 
            '".$phone."', 
            '".$phoneExt."', 
            '".$mobile."', 
            '".$fax."', 
            '".$address."', 
            '".$city."', 
            '".$state."', 
            '".$country."', 
            '".$zipCode."', 
            '".$heardAbout."', 
            '".$inquiring."')"; 
//////-----> 
$result=mysql_query($query) or die("Error in query:".mysql_error()); 
//if ($result) 
    //echo mysql_affected_rows()." row inserted into the database effectively."; 

//  CLOSE CONNECTION ---> 
mysql_close($connection); 

/////////////////////////////////////////////////////////////////////////////////// 
        } 
    else{ 

            print "Sorry, but the form cannot be sent until the fields indicated are filled out completely - <br>\n"; 
            print "$error<br>\n"; 
            print "<br>\n"; 
            print "<br>\n"; 
            print "Please use your \"Back\" button to return to the form to correct the omissions.  Thank you.<br>\n"; 
        } 

?> 
</body> 
</html> 

Last edited by LuciWiz : 14-Oct-2005 at 01:24. Reason: Please insert your Php code between [php] & [/php] tags
  #2  
Old 16-Oct-2005, 22:55
dannybedor dannybedor is offline
New Member
 
Join Date: Jul 2005
Posts: 13
dannybedor is on a distinguished road

Re: Newbie Here Parse Error Please Help!


I believe that you should inform us the code of the page which call the contact.php because that's where the variables come.
 
 

Recent GIDBlogAccepted for Ph.D. program by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Steps to create and compile c program in SUSE batrsau Computer Software Forum - Linux 7 03-Jun-2007 20:49
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' quiescent MySQL / PHP Forum 7 13-Nov-2005 16:43
linked lists, newbie needs help moltarim C Programming Language 4 06-May-2004 12:32
newbie using Sam's series Skampy C++ Forum 3 06-Mar-2004 19:51

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 19:21.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.