How to store data from a sign up form on a website into an sql databse

Joined
Sep 8, 2022
Messages
1
Reaction score
0
I have written the SQL and CSS code for a sign up and login form on a website but I don't know how to store the data inputted to an SQL database or retrieve the data when they try to login again.

This is the html:

<!DOCTYPE html>

<html>

<head>

<title>Sign Up | By Code Info</title>

<link rel="stylesheet" href="style.css" />

<link

href="https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap"

rel="stylesheet"

/>

</head>

<body>

<div class="signup-box">

<h1>Sign Up</h1>

<h4>It's free and only takes a minute</h4>

<form>

<label>First Name</label>

<input type="text" placeholder="" />



<label>Last Name</label>

<input type="text" placeholder="" />



<label>Email</label>

<input type="email" placeholder="" />



<label>Password</label>

<input type="password" placeholder="" />



<label>Confirm Password</label>

<input type="password" placeholder="" />



<input type="button" value="Submit" />

</form>

<p>

By clicking the Sign Up button,you agree to our <br />

<a href="#">Terms and Condition</a> and <a href="#">Policy Privacy</a>

</p>

</div>

<p class="para-2">

Already have an account? <a href="login.html">Login here</a>

</p>

</body>

</html>







<!DOCTYPE html>

<html>

<head>

<title>Login | By Code Info</title>

<link rel="stylesheet" href="Css/style.css" />

<link

href="https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap"

rel="stylesheet"

/>

</head>

<body>

<div class="login-box">

<h1>Login</h1>

<form>

<label>Email</label>

<input type="email" placeholder="" />



<label>Password</label>

<input type="password" placeholder="" />

<input type="button" value="Submit" />

</form>

</div>

<p class="para-2">

Not have an account? <a href="signup.html">Sign Up Here</a>

</p>

</body>

</html>
 
Joined
Mar 11, 2022
Messages
227
Reaction score
32
Please use code tags. It's hard to read.

But to answer your question.

It's
Code:
<form method="post">
<input type="text" placeholder="Something" name="something"><input type="submit" value="send">
</form>

<?php
if(isset($_POST['something'])){
echo trim($_POST['something']);
}
?>
as basics. From there you can take the next step. Try and learn. Then come back in PHP or SQL section of this forum.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top