mysql_num_rows

Heres the code:



<?
if (isset($login))
{
$dbcnt = mysql_connect('localhost','root','645pibbk645');
$dbslt = mysql_select_db('lxs');
$sql = "SELECT user FROM lxs_users WHERE user = '$user' AND pass = password('$pass')";
$result = mysql_query($sql) or die ("table probs");
if (mysql_num_rows($result) == 0) { ?>
You have entered the wrong user name or password, please ">try again or ?add=1">register a new
user name.
<?
}
else
{
echo "You are now logged in, $user.";
}
}
else if(isset($add))
{
?>

Please enter all fields

">

User Name



Password



E-Mail



Hometown



Interest



Homepage







<?
}

else if(isset($register))
{
$dbcnt = mysql_connect('localhost','root','645pibbk645');
$dbslt = mysql_select_db('lxs');
$sql = "SELECT user from lxs_users WHERE user='$user'";
$result = mysql_query($sql);
if (mysql_num_rows($result) == 0)
{
$dbcnt = mysql_connect('localhost','root','645pibbk645');
$dbslt = mysql_select_db('lxs');
$sql = "INSERT into lxs_users SET user='$user',pass=password('$pass'),email='$email',hometown='$hometown',interest='$interest',homepage='$homepage'";
$query = mysql_query($sql) or die("table probs..again, shut up kyle");
echo "You have successfully created an account, <?=$user?>. Your information is as follows --";
echo "$user
$pass
$email
$hometown
$interest
$homepage";
}
else
{
echo "Error.";
}
}
else
{
?>

Please Log In

">

Username



Password







<?
}
?>




heres my error:


Parse error: parse error in /usr/home/odin/public_html/user_login.php on line 69

Can i get any help
-ocYrus
www.ocyland.com
www.imagine-wedesigns.com
www.lightx-security.com

Comments

  • hi,

    replace this

    echo "You have successfully created an account, <?=$user?>. Your information is as follows --";


    with this :

    echo "You have successfully created an account, $user. Your information is as follows --";



    Alex Elderson


    : Heres the code:
    :
    :
    :
    : <?
    : if (isset($login))
    : {
    : $dbcnt = mysql_connect('localhost','root','645pibbk645');
    : $dbslt = mysql_select_db('lxs');
    : $sql = "SELECT user FROM lxs_users WHERE user = '$user' AND pass = password('$pass')";
    : $result = mysql_query($sql) or die ("table probs");
    : if (mysql_num_rows($result) == 0) { ?>
    : You have entered the wrong user name or password, please ">try again or ?add=1">register a new
    : user name.
    : <?
    : }
    : else
    : {
    : echo "You are now logged in, $user.";
    : }
    : }
    : else if(isset($add))
    : {
    : ?>
    :

    Please enter all fields

    : ">
    :
    : User Name
    :
    :
    :
    : Password
    :
    :
    :
    : E-Mail
    :
    :
    :
    : Hometown
    :
    :
    :
    : Interest
    :
    :
    :
    : Homepage
    :
    :
    :
    :
    :
    :
    :
    : <?
    : }
    :
    : else if(isset($register))
    : {
    : $dbcnt = mysql_connect('localhost','root','645pibbk645');
    : $dbslt = mysql_select_db('lxs');
    : $sql = "SELECT user from lxs_users WHERE user='$user'";
    : $result = mysql_query($sql);
    : if (mysql_num_rows($result) == 0)
    : {
    : $dbcnt = mysql_connect('localhost','root','645pibbk645');
    : $dbslt = mysql_select_db('lxs');
    : $sql = "INSERT into lxs_users SET user='$user',pass=password('$pass'),email='$email',hometown='$hometown',interest='$interest',homepage='$homepage'";
    : $query = mysql_query($sql) or die("table probs..again, shut up kyle");
    : echo "You have successfully created an account, <?=$user?>. Your information is as follows --";
    : echo "$user
    $pass
    $email
    $hometown
    $interest
    $homepage";
    : }
    : else
    : {
    : echo "Error.";
    : }
    : }
    : else
    : {
    : ?>
    :

    Please Log In

    : ">
    :
    : Username
    :
    :
    :
    : Password
    :
    :
    :
    :
    :
    :
    :
    : <?
    : }
    : ?>
    :
    :
    :
    :
    : heres my error:
    :
    :
    : Parse error: parse error in /usr/home/odin/public_html/user_login.php on line 69
    :
    : Can i get any help
    : -ocYrus
    : www.ocyland.com
    : www.imagine-wedesigns.com
    : www.lightx-security.com
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion