Can someone please help me

I need help on Replit my form wont submit the data and I have tried 3 different ways i cannot make the form save the input to save my life can someone plz come on my repl and i will give you editing rights and make the form save the input i would really appreciate it thank you
Link to html repl
link to PHP repl

1 Like

Are you trying to save input on a database?

Or you’re just trying to access the data when user submits a form?

Because your forms works perfectly fine, except you have no function to save or access the data of the user.

2 Likes

save it in a database

Add this code in a script tag or your script.js file to fetch the input:

//Fetch the parameters from your link as that is where by default parameters are submitted
const params = new URLSearchParams(window.location.search);

//Assign the parameter name
const name = params.get("name")
//Assign the parameter email
const email = params.get("email")
//Assign the parameter message
const message = params.get("message")

What this code does is get all the submitted values and assign it to respective variables, what it doesn’t do is to save it into a database. You’ll need to save it yourself.

Though if you plan on using replitdb and php to get the results, you might take a look at this, a website showing how to use replitdb by amasad a.k.a CEO himself.

2 Likes

it is now working thanks

You may close this if it works :slight_smile:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.