Jump to content

Recommended Posts

Posted

get this error after trying to log in

 

Fatal error: Call to undefined function: myql_query() in /homepages/21/d176117763/htdocs/login.php on line 12

 

this is what I have so far in my login.php script below

 

<?php

 

session_start();

 

include ('mysql.php');

 

if (isset ($_POST['submit'])) {

$username = mysql_escape_string($_POST['username']);

$password = mysql_escape_string(sha1 ($_POST['password']));

 

if (!empty ($username) && !empty ($password)) {

$sql = myql_query ("SELECT * FROM users

WHERE username ='" . $username . "' AND

user_password='" . $password . "' LIMIT 1");

 

if (mysql_num_rows ($sql) > 0)

{

$_SESSION['loggedin'] = true;

$_SESSION['username'] = $username;

echo 'you are now logged in!';

}

else

{

echo 'your username and/or password is incorrect!';

}

}

}

else

{

echo '

Username:

 

Password:

 

';

}

 

?>

~

~Gotta get the time to go through more tuts but it is hard.

Wish the examples would just work. like the print "statement" prints statement and ; is a stop

Once I can get some basic scripts together for the functions I need I can can probably save them to reuse.

~

~

Posted
thanks. gotta try to have a better eye.

It happens.

 

If you are getting "Call to undefined function" for functions built into PHP, first check the spelling. If you are getting that error for your own functions, check the spelling (if your functions and your function call are in the same file)

 

[file]

function test() {}

test();

[end file]

 

or check the paths of any includes that include the function code

 

[file]

include("path/to/file.php");

test();

[end file]

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...