FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » My contact form is not emailed to me
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: My contact form is not emailed to me [message #173514 is a reply to message #173512] Sat, 16 April 2011 21:40 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 4/16/2011 4:25 PM, P E Schoen wrote:
> "nathanir" wrote in message
> news:c6e55a71-4746-4038-b6da-c5e7efb2a6b0(at)a11g2000pro(dot)googlegroups(dot)com...
>
>>> // Pick up the form data and assign it to variables
>>> $name = check_input($_POST['name']);
>>> $email = check_input($_POST['email']);
>>> $select = $_POST['select'];
>>> $textinput = check_input($_POST['textinput']);
>>
>>> // Build the email (replace the address in the $to section with your
>>> own)
>>> $ToEmail = 'raj...@childsurgeon.com';
>>> $Emailsubject = "New message: $select";
>>> $MESSAGE_BODY = "$name said: $textinput";
>>> $mailheader = "From: $email";
>>
>>> // Send the mail using PHPs mail() function
>>> mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader);
>
>> BTW when I tested this script on my webpage it did send out an email
>> to me. This one also came from the same site.
>
> <?php
> mail('rajesh(at)childsurgeon(dot)com','Test mail','The mail function is
> working!');
> echo 'Mail sent!';
> ?>
>
> I'm not an expert but I do have a similar setup that works, with an HTML
> form and a PHP script which sends a confirmation email to myself. I
> don't see what's wrong, but some suggestions to try are:
>
> Incorporate a logfile which contains the values of variables such as
> $ToEmail, $select, etc.
>
> It may be best to use "selected" as the variable name rather than the
> element name "select".
>
> Then you can use the actual variables for your direct test email
> function. Also, as Jerry said, check the error logs on the server. And
> hopefully you are doing this on a localhost and not yet as a "live"
> application. It also should have some security measures, such as a
> password and a time delay to thwart DoS attacks such as a barrage of
> calls to the PHP script thousands of times per second.
>
> Maybe the experts can help, or even better you may try some things and
> learn a lot with eventual success. Good luck.
>
> Paul

I hope your script is much more secure than Nathan's. Poorly written
script by people who don't understand security are a major problem in PHP.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: doctype not found?
Next Topic: Re: Weird stuff
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 29 04:35:31 GMT 2024

Total time taken to generate the page: 0.04766 seconds