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 10 of 10

Thread: Forms

  1. #1
    Join Date
    May 2007
    Location
    Brisbane, Australia
    Posts
    796
    Tokens
    0

    Default Forms

    Hello i did a form Email me form and when i hit submit it opens out look it dosent just send it, It would open a new Message thats blank

    HTML Code:
    <form action="mailto:[email protected]" method="get" enctype="text/plain">
    Name*<br>
    <input type="text" name="name" id="name" size="30" style="color: #FFFFFF; font-family: Trebuchet MS; border: 1px solid #FFFFFF; background-color: #131313" /><br>
    What Job*<br>
    <select name="rating" id="rating" style="font-family: Trebuchet MS; color: #FFFFFF; border: 1px solid #FFFFFF; background-color: #131313" size="1"><br>
      <option>Options:</option>
      <option>DJ</option>
      <option>Radio manager</option>
      <option>Alterations Artists</option>
      <option>News Reporter</option>
      <option>News Manager</option>
      <option>Content Manager</option>
      <option selected>Pick a Job Please</option>
    </select><br>
    Why*<br>
    <textarea name="improve" id="improve" rows="4" cols="46" style="color: #FFFFFF; font-family: Trebuchet MS; border: 1px solid #FFFFFF; background-color: #131313"></textarea><br>
    <input type="submit" value="Send Feedback" style="border: 1px solid #FFFFFF; background-color: #C0C0C0" />
    </form
    Moved by Agesilaus (Forum Moderator) from Designing and Development: Please post in the correct forum next time.
    Last edited by Agesilaus; 05-01-2008 at 12:21 PM.
    Thanks,
    Chris
    Free Image Uploading

    __________________


    [/url]

    [/FONT]

  2. #2

    Default

    You need to use php to send it to the pop server and deliver the email.
    PHP Code:
    <?php
    if(isset($_POST['send']))
    //send would be the name of your submit button..
    {
        
    $name $_POST['name'];
        
    //The name field..
        
    $job $_POST['job'];
        
    //The choose job dropdown.
        
    $improve $_POST['improve'];
        
    //The improve textarea
        
    if(!isset($name) || !isset($job) || !isset($improve))
        {
            echo(
    "Fields left blank..");
        }
        else
        {
            
    $to "[email protected]";
            
    $subject "Contact form submission from " $name "..";
            
    $msg "" $name " has contacted you about the " $job " job opening. He left the following message..\n\n" $msg "";  
            
    mail("$to""$subject""$msg");
        }
    }
    else
    {
        echo(
    "Your form..");
    }
    ?>
    That should work, take out the form action and name your job option as job and your submit button as send.

  3. #3
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    :S a bit unclean..
    Coming and going...
    Highers are getting the better of me

  4. #4

    Default

    I don't see how it's unclean but oh well, it was only an example of how it would be done..
    Last edited by Jme; 05-01-2008 at 04:36 PM.

  5. #5
    Join Date
    May 2007
    Location
    Brisbane, Australia
    Posts
    796
    Tokens
    0

    Default

    ty worked
    Thanks,
    Chris
    Free Image Uploading

    __________________


    [/url]

    [/FONT]

  6. #6
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Jme View Post
    I don't see how it's unclean but oh well, it was only an example of how it would be done..
    You havent cleaned anything ... :rolleyes:

    Eg
    PHP Code:
    $name $_POST[name]; 
    Coming and going...
    Highers are getting the better of me

  7. #7
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by MrCraig View Post
    You havent cleaned anything ... :rolleyes:

    Eg
    PHP Code:
    $name $_POST[name]; 
    I think JME is thinking you meant it's not tidy.

    If there are exploits to POP servers (or whatever he's sending to) with web forms, good idea to clean the forms, but I don't know if there are.

  8. #8

    Default

    Quote Originally Posted by Hitman View Post
    I think JME is thinking you meant it's not tidy.

    If there are exploits to POP servers (or whatever he's sending to) with web forms, good idea to clean the forms, but I don't know if there are.
    Ohhh, i see I didn't see the point to clean the input because it can't effect the pop server. If i was inserting it into a database then there would be a point to cleaning the input.

  9. #9
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Yes it's unsecure.

    Remove \n and \r from inputs.

  10. #10
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Someone might find a way..

    better to be safe than sorry.
    Coming and going...
    Highers are getting the better of me

Posting Permissions

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