Jump to content
php.lv forumi

kad ielogojos nepariet uz nakosho lapu


Techno

Recommended Posts

Man ir tāda problēma ar manu login scriprtu kad es logojos ieksha pec ielogoshanas vajazdetu pariet uz memberspage manu bet ta vieta paradas vienkarshi tukša lapa un kad ierakstu nepareizu loginu vajazdetu paradit ka bad login bet ta vieta ari tukša lapa parādās . lūdzu palīdzat reku bus scripts mana login.php

 

<?php

//Database Information

$dbhost = "localhost";
$dbname = "useri";
$dbuser = "root";
$dbpass = ":D :D :D";

//Connect to database

mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());

session_start();
$username = $_POST[‘username’];
$password = md5($_POST[‘password’]);

$query = “select * from users where username=’$username’ and password=’$password’”;

$result = mysql_query($query);

if (mysql_num_rows($result) != 1) {
$error = “Bad Login”;
include “login.html”;

} else {
$_SESSION[‘username’] = “$username”;
include “memberspage.php”;
}

?>

Link to comment
Share on other sites

×
×
  • Create New...