Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2009
    Location
    Vienna
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Configuring custom php contact form

    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.

    PHP Code:
    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
    Last edited by wolfflow; 09-20-2009 at 11:45 AM.

  • #2
    Regular Coder Element's Avatar
    Join Date
    Jul 2004
    Location
    Lynnwood, Washington, US
    Posts
    855
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Yeah, you definitely can can do this. Using a different method of string, you are able to implement HTML code much easier.

    PHP Code:

    // 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.

    Code:
    </body>
    </html>

  • #3
    New to the CF scene
    Join Date
    Sep 2009
    Location
    Vienna
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Solved

    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 :-)
    Last edited by wolfflow; 09-21-2009 at 03:18 PM. Reason: Solved


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •