passing a form value to email script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thibautr
Forum Newbie
Posts: 3
Joined: Thu Dec 13, 2007 4:57 pm

passing a form value to email script

Post 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
User avatar
andym01480
Forum Contributor
Posts: 390
Joined: Wed Apr 19, 2006 5:01 pm

Post by andym01480 »

Is the form method POST or GET?

Watch out for email header injection too.
thibautr
Forum Newbie
Posts: 3
Joined: Thu Dec 13, 2007 4:57 pm

Post 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...
thibautr
Forum Newbie
Posts: 3
Joined: Thu Dec 13, 2007 4:57 pm

Post 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
Post Reply