Jump to content


Photo

parse error


  • Please log in to reply
2 replies to this topic

#1 scott532

scott532
  • Members
  • PipPip
  • Member
  • 14 posts
  • LocationSanta Barbara, CA. (USA)

Posted 01 September 2006 - 02:49 PM

I'm getting this error:
Parse error: parse error, unexpected $ in /usr3/home/cuttingclub.com/htdocs/pravana/v2/php/dvd_signup.php on line 234

Please help

<?php
include_once "./common_db.inc";

function register_form()
{
	global $PHP_SELF;

	$link_id = db_connect();
	mysql_select_db("sample_db");
	mysql_close($link_id);

	?>
<style>
body {
font-family: 'Lucida Grande', Arial; font-size: 11px; color: #333;
background: url(img/bg_texture.jpg);
}
th {	text-align: right ; font-size: 12px; border-bottom: 1px solid #999; }
input, select, textarea {
background: #EEE;
}
</style>
	<center><h3>Sign Up For A Free PRAVANA DVD!</h3></center>
	<form method="post" action="<?php echo $PHP_SELF ?>">
		<input type="hidden" name="action">
			<div align="center">
				<center>
				<table width="90%" cellpadding="6" border="1" bordercolor="purple" cellspacing="0" align="center">
					<tr>
						<th width="30%" nowrap>First Name:</th>
						<td width="70%"><input type="text" name="fname" size="8" maxlength="20"></td>
					</tr>
					<tr>
						<th width="30%" nowrap>Middle Initial:</th>
						<td width="70%"><input type="text" name="minitial" size="1" maxlength="1"></td>
					</tr>
					<tr>
						<th width="30%" nowrap>Last Name:</th>
						<td width="70%"><input type="text" name="lname" size="10" maxlength="30"></td>
					</tr>
					<tr>
						<th width="30%" nowrap>Salon Name:</th>
						<td width="70%"><input type="text" name="salonname" size="20" maxlength="30"></td>
					</tr>
					<tr>
						<th width="30%" nowrap>Salon Address: (<i>Example: 456 Main ST.</i>)</th>
						<td width="70%"><input type="text" name="minitial" size="20" maxlength="60"></td>
					</tr>
					<tr>
						<th width="30%" nowrap>State:</th>
						<td width="70%"><select name="state">
<option value="">Select State</option>

<option value="AK">Alaska(AK)</option>
<option value="AL">Alabama(AL)</option>
<option value="AR">Arkansas(AR)</option>
<option value="AZ">Arizona(AZ)</option>
<option value="CA">California(CA)</option>
<option value="CO">Colorado(CO)</option>
<option value="CT">Connecticut(CT)</option>
<option value="DC">District of Columbia(DC)</option>

<option value="DE">Delaware(DE)</option>
<option value="FL">Florida(FL)</option>
<option value="GA">Georgia(GA)</option>
<option value="HI">Hawaii(HI)</option>
<option value="IA">Iowa(IA)</option>
<option value="ID">Idaho(ID)</option>
<option value="IL">Illinois(IL)</option>
<option value="IN">Indiana(IN)</option>
<option value="KS">Kansas(KS)</option>

<option value="KY">Kentucky(KY)</option>
<option value="LA">Louisiana(LA)</option>
<option value="MA">Massachusetts(MA)</option>
<option value="MD">Maryland(MD)</option>
<option value="ME">Maine(ME)</option>
<option value="MI">Michigan(MI)</option>
<option value="MN">Minnesota(MN)</option>
<option value="MO">Missouri(MO)</option>
<option value="MS">Mississippi(MS)</option>

<option value="MT">Montana(MT)</option>
<option value="NC">North Carolina(NC)</option>
<option value="ND">North Dakota(ND)</option>
<option value="NE">Nebraska(NE)</option>
<option value="NH">New Hampshire(NH)</option>
<option value="NJ">New Jersey(NJ)</option>
<option value="NM">New Mexico(NM)</option>
<option value="NV">Nevada(NV)</option>
<option value="NY">New York(NY)</option>

<option value="OH">Ohio(OH)</option>
<option value="OK">Oklahoma(OK)</option>
<option value="OR">Oregon(OR)</option>
<option value="PA">Pennsylvania(PA)</option>
<option value="RI">Rhode Island(RI)</option>
<option value="SC">South Carolina(SC)</option>
<option value="SD">South Dakota(SD)</option>
<option value="TN">Tennessee(TN)</option>
<option value="TX">Texas(TX)</option>

<option value="UT">Utah(UT)</option>
<option value="VA">Virginia(VA)</option>
<option value="VT">Vermont(VT)</option>
<option value="WA">Washington(WA)</option>
<option value="WI">Wisconsin(WI)</option>
<option value="WV">West Virginia(WV)</option>
<option value="WY">Wyoming(WY)</option>
<option value="">-----</option>
<option value="AS">American Samoa(AS)</option>

<option value="FM">Federated States of Micronesia(FM)</option>
<option value="GU">Guam(GU)</option>
<option value="MH">Marshall Islands(MH)</option>
<option value="MP">Northern Mariana Islands(MP)</option>
<option value="PW">Palau(PW)</option>
<option value="PR">Puerto Rico(PR)</option>
<option value="VI">Virgin Islands(VI)</option>

          </select>
</td>
					</tr>
					<tr>
						<th width="30%" nowrap>City:</th>
						<td width="70%"><input type="text" name="city" size="20" maxlength="40"></td>
					</tr>
					<tr>
						<th width="30%" nowrap>Zipcode:</th>
						<td width="70%"><input type="text" name="zip" size="12" maxlength="15"></td>
					</tr>
					<tr>
						<th width="30%" nowrap>Phone Number:</th>
						<td width="70%">( <input type="text" name="areacode" size="3" maxlength="3"> )-<input type="text" name="phonep1" size="3" maxlength="3">-<input type="text" name="phonep2" size="4" maxlength="4"></td>
					</tr>
					<tr>
						<th width="30%" nowrap>Email Address:</th>
						<td width="70%"><input type="text" name="email" size="20" maxlength="45"></td>
					</tr>
					<tr>
						<th width="30%" nowrap>Number of Stylists/Colorists:</th>
						<td width="70%"><input type="text" name="numstylists" size="4" maxlength="5"></td>
					</tr>
					<tr>
						<th width="30%" nowrap>Average Total Number of Hair Colors Done Each Day in The Salon:</th>
						<td width="70%"><input type="text" name="avgcolors" size="4" maxlength="10"></td>
					</tr>
					<tr>
						<th width="30%" nowrap>Hair Colors Currently Being Used in The Salon:</th>
						<td width="70%"><textarea name="haircolors" cols="25" rows="5"></textarea></td>
					</tr>
					<tr>
						<th width="30%" nowrap>Which Pravana products are you using in the salon?:</th>
						<td width="70%"><textarea name="products" cols="25" rows="5"></textarea></td>
					</tr>
				</table>
				</center>
			</div>
	</form>
	<?php
}

function create_account()
{
	$fname = $_POST['fname'];
	$minitial = $_POST['minitial'];
	$lname = $_POST['lname'];
	$salonname = $_POST['salonname'];
	$address = $_POST['address'];
	$state = $_POST['state'];
	$city = $_POST['city'];
	$zip = $_POST['zip'];
	$areacode = $_POST['areacode'];
	$phonep1 = $_POST['phonep1'];
	$phonep2 = $_POST['phonep2'];
	$email = $_POST['email'];
	$numstylists = $_POST['numstylists'];
	$avgcolors = $_POST['avgcolors'];
	$haircolors = $_POST['haircolors'];

	global $default_dbname;

	if(empty($fname)) {
		error_message("Please Enter Your First Name");
	if(empty($lname)) {
		error_message("Please Enter Your Last Name");
	if(empty($salonname)) {
		error_message("Please Enter The Name of Your Salon");
	if(empty($address)) {
		error_message("Please Enter Your Salon's Address");
  if(empty($state)) {
		error_message("Please Select a State");
  if(empty($city)) {
		error_message("Please Enter a City");
	if(empty($zip)) {
		error_message("Please Enter Your Zip Code");
	if(empty($areacode)) {
		error_message("Please include an Area Code with Your Phone Number");
	if(empty($phonep1)) {
		error_message("Please Enter a telephone number");
	if(empty($phonep2)) {
		error_message("Please Enter a telephone number");
	if(empty($email)) {
		error_message("Please Enter an email address");
	if(empty($numstylists)) {
		error_message("Please tell us how many stylists/colorists you have");
  if(empty($avgcolors)) {
		error_message("Please tell us the average total number of hair colors done each day in your salon");
	if(empty($haircolors)) {
		error_message("Please tell us what hair colors are currently being used in your salon");

		$link_id = db_connect($default_dbname);
		$query = "INSERT INTO freedvd VALUES('$fname', '$minitial', '$lname', '$salonname',
											'$address', '$state', '$city', '$zip', '$areacode', '$phonep1', '$phonep2',
											'$email', '$numstylists', '$avgcolors', '$haircolors')";
		if(!result){
			error_message(sql_error());
		}
?>
<center><h3>Thank You <?php echo $fname ?>. We will be mailing out our DVD to you, free of charge!</h3></center>
<?php

if (empty($_POST)){
	$_POST['action'] = "";
}
switch($_POST['action']) {
	case "dvd_signup":
		create_account();
	break;
	default:
		register_form();
	break;
}
?>


#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 01 September 2006 - 02:55 PM

I'm assuming line 234 is the end of your code .... which means that somewhere in your code you're missing a curly brace } to close one of the loops/conditionals
Legend has it that reading the manual never killed anyone.
My site

#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 01 September 2006 - 03:40 PM

From just browsing your code. You dont close you if statements in the create_account function, you start the if then you dont close it anywhere. For example this is the first if statment in the create_account function:
if(empty($fname)) {
		error_message("Please Enter Your First Name");
Notice you havn't closed the if statment, you have left out the closing curly brace - } - after you call the error_message function. That first if should be like this:
if(empty($fname)) {
		error_message("Please Enter Your First Name");
} // close the if statment

If you close all if statments that should solve the error




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users