View Full Version : Configuring custom php contact form

09-20-2009, 11:36 AM
Hi All,

this is my first attempt to start learning and implementing custom php programming. My first try is that I use a php script that I have found at http://www.ibdhost.com/contact/ and I did sucessfully applyed at my own web-hosting page.

Everything work just fine but in the case that an user do not fill out every requested field the form automaticly send a very poor output message.

This is the part of the code I would like to custom, that means I want that the message "Go Back! !" is shown in a nicely graphic layout then just as it does now --> black written characters and nothing else and because my html page layout have a darker colored output the message cannot be read satisfactory manner.

echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
echo $badinput;
die ("Go back! ! ");

I'm at my first attempt to php codeing so I will be very thankfull if anyone could help me in this undertaking. I guess that it may be possible to get this "die" operation call a custom page that provide the right layout to the output message.

Link to the actual implemented form: http://www.garschagen.at/contact/contact.php

Thank for any suggestion

09-21-2009, 04:04 AM
Yeah, you definitely can can do this. Using a different method of string, you are able to implement HTML code much easier.

// In this file, have just the layout starting after the body tag, to the ending </html> tag
die( include( './invalid-email.layout.html' ) );

The script dies, but displays a file (that you need to create) that has the layout code you want, including your error message, displayed as you'd like in HTML.

You then end the document as you with the ending HTML tags.


09-21-2009, 01:46 PM
Hi Element, just got your suggestion, thank you very much. Will go implement that. Let you know how I'm doing. Great!!

Edit: It works smothly- many Thanks :-)