Save user input to the website?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stuntpenguin007
Forum Newbie
Posts: 1
Joined: Sun Dec 05, 2010 9:56 pm

Save user input to the website?

Post by stuntpenguin007 »

I have a textbox and a submit button in an html form. I want to make it so that when a user enters text and clicks submit, it saves it to the website, and other people can see what they wrote. right now I have:

Code: Select all

<?PHP $input = $_POST['input']; ?>
1. <?PHP echo $input ?>
That shows up as "1. [whatever the user typed here]" locally, but how can I make it so other people on different computers can see the submitted text?
Mince
Forum Commoner
Posts: 25
Joined: Mon Aug 03, 2009 9:36 am

Re: Save user input to the website?

Post by Mince »

Well you would have to save it into a database and then echo it from there.
matt1234
Forum Commoner
Posts: 44
Joined: Wed Nov 26, 2008 9:43 pm

Re: Save user input to the website?

Post by matt1234 »

It needs to be stored on the server somehow for the public to view. You can use a database and store the values there or some sort of file that you read in and update each time the form is submitted. It depends on how complicated the project is.
Post Reply