...

View Full Version : dababase connection using php



pooja13
04-12-2012, 02:39 PM
<html>
<head>
<title>Result Process</title>
</head>
<?php
$username=$_POST["uname"];
$password=$_POST["pwd"];
$select = "SELECT * FROM customer WHERE Username ='$username'
AND Password='$password'";
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("places of interest", $con);



$Name= $_POST["Name"];
$Address= $_POST["Address"];
$Username= $_POST["Username"];
$Password= $_POST["Password"];
$Retype_password= $_POST["Retype_password"];
$E_mail= $_POST["E_mail"];






$select = "SELECT * FROM customer WHERE E_mail ='$E_mail'AND Username='$username' AND Password='$password' ";
$Rs = mysql_query($select);
if (mysql_num_rows($Rs)>0)
{
mysql_close($con);



$sql_insert = "INSERT INTO customer
(Name,Username, Password,Retype_password , E_mail,Address )
values ('$Name','$Username', '$Password','$Retype_password', '$E_mail','$Address')";
if (!mysql_query($sql_insert,$con))
{
die('Error: '.mysql_error());

}
mysql_close($con);
?>

<BODY STYLE = "background:ROyalblue">





<style type="text/css" >
h1 {color: navy;}
</style>
<body>
<h1 align ="center"><b>Congratulations you have successfully signed up!!!</b></h1>
<br><br><br>

<h2> You can now use your username and password to login.</h2>
<br>
<h2 > Click <a href="log.php">Here</a> to continue</h2>



</body>


</html>

abduraooft
04-12-2012, 02:46 PM
Okay! Any questions?

tangoforce
04-12-2012, 02:58 PM
So what is the issue? Why have you posted us a random login script?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum