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;
}
?>

Link to comment
Share on other sites

<?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.  :-[

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.