PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
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  
Old August 12th, 2002, 12:02 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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.

Reply With Quote
  #2  
Old August 12th, 2002, 12:17 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Recommend a friend script

php Code:
Original - php Code
  1.  
  2. $cur_email = $emails[$i];
  3. //...
  4. mail($cur_mail, ...

look... $cur_email and $cur_mail is diferent ;)

Reply With Quote
  #3  
Old August 12th, 2002, 11:56 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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.

Reply With Quote
  #4  
Old August 12th, 2002, 02:25 PM
cjrobs cjrobs is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Southampton, England
Posts: 121 cjrobs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to cjrobs
RE: Recommend a friend script

to get charlie up 1 or 2 lines:

php Code:
Original - php Code
  1.  
  2. $message.="Dear $cur_name,nn" // Fill your message in the space below.
  3. ."So and so. Visit this site please.nn"
  4. ."Thanks,
  5. .$senders_name"

(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?


Reply With Quote
  #5  
Old August 12th, 2002, 02:44 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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");
?>


Reply With Quote
  #6  
Old August 12th, 2002, 03:29 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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[]


Reply With Quote
  #7  
Old August 12th, 2002, 11:44 PM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Recommend a friend script

i can't be shure what is happening...

try echoing instead mailing all the variables... use:

php Code:
Original - php Code
  1.  
  2. for ($i=0; $i<count($names); $i++){
  3.   echo $cur_name = $names[$i];
  4.   echo $cur_email = $emails[$i];
  5. }


and when u tell us what it echoes, then we could help u...

Reply With Quote
  #8  
Old August 13th, 2002, 02:04 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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

Reply With Quote
  #9  
Old August 13th, 2002, 05:01 AM
siteworkspro.com siteworkspro.com is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Sydney, Australia
Posts: 92 siteworkspro.com User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to siteworkspro.com Send a message via AIM to siteworkspro.com
RE: Recommend a friend script

if you want a recomend-a-friend script try sitetell.com

Reply With Quote
  #10  
Old August 13th, 2002, 10:22 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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.

Reply With Quote
  #11  
Old August 13th, 2002, 08:53 PM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
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...

Reply With Quote
  #12  
Old August 13th, 2002, 09:45 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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.


Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Recommend a friend script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |