FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Question about forms on websites?





ncwdavid
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?
hexkid
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)
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.')
?>
IceCreamTruck
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. Wink

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. Laughing 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)."
hexkid
IceCreamTruck wrote:
hexkid wrote:
'Thank you posting the information. It will be sent to the authorities in a few minutes.'


This line made me laugh. Laughing Either english is not your first language, a translator made the mistake, or you're actually kind of a funny person.


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 Smile
steveadams617
Try this and see what you think. It's pretty easy:

http://www.christian-web-masters.com/articles/web_php-mail-form-2.html
IceCreamTruck
hexkid wrote:
IceCreamTruck wrote:
hexkid wrote:
'Thank you posting the information. It will be sent to the authorities in a few minutes.'


This line made me laugh. Laughing Either english is not your first language, a translator made the mistake, or you're actually kind of a funny person.


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 Smile


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
Kinda dumb question regarding DNS
Easily create forms and many other stuff without much knowle
Interview Tips: Handling Difficult Question
I have a question regarding forms and such.
Websites hacked/defaced on Server 2
a question about forms. [SOLVED]
Really noob question...
Question on having Several websites under one hosting
Prices for Websites
What would be our world like without crude oils?
HTML Tutorial.
God and aliens
Question
Question
Reply to topic    Frihost Forum Index -> Computers -> Computer Problems and Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.