![]() |
|
#1
|
|||
|
|||
HTML Form to PHP File - Help RequestedHi everyone,
I have a fairly small knowledge of PHP scripting, but I know what I want to do here. I want to take an HTML form and post the data to a PHP file. I will explain: I am working on a whole new part of my site and it would be a great addition to it; anyway... I would like to have an HTML file with an HTML form in it. This form would contain several fields that would then need to be transported to a PHP file. I would like for the PHP file to show the data entered into the form. And I am not talking about showing the user who entered the information in, I'm talking about posting the data to the public on the page (the page will be in my site design using frames or something similar). Is there a way to keep that data shown to everyone (the public)? And if so, is there a way to erase the data after a given number of hours. This is going to be a user-defined weather alert post page. The user can set expiration times/dates with a specificed number of hours. Could someone please help me with the scripting of the PHP file, and also anything to connect the HTML form to the PHP file, such as "<form action" which I will need to know. Please help me out, this would be a great addition and I can't wait to inform everyone of important weather information (it will be collaborative, that is why I'm using forms). Please reply as soon as possible, any help is truly appreciated!! Thanks in advance! |
|||
|
#2
|
||||
|
||||
Re: HTML Form to PHP File - Help RequestedI just came across an interesting read about some of what you're asking about here:
http://www.webmonkey.com/99/21/index2a.html You could probably jump right into 'Lesson 2' topics (there's a link on the left-hand side of the page). Post back if there may be other need(s). __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#3
|
|||
|
|||
Re: HTML Form to PHP File - Help RequestedThanks for the link
... I already have MySQL and PHP installed. My main site would not run without either (see vigilantweather.com). I am going to hopefully branch it off in a different directory, away from the main site. I would never think to use a database with my situation here... do you have any information?I am thinking about saving the results for a specificed time period and showing everyone the results for that time period. Example: User clicks on Boston weather office (this is how it will be set up), sees a 'weather discussion' (or whatever made in the HTML form) issued and the person that sent in the form set the alert to expire in 4 hours... then in 4 hours it is taken off automatically. But the thing is, we need the public to see all of this for those 4 hours and then for it to be removed after 4 hours, and 4 hours after issuance to be exact. (4 hours is an example, there will be a field for the form-filler person to set the hours). Hopefully this concept is not too complicated to understand, it is a bit complicated to explain But do you see what I mean? And if so, could you help me do this? The DB may come in handy, but I don't know how to set that up, I will need some help. Anyone!? As you see I am a wreck in the birth of this project which would be great to have running!! Please respond ASAP, I REALLY appreciate it!! And Turbo, thanks for responding, anymore info? |
|
#4
|
||||
|
||||
Re: HTML Form to PHP File - Help RequestedQuote:
For the database part, since you were not sure about using one, I noticed that you claimed: Quote:
It all depends on the overall goal/plan. Let's see if other posters have other ideas to offer. __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#5
|
||||
|
||||
Re: HTML Form to PHP File - Help RequestedThere are basically only 2 ways for you to save the data supplied by a user. Inside a text file or inside a database table.
You have to decide which before you seek assistance here. |
|
#6
|
|||
|
|||
Re: HTML Form to PHP File - Help RequestedOk thanks, I appreciate all the help
Quote:
This is one of the parts that I am left in the dark at. How do I automatically and instantly store this information in a database? And how do I recall them later? I suppose I could use MySQL for the database, and PHP for recalling. I understand how I want this all set-up, and I understand how the final product will work (granted all goes well). Quote:
And admin-- I choose database to be safe since there are going to be multiple fields and it seems safer and more interactive with PHP. I am just a little in the dark about posting the data to the database and calling it back. I know what I want to do, I (think) I know how this will be done, as you both mentioned--database, so MySQL. So how do I get it in the database and called back into PHP for everyone to see--details on my first and my second post in this thread, please see them to see what I mean. Thanks guys, I really appreciate the help! |
|
#7
|
|||
|
|||
Re: HTML Form to PHP File - Help RequestedAlright... the database is running, my setup is correct, and I am one step closer to my (hopefully) final product. I have a file called submit.php submitting data to my MySQL database. And a file called view.php recalling the data and showing it.
I will post the code to show you. submit.php PHP Code:
view.php PHP Code:
My issues now are: Editing the form to suit my needs (and not screwing up the file!!), and hopefully making view.php display the data neatly and how I want it. First off, Can I edit the form without screwing up the data (seems like a lot of code editing would be needed) Secondly, Can I make view.php look a little something like this (custom text at top with date & time form was submitted) VWFN - BOS Short Term Outlook *DATE FORM SUBMITTED* - *TIME FORM SUBMITTED* ---ONE OF THE FORM FIELDS HERE (it would be a textarea to display the weather alert--- ---ANOTHER FIELD (forecaster's [form fillers] last name; entered in form text box field--- ***** This should be easy, and I have seen it done before, so hopefully I, too can pull it off!! But back to what I was saying earlier. Another field is the form filler/forecaster-specified alert expiration. I would like for the person filling the form to say that the alert with expire in 6 hours, or 3 hours, or whatever he/she enters. And then that automatically erases the data from the database, so view.php will not show it after the specified amount of hours. Once again, this has been done before, I just don't know how exactly to write the code to suit my needs, or what needs to be done. Any help is appreciated, thanks!! |
|
#8
|
||||
|
||||
Re: HTML Form to PHP File - Help RequestedFor the first part, not really sure what you mean there, but the form should be editable without messing with data.
On the second part, Lesson 3 of the link (from a prior post) shows how to create a title that can be 'included' across as many php files as needed. Something like this can be done to have a custom header/layout -- even if relative to only one file. __________________
Use the force...read the source!! WYCIWYG -- what you code is what you get! |
|
#9
|
|||
|
|||
Re: HTML Form to PHP File - Help RequestedOk thanks, I will check it out... thanks for the link by the way!
|
|
#10
|
|||
|
|||
Re: HTML Form to PHP File - Help RequestedFor anyone here--
Please see my code for submit.php (post #7 in this thread). How do I change the form to allow radio options (those dot options to select) in the form for a field and enter that in the database. I also need a textarea field, not a text box, but a large, textarea one. I tried simply replacing the html type code "<input name", etc. or something like that with the textarea one and radio one to suit my needs... I saved and replaced the file on my server and still they were text boxes!! How do I get the form to allow me to do such a thing? Do you have any code to replace it? Thanks in advance!! |
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Airport Log program using 3D linked List : problem reading from file | batrsau | C Programming Language | 11 | 29-Feb-2008 08:44 |
| Upload Script | da_bomb50 | MySQL / PHP Forum | 6 | 21-Mar-2005 12:01 |
| CD burner wont burn!! | robertli55 | Computer Hardware Forum | 1 | 18-Jun-2004 11:53 |
| Yet another CD burner problem: Lite-On LSC-24082K | Erwin | Computer Hardware Forum | 1 | 22-May-2004 12:28 |
| loading an html file from a db using php | mdonovan | Web Design Forum | 8 | 22-Mar-2004 00:38 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The