Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS How do I store sign up information into an SQL database

finners

New Coder
I've got the html and CSS code for a sign up and login system on a website but I don't know how to then store the information inputted into an SQL database and then retrieve that data when a user wants 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>
 
To elaborate on Johna's answer : You cannot store or save anything from HTML or JavaScript, be it in a text file or a database. You need to have a server do that. Indeed PHP is the obvious and easiest choice, You can either create your webpage with PHP, in which case it's quite easy, or you can activate a PHP function on your server via an Ajax request. I recently did that and can provide the code it that would be useful. This is only for saving a text file on the server, the database code would be for you to fill in.
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom