Jump to content

Parse error: syntax error, unexpected T_DEFAULT


lpxxfaintxx

Recommended Posts

I've been looking at the code for quite a while now, trying to see whats wrong. I just can't find it, so I thought some fresh eyes would do a better job.

 

Parse error: syntax error, unexpected T_DEFAULT in /home/q94/public_html/alumnify.com/login.php on line 39

 

Line 39 is 'default:'

 

<?php

switch($_GET['action']){

case "login":

if(isset($_POST['login']))
	{

$email = trim(addslashes($_POST['email']));
$password = md5(trim($_POST['password']));

$query = mysql_query("SELECT * FROM Users WHERE email = '$email' AND Password = '$password' LIMIT 1") or die	(mysql_error());

$row = mysql_fetch_array($query);



if(mysql_num_rows($query) > 0)
	{

	if($row['Activated'] > 0)
		{

		$_SESSION['s_logged_n'] = 'true';
		$_SESSION['s_username'] = $username;
		$_SESSION['s_name'] = $row['Name'];
		$_SESSION['rank'] = $row['Activated'];

	} else {

	echo '
	<p>Sorry, you must activate your account first. Please check your email for the activation email.</p>
	<p>Didn'."'".'t get your validation email? <a href="resend.php">Click here</a> to resend the validation email.</p>
	';

			}
	break;
	default:

<html>

include('includes/header.php');

<p>You must login to view this page. Enter your username and password below and hit submit:</p>
<form method="post" action="<?= $_SERVER['PHP_SELF'] ?>">
<p>Email Address:<br>
<input name="email" type="text" Cid="email">

<p>Password:<br>
<input name="password" type="password" id="password">
</p>
<p>
<input name="login" type="submit" id="login" value="Submit">
</p>
</form>
<p>Didn't get your validation email? <a href="resend.php">Click here</a> to resend the validation email.</p>
<p>Need an account? <a href="register.php">Click here</a> to register, it's completely free! </p>

include('includes/footer.php');


</html>


break;
}
?>

<?php

switch($_GET['action']){

case "login":

if(isset($_POST['login']))
	{

$email = trim(addslashes($_POST['email']));
$password = md5(trim($_POST['password']));

$query = mysql_query("SELECT * FROM Users WHERE email = '$email' AND Password = '$password' LIMIT 1") or die	(mysql_error());

$row = mysql_fetch_array($query);



if(mysql_num_rows($query) > 0)
	{

	if($row['Activated'] > 0)
		{

		$_SESSION['s_logged_n'] = 'true';
		$_SESSION['s_username'] = $username;
		$_SESSION['s_name'] = $row['Name'];
		$_SESSION['rank'] = $row['Activated'];

	} else {

	echo '
	<p>Sorry, you must activate your account first. Please check your email for the activation email.</p>
	<p>Didn'."'".'t get your validation email? <a href="resend.php">Click here</a> to resend the validation email.</p>
	';

			}
	break;
	default:

<html>

include('includes/header.php');

<p>You must login to view this page. Enter your username and password below and hit submit:</p>
<form method="post" action="$_SERVER['PHP_SELF']">
<p>Email Address:<br>
<input name="email" type="text" Cid="email">

<p>Password:<br>
<input name="password" type="password" id="password">
</p>
<p>
<input name="login" type="submit" id="login" value="Submit">
</p>
</form>
<p>Didn't get your validation email? <a href="resend.php">Click here</a> to resend the validation email.</p>
<p>Need an account? <a href="register.php">Click here</a> to register, it's completely free! </p>

include('includes/footer.php');


</html>


break;
}
?>

 

Same problem.  :-[

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.