PHP SCRIPT
#8

Quote:
Originally Posted by minijackc
Посмотреть сообщение
Leave him be, He's new to PHP it looks like.

If you want more assistance i've added your skype.

- Alexander
No offence but I did not mean to harm anyone, I just needed to know why he did so.
____________________________________
PHP код:
<?php
$conn 
= new mysqli($server$username$password$dbname);
if (
$conn->connect_error)
    die(
"Connection failed: " $conn->connect_error);
if(isset(
$_POST["submit"])) {
    if(!
is_null($_POST["username"])) {
        if(!
is_null($_POST["password"])) {
            
$username $conn->real_escape_string(stripslashes($_POST['username']));
            
$password sha1($conn->real_escape_string(stripslashes($_POST['password'])));
            
$sql "SELECT Username, Password FROM login WHERE Username= '$username' AND Password= '$password'";
            
$result $conn->query($sql);
            if(
$result->num_rows 0) {
                echo 
"logged in.";
            }
        }
        else
            echo 
"Don't leave the password empty.";
    }
    else
        echo 
"Don't leave the username empty.";
}
$conn->close();
?>
Now it wont work, cause you need to get the name="" in the <input> in order to handle a form request.
So that's why we can't help you without the html.
Reply


Messages In This Thread
PHP SCRIPT - by alexanderjb918 - 10.07.2016, 10:44
Re: PHP SCRIPT - by Luicy. - 10.07.2016, 11:08
Re: PHP SCRIPT - by alexanderjb918 - 10.07.2016, 11:12
Re: PHP SCRIPT - by Luicy. - 10.07.2016, 11:14
Re: PHP SCRIPT - by Luicy. - 10.07.2016, 11:18
Re: PHP SCRIPT - by minijackc - 10.07.2016, 11:19
Re: PHP SCRIPT - by alexanderjb918 - 10.07.2016, 11:20
Re: PHP SCRIPT - by Luicy. - 10.07.2016, 11:25

Forum Jump:


Users browsing this thread: 1 Guest(s)