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!


Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25

Thread: Form Tutorial

  1. #11
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    People are rambling about forms so im giving this a little bump *wistles inccently*

    Ps. tut systesm up, Ish, its teh layoust thingy thats casuing problems is i need 2 figure out how 2 do an upload system "/

  2. #12
    Join Date
    Jun 2005
    Location
    West Midlands, UK
    Posts
    169
    Tokens
    0

    Default

    Aaaagh mine refuses to work

    The form itsself is at http://www.habbophunk.com/request.html. When I full it in it gives me some complicated message that I don't get

    I've posted the code below. Wold you mind looking through and checking what the mistake is?

    Thanks.


    HTML Code:
    <?php
    if ($_SERVER['REQUEST_METHOD'] != 'GET'){
    $mess = $_POST['habbo']; 
    $mess = $_POST['type']; 
    $mess = $_POST['dj']; 
    $mess = $_POST['message'];
    
    
    $messig = " 
    
    Habbo Name: $mess 
    \n 
    Message Type: $mess 
    \n 
    Current DJ: $mess 
    \n
    Message: $mess 
    
    "; 
    
    $subject = $habbo;
    
    mail($mailto, $subject, $messig); 
     
    
    $tool = $_POST['dj']; // now its a varible 
    
    //next we do the if stament 
    if($dj == "DJ Frobberwob"){$mailto = "andygreen1000********.com" ;} 
    elseif($dj == "DJ Acid"){$mailto = "Ziffachan********.com" ;} 
    else {die("Error, no one to send email to"); } 
    
    Header("Location: requestconfirm.php"); 
    
    } 
    else 
    { 
    echo 'ERROR'; 
    } 
    
     
    ?>
    The censored part is our e-mails


    Lolage.co.uk

    Please register on Lolage




  3. #13
    Join Date
    Mar 2005
    Location
    Dog House
    Posts
    1,000
    Tokens
    0

    Latest Awards:

    Default

    whats the contact codes?

  4. #14
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    lol who bumped this its 5 months old

  5. #15
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Quote Originally Posted by Acidude
    Aaaagh mine refuses to work

    The form itsself is at http://www.habbophunk.com/request.html. When I full it in it gives me some complicated message that I don't get

    I've posted the code below. Wold you mind looking through and checking what the mistake is?

    Thanks.


    HTML Code:
    <?php
    if ($_SERVER['REQUEST_METHOD'] != 'GET'){
    $mess = $_POST['habbo']; 
    $mess = $_POST['type']; 
    $mess = $_POST['dj']; 
    $mess = $_POST['message'];
    
    
    $messig = " 
    
    Habbo Name: $mess 
    \n 
    Message Type: $mess 
    \n 
    Current DJ: $mess 
    \n
    Message: $mess 
    
    "; 
    
    $subject = $habbo;
    
    mail($mailto, $subject, $messig); 
     
    
    $tool = $_POST['dj']; // now its a varible 
    
    //next we do the if stament 
    if($dj == "DJ Frobberwob"){$mailto = "andygreen1000********.com" ;} 
    elseif($dj == "DJ Acid"){$mailto = "Ziffachan********.com" ;} 
    else {die("Error, no one to send email to"); } 
    
    Header("Location: requestconfirm.php"); 
    
    } 
    else 
    { 
    echo 'ERROR'; 
    } 
    
     
    ?>
    The censored part is our e-mails

    you seem to have amade a few mistakes in how php works by assigning many differnt things the same varible for exsmple.
    i was planing to ad full code exsamples but they stupuidly disabled the edit function "/

    anyway

    try this

    PHP Code:
    <?php
    if ($_SERVER['REQUEST_METHOD'] != 'GET'){

    $mess1 $_POST['habbo'];
    $mess2 $_POST['type'];
    $mess3 $_POST['dj'];
    $mess4 $_POST['message'];


    $messig "

    Habbo Name: 
    $mess1
    \n
    Message Type: 
    $mess2
    \n
    Current DJ: 
    $mess3
    \n
    Message: 
    $mess4

    "
    ;

    $subject $mess1;




    $tool $_POST['dj']; // now its a varible

    //next we do the if stament
    if($mess3 == "DJ Frobberwob"){$mailto "andygreen1000********.com" ;}
    elseif(
    $mess3 == "DJ Acid"){$mailto "Ziffachan********.com" ;}
    else {die(
    "Error, no one to send email to"); }

    mail($mailto$subject$messig);

    Header("Location: requestconfirm.php");

    }
    else
    {
    echo 
    'ERROR';
    }


    ?>
    All avibles have the own unice varible to store to, plus the mail to varible in your own was after the mail function wich sends the email itself wich is most likly what was throwing up all the errors, hope that helps

  6. #16
    Join Date
    Jun 2005
    Location
    West Midlands, UK
    Posts
    169
    Tokens
    0

    Default

    YAYAYAYAYAY!

    WH00T! IT WORKS!

    Thanks dude!

    *Gives rep*

    Now all I need to sort out is the radio issues XD


    Lolage.co.uk

    Please register on Lolage




  7. #17

    Default I need help with part of my form

    I need something that will count how many letters are being typed in a letter box and when it reachs 144 it wont let you type any more, anyone know how to build one?

  8. #18
    Join Date
    Aug 2005
    Location
    Manchester
    Posts
    267
    Tokens
    0

    Default

    Wow this tutorial was written ages ago

  9. #19

    Default ;O

    I know

  10. #20
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Quote Originally Posted by SamMaddock
    I need something that will count how many letters are being typed in a letter box and when it reachs 144 it wont let you type any more, anyone know how to build one?
    ok im still not a 100 what u mean.

    u can limit amount of letters able to enter with the max lengh attribute

    Code:
    maxlength="144"
    Or do u want javascript to activty type whats being entered.

    Heres a quick code, im not great a javascript and this is off the top of my head so may not work

    Code:
    <script>
    function CheckLength() {
    	MessageLength  = document.FORMNAME.BITNAME.value.length;
    	
    Out = MessageLength - 144 ;
    		
    alert(Out + " charciters remaining");
    
    }
    </script>
    Exsmaple of use

    Code:
    <script>
    function CheckLength() {
    	MessageLength  = document.FORMNAME.BITNAME.value.length;
    	
    Out = MessageLength - 144 ;
    		
    alert(Out + " charciters remaining");
    
    }
    </script>
    
    
    
    <br>
    <script>
    CheckLength();
    </script>
    <form name="FORMNAME" method="post" action="">
      <input type="text" name="BITNAME">
    </form><br>
    
    <a href='javascript:CheckLength()'>Check Post Length</a>

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

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