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
Bad parameter in mailform, help needed...
Old 09-15-2008, 08:55 AM Bad parameter in mailform, help needed...
Junior Talker

Posts: 1
Trades: 0
Hi all!

I have a problem with a mailform (who doesnīt?). I have a dynamic flash template with an built in contact form. When I try it, I get this error:
------------
Warning: mail(): Bad parameters to mail() function, mail not sent. in /hsphere/local/home/smultronkort/smultronkortet.se/site_flash/contact.php on line 40 Your message was successfully sent!
------------

In my main .html file i have the value &recipient=myemail@mysite.com. The support tells me this is the only value i need to change but thatīs clearly not the case.

This is the code as I got it from the template

<?
Error_Reporting(E_ALL & ~E_NOTICE);
while ($request = current($_REQUEST)) {
if (key($_REQUEST)!='recipient') {
$pre_array=split ("&777&", $request);
$post_vars[key($_REQUEST)][0]=$pre_array[0];
$post_vars[key($_REQUEST)][1]=$pre_array[1];
}
next($_REQUEST);
}

reset($post_vars);

$subject="From ".$post_vars['your_name'][0] ;
$headers= "From: ".$post_vars['your_email'][0] ."\n";
$headers.='Content-type: text/html; charset=utf-8';
$message='';
while ($mess = current($post_vars)) {
if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) {
$message.="<strong>".$mess[1]."</strong>&nbsp;&nbsp;&nbsp;".$mess[0]."<br>";
}
next($post_vars);
}
mail($_REQUEST['recipient'], $subject, "
<html>
<head>
<title>Contact letter</title>
</head>
<body>
<br>
".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
?>
<script>
resizeTo(300, 300);
</script>

--------------------
Line 40 is </html>" , $headers);

Can anyone help figure this out. Iīm not that good with php but with some trial and error and your help, i believe Iīll solve the problem.

Thanx!
acanjo is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-16-2008, 08:38 AM Re: Bad parameter in mailform, help needed...
Super Spam Talker

Latest Blog Post:
PSD Squirrel Launched
Posts: 932
Trades: 7
Hi there,

first things first, lets do some debugging.. print to screen the following variables and paste reults here:

$_REQUEST['recipient']
$subject
$headers

cheers
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Sir P is offline
Reply With Quote
View Public Profile Visit Sir P's homepage!
 
Reply     « Reply to Bad parameter in mailform, help needed...
 

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