0

hey guys so im doing a really simple sign up form but its not working. maybe im doing smtg wrong.

form:

<form method="post" action="PersonalDetails_Process.php"><!--link to DB-->

                <br>

                <h1><center>PERSONAL DETAILS</center></h1>
                <br>
                <br>
                <label>Name
                <span class="small">Add your name</span>
                </label>
                <input type="text" name="name" id="name" required />


                <label>Phone
                <span class="small">Add your phone</span>
                </label>
                <input type="text" name="phone" id="phone" maxlength=
                "20" size="20" required />


                <label>Email
                <span class="small">Add a valid address</span>
                </label>
                <input type="text" name="email"  />
                <br>     
                <br>
                <br>

              <input type="submit" name="next" value="Next"/>

                <div class="spacer"></div>

                </form>

process :

<?php
    include "dbase.php";
//Dapatkan details
if(isset($_POST['next'] ))
{
    $name = mysql_real_escape_string($_POST['name']);
    $phone =  mysql_real_escape_string($_POST['phone']);
    $email = mysql_real_escape_string($_POST['email']);

    $query =@mysql_query("INSERT INTO personaldetails VALUES ('$name','$phone','$email')") or die(mysql_error());

    if($query)
    {
        echo ('<script>window.location("BookingnDisplay.php")</script>');
    }
    else
    {   
        echo "nope";
    }




}
?>

dbase connection:

<!-- dbase.php -->
<!-- To connect between php scripting and database. -->
<?php

$conn = mysql_connect("localhost","root","") or die("Could not connect to database");
$conn1 = mysql_select_db("studio") or die ("Could not connect to database");

if($conn)
{
    echo "yes";
}

if($conn1)
{
    echo "yes";
}

?>

the thing is it reads the include "dbase"; and nothing after that. the if(isset($_POST)) doesnt even run. so when the page runs only yesyes is displayed. whats going on? i dont get it.

2
Contributors
2
Replies
12
Views
3 Years
Discussion Span
Last Post by zouhair.kasmi
0

ive even tried putting the database connection coding into the process file instead of including a database file. doesnt work as well. same output. yesyes

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.