PDA

View Full Version : help: coding problem. parse error


twiedie
02-25-2009, 02:52 PM
This is the error i'm getting. please help me.

Parse error: parse error in C:\wamp\www\Test\login.php on line 11

find code below

<?php
require_once("Connections/connection.php"); // database connection

// catch field data
$userid = $_POST['userid'];
$password = $_POST['password'];
$submitted = $_POST['submitted'];

if ($userid && $password) (
///////////////////////////////////////////////////////
$query = sprintf("SELECT * FROM users where user_name='$userid' and user_password = '$password'");
$result = @mysql_query($query);
$rowAccount = @mysql_fetch_array($result);
//////////////////////////////////////////////////////
)

if ($rowAccount) (

echo "the record exists so you can enter";

)elseif ($submitted) (

echo "you don't exist in the system so your not getting in '";

)
?>

davidj
02-25-2009, 09:15 PM
conditional statements are incorrect


if ($rowAccount) (

echo "the record exists so you can enter";

)elseif ($submitted) (

echo "you don't exist in the system so your not getting in '";

)


format is ....

notice the curly braces


if ($rowAccount){

//code

}elseif($submitted){

//code

}