Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-14-2004, 04:38 PM   PM User | #1
hodgo2002
New to the CF scene

 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
hodgo2002 is an unknown quantity at this point
Formmail Help!

Hi can anyone tell me why the data sent fromthe html does not appear in the email received please? I need the value Q1 (radio button response) to be sent in th email!!!!!

HTML----

<input type="hidden" name="board2" value="BB Comp January">
<input type=hidden name="subject" value="BB January Comp">
<input type=hidden name="recipient" value="paul@uknetweb.com">
<tr valign="top">
<td width="280" height="74">
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Q1</b>
In the &quot;Board room&quot; section, which is Beachbeats
sister site called for classic longboards?</font></p>
</td>
<td width="270" height="74"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<input type="radio" name="Q1" value="Cord">
Cord<br>
<input type="radio" name="Q1" value="Cape">
Cape<br>
<input type="radio" name="Q1" value="Core">
Core</font></td>

------------------------------------------------------------------------

The PHP page that this sends to...

<?
$subject = ("$subject");
$Q1 = stripslashes ("$Q1");
$from = "From:\"$realname\" <$from>\nX-Mailer: uknetweb_PHP";
$comment = stripslashes($comment);
mail("paul@uknetweb.com",$subject,$comment,$from,$Q1);
if (mail($email,$subject,$comment,$from,$Q1))
{
echo "Email sent correctly. We will be in touch with you shortly";
} else {
echo "Email failed to send. Please check their email address.";
}
?>
hodgo2002 is offline   Reply With Quote
Old 01-14-2004, 04:48 PM   PM User | #2
mordred
Senior Coder


 
Join Date: Jun 2002
Location: frankfurt, german banana republic
Posts: 1,848
Thanks: 0
Thanked 0 Times in 0 Posts
mordred is an unknown quantity at this point
Perhaps you have register_globals disabled? Use

PHP Code:
phpinfo(); 
in an otherwise blank PHP file and check the PHP settings. If register_globals is disabled, that's basically a Good Thing(TM), and the only thing you need to do is to adjust the variables used in your script.

Everything coming from a POST form appears in the superglobal $_POST array. You write

PHP Code:
$comment stripslashes($_POST['comment']); 
instead. See also
http://www.php.net/manual/en/securit...terglobals.php
http://www.php.net/manual/en/languag...predefined.php
__________________
De gustibus non est disputandum.
mordred is offline   Reply With Quote
Old 01-14-2004, 04:53 PM   PM User | #3
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,222
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
If you are using the popular formmail.php then you should consider using something else. There are security holes in it and people are exploiting it all over the place sending spam mail from other peoples accounts. At the very least change the name of the file because people are scanning servers looking for it.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 01-14-2004, 11:06 PM   PM User | #4
DsgnrsTLZAdmin
Regular Coder

 
Join Date: Jan 2004
Location: Georgia
Posts: 306
Thanks: 0
Thanked 0 Times in 0 Posts
DsgnrsTLZAdmin is an unknown quantity at this point
first of all you have all your radio inputs named the same, first rename them such as Q1, Q2, Q3. Then if that email is being sent to anyname@yourdomain.com then you need to send an email to that address first to make sure its enabled correctly on your server. And it seems like you forgot the beginning for the form unless you just forgot to paste it ?....looks like you forgot <form method="post" action="processor.php" />.....and dont forgot </form> at the end.
__________________
~Designer's Toolz~
DsgnrsTLZAdmin is offline   Reply With Quote
Old 01-15-2004, 03:17 AM   PM User | #5
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,222
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
Quote:
Originally posted by DsgnrsTLZAdmin
first of all you have all your radio inputs named the same, first rename them such as Q1, Q2, Q3.

Umm that's how radio buttons work. They have to be named the same so they work as a group otherwise you would be able to select all of them.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 09:09 AM.


Advertisement
Log in to turn off these ads.