Page 1 of 1

New member - PHP Contact us form help

Posted: Tue Apr 28, 2009 9:42 am
by graines
Hi there, firstly I am very new to this web design stuff so please bare with me. Hopefully this will be a very question to answer for someone who actually knows a bit about php! :)

So...I have created a contact us form on my domain and set up the php scripting however the form showed errors during testing. Therefore I contacted my ISP who informed me that their servers didn't accept php email components for security reasons. Now I have a page with a nice looking layout etc but a non working form. My only other idea, apart from re-designing the page, was to run the script from one of our other hosting servers which I know support php. is this possible? The html pages would still have to be on the other server!

Hope you can help!! many thanks in advance

Re: New member - PHP Contact us form help

Posted: Tue Apr 28, 2009 10:02 am
by ben.artiss
It is possible to put your contact form script on another server and keep your html page where it is, but I'm not too sure of the security implications! But you could change the action of the form to point to the script on a different server (e.g. <form name="contactForm" method="post" action="http://www.otherserver.com/path/to/contact.php">), then you could process what the user sends and redirect back to the original website using the PHP header function e.g. header("Location: http://www.originalserver.com/contact.html"). Hope that helps a bit.

Re: New member - PHP Contact us form help

Posted: Tue Apr 28, 2009 10:12 am
by user___
Actually the idea with setting the script on another server is insecure. In that way you need to store your sessions in a DB and both servers must have access to it. In my opinion for a form it does not worth the effort. You can just move the whole site on that server and change your DNS to point to the new server.