Member 14630705 Ответов: 1

Ошибка синтаксического анализа: синтаксическая ошибка, неожиданный конец файла в C:\xampp\htdocs\matrimony\matrimony\register.php на линии 465


* This E-Mail Address is ALREADY REGISTRED ";
			}
		
		
		
		else if(@mysql_num_rows($result2)!=0){
			$emailMsg = "<font color="#FF0000">* This Profile ID is ALREADY REGISTRED</font>";
			}
		
		else if($age < 18 || $age > 60)
		{
			$emailMsg = "<font color="#FF0000">You cannot be register with us, if your age is less than 18 or greater than 60</font>";
		}
		
		else{



			$insert = "insert into users(LoginID, EmailAddress, Password, Gender, BirthDate, BirthMonth, BirthYear, ReligionID, CountryID, ConfirmationCode, AddedDate, Age, dobstatus) 
			VALUES (
				'".mysql_escape_string($_POST['login'])."',
				'".mysql_escape_string($_POST['email'])."',
				'".mysql_escape_string($_POST['password1'])."',
				'".mysql_escape_string($_POST['gender'])."',
				'".mysql_escape_string($_POST['day'])."',
				'".mysql_escape_string($_POST['month'])."',
				'".mysql_escape_string($_POST['year'])."',
				".$_POST['community'].",
				".$_POST['countryofresidence'].",
				'".md5(mysql_escape_string($_POST['email']))."',				
				NOW(),
				'".$age."',
				".$dobstatus."
			)";	
			$resultt = mysql_query($insert);

if($rowsettings['smtpstatus'] == 1)		
{
	
	$email_layout = "<br><br><br><table border="0" width="100%"><tbody><tr><td colspan="2" height="2"></td></tr></tbody></table><br><br><br>Dear Member,<br><br>Your Registration with ".$rowsettings['ScriptName']." has been successfully completed, but you need to confirm your registration first by clicking the below link. If you cannot access the confirmation page by clicking at this link, then kindly copy paste this link into your browser's address bar and press enter. After you will confirm your registration, You will be able to create your profile.<br><br><br>click below to confirm your registration:<br><br><a href="".$rowsettings[">".$rowsettings['url']."/registration_confirmation.php?confirm=".md5(mysql_escape_string($_POST['email']))."</a>";
	

require("phpmailer/class.phpmailer.php");

	$mail = new PHPMailer();
	
	$mail->IsSMTP();            
	$mail->Host = $rowsettings['smtp'];
	$mail->Port = $rowsettings['port'];
	$mail->SMTPAuth = true;     
	$mail->Username = $rowsettings['AdminEmail'];
	$mail->Password = $rowsettings['AdminEmailPassword'];
	
	$mail->From = $rowsettings['AdminEmail'];
	$mail->FromName = $rowsettings['ScriptName'];
	$mail->AddAddress($_POST['email']);  

	
	$mail->WordWrap = 50;                                 // set word wrap to 50 characters
	$mail->IsHTML(true);                                  // set email format to HTML
	
	$mail->Subject = "Action Required to Confirm Registration";
	$mail->Body = $email_layout;
	$mail->Send();
	
	}
	else
	{
	$to=$_POST['email'];
	$email_layout = "<br><br><br><table border="0" width="100%"><tbody><tr><td colspan="2" height="2"></td></tr></tbody></table><br><br><br>Dear Member,<br><br>Your Registration with ".$rowsettings['ScriptName']." has been successfully completed, but you need to confirm your registration first by clicking the below link. If you cannot access the confirmation page by clicking at this link, then kindly copy paste this link into your browser's address bar and press enter. After you will confirm your registration, You will be able to create your profile.<br><br><br>click below to confirm your registration:<br><br><a href="".$rowsettings[">".$rowsettings['url']."/registration_confirmation.php?confirm=".md5(mysql_escape_string($_POST['email']))."</a>";
	$subject="Action Required to Confirm Registration";
	$description=$email_layout;
	$headers  = "MIME-Version: 1.0\r\n";
	$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
	$headers .= "From: ".$rowsettings['ScriptName']." <".$rowsettings['AdminEmail'].">\r\n";

	$res=@mail($to,$subject,$description,$headers);
	}
	
	header("Location: register2.php?email=".mysql_escape_string($_POST['email']));
		}
}
?>




<title> <?PHP echo $rowsettings['ScriptName'] ?> - Register

		






			
			<center>
		
				
				<div style="width: 762px" align="right">
					
				</div>
				
			
			
			<div style="width: 762px; background-color: rgb(255, 255, 255)">
			<div>


				
				<div style="padding: 2px 0pt 4px 0px">
					<div style="padding: 4px 0pt 4px 16px; width: 215px; float: left; text-align: left">
					<a href="index.php"></a>
					</div>
				<br clear="all">
			
			</div>
			
		
					<div>
					<div style="background-color: #000000">
					<div style="margin: 1px 0pt 1px 0px; padding: 3px 0pt 3px 0px; background-color: #990000" class="mediumwhitebold">
						
	
						</div>
					</div>
				</div>
				


			</div>
			</div>
			
			</center>

<center>
<div style="width: 762px">
	<div class="mediumblack">
		<div style="width: 760px">
			<div style="width: 30px; float: left"><br></div>
 			<div style="margin: 0pt 0pt 10px 0px; width: 700px; float: left">
				<br>
				
				
				<br>				<div style="float: left; text-align: left; padding-top: 10px"><br>
				
				<li> <span>View unlimited profiles</span> </li>				<li> <span>Express Interest in members</span> </li>				
				<li> <span>Get contacted directly</span> </li>				</div>

				<br clear="all"><br>
				<div style="padding: 15px 0pt 5px 0px; width: 430px; float: left; text-align: left">
				</div>
				<div class="smallgrey" style="padding: 2px 0pt 5px 0px; width: 270px; float: left; text-align: right"><span style="font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 16px; font-size-adjust: none; line-height: 18px"><br></span>Already Registered? <a href="login.php" class="smallbluelink">Login</a> </div><br clear="all">
				<div style="padding: 5px 0pt 0pt 0px; text-align: left; font-family: tahoma; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; color: rgb(127, 127, 127)">All fields are compulsory. This information is a must for successful account creation</div>
			</div>



			
							



			
			
			
			<div id="regform">



				<div style="width: 90%">


					<div class="div1">
					
					<table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr>						<td>					
		
		
		
		

		
		
		<table class="tblreg" border="0" cellpadding="5" cellspacing="4" width="400"><tbody><tr>			<td nowrap="nowrap" width="150">Profile ID</td>			<td class="smallgrey">
		
		<span class="hint" id="hint_login">
		<div>
			<div></div>
			<div style="padding: 0pt 5px 0pt 8px; width: 201px; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; color: rgb(127, 127, 127)">Your nickname on <br>Minimum 4 characters. Your Profile ID<br>can only contain letters or numbers.</div>
			<div></div>
		</div>
		<div></div>
		</span>
		
	<br>
			<span id="errmsg_login" class="error"></span></td>		</tr>		<tr>			<td>Email</td>			<td class="smallgrey">
		
		<span class="hint" id="hint_email">
		<div>
			<div></div>
			<div style="padding: 0pt 5px 0pt 8px; width: 201px; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; color: rgb(127, 127, 127)">Type your email address<br>We will use this Email Address to send you profiles that match your requirements.</div>
			<div></div>
		</div>
		<div></div>
		</span>
		
	<br>
			<span id="errmsg_email" class="error"></span></td>		</tr>		<tr>			<td>Confirm Email</td>			<td>
		
		<span class="hint" id="hint_retypeemail">
		<div>
			<div></div>
			<div style="padding: 0pt 5px 0pt 8px; width: 201px; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; color: rgb(127, 127, 127)">Retype your email address<br>This will make sure you have typed the correct email address.</div>
			<div></div>
		</div>
		<div></div>
		</span>
		
	<br>
			<span id="errmsg_retypeemail" class="error"></span></td>		</tr>		<tr class="spacer">			<td colspan="2"><br></td>		</tr>		<tr>			<td>Password</td>			<td class="smallgrey">
		
		<span class="hint" id="hint_password1">
		<div>
			<div></div>
			<div style="padding: 0pt 5px 0pt 8px; width: 201px; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; color: rgb(127, 127, 127)">Type your password<br>Minimum 4 characters. Your password cannot contain spaces.</div>
			<div></div>
		</div>
		<div></div>
		</span>
		
	<br>
			<span id="errmsg_password1" class="error"></span></td>		</tr>		<tr>			<td>Confirm Password</td>			<td>
		
		<span class="hint" id="hint_password2">
		<div>
			<div></div>
			<div style="padding: 0pt 5px 0pt 8px; width: 201px; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; color: rgb(127, 127, 127)">Retype your password<br>Minimum 4 characters. Your password cannot contain spaces.</div>
			<div></div>
		</div>
		<div></div>
		</span>
		
	<br>
			<span id="errmsg_password2" class="error"></span></td>		</tr>		<tr class="spacer">			<td colspan="2"><br></td>		</tr>		<tr>			<td>Gender</td>			<td>
		
		<span class="hint" id="hint_gender">
		<div>
			<div></div>
			<div style="padding: 0pt 5px 0pt 8px; width: 201px; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; color: rgb(127, 127, 127)">Please select the gender of the person looking to get married.</div>
			<div></div>
		</div>
		<div></div>
		</span>
		
	 Male  <br>
			 Female<br>
			<span id="errmsg_gender" class="error"></span></td>		</tr>		<tr>			<td>Date of Birth</td>			<td class="smallgrey">			Day01020304050607080910111213141516171819202122232425262728293031  MonthJanFebMarAprMayJunJulAugSepOctNovDec  Year1989198819871986198519841983198219811980197919781977197619751974197319721971197019691968196719661965196419631962196119601959195819571956195519541953195219511950194919481947
		
		<span class="hint" id="hint_dateofbirth">
		<div>
			<div></div>
			<div style="padding: 0pt 5px 0pt 8px; width: 201px; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; color: rgb(127, 127, 127)">Please select date of birth of the<br>person looking to get married.<br>(Visible only to you)</div>
			<div></div>
		</div>
		<div></div>
		</span>
		
<br>
 Check this box to display your date of birth in profile.
			<span id="errmsg_dateofbirth" class="error"></span></td>		</tr>		<tr>			<td>Religion / Community</td>			<td>			Select
			
						
						
						
			<br>
			<span id="errmsg_community" class="error"></span></td>		</tr>		<tr>			<td>Country of Residence</td>			<td>Select
			
						
						>
						
			<br>
			<span id="errmsg_countryofresidence" class="error"></span></td>		</tr>		</tbody></table>
		
	
						</td>						<td valign="bottom">					<br>
					<br>
					</td>					</tr>					</tbody></table>
					</div><br clear="all">
				</div>

			</div>

			

			<div style="margin: 0pt 5px; width: 91%">

				
				<div class="smallblack" style="padding: 12px 0pt 0pt 25px; text-align: left">

					<span class="input"></span> I affirm that I have read and agree to the  <a href="privacy.php" class="smallbluelink" target="_blank">Privacy Policy</a> and <a href="terms.php" class="smallbluelink" target="_blank">Terms and Conditions</a>.<br><span style="line-height: 10px"></span><br>

					<br>

										
									</div>
				

			</div>
			
			

			</div><br><br>



		</div>
	</div>


</center>




			<center>
				<div class="smalldgray" style="width: 760px; text-align: left; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none">
					<div style="margin: 0px">
						<div style="width: 100%; text-align: center">
						
		<br>
		<div style="width: 100%; text-align: center; margin-bottom: 5px">
			<div style="padding: 0pt 0pt 0pt 14px; width: 100%">
				
						</div>
					</div>
				</div>
				</div>
				</div>
			</center>




What I have tried:

We tried checking if all the loops are closed correctly. We couldn't debug. Please help asap!

1 Ответов

Рейтинг:
2

OriginalGriff

Во - первых, вываливать на нас большой кусок своего досье и говорить: "разберись со мной" - это грубо-тебе бы понравилось, если бы я сделал то же самое с тобой?

И делать это с плохо отступленным, недокументированным, раскомментированным кодом, у которого где - то отсутствует скобка, не просто грубо-это выходит за рамки этого.

Сделайте правильный отступ в вашем коде: когда я вижу такие вещи, как это:

	$res=@mail($to,$subject,$description,$headers);
	}
	
	header("Location: register2.php?email=".mysql_escape_string($_POST['email']));
		}
}
Совершенно очевидно, что вы собрали это из множества мест, не заботясь о удобочитаемости.

И где-то в этом беспорядке из 500 строк кода есть недостающая скобка ... - куда же? Не знаю. И я тоже не собираюсь его искать.
Вернитесь к исходному коду, выберите стиль отступа, который работает для вас (я вижу там три варианта на выбор, так что выбирайте сами), и переформатируйте свой код, чтобы использовать его последовательно. Это почти наверняка поднимет проблему для вас, и вы сможете исправить ее для себя.