Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    dababase connection using php

    <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>

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,859
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Okay! Any questions?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,332
    Thanks
    60
    Thanked 526 Times in 513 Posts
    Blog Entries
    4
    So what is the issue? Why have you posted us a random login script?
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •