Vidahost PHP form mail to

Associate
Joined
28 Nov 2005
Posts
431
Location
Scotland
I am hosting my site with vidahost. I am currently creating the site and have a form which the user inputs data, on submitting the form, the form contents is passed to a PHP script which does some validation etc before email the contents to an email address.

Being a bit of a noob with PHP and its server side configuration, is there any way in my vidahost cpanel I can set the address in which PHP uses to send the content. Currently it comes from *domain username*@geneva.footholds.net

(im guessing this is probably targeted at fellow vidahost customers :))
 
Currently doing something similar with PHP and I'm also with vidahost, I don't know if this is the correct way to do it but within my PHP I can specify the email it appears to be sent by.

Like this:
$header = "From: [email protected]";

Seems to work fine for me.
 
Watch out for contact form header injection as well - set this up *before* your form gets exploited to send spam to everyone :p

Make sure you sanitise user input wherever it is used.
 
Back
Top Bottom