kelleydl Posted August 3, 2009 Share Posted August 3, 2009 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 More sharing options...
Synook Posted August 3, 2009 Share Posted August 3, 2009 Look at databases and the $_POST superglobal. Link to comment Share on other sites More sharing options...
smerny Posted August 3, 2009 Share Posted August 3, 2009 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 More sharing options...
kelleydl Posted August 4, 2009 Author Share Posted August 4, 2009 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 More sharing options...
justsomeguy Posted August 4, 2009 Share Posted August 4, 2009 You probably just need to change the permissions on the folder. A database will be easier to maintain in the future though, text files are quick and easy but they get messy and it's easy to lose data. Link to comment Share on other sites More sharing options...
kelleydl Posted August 4, 2009 Author Share Posted August 4, 2009 ok i have tried using umask() before to change the permissions. is there another way to change permissions or maybe i just didnt use the correct code format for umask() ? Link to comment Share on other sites More sharing options...
justsomeguy Posted August 4, 2009 Share Posted August 4, 2009 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.