Jump to content

[SOLVED] login problem help


chanfuterboy

Recommended Posts

hi,

 

I just cant see what im dont wrong, someone can help me, i have the username and pasw field in other page when enter in redirect to login.php so something is not good in the script, but what i dont know i just see the page goes cant open it pls help me out

 

<?php

session_start();

include ('dbconfig.php');


$username= $_POST['username'];
$password= $_POST['password'];

if ($username&&$password)
{

$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'];
  
}

// chek


)
else
     die(" e username no ta eksisti");

}

else
   die("Please hinka un username of pasw");



?>

Link to comment
https://forums.phpfreaks.com/topic/180564-solved-login-problem-help/
Share on other sites

I cleaned up the code so syntactically, it's correct.

<?php
session_start();
include ('dbconfig.php');
$username= $_POST['username'];
$password= $_POST['password'];
if ($username&&$password){
$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'];
	}
	// chek
}
else
die(" e username no ta eksisti");
}
else
die("Please hinka un username of pasw");
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.