JAI MATADI all ..
i have made one login form in php using mysql database connectivity . .
here is my code .. (LOGIN.PHP)
-------------------------------------
LOGIN.PHP
---------------------
<form name="f1" id="f1" method="post">
Username : <input type="text" name="uname" />
<br />
Password : <input type="text" name="passwrd" />
<br />
<input type="submit" name="submit" id="submit" />
</form>
<?php
if(isset($_POST["submit"]))
{
$user = $_POST["uname"];
$pwrd = $_POST["passwrd"];
mysql_connect("localhost","root","");
mysql_select_db("alldatabase");
$qry = "select count(*) from signup where username='" . $user . "' and pword='" . $pwrd . "'";
$result = mysql_query($qry);
$row = mysql_fetch_array($result);
if($row[0] == 1)
{
echo "Login Successfully";
}
else
{
echo "Invalid Username or Password";
}
}
?>
---------------------------------------------
what i wanna do here is i have another form called "PROFILE.PHP"
if the user write a wrong USERNAME or PASSWORD he/she will get the error in the same "LOGIN.PHP" form .. but if the user has entered the correct he/she will be able to go into "PROFILE.PHP" page and will be able to see his/her account then after ..
how can i do this .. ?
i have made one login form in php using mysql database connectivity . .
here is my code .. (LOGIN.PHP)
-------------------------------------
LOGIN.PHP
---------------------
<form name="f1" id="f1" method="post">
Username : <input type="text" name="uname" />
<br />
Password : <input type="text" name="passwrd" />
<br />
<input type="submit" name="submit" id="submit" />
</form>
<?php
if(isset($_POST["submit"]))
{
$user = $_POST["uname"];
$pwrd = $_POST["passwrd"];
mysql_connect("localhost","root","");
mysql_select_db("alldatabase");
$qry = "select count(*) from signup where username='" . $user . "' and pword='" . $pwrd . "'";
$result = mysql_query($qry);
$row = mysql_fetch_array($result);
if($row[0] == 1)
{
echo "Login Successfully";
}
else
{
echo "Invalid Username or Password";
}
}
?>
---------------------------------------------
what i wanna do here is i have another form called "PROFILE.PHP"
if the user write a wrong USERNAME or PASSWORD he/she will get the error in the same "LOGIN.PHP" form .. but if the user has entered the correct he/she will be able to go into "PROFILE.PHP" page and will be able to see his/her account then after ..
how can i do this .. ?