Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8332823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:49:55+00:00 2026-06-09T02:49:55+00:00

I am attempting a registration form that saves the data into a sql db.

  • 0

I am attempting a registration form that saves the data into a sql db. I’m not doing form validation just yet as what is most troubling me is getting this stuff onto sql. I’d appreciate any advice!!

I have a form.php file that should be doing the hard work. When I submit my form, at this point, I get a blank screen and nothing loads into the database.

<?php
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$password = $_POST['password'];
$email = $_POST['email'];
$cell = $_POST['cell'];
$experience = $_POST['experience'];
$ip = $_POST['ip'];

$password = md5($_POST['password']);

$connection = msql_connect(localhost, USERNAME, PASSWORD);
$db = mysql_select_db(registration,$connection);    

mysql_query("INSERT INTO userTable (fname,lname,password,email,cell,experience,ip) VALUES ('$fname', '$lname', '$password', '$email', '$cell', '$experience', '$ip')")
    or die (mysql_error());

echo "Thank you for your registration";


?>

And I have an html file that contains this:

            <form method = "post" action = "form.php">
            <h2>User Information</h2>

            <div><label>First Name:</label>
                <input type = "text" name = "fname"></div>
            <div><label>Last Name:</label>
                <input type = "text" name = "lname"></div>
            <div><label>Password:</label>
                <input type = "password" name = "password"></div>
            <div><label>Email:</label>
                <input type="text" name="email"></div>
            <div><label>Cellphone:</label>
                <input type="text" name="cell"></div>
                <input type="hidden" name="ip" value='<?php echo $IP ?>'/>
            <h2>What Is Your Experience Mountain Biking?</h2>
            <p><input type="radio" name="experience" value="n00b"
                checked>n00b
                <input type="radio" name="experience" value="intermediate">Intermediate
                <input type="radio" name="experience" value="extreme">Extreme                   
                </p>
            <p><input type="submit" name="submit" value="Register"></p>
        </form>

Finally, I have a sql database (I’m running xampp locally) called “registration”
The table I’ve created is called “userTable” and it contains 8 fields including ID (auto incrementing) and the 7 other values I’ve included up top. Any idea what the heck I’m doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T02:49:57+00:00Added an answer on June 9, 2026 at 2:49 am
    Solved my own problem
    
    
    <?php
    $fname = $_POST['fname'];
    $lname = $_POST['lname'];
    $password = $_POST['password'];
    $email = $_POST['email'];
    $cell = $_POST['cell'];
    $experience = $_POST['experience'];
    $ip = $_POST['ip'];
    
    $fname = mysql_real_escape_string($fname);
    $lname = mysql_real_escape_string($lname);
    $email = mysql_real_escape_string($email);
    $password = md5($_POST['password']);
    
    $servername="localhost";
    $username="user";
    $conn=  mysql_connect($servername,$username, password)or die(mysql_error());
    mysql_select_db("registration",$conn);
    $sql="insert into userTable (fname,lname,password,email,cell,experience,ip) VALUES ('$fname', '$lname', '$password', '$email', '$cell', '$experience', '$ip')";
    
    $result=mysql_query($sql,$conn) or die(mysql_error());          
    print "<h1>you have registered sucessfully</h1>";
    
    
    echo "Thank you for your registration to the ";
    
    mysql_close($connection);
    

    ?>

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Attempting to use XStream's JavaBeanConverter and running into an issue. Most likely I'm missng
Attempting to take the data in my gridview and convert it back into a
Attempting/struggling to get registration and sign-up working within an active admin project. I have
Attempting to use the data series from this example no longer passes the JSONLint
Attempting to make a NSObject called 'Person' that will hold the login details for
Attempting to run a MIB based SNMP script and I running into an issue.
I am attempting to make a registration-like page for a small forum. To register
I'm running into a problem with Jackson where it does not respect the @JsonTypeInfo
I have built a simple registration form shown below and Iam trying to get
I am attempting to write a user registration system for my web site. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.