At 5:04 PM +0000 1/16/03, Miguel Br·s wrote:
Hi,

i made a page to display some user details and then clicking on the user
name it goes to another page to send a mail via mail() function.

here is the line of the first page
<td width="20%" align="center"><b><font face="Arial" size="1"
color="#808080"><a href="mail_active.php?email=$email"><? echo $row->name;
?></a></font></b></td>

when click on user name, it goes to the mail_active.php?[EMAIL PROTECTED]

on the mail_active.php page, how do I get the e-mail address to send?
I mean, the mail function is mail ("$to","$subject","$message","From:
$sender");
How can I take the $to string to be [EMAIL PROTECTED]?

IN this case you could use

	mail ($_GET['email'],"$subject","$message","From:$sender");
or
	mail ($_REQUEST['email'],"$subject","$message","From:$sender");

See
	http://www.php.net/manual/en/language.variables.external.php

for more information on variable handling.

Also keep in mind that the script as you've shown it is looks very
insecure; anybody, including joe-spammer, could send mails to people
simply by calling your URL

	http://your.domain/mail_active.php?[EMAIL PROTECTED]

It's best to pass some sort of obscure ID instead of the data. I
would check out the use of sessions here:

	http://www.php.net/manual/en/ref.session.php

-steve


--
+------------------------------------------------------------------------+
| Steve Edberg                                      [EMAIL PROTECTED] |
| University of California, Davis                          (530)754-9127 |
| Programming/Database/SysAdmin               http://pgfsun.ucdavis.edu/ |
+------------------------------------------------------------------------+
| SETI@Home: 1001 Work units on 23 oct 2002                              |
| 3.152 years CPU time, 3.142 years SETI user... and STILL no aliens...  |
+------------------------------------------------------------------------+

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to