Click to See Complete Forum and Search --> : Submit Form


drumbum360
07-08-2005, 05:56 PM
I am building a website for my sister. She doesn't know anything about coding or really much of anything about computers. I want to make a form, like this one: http://gamingnn.com/submit.html but when she clicks submit it places the date in a certain area of a different file that I have already. I want the date in a certain place in the code, the mood, content and signed all in different areas inside a table. And when she clicks submit, it adds the new post above the last one and connects to the server and uploads the file to overwrite the previous version. Is this possible? How can I learn how to do this? Thank you much in advance.

SpectreReturns
07-10-2005, 09:35 PM
The first step is making the form, which should submit to a .php file. The PHP figures out what's what, and then by using the filesystem functions (http://ca.php.net/manual/en/ref.filesystem.php), write an INI or XML file with your data.

To read it, you'll need to take apart the file, reverse it (so the newest entry is first), then output it.

drumbum360
07-10-2005, 11:31 PM
correct, that is the process that I thought I have to do, but I have no idea how to. :( Will you please help meh?

Bootsman123
07-11-2005, 12:01 AM
Look at the example at this page:
http://nl2.php.net/manual/en/function.fwrite.php

Then write some code by yourself and use Google if you get any errors. Won't it succeed after 2-3 days then you can come back.

drumbum360
07-13-2005, 04:25 PM
well here's what I've done so far: http://www.gamingnn.com/monker70/submit.html
after you fill that out click submit and it shows the next window. Now I would like that info on the index page and to have it stay there so next time you update the newer post will be above that one. Am I on the right track on doing this so far?

BeachSide
07-13-2005, 11:21 PM
Yeah, you are on track to greatness :D

How are you going to store the data that is entered so that you can redisplay it later? If you have MySQL that would be preferable for sure. If you don't have that though you can use something like XML or even a text file.

Also you might want to consider form validation because currently you can submit the form without entering anything. When you do this form validation though you will find a bunch of people only using JavaScript for it, I would recommend that you also do it server-side as well for those that have JavaScript turned off for whatever reason.

drumbum360
07-14-2005, 10:47 AM
Here is what my server provider package says: mySQL Databases | Unlimited
So I guess I do have mySQL. Now I just need to find out how to use that to store the data.

drumbum360
07-15-2005, 09:04 PM
I still cannot figure out how to send this information to the database. All this stuff just doesn't register in my head on how to properly go about doing this. I have been trying to follow the instructions on this site: http://www.freewebmasterhelp.com/tutorials/phpmysql/3
Not sure if that is what I need to do but I'm pretty sure it is. Please help me out with this. Thank you very much. I'm just getting frustrated with this.

BeachSide
07-15-2005, 11:32 PM
Ok, cool that is why we are here man :D

Where excatly are you stuck? Let's start from there then we can move forward.

Right now you have a form. It is passing the values to the next page, correct? Is this where we stand?

drumbum360
07-15-2005, 11:43 PM
it sure is. I cannot figure out how to send that info, after it goes to the next page which is after the form, to the database. Then I don't know how to get it out of the database and onto the index.php or index.html page (whichever I'll end up needing to do it). Also, I'll need to figure out how to get the new post at the top every time. Thank you.

BeachSide
07-16-2005, 12:09 AM
Do you have Yahoo! IM because this will wind up being a larger process then what should probably be posted here as it will take up quite a bit of space? If not hit me up in a pm and I'll give you my email

drumbum360
07-16-2005, 02:19 AM
yes. My Yahoo! name is drumbum360