Click to See Complete Forum and Search --> : email form that handles multiple addresses


tiki16
03-23-2007, 03:03 PM
Hello,
I'd like to create an email form that has the ability to handle numerous email addresses of contacts on a page. Is there a way that when you click a users email link it directs to the form and populates the send address with an email address specific to that person? Does this require a database? I thought that you could send the address as a variable that the from then uses. How could I go about this?
regards,
Steve W.

NightShift58
03-23-2007, 10:38 PM
Just like any other $_GET.<a href='nexptage.php?email=abc@de.com'>Bokeh</a>In nextpage.pgp, capture with: $_GET['email'].

pcthug
03-24-2007, 12:30 AM
Very susceptible to mail server hijacking, I'd suggest in the very least that you check that the email address against a whitelist, or better yet (prevent spam bots collecting the email address from URL's) just assign any given email a numeric indice:
$addresses = array(
'foo@example.com', // this will be the default address
'bar@example.net',
'baz@example.org');

$email = array_key_exists((int)$_GET['email'], $addresses) ? $addresses[(int)$_GET['email']] : $addresses[0];

<a href='nexptage.php?email=0'>E-mail Foo</a>
<a href='nexptage.php?email=1'>E-mail Bar</a>
<a href='nexptage.php?email=2'>E-mail Baz</a>