Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Form Mailer Script (PHP)
Old 04-25-2006, 11:45 AM Form Mailer Script (PHP)
wilbury's Avatar
Skilled Talker

Posts: 68
Trades: 0
Is there a form mailer script that will work with any type of form with any type of of field (text, check box, radio button, comments)?

Or does the script have to be written for a specific form?
wilbury is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-25-2006, 11:50 AM Re: Form Mailer Script (PHP)
cdwhalley.com's Avatar
Skilled Talker

Posts: 75
Trades: 0
The script would have to be adapted to show in the email message what radio button, checkbox etc had been selected, but other than that you could just use a generic form mail function.
cdwhalley.com is offline
Reply With Quote
View Public Profile Visit cdwhalley.com's homepage!
 
Old 04-25-2006, 12:50 PM Re: Form Mailer Script (PHP)
Experienced Talker

Posts: 40
Location: Denmark
Trades: 0
If you dont need validation - its pretty easy to make a formmail script..

The following script performs no validation at all, and it mails whatever input it receives from the form. Pretty basic, but have been useful for others in the past.

$email should be your own email, $thanksurl is a url to the page which the script redirects to, after mailing the info the $email. (A thanks for the feedback-page).

Feel free to use it.

PHP Code:
<?php 
$email 
'dennis@moellegaard.dk.invalid';  // Change me 
$thanksurl '/thanks.html';  // Change me

if( count($_POST) > ) { 
$message 'Feedback from ' $_SERVER['PHP_SELF'] . "\n\n";
foreach(array(
'topic','email','message') as $field ) {
    
$message .= "$field:\n\t{$_POST[$field]}\n\n";
}
$message .= "Remote addr: {$_SERVER['REMOTE_ADDR']}\n";
mail($email,'Homepage feedback'$message );
header('Location: ' $thanksurl);
exit;
}
?>
<h1>Contact</h1>

<p>Send an email from here, please remember to enter a valid email.</p>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<table>
<tr>
    <td>Topic</td>
    <td><input class="inputbox" name="topic" maxlength="30"></td>
</tr>
<tr>
    <td>Your email</td>
    <td><input class="inputbox" name="email" maxlength="30"></td>
</tr>
<tr>
    <td valig="top">Message</td>
    <td><textarea class="inputbox" name="message" rows="10" cols="20"></textarea></td>
</tr>
<tr>
    <td></td>
    <td><input class="button" type="submit" value="Send"></td>
</tr>
</table>
</form>
dennismp is offline
Reply With Quote
View Public Profile Visit dennismp's homepage!
 
Reply     « Reply to Form Mailer Script (PHP)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21537 seconds with 12 queries