|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
Recommend a friend script
This is my refer a friend script based on a contact us script i use.
I am using this processor code in my thank you page but I cannot to get it work. <? $sitename=getenv("HTTP_HOST"); $message = ""; for ($i=0;$i<count($names);$i++){ $cur_name = $names[$i]; $cur_email = $emails[$i]; $message.="Look: $sitenamenn"; $message.="Dear $cur_name,nn" // Fill your message in the space below. ."So and so. Visit my site please.nn" ."Thanks, www.websitevrm.com"; mail($cur_mail,"$senders_name check this out",$message,"From: $senders_email"); $message = "test test test"; } ?> I get these error messages: Warning: Bad Message destination in D:inetpubwebsiteswebsitevrmnThanks.php on line 27 Warning: Bad Message destination in D:inetpubwebsiteswebsitevrmnThanks.php on line 27 Warning: Bad Message destination in D:inetpubwebsiteswebsitevrmnThanks.php on line 27 My form fields are - senders name = field name - senders_name senders email = field name - senders_email friends name = field name - names[] friends email - field name - emails[] friends name = field name - names[] friends email - field name - emails[] friends name = field name - names[] friends email - field name - emails[] (I have 3 friend form fields, figured i should be precise and let you guys know) I sure I am almost there in making this work. |
|
#3
|
|||
|
|||
|
RE: Recommend a friend script
Thank you it works, but I still get these errors:
Warning: Bad Message destination in D:inetpubwebsitesWebsiteVRMsent.php on line 16 Warning: Bad Message destination in D:inetpubwebsitesWebsiteVRMsent.php on line 16 Warning: Bad Message destination in D:inetpubwebsitesWebsiteVRMsent.php on line 16 Warning: Bad Message destination in D:inetpubwebsitesWebsiteVRMsent.php on line 16 This my code: <? $sitename=getenv("HTTP_HOST"); $message = ""; for ($i=0;$i<count($names);$i++){ $cur_name = $names[$i]; $cur_email = $emails[$i]; $message.="Look: $sitenamenn"; $message.="Dear $cur_name,nn" // Fill your message in the space below. ."So and so. Visit this site please.nn" ."Thanks,nn .$senders_name"; mail($cur_email,"Invitation from $senders_name",$message,"From: $senders_email"); - LINE 16 } ?> I can't understand how it can send the message no problem, but bring up four lines of errors on my webpage? One other thing, this is my message output: Look: www.websitevrm.com Dear paul, So and so. Visit this site please. Thanks, charlie How can I drag the senders name (charlie) up one line? i tried all the new line commands? thank you. |
|
#4
|
|||||
|
|||||
|
RE: Recommend a friend script
to get charlie up 1 or 2 lines:
php Code:
(take out the "n"s after Thanks,) as for your error problem... a) does it acually send the email? i assume not have a look at your PHP.ini file - is mail() set up correctly, can you log into the smtp server? |
|
#5
|
|||
|
|||
|
RE: Recommend a friend script
Yes it does send the mail.
you can try it here - http://www.websitevrm.com/recommend.php but I can't understand why i get those page errors. my recommend a friend script is loosely based on the script below which processes my contact us form no problem - <? $sitename=getenv("HTTP_HOST"); $message.="Site: $sitenamenn"; while ( list( $key, $val )=each($HTTP_POST_VARS) ) { $message .="$key : $valn" ; } mail("myemailaddress","WebsiteVRM",$message,"From: mail@mysite.com"); ?> |
|
#6
|
|||
|
|||
|
RE: Recommend a friend script
not quite sure what you mean, but my form elements are named -
friends name = field name - names[] friends email - field name - emails[] friends name = field name - names[] friends email - field name - emails[] friends name = field name - names[] friends email - field name - emails[] |
|
#7
|
|||
|
|||
|
RE: Recommend a friend script
|
|
#8
|
|||
|
|||
|
RE: Recommend a friend script
I did that and it printed the friends name at the top of the thank you page. plus there were no error messages. you can try the form here -
http://www.websitevrm.com/recommend.php thanks for all your guys. I really appreciate it |
|
#9
|
|||
|
|||
|
RE: Recommend a friend script
if you want a recomend-a-friend script try sitetell.com
|
|
#10
|
|||
|
|||
|
RE: Recommend a friend script
I would prefer to use my script as I have more than one site, it sends the email, its just those friggin' page errors.
|
|
#11
|
|||
|
|||
|
RE: Recommend a friend script
well... it doesn't echo any error message... i entered my name and mail, and two other, and it just displayed it all at the beginning, and didn't echo any error or warning...
btw, u can put @ in front of any line that echoes warnings if u don't care about them much... |
|
#12
|
|||
|
|||
|
RE: Recommend a friend script
I can't understand it either. Yet the form works (prior ro me changing the code for echos).
As I said my contact us form script is similar and that works no problem. |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Recommend a friend script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|