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 2 of 2
  1. #1
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default Form mailer... PHP

    I got bored so I thought I'd code something up for the fun of it, so I thought back when I used to struggle at FORMS and sending them to a e-mail address. Below is some basic PHP to build your form and send it to the specified email.

    You can add as many items to the array. so blow yourself away.

    I haven't tested the mailer properly as i was using WAMP when coding, so yeah. It hopefully will work.
    omgz <?php <<--- Zomgz.
    PHP Code:
    <?php
    $forms 
    = array( "input|name|Name*",
                    
    "password|password|Email Address*",
                    
    "textarea|message|Message*");
    $siteurl "jamesrozee.com";
    $email "[email protected]"// Email you want your mail sent to.
    $font "Tahoma"// tahoma, it owns
    $size "2"// font size
    $title "My Test Form!"// page titleizzle
    $textb4 "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book."// Include images if you think your pr0

    // - this next, I wouldn't edit in all fairness unless you have too. - dont cry.
    echo('<html><head><title>'.$title.'</title></head><body>');
    if(
    $_GET["x"] == "exec") {
        for(
    $i 0$i sizeof($forms); $i++) {
            
    $formation explode("|"$forms[$i]);
            if(
    str_replace("*"""$formation[2])) { if($_POST[$formation[1]] == "") { $relay false; echo('<font face="'.$font.'" size="'.$size.'">'.str_replace("*"""$formation[2]).' is a required field.<br>'); } elseif($_POST[$formation[1]] != "") { $mailit $mailit.$formation[2]." = ".$_POST[$formation[1]]."<br>"; } } else { $mailit $mailit.$formation[2]." = ".$_POST[$formation[1]]."<br>"; }
            unset(
    $formation); }
        if(!
    $relay == false) {
        
    $mailit str_replace("*"""$mailit);
        
    $subject "";
        
    $headers 'From: '.$email "\r\n" .
        
    'Reply-To: '.$email "\r\n" .
        
    'X-Mailer: PHP/' phpversion();
        
    mail($email$subject$mailit$headers); }
    } else {
        echo(
    '<form method="post" action="?x=exec"><table width="500" border="0" cellpadding="5"><tr><td colspan="2"><font face="'.$font.'" size="'.$size.'">'.$textb4.'</font></td></tr>');
        for(
    $i 0$i sizeof($forms); $i++) {
            
    $formation explode("|"$forms[$i]);
            
    $name $formation[1];
            
    // $namex = str_replace("*", "", $formation[2]);
            
    $namex $formation[2];
            echo(
    '<tr><td><font face="'.$font.'" size="'.$size.'">');
            if(
    $formation[0] == "input") { echo($namex.'</font></td>');
                echo(
    '<td><input type="text" name="'.$name.'"></td>');
            } elseif(
    $formation[0] == "textarea") { echo($namex.'</font></td>');
                echo(
    '<td><textarea name="'.$name.'"></textarea></td>');
            } elseif(
    $formation[0] == "password") { echo($namex.'</font></td>');
                echo(
    '<td><input type="password" name="'.$name.'"></td>');
            } else { echo(
    $namex.'</font></td>');
                echo(
    '<td><input type="text" name="'.$name.'"></td>'); }
            echo(
    '</tr>');
            unset(
    $formation); }
        echo(
    '<tr><td><input type="submit" value="Submit"></td></tr></table></form></body></html>');
    }
    ?>
    parrrrrrrrrtaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay :eusa_danc
    Hi, names James. I am a web developer.

  2. #2
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    More INFO, live version just up for tonight as my sites are down =(
    http://78.146.215.56:5800/contact_form.php
    Hi, names James. I am a web developer.

Posting Permissions

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