ahiruman Posted August 5, 2008 Share Posted August 5, 2008 Hi everyone, I and very new to PHP scripting and I'm trying to setup a referal script on my site. I'm having problems with the codes not grabbing the information. I'm not sure what that is called. Basicly what a user does is put up to 5 email addresses into the form and it suppose to use: $to=("".$_POST[refemail1].",".$_POST[refemail2].",".$_POST[refemail3].",".$_POST[refemail4].",".$_POST[refemail5].","); $headers.= "MIME-Version: 1.0\r\n"; $headers.= "Content-type: html; "; $headers.="From: [email protected]"; $subject="An Invitation Has Been Sent To You From www.dontgetscrewedtrade.com!"; $body="'<'img src=http://dontgetscrewedtrade.com/lang/eng/images/logo.gif'>' <p style=font-family:Tahoma;>One of your friends has invited you to check out this web site: http://www.dontgetscrewedtrade.com. A free community where you can get free college textbooks. The first 200 people to join will receive a free $20 gas card. You have nothing to lose and free books to gain.</p> <span style=font-family:Tahoma;>DontGetScrewedTrade Support Team</span>"; mail($to,$subject,$body,$headers); to send it out to their friends. Some how my $_post[refemail2] - $_post[refemail5] are not collecting the information from the form. $_post[refemail1] works fine. Is there something that I am doing wrong? I have been researching and working on this for 3 days, now i'm deperate. Please help. ??? Link to comment https://forums.phpfreaks.com/topic/118253-php-email-script-help/ Share on other sites More sharing options...
ngreenwood6 Posted August 5, 2008 Share Posted August 5, 2008 First thing I can see is that the code should look like this: $to=("".$_POST['refemail1'].",".$_POST['refemail2'].",".$_POST['refemail3'].",".$_POST['refemail4'].",".$_POST['refemail5'].","); You were missing the ('). Link to comment https://forums.phpfreaks.com/topic/118253-php-email-script-help/#findComment-608567 Share on other sites More sharing options...
ngreenwood6 Posted August 5, 2008 Share Posted August 5, 2008 You should code it to be something like this also: $refemail1 = $_POST['refemail1']; $refemail2 = $_POST['refemail2']; $refemail3 = $_POST['refemail3']; $refemail4 = $_POST['refemail4']; $refemail5 = $_POST['refemail5']; $to = ("'$refemail1', '$refemail2', '$refemail3', '$refemail4', '$refemail5'") Looks alot cleaner. Link to comment https://forums.phpfreaks.com/topic/118253-php-email-script-help/#findComment-608571 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.