Hey, I can create forms for websites and buttons like submit and I know how to send the person to a page after they click the submit button but I want to know is there a way of sending them to a different page after clicking the submit button and also having the information they typed in in the form sent to some sort of text file or something similar?
Question about forms on websites?
As you know, when the submit button is pressed (unless some JavaScript "messes" things up) the info is sent to the page specified in the action attribute of the respective form.
This page can be a script that saves the info and shows some thing to the user, for example, a "thank you" (example in PHP)
This page can be a script that saves the info and shows some thing to the user, for example, a "thank you" (example in PHP)
| Code: |
| <?php
$data = print_r($_POST, true); file_put_contents('/home/hexkid/www/data/' . date('mdHis'), $data, FILE_APPEND); // works for PHP 5 exit('Thank you posting the information. It will be sent to the authorities in a few minutes.') ?> |
I recomend a course in PHP, JavaScript, or PERL. Or you could just do what I did, and buy the books on the subjects and ask questions online.
If you have a need for web forms, then you must be uploading pages to a
server, and there's where you need to do a little homework. If it's frihost, then you can use perl, or php to process the form. You could also use MySQL depending on how much information you want to save over time. Databases only come into play when you are talking mind blowing amounts of data. If you can read the list of all recorded information in an hour, then data bases probably aren't needed.
In perl it's pretty easy, and I know perl, so tell me where you are trying to do this, and outline what you are trying to do and I will give you detailed examples of how to handle recall the data being submitted, process into a readable page, save the page, show the page back to the user, and say "thanks" or ask if they want to submit more data.
This line made me laugh.
Either english is not your first language, a translator made the mistake, or you're actually kind of a funny person.
If english is not your first language, then read the line again and realize that it says "The information was sent to the POLICE (aka authorities)."
If you have a need for web forms, then you must be uploading pages to a
server, and there's where you need to do a little homework. If it's frihost, then you can use perl, or php to process the form. You could also use MySQL depending on how much information you want to save over time. Databases only come into play when you are talking mind blowing amounts of data. If you can read the list of all recorded information in an hour, then data bases probably aren't needed.
In perl it's pretty easy, and I know perl, so tell me where you are trying to do this, and outline what you are trying to do and I will give you detailed examples of how to handle recall the data being submitted, process into a readable page, save the page, show the page back to the user, and say "thanks" or ask if they want to submit more data.
| hexkid wrote: |
| 'Thank you posting the information. It will be sent to the authorities in a few minutes.' |
This line made me laugh.
If english is not your first language, then read the line again and realize that it says "The information was sent to the POLICE (aka authorities)."
| IceCreamTruck wrote: | ||
This line made me laugh. |
English isn't my first language, but that's pretty much irrelevant.
The reason for that line was that I'm actually kind of a funnny person.
I'd love to see that line on a real site
Try this and see what you think. It's pretty easy:
http://www.christian-web-masters.com/articles/web_php-mail-form-2.html
http://www.christian-web-masters.com/articles/web_php-mail-form-2.html
| hexkid wrote: | ||||
English isn't my first language, but that's pretty much irrelevant. The reason for that line was that I'm actually kind of a funnny person. I'd love to see that line on a real site |
LOL, try submitting info to the CIA then!! You are a funny person, and probably have a better grasp on the english language than I do. HA!
Related topics
