Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

?
Lv 4

what is wrong with this part 2?

right...

thanks to the 3 answerers i got in the first question.

im basically trying to add a function that checks to see if the user info they enter upon login matches with the info in the database.

if it does then they it should echo "you have successfully logged in"

if not it should say "incorrect password"

I get this error:

Parse error: syntax error, unexpected $end in /home/a4264749/public_html/logintest.php on line 61

line 61 is: ?>

Here is my code:

<?php

$username = $_POST['username'];

$password = $_POST['password'];

if ($username&&$password)

{

$connect = mysql_connect('mysql11.000webhost.com','…

if(!$connect)

die("could not connect to database");

mysql_select_db("a4264749_login") or die ("couldn't find database");

$query = mysql_query("SELECT * FROM users WHERE username='$username'");

$numrows = mysql_num_rows ($query);

if ($numrows!=0)

{

while ($row = mysql_fetch_assoc($query))

{

$dbusername = $row['username'];

$dbpassword = $row['password'];

}

//check to see if they match

if ($username==$dbusername&&$password==$dbp…

{

echo "You have successfully logged in!";

}

else

{

echo "Incorrect password";

}

}

?>

2 Answers

Relevance
  • Anonymous
    1 decade ago
    Favorite Answer

    Your not closing this bracket:

    if ($username&&$password)

    {

  • 4 years ago

    sounds like something you should chat to her surgeon approximately. "Potato Boy" is a fine looking nickname. eating strings must be interest, boredom, or an indication that she is lacking specific food. Licking a lightbulb sounds like a foul determination on her section. yet i won't be in a position to help questioning how she have been given the possibility to lick a lit lightbulb. Giving the cat haircuts and making the partitions "rather" are additionally prevalent issues for a splash youngster to objective. Does she understand the regulations of the abode? And does she get disciplined for doing those issues? time outs, eliminating toys, canceling journeys to the park, etc... Does she get too plenty self-discipline? you won't be in a position to anticipate her to sit down down around all day and don't something the two. And do you have appropriate occasions obtainable to maintain her occupied? in the journey that your youngster is stepping into this plenty mischief, it sounds like time to re-infant-evidence your place. Take her to a pediatrician or 2 or 3 - communicate approximately her habit, ask if she desires specific help, and ask for suggestion on the thank you to chop back those undesirable suggestions she gets.

Still have questions? Get your answers by asking now.