Re: Contact form....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2010-04-26 at 15:46 -0400, Watson Blair wrote:

> I knew i was missing something.... although it still doesn't work... i'm
> still getting :
> 
> "; $send_contact=mail($to,$subject,$message, $header); if($send_contact){
> echo "Thank you for Contacting Us!"; } else { echo "An error occured while
> sending your message, review your information and please try again."; } ?>
> 
> would it make a difference that i'm running it off of my computer rather
> than hosting it online?
> 
> Thanks,
> Watson
> 
> On Mon, Apr 26, 2010 at 3:30 PM, Dan Joseph <dmjoseph@xxxxxxxxx> wrote:
> 
> > Looks like you might have errors turned off.  I see:
> >
> > $subject =$_POST"subject";
> >
> > Which should be:
> >
> >  $subject =$_POST["subject"];
> >
> > $_POST is an array, and that's how you access those elements.  check to see
> > if errors are on, if not, you'll see errors in the log files.
> >
> > --
> > -Dan Joseph
> >
> > www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
> > Code "NEWTHINGS" for 10% off initial order
> >
> > http://www.facebook.com/canishosting
> > http://www.facebook.com/originalpoetry
> >


That might be it if you're running Windows, although a Linux system
would usually have sendmail installed by default.

Also, make sure you validate your inputs. Don't put the to address as a
field within the form, leave that hard coded in your app, just let the
radio buttons switch between an array of values in send.php. Putting
them in the form like that could let anyone use your form to send email
to anywhere they wanted. Also, it's very simple to modify the from field
to include as many cc or bcc fields as someone wants, and use your form
as a spam relay system.

Thanks,
Ash
http://www.ashleysheridan.co.uk



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux