Results 1 to 7 of 7

Thread: Contact Form

  1. #1
    Join Date
    Jun 2006
    Location
    Northern Ireland
    Posts
    307
    Tokens
    0

    Default Contact Form

    Hey people, I am starting up my own Habbo Blog site called Habblog and I am in need of a contact form. Unfortunately, my PHP skills cannot be said to be more than amateur and so I was wondering if any of you guys know of any tutorial sites that assists you in creating a form.....

    +Rep for all help given, thanks

    Post Count:

    50 100 200 500 1000

  2. #2
    Join Date
    Dec 2007
    Location
    Toronto, Ontario, Canada
    Posts
    689
    Tokens
    0

    Default

    Here you go:

    PHP Code:
    <?php
    // The variables
    $name = ($_POST["name"]);
    $why = ($_POST["why"]);
    $to "YOUREMAIL";
    $message "Name: $name<br />
    Why: 
    $para
    $headers = "MIME-Version1.0" . "\r\n";
    $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";";

            if (
    $_GET["action"] == "submit")
    {
            if (
    $name== "")
        {
            echo 
    "Whoops! You didn't enter your name.";
            exit;
        }
        
                if (
    $why == "")
        {
            echo 
    "Whoops! You didn't type out why!";
            exit;
        }
        
        echo 
    "MK. If the user inputs the data properly, this'll show.";
        
    mail($to,$subject,$message,$headers);
        exit;
        }
        
    // The form
    echo "<form action=\"?action=submit\" method=\"post\">
        <div id=\"title\">Name:</div>
        <input type=\"text\" name=\"name\"><br /><br />
        <div id=\"title\">Why:</div>
        <style=\"width=\"169\"; height=\"116\"><textarea rows=\"7\" input type=\"text\" name=\"why\" cols=\"28\"></textarea><br />
        <input type=\"submit\" name=\"submit\" value=\"Submit\"></form>"
    ;
    ?>
    I'm pretty sure that'll work.
    Last edited by loserWILL; 21-12-2007 at 09:10 PM.

  3. #3
    Join Date
    Jun 2006
    Location
    Northern Ireland
    Posts
    307
    Tokens
    0

    Default

    Thanks, I will see how I get on with that... +Rep
    Post Count:

    50 100 200 500 1000

  4. #4
    Join Date
    Dec 2007
    Location
    Toronto, Ontario, Canada
    Posts
    689
    Tokens
    0

    Default

    Quote Originally Posted by Yamba View Post
    Thanks, I will see how I get on with that... +Rep
    Thank you, post back if it doesn't work.

  5. #5
    Join Date
    Jun 2006
    Location
    Northern Ireland
    Posts
    307
    Tokens
    0

    Default

    I was looking for like a form similar to that of Club Habbo:

    http://www.clubhabbo.net/clubhabbo/submitcontact.php

    Habbo Name:
    Email:
    Contact Reason: (Drop Down Box)
    Message:
    Post Count:

    50 100 200 500 1000

  6. #6
    Join Date
    Dec 2007
    Location
    Toronto, Ontario, Canada
    Posts
    689
    Tokens
    0

    Default

    Just edit mine? Here's what you want though:

    PHP Code:
    <?php
    // The variables
    $name = ($_POST["name"]);
    $email = ($_POST["email"]);
    $reason = ($_POST["reason"]);
    $question = ($_POST["question"]);
    $to "YOUREMAIL";
    $message "Name: $name<br />
    Email: 
    $email <br />
    Reason: 
    $reason <br />
    Question: 
    $question";
    $headers "MIME-Version: 1.0" "rn";
    $headers .= "Content-type:text/html;charset=iso-8859-1" "rn";

            if (
    $_GET["action"] == "submit")
    {
            if (
    $name== "")
        {
            echo 
    "ono! You didn't enter your name.";
            exit;
        }
        
                if (
    $email == "")
        {
            echo 
    "ono! You didn't type out your email!";
            exit;
        }
                    if (
    $reason == "")
        {
            echo 
    "ono! You didn't say why you're contacting!";
            exit;
        }
                    if (
    $question == "")
        {
            echo 
    "ono! You didn't write anything!";
            exit;
        }
        
        echo 
    "MK. If the user inputs the data properly, this'll show.";
        
    mail($to,$subject,$message,$headers);
        exit;
        }
        
    // The form
    echo "<form action=\"?action=submit\" method=\"post\">
    Name:
    <input type=\"text\" name=\"name\"><br />
    Email:
    <input type=\"text\" name=\"email\">
    <div id=\"title\">Your Reason:</div>
    <select name=\"reason\">
    <option id=\"rs1\">Reason 1</option>
    <option id=\"rs2\">Reason 2</option>
    <option id=\"rs3\">Reason 3</option>
    <option id=\"rs4\">Reason 4</option>
    </select>
    <div id=\"title\">Question:</div>
    <style=\"width=\"169\"; height=\"116\"><textarea rows=\"7\" input type=\"text\" name=\"question\" cols=\"28\"></textarea>
    <input type=\"submit\" name=\"submit\" value=\"Submit\"></form>"
    ;
    ?>
    Last edited by loserWILL; 21-12-2007 at 09:28 PM.

  7. #7
    Join Date
    Nov 2006
    Location
    Narrich
    Posts
    5,687
    Tokens
    0
    Habbo
    Jamesy...

    Latest Awards:

    Default

    Quote Originally Posted by Yamba View Post
    Hey people, I am starting up my own Habbo Blog site called Habblog and I am in need of a contact form. Unfortunately, my PHP skills cannot be said to be more than amateur and so I was wondering if any of you guys know of any tutorial sites that assists you in creating a form.....

    +Rep for all help given, thanks

    If it is for wordpress there is a nice plugin that does the job fantastically.

    http://jamesysblog.net/?page_id=3

    See, but my host is down at the minute. Crap.
    Ex-janitor. Might pop in from time to time, otherwise you can grab all my information from http://jamesy.me.uk/

Posting Permissions

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