Hello everyone,
I have this idea for a website that I can't seem to solve. I created an intro page where there's a username and a password to type and two buttons, a login button and a register button.
What I wanted to do is when the login button is pressed it compares the username and the password with database entries, if they're available, it would redirect the client to homepage. If not, the lightbox would appear for registration.
When both buttons are click, nothing happens :/..
The code to my intro page is:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title> RYNC - Rent Your Car Now</title>
<style type="text/css">
@import "Dialog/DescriptionDialog.css";
@import "Dialog/styles.css";
</style>
<style>
body {
background: url(../Images/Bgcolor.jpg);
background-size: 100%;
background-position: top center;
background-repeat: no-repeat;
}
</style>
</script>
<script type="text/javascript" src="JQuery.js"></script>
<script type="text/javascript" src="Dialog/jquery.lightbox_me.js"></script>
<?php
function ShowLogin(){
$f_usr = $POST["username"];
$f_pswd = $POST["password"];
$con=mysql_connect("localhost","root","");
if(! $con){
die('Connection Failed'.mysql_error());
}
mysql_select_db("projet",$con);
$result = mysql_query("SELECT * FROM client WHERE username= '" .$f_usr. "' AND password= '" .$f_pswd. "' ");
$numrows=mysql_num_rows($result);
if ($numrows != 0){
header("Location: Homepage.php");}
else{
ShowRegistration();}
}
?>
<script type="text/javascript">
function ShowRegistration(){
.get("Registration.php",
function(data){
$("#descDialog").empty();
$("#descDialog").append(data);
$("#descDialog").lightbox_me({
centered:true
});
})
}
</script>
</head>
<body>
<form name="frm" action="Registration.php" method="post">
<center>
<OBJECT classid="clsid😃27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macr...ersion=6,0,0,0"
WIDTH="640" HEIGHT="480" id="RYNC" ALIGN="">
<PARAM NAME=movie VALUE="RYNC.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="../Flash/RYNC.swf" quality=high bgcolor=#FFFFFF WIDTH="640" HEIGHT="480" NAME="RYNC" ALIGN="" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedi...layer"></EMBED>
</OBJECT>
<br>
Username
<input type="text" value="" name="username">
<br>
Password
<input type="password" value="" name="password">
<br>
</form>
<input type="button" value="Log In" name="Login" onclick="<? ShowLogin(); ?>">
<input type="button" value="Register now" name="Register" onclick="ShowRegistration();">
<div id="descDialog"></div>
</body>
</html>
Thanks in advance
Regards,
Chris