JAI MATADI all . .
go to this website .. its in PHP
http://zssonline.com/matrimonial.php
and then first click on "Login" Button without writing anything in login .. and see in the Addressbar or your Browser what happens ..
now after this .. write something in your Username and Password field and then click on "Login" Button and then see in the Addressbar .. see what happens ..
well i have similar like this .. i have LOGIN.PHP and PROFILE.PHP page ..
what i wanna do here is if the user puts a wrong username or password .. he or she will get a error msg like this as i mentioned above or will get a msg in the LOGIN.PHP webpage ..
and if he/she will enter a correct he/she will be able to go to his/her profile ..
here is my code . .
-----------------------
LOGIN.PHP
-----------------------
<form name="f1" id="f1" method="post" >
Username : <input type="text" name="uname" />
<br />
Password : <input type="text" name="passwrd" />
<br /><br />
<input type="submit" name="submit" id="submit" value="Login" />
</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";
}
}
?>
------------------------------------------------------------
i have already posted this question here
http://answers.yahoo.com/question/index?qid=20101230002949AAAWhZ8
and i got an answer from my friend @just JR
but m not satisfied with that answer as m didnt unserstand is properly . .
i have an example also now what i wanna do .. as i dont have any sort of idea what so ever in this ..
please let me know and throw me out of this confusion with good idea ..
thank you . .
@Colinc
but howw .. ?
go to this website .. its in PHP
http://zssonline.com/matrimonial.php
and then first click on "Login" Button without writing anything in login .. and see in the Addressbar or your Browser what happens ..
now after this .. write something in your Username and Password field and then click on "Login" Button and then see in the Addressbar .. see what happens ..
well i have similar like this .. i have LOGIN.PHP and PROFILE.PHP page ..
what i wanna do here is if the user puts a wrong username or password .. he or she will get a error msg like this as i mentioned above or will get a msg in the LOGIN.PHP webpage ..
and if he/she will enter a correct he/she will be able to go to his/her profile ..
here is my code . .
-----------------------
LOGIN.PHP
-----------------------
<form name="f1" id="f1" method="post" >
Username : <input type="text" name="uname" />
<br />
Password : <input type="text" name="passwrd" />
<br /><br />
<input type="submit" name="submit" id="submit" value="Login" />
</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";
}
}
?>
------------------------------------------------------------
i have already posted this question here
http://answers.yahoo.com/question/index?qid=20101230002949AAAWhZ8
and i got an answer from my friend @just JR
but m not satisfied with that answer as m didnt unserstand is properly . .
i have an example also now what i wanna do .. as i dont have any sort of idea what so ever in this ..
please let me know and throw me out of this confusion with good idea ..
thank you . .
@Colinc
but howw .. ?