Jump to content

Form Text Into Website


kelleydl
 Share

Recommended Posts

So I know how to create a form and buttons and such, but I wondering if I have say inside my form 3 text boxes for input and a submit button. When that submit button is clicked I want to take that information and post it in my webpage. Like comments and such to where the information goes above the previous text and pushes the rest down. Can anyone help? I've read the PHP forms on W3Schools but i can't quite figure it out.DK

Link to comment
Share on other sites

set the form attribute "method" to "post" ( <form method='post'... )and the attribute "action" to the webpage you are loading to ( <form method='post' action='webpage.php'... )and then your information in the form will be submitted to the next page in a post array... for example, if you have a text input <input type='text' name='something'>, whatever was in that input field will be available on webpage.php as $_POST['something']

Link to comment
Share on other sites

I understand the $_POST and have that part working. What I'm not understanding is when the Submit is clicked how the posts continually add like comments. I thought of 2 ways of doing it, one being that I used MySQL to hold all of the posts. But then I thought of something that could be more simple by reading and writing to a text file. I thought I understood how to do all that but for some reason I am getting errors and being denied access to the text files. Do you have any other suggestions?
Link to comment
Share on other sites

chmod changes permissions. You might need to log in through FTP or SSH in order to do it if the user that PHP is running under does not own the directory. If the PHP user does not have permission in the first place you'll need to change the owner to the PHP user or group, or just set the permissions high enough so that anyone can write.

Edited by justsomeguy
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...