Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 5 of 5

Thread: PHP Email form

  1. #1
    Join Date
    Apr 2007
    Location
    Kent
    Posts
    482
    Tokens
    0

    Smile PHP Email form

    Hi, this is Blazz. I've gone off of habbo but i know this site is good for coding etc.

    Anyway, im creating a Designing website and i was wondering how you would create a php form so it will email to me, is there any generator to make one?

    +REP !

    :eusa_whis
    Tis' I.

  2. #2
    Join Date
    Dec 2007
    Posts
    18
    Tokens
    0

    Default

    No there is not one to generate.

  3. #3
    Join Date
    Apr 2007
    Location
    england
    Posts
    536
    Tokens
    0

    Default

    Use something like this, just edit it to your needs:

    PHP Code:
    <?php
    // These are the variables
    $name = ($_POST["name"]);
    $job = ($_POST["job"]);
    $aboutme = ($_POST["aboutme"]);
    $email = ($_POST["email"]);
    $to "[email protected]";
    $subject "Email subject";
    $message "email body";
    $headers "MIME-Version: 1.0" "\r\n";
    $headers .= "Content-type:text/html;charset=iso-8859-1" "\r\n";

    // After the form is sent, the following makes sure the user entered everything in the form.
    if ($_GET["action"] == "submit")
    {
    if (
    $name == "")
        {
            echo 
    "Whoops! You didn't enter your name.";
            exit;
        }
        if (
    $job == "")
        {
            echo 
    "Whoops! You didn't enter a job to apply for.";
            exit;
        }
        if (
    $aboutme == "")
        {
            echo 
    "Whoops! You didn't enter anything about yourself.";
            exit;
        }
            if (
    $email == "")
        {
            echo 
    "Whoops! You didn't enter an email, we need this to contact you.";
            exit;
        }

    echo 
    "Thanks for applying, add whatever information you want here";
    mail($to,$subject,$message,$headers);
    exit;
    }

    // Now, its time to display the actual form
    echo "Hi, here is the app form, add details about your site and whatever here.<br>
    <br>
    <form action=\"?action=submit\" method=\"post\">
    Name:
    <input type=\"text\" name=\"name\">
    Job:
    <input type=\"text\" name=\"job\">
    Email:
    <input type=\"text\" name=\"email\">
    About me:
    <input type=\"text\" name=\"aboutme\">"
    ;
    That should work, I haven't tested it but i'm pretty sure it'll work.


    Selling DJ/Habbo layout, more info here.


  4. #4
    Join Date
    Apr 2007
    Location
    Kent
    Posts
    482
    Tokens
    0

    Default

    Quote Originally Posted by Hashbrown View Post
    No there is not one to generate.
    Why did you post this, there was no point what so ever. :S

    adamFTW, i've +REPPED You, thanks for the code
    Tis' I.

  5. #5
    Join Date
    Dec 2006
    Location
    Nottingham
    Posts
    7,752
    Tokens
    756
    Habbo
    katie.pricejorda

    Latest Awards:

    Default

    It's PHP, works fine, no advertising, good experiences with it.

    http://www.freeformmaker.com/

    If you want to edit it manually afterwards it never seems to work as the code is garbled but some how works, make sure you make the form correctly the first time.

    And whoever said there's no generator? Google is your friend!

Posting Permissions

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