Welcome Guest ( Log In | Register )




                Web Hosting

 
Closed TopicNew Topic
Do You Want A Mail Form In Your Site
ejasoft
post May 2 2005, 11:57 PM
Post #1


Newbie [ Level 2 ]
Group Icon

Group: Banned
Posts: 18
Joined: 2-May 05
Member No.: 4,656


Notice from m^e:
Repeat post. Credits reduced by 5 days. Learn to USE THE SEARCH BUTTON before you make such posts.


did you want to have in your web site mail form
that allow the user
to send mails to anther mail from his mail e.g. the compose in yahoo
CODE
<body>
<form name="email" method="post">
<table align="center">
<tr>
<td>from</td>
<td align="right"><input type="text" size="60" name="from" /></td>
</tr>

<tr>
<td>to</td>
<td align="right"><input type="text" size="60" name="to" /></td>
</tr>

<tr>
<td>cc</td>
<td align="right"><input type="text" size="60" name="cc" /></td>
</tr>

<tr>
<td>bcc</td>
<td align="right"><input type="text" size="60" name="bcc" /></td>
</tr>

<tr>
<td>subject</td>
<td align="right"><input type="text" size="60" name="subject" /></td>
</tr>

<tr>
<td colspan="2">
<textarea name="body" cols="60" rows="10">
</textarea>
</td>
</tr>

<tr>
<td colspan="2" align="right">
<input type="submit" value="send" />
</td>
</tr>
</table>
</form>

<?
function param($Name)
        {
        global $HTTP_POST_VARS;

        if(isset($HTTP_POST_VARS[$Name]))
           return($HTTP_POST_VARS[$Name]);

        return("");
        }

$from = param("from");
$to = param("to");
$cc = param("cc");
$bcc = param("bcc");
$subject = param("subject");
$body = param("body");

if($from != "" && $to != "" && $subject != "")
 {
 $headers = "From: " . $from . "\n" .
            "To: " . $to . "\n" .
            "CC: " . $cc . "\n" .
            "BCC: " . $bcc;

 mail("", $subject, $body, $headers);
 }
?>

</body>
</html>

that`s all

This post has been edited by microscopic^earthling: May 3 2005, 12:11 PM
Go to the top of the page
 
+Quote Post
nakulgupta
post May 3 2005, 11:48 AM
Post #2


Advanced Member
Group Icon

Group: Members
Posts: 173
Joined: 22-March 05
From: Hyderabad,India
Member No.: 3,155


Does the above code have any risks?? Like can it be used to spoof e-mail addresses??
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post May 3 2005, 12:09 PM
Post #3


PsYcheDeLiC dR3aMeR
Group Icon

Group: Admin
Posts: 2,242
Joined: 29-January 05
From: Nakorn Chaisri, Thailand
Member No.: 2,411
myCENTs:84.36


Spoof as in you can enter any random email address - as you can with any form mailers... there's no certain way to check that it is your authentic address unless you put some email activation mechanism following the form feedback... but then that's a total overkill when you're using this form to simply submit comments. Email verification is good for only forum & site memberships...

Anyway, I think this code is useless at this point, coz we've already posted this 2-3 times before in both javaScript and PHP sections.. While it's a good attempt, this shows that people still DO NOT use the SEARCH button before posting. One of the previous articles can clearly be found under PHP Form to Email title.

Credits adjusted for this....
Go to the top of the page
 
+Quote Post

Closed TopicNew Topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No New Posts   5 turbopowerdmaxsteel 767 1st January 2009 - 05:55 AM
Last post by: Guest
No New Posts   0 zainboy 52 25th December 2008 - 08:48 PM
Last post by: zainboy
No New Posts 10 PUNKANGEL 8,581 24th December 2008 - 11:33 AM
Last post by: kpxchunsa
No new   22 Marcella 2,492 24th December 2008 - 03:54 AM
Last post by: chifro
No New Posts   1 veerumits 584 21st December 2008 - 06:26 AM
Last post by: TavoxPeru
No New Posts   4 laniczech 267 12th December 2008 - 02:06 AM
Last post by: quack
No New Posts   9 TavoxPeru 1,046 11th December 2008 - 04:11 PM
Last post by: magiccode9
No New Posts   2 TavoxPeru 267 10th December 2008 - 12:21 AM
Last post by: Sellaman
No New Posts 16 JasPuneet 842 10th December 2008 - 12:09 AM
Last post by: Sellaman
No New Posts 11 BHerath 1,354 6th December 2008 - 09:47 AM
Last post by: TehJohn
No New Posts 4 psionics 271 4th December 2008 - 11:36 PM
Last post by: Quatrux
No new   39 mastercomputers 10,214 4th December 2008 - 01:39 AM
Last post by: laniczech
No New Posts   5 honmore 1,676 1st December 2008 - 12:37 PM
Last post by: iG-Greg Chumney
No New Posts   14 Casanova 2,223 24th November 2008 - 02:31 PM
Last post by: TheUnreal
No New Posts   6 Houdini 1,857 21st November 2008 - 10:37 AM
Last post by: magiccode9