Forum Moderators: coopster
Parse error: parse error, unexpected T_IF on line 25
<?php
include("new_login.php");
Global $username;
global $userID, $usergroup,$username1, $userpass, $firstname, $lastname;
$conn1 = mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db('saberplex', $conn1) or die(mysql_error());
function display($username1)
{
$username = $_POST['user'];
$query1= "select * from users where u_user_name = '$username'";
$result = mysql_query($query1);
$dbarray = mysql_fetch_array($result);
if(!$result)
{
echo "Could not establish connection with the database server";
}
else
(
if($dbarray['u_user_status']==0)
{
echo "Your profile has been terminated! Please contact the administrator!";
}
else
{
$userID = $dbarray["u_user_id"];
$usergroup = $dbarray["u_user_group"];
$username1 = $dbarray["u_user_name"];
$userpass = $dbarray["u_user_password"];
$firstname = $dbarray["u_user_first_name"];
$lastname = $dbarray["u_user_last_name"];
echo "$username1";
}
}
}
?>
<?php if(isset($_POST['View'])): ?>
<?php endif; ?>
<html>
<form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<strong>Click here to view your profile:</strong>
<label>
<input type="submit" name="View" value="View Profile">
</label>
</form>
</html>
[edited by: eelixduppy at 1:54 pm (utc) on July 10, 2008]
or in your code:
if(!$result)
{
echo "Could not establish connection with the database server";
}
else !try <b>else{ }</b>
(
if($dbarray['u_user_status']==0) { \
it was just after quick examining, so best way is to check manual for
good if(){
}else{
}
syntax.
Hope it help a little bit;.
if(!$result)
{
echo "Could not establish connection with the database server";
}
elseif ($dbarray['u_user_status']== 0)
{
echo "Your profile has been terminated! Please contact the administrator!";
}
else
{
$userID = $dbarray["u_user_id"];
$usergroup = $dbarray["u_user_group"];
$username1 = $dbarray["u_user_name"];
$userpass = $dbarray["u_user_password"];
$firstname = $dbarray["u_user_first_name"];
$lastname = $dbarray["u_user_last_name"];
echo "$username1";
}