|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I'd like to use the $headers field in the mail() function of PHP, but
I'd like to be able to make these variable that somebody could change in a form. $headers .= 'To: $to' . "\r\n"; Something like that above. Thanks, --TJ |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
techjohnny@gmail.com wrote:
> I'd like to use the $headers field in the mail() function of PHP, but > I'd like to be able to make these variable that somebody could change > in a form. > > $headers .= 'To: $to' . "\r\n"; > > > Something like that above. > > Thanks, > > --TJ > Which will open your site as a spam relay, and quickly get your hosting account canceled. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Feb 25, 3:51 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> techjoh...@gmail.com wrote: > > I'd like to use the $headers field in the mail() function of PHP, but > > I'd like to be able to make these variable that somebody could change > > in a form. > > > $headers .= 'To: $to' . "\r\n"; > > > Something like that above. > > > Thanks, > > > --TJ > > Which will open your site as a spam relay, and quickly get your hosting > account canceled. > > -- > ================== > Remove the "x" from my email address > Jerry Stuckle > JDS Computer Training Corp. > jstuck...@attglobal.net > ================== Yeah, I realize that now. But, what about making one of the header fields a variable? I just don't understand the php syntax well enough to make this happen. --JP |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
techjohnny@gmail.com wrote:
> On Feb 25, 3:51 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote: >> techjoh...@gmail.com wrote: >>> I'd like to use the $headers field in the mail() function of PHP, but >>> I'd like to be able to make these variable that somebody could change >>> in a form. >>> $headers .= 'To: $to' . "\r\n"; >>> Something like that above. >>> Thanks, >>> --TJ >> Which will open your site as a spam relay, and quickly get your hosting >> account canceled. >> >> -- >> ================== >> Remove the "x" from my email address >> Jerry Stuckle >> JDS Computer Training Corp. >> jstuck...@attglobal.net >> ================== > > Yeah, I realize that now. But, what about making one of the header > fields a variable? I just don't understand the php syntax well enough > to make this happen. > > --JP > Read up on single and double quoting strings, for starters. You need either: $headers .= "To: $to\r\n"; Or $headers .= 'To: ' . $to . "\r\n"; Variables are not replaced when in single quotes. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
>>> $headers .= 'To: $to' . "\r\n";
>>> Something like that above. >> Which will open your site as a spam relay, and quickly get your hosting >> account canceled. > Yeah, I realize that now. But, what about making one of the header > fields a variable? I just don't understand the php syntax well enough > to make this happen. First thing to read about is mail injection. If you don't read up on that, your site will STILL be a spam relay. Good luck, -- Willem Bogaerts Application smith Kratz B.V. http://www.kratz.nl/ |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
On Feb 26, 3:21 am, Willem Bogaerts
<w.bogae...@kratz.maardanzonderditstuk.nl> wrote: > >>> $headers .= 'To: $to' . "\r\n"; > >>> Something like that above. > >> Which will open your site as a spam relay, and quickly get your hosting > >> account canceled. > > Yeah, I realize that now. But, what about making one of the header > > fields a variable? I just don't understand the php syntax well enough > > to make this happen. > > First thing to read about is mail injection. If you don't read up on > that, your site will STILL be a spam relay. > > Good luck, > -- > Willem Bogaerts > > Application smith > Kratz B.V.http://www.kratz.nl/ $headers .= "FROM: $from \r\n"; //$from should be checked for injection already mail($to,$subject,$body,$headers); //the $to is the first argument passed to mail().... http://us.php.net/manual/en/function.mail.php but you issues seemed to be string based. ////// $a="a test string"; echo 'this is $a'; //this is $a echo 'this is'.$a; //this is a test string echo "this is $a"; //this is a test string /////// ' ' = literal.. the string is sent tot he browser as it appears in code " " = interpreted.. the string is processed, variables are substituted out for their values |
|
![]() |
| Outils de la discussion | |
|
|