You are here: Re: Passing Variables from a form to an email « All PHP « IT news, forums, messages
Re: Passing Variables from a form to an email

Posted by robert on 05/17/06 08:57

| //email variable declaration
| $email_to = "person@abc.com";
| $email_subj = "the form name";
| $from_address = "bill@def.com";
|
| // now we build the message of the email
| session_start();
| echo $_SESSION['message'];
| $the_message = $_SESSION['message'];
| // now we send the email
| mail($email_to, $email_subj,$the_message,"From: $from_address"); //send
| the message
| ?>
|
| When I did things this way, Hunger and Liar Lunatic make to the body of
the
| message, but not the contents of $email_hunger and $email_liar_lunatic.
| What I am doing wrong ... is there a better way???

man, that's a security hole just waiting to be used! don't store the message
in a session variable. ex., i log on as admin and send a sensitive message
to user A. next, i try to send a message to user B but the script poops a
bit in generating the message but continues to email from the session
message...user B now has info that only A should have - things like user
names, passwords, financials, etc..

i would make/use an email class object...the page with your form should be
building your message and sending it via the email class. there's NO need to
session anything. this is the same methodology as collecting data and
putting it in a db...only here, there's no db - you instead output via
email.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация