Page 1 of 1

passing a form value to email script

Posted: Thu Dec 13, 2007 5:08 pm
by thibautr
Ok - this might sound dumb but here's my issue.

I have a form that i successfully pass a hidden field to using this:
<input type="hidden" name="propemail" id="propemail" value="'.get_post_meta(isset($_GET['pid'])? $_GET['pid'] : get_the_ID(), property_email, true).'"/>' . $nl;

ie. i can see the correct property_email (actual email) in my form.

I'm trying to pass this email value to the php script that sends emails. I dont' know how to do that.
here is what I'm trying:

$propmail = $_GET['propemail'];

which i then call here
$headers.= "BCC: ". $propmail . $eol;

Now when i hardcode with this:

$propmail = 'joe@something.com'

It works (the message is sent to the bcc email address.

Can someone PLEASE help me.

Thanks in advance

Posted: Thu Dec 13, 2007 5:12 pm
by andym01480
Is the form method POST or GET?

Watch out for email header injection too.

Posted: Thu Dec 13, 2007 5:37 pm
by thibautr
it's post.

here is the link http://www.pascallanguillon.com/vplptes ... le-quercy/ (it's in the middle of the page)

Thanks for your help...

Posted: Thu Dec 13, 2007 5:50 pm
by thibautr
so i tried it with this:

$_POST['propemail']

but it still didn't work,

what should i watch out for in the header injection?

thanks for your time