Forum Moderators: coopster
$headers = str_replace('%replyto%', $you@yoursite.com,$headers);
If I try to use single or double quotes around the email address then I get an unexpected T thingy.
One more question, I have been reading about the email injection issues with php would showing the email address in the form expose the form to that problem?
and lo' and behold he's right again (he searches for my mistakes ;))
str_replace('%replyto%', $you.'@yoursite.com',$headers)
that works perfectly, syntax is right and all. So something else must be bumping out your line, maybe a syntax error in the line above?
Though, I often step things out for clarity and if I can't get something to work in it's original form I go from a different angle. There are a few functions that get messed up if you try to concat inside the call. There is also the question of whether you should or not as you may need the data again.
he searches for my mistakes
Now anybody that hangs in this forum knows darn well that is just not true,
we just keep each other in check around here and humiliation builds character. I have a lot of character and I just want everyone to know that jatar_k does too ;)
I remembered testing this in a little snippet before I posted and received no syntax errors, so I thought I would offer a very respectable clarification in that the concatenation would work just fine.
$headers = 'My Name<%replyto%>';
$you = 'yourname';
$headers = str_replace('%replyto%', $you.'@yoursite.com',$headers);
print $headers;
exit;