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


Submission Forms





DJGuardy
Ok, I didnt know anywhere else to put this post but here. Here's the situation. My friend has designed a form, including radio buttons, text boxes and labels, drop down lists etc. The problem is that we want to know how to make the Submit button send the results to admin emails and to show a new page for the user.

Anyone who can help, thank you Smile
DJGuardy
*bump*
Grimboy
I would use php as it has a relitivly shallow learning curve. You can do this two ways:

You can submit is to a seperate .php page.
--OR--
You can submit it back to it's self. (This is my favorite method)

Tutorials for both of these methods can be found here and here respectively.
izcool
Two ways of making the button :

Code:

<input type="Submit" value="Submit Form">


Or :

Code:

<button type="Submit">Submit Form</button>


Not sure if that's what you were asking.

- Mike.
Simulator
Do you want it to have like a Database connection?[/code]
eluder
Methinks, the best approach is to process the submitted data, send email (via mail() etc) and either display the content for the users or relocate to another URL that displays that content, e.g., in case of PHP

Code:

<?php
  ob_start(); // or make sure no output is done until the end of the script
// ...
  $mydata = $_POST['somedata'];
  $rc = @mail($adminemail, "Submitted data", $mydata);
// ...
  header("Location: http://mysite.tld/user-content.php");
  exit(0);
?>


Of course that's a rude draft, nothing more. You should check that data are passed through POST, that it comes from your website, you should remove dangerous user-typed data if necessary etc etc.
dandelion
Here is basic universal code to email data submitted from a form.
Code:
<?
$message = '';
foreach($_POST as $field => $value) {
  $message .= "$field: $value\n";
}
mail('you@example.com', 'Data Submitted', $message);
?>

You can add to the message some explanation, time mark, etc.
In additional you need the header() function to redirect the browser (see eluder's code).

Also you might use 'mailto:' in the action attribute of the form element.
It isn't reccomended, however, and you should always use php script if it is possible.
alwi_frih
I'd recommend you download and install form-processor script. My recommendation are:

1. FormMail -- a CGI script from Matt's Script Archive. Download at http://www.scriptarchive.com/formmail.html
2. PHPFormMail -- a PHP version of the above script. Download at http://www.boaddrink.com/projects/phpformmail/ or http://freshmeat.net/projects/phpformmail/
3. FormMail.com -- Remotely hosted FormMail script. Just go to http://www.formmail.com/ for details

Good Luck Wink

ALWI
Related topics
The justification for war
basic tutorials on most forms of web programming
Urban Legends About the Iraq War
"Forms To Go" create scripts in PHP, ASP and Perl
Easily create forms and many other stuff without much knowle
site submission for free
Multiple Forms
I have a question regarding forms and such.
Anyone that can give me help/suggestions for forms?
Flash Tutorials
Search Engine Submission Links
Building Web Forms In Flash
Multi submission and Spam
How do you define Faith?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

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