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.

Coding Forum


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



Reply
Old 11-18-2010, 01:00 PM FormMail question
Junior Talker

Posts: 4
Trades: 0
Hi,

Can someone please tell me what's wrong with this form:

<form action="/cgi/formmail" method = "POST">
<input type="hidden" name="recipient" value="xxxx@xxxxxxx.com">
<input type="hidden" name="subject" value="Website Inquiry">
<input type="text" name="realname" style="background:#EFE39C; color:#1030A5; font-family:verdana; font-size:11px;" size="22" maxlength="40" name="name">
<input type="text" style="background:#EFE39C; color:#1030A5; font-family:verdana; font-size:11px;" size="22" maxlength="40" name="e-mail">
<textarea name="message" rows="10" cols="24" style="background:#EFE39C; color:#1030A5; font-family:verdana; font-size:11px;" name="message"></textarea>
<input type="submit" value="Submit">
</form>

It works, but it does not show the name of the sender in the e-mail body, just the e-mail address and the comments.

The sender's name shows up in the "From" field in the e-mail header, thus the "realname" part.
esebm is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-19-2010, 03:47 AM Re: FormMail question
Gakoyu Ojima's Avatar
Skilled Talker

Posts: 59
Location: Netherlands.
Trades: 0
Code:
<input type="text" name="realname" style="background:#EFE39C; color:#1030A5; font-family:verdana; font-size:11px;" size="22" maxlength="40" name="name">
It has two name attributes. See if that fixes your issue.
__________________
$gocore = new gakoyucore();
$con = mysql_connect($gocore->server, $gocore->username, $gocore->password) or die(mysql_error());
Gakoyu Ojima is offline
Reply With Quote
View Public Profile
 
Old 11-19-2010, 10:49 AM Re: FormMail question
Junior Talker

Posts: 4
Trades: 0
I removed the name="name" attribute but it doesn't make any difference. The name still does not show in the e-mail.
esebm is offline
Reply With Quote
View Public Profile
 
Old 11-20-2010, 04:57 PM Re: FormMail question
Junior Talker

Posts: 4
Trades: 0
I was told that the "name" and "realname" attributes cannot be used in the same form. The formmail handler couldn't handle that.

Is that correct? Or is there a script that can do that> I'm currently using the NMS script.

Thanks
esebm is offline
Reply With Quote
View Public Profile
 
Old 11-22-2010, 03:13 AM Re: FormMail question
Gakoyu Ojima's Avatar
Skilled Talker

Posts: 59
Location: Netherlands.
Trades: 0
Personally I have used 'realname' and it worked fine. But, best way is to find out by trying another attribute name and see if that works.
__________________
$gocore = new gakoyucore();
$con = mysql_connect($gocore->server, $gocore->username, $gocore->password) or die(mysql_error());
Gakoyu Ojima is offline
Reply With Quote
View Public Profile
 
Old 11-22-2010, 10:41 AM Re: FormMail question
Junior Talker

Posts: 4
Trades: 0
I am using "realname" and it works fine. But that's not the problem!

I am trying to use "realname" and "name" at the same form.

Realname gives me the name of the sender in my e-mail header but not in the e-mail body!

Name does it exactly the other way around. I want to combine both!
esebm is offline
Reply With Quote
View Public Profile
 
Old 11-23-2010, 09:42 PM Re: FormMail question
Skilled Talker

Posts: 61
Name: Rafael
Location: Texas
Trades: 0
copy this and save as contactus.htm

<form method="POST" action="mailer.php">
<table width="500" align="center" cellpadding="5" cellspacing="5">
<tr>
<td width="71"><p>Name: <br>
</p></td>
<td width="412"><input type="text" name="name" size="39"></td>
</tr>
<tr>
<td>E-Mail: </td>
<td><input type="text" name="email" size="39"></td>
</tr>
<tr>
<td>Message:<br>
<br>
</td>
<td><textarea name="message" cols="30" rows="10" wrap="OFF"></textarea></td>
</tr>
<tr>
<td><br>
</td>
<td>
<input name="check[]22" type="checkbox" value="newsletter" checked>
Sign up for our Email Newsletter</td>
</tr>
<tr>
<td>&nbsp; </td>
<td><input type="reset" name="Reset" value="Reset">
<input type="submit" value="Submit" name="submit"></td>
</tr>
</table>
</form>

build another web page name it mailer.php copy the text below and edit it with your email and subject name enjoy

<?php
if(isset($_POST['submit'])) {

$to = "youremailaddress";
$subject = "Subject Name";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];

foreach($_POST['check'] as $value) {
$check_msg .= "Checked: $value\n";
}

$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message\n $check_msg";

echo "Data has been submitted to $to!";
mail($to, $subject, $body);

} else {
echo "blarg!";
}
?>
__________________
Free Web Templates
Please login or register to view this content. Registration is FREE
rswebs is offline
Reply With Quote
View Public Profile Visit rswebs's homepage!
 
Reply     « Reply to FormMail question
 

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.31423 seconds with 12 queries