A Dount in Mail |
![]() ![]() |
A Dount in Mail |
Nov 16 2009, 02:46 AM
Post
#1
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 8,266 Joined: 23-November 08 Member No.: 6,521 |
I am just starting with PHP. I learned some basic tutorials and i downloaded some simple script like contact form, guestbook to get practice,,,
yesterday i studied a contact form and i got a doubt in a code,,,,, 1. PHP Code: $headers = "From: " . $mailform_from . "n"; // From address $headers .= "Reply-To: " . $mailform_from . "n"; // Reply-to address $headers .= "Organization: " . $company . "n"; // Organisation $headers .= "Content-Type: text/html; charset=iso-8859-1n"; // Type mailform_from is the name given for the "from email" in the HTML form,,, in this code why it is used two times and also what is the meaning for "$headers .= " 2. PHP Code: mail(str_replace("RCPT TO:", "", $reciever), str_replace("RCPT TO:", "", $subject), str_replace("RCPT TO:", "", $alertmsg), str_replace("RCPT TO:", "", $headers)); i understand the above code, but i don't know weather i understand correct or not,, here it is,,, str_replace function checks for the word "RCPT TO:" in the $receiver, if it is not found then it will not replace anything,,,,, correct,,,,, and also i don't know why they are using str_replace inside the mail function and why they are using specific word "RCPT TO:",,,,,,, please help me,,,, |
|
|
|
![]() ![]() ![]() |
|
Lo-Fi Version | Time is now: 14th March 2010 - 12:00 AM |