New member - PHP Contact us form help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
graines
Forum Newbie
Posts: 1
Joined: Tue Apr 28, 2009 9:30 am

New member - PHP Contact us form help

Post 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
ben.artiss
Forum Contributor
Posts: 116
Joined: Fri Jan 23, 2009 3:04 pm

Re: New member - PHP Contact us form help

Post 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.
user___
Forum Contributor
Posts: 297
Joined: Tue Dec 05, 2006 3:05 pm

Re: New member - PHP Contact us form help

Post 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.
Post Reply