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 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Join Date
    Oct 2005
    Location
    Spain, Valencia
    Posts
    20,492
    Tokens
    3,575
    Habbo
    GoldenMerc

    Latest Awards:

    Default How to get this email form working?

    Well i just baught a layout and its got a email function for people to apply for beta and it just doesn't seem to be working, apparently it gets your email to send their emails from via emails.txt although it doesn't seem to be working heres the codes;

    Code:
    </ul>
                <form action="mail.php" method="post" id="form-email">
                    <p>
                        <input type="text" name="email" id="email" value="Please  enter your e-mail address here to apply for beta!"/>
                    </p>
                    <p>
                        <input type="submit" name="submit" id="submit" value="" />
                    </p>
                </form>
    Then in email its just got my email and thats it?
    +Rep for help x!

  2. #2
    Join Date
    Jul 2004
    Location
    California
    Posts
    8,725
    Tokens
    3,789
    Habbo
    HotelUser

    Latest Awards:

    Default

    PHP Code:
    <?php
    mail
    ('[email protected]''SMS2PAYPAL'"from {$_POST['email']}");
    ?>
    Put that for mail.php
    I'm not crazy, ask my toaster.

  3. #3
    Join Date
    Oct 2005
    Location
    Spain, Valencia
    Posts
    20,492
    Tokens
    3,575
    Habbo
    GoldenMerc

    Latest Awards:

    Default

    That doesn't seem to work, heres all the codes
    Code:
    function isValidEmailAddress(emailAddress) {
    var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
    return pattern.test(emailAddress);
    }
    
    
    
    /*FORM validation and div changing*/
    $(document).ready(function() { 
        $().click(function (ev) {
            var $target = $(ev.target);
              if( !$target.is("input") ) {
                    $("input#email").val('Please  enter your e-mail address here to apply for beta');
              }
        }); 
    
        $("#email").click(function() {
                $("input#email").val('');
        });
        
        $("#submit").click(function() {
            var email = $("input#email").val();
            if(!isValidEmailAddress(email)){ 
                $("input#email").focus();
                $("input#email").val('Enter a valid e-mail');
             return false;
            }
        });
        
        /*form submit*/
        $("form#form-email").submit(function() {
            var email = $("input#email").val();
            $.ajax({
                url:'mail.php',
                type:'post',
                data: "email="+email,
                success: function(msg){
                    if (msg==1)
                        $("input#email").val('Thank you, your application has been recieved');
                    else
                        $("input#email").val('Some trouble on sending');
                }
            });
            return false;
        });
    /*end formsubmit*/
    });
    and then thats it, it just wont submit, what i want it to do is send me a email at [email protected] with the beta's application just the email address really. but it just doesn't seem to be working...

  4. #4
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    PHP Code:
    <?php
    if($_POST['submit']) {
    $email htmlspecialchars($_POST['email']);
    mail('[email protected]','subject','message')
    echo 
    'Thanks for signing up';
    } else {
    <
    form action="" method="post">
    Enter your email here: <input type="text" name="email" /> <br />
    <
    input type="submit" name="submit" value="Submit!" />
    </
    form>
    }
    ?>
    Wouldn't it just be more effective if you created a mailing list instead since all you need is an email address?

  5. #5
    Join Date
    Jul 2004
    Location
    California
    Posts
    8,725
    Tokens
    3,789
    Habbo
    HotelUser

    Latest Awards:

    Default

    Quote Originally Posted by Fazon View Post


    Wouldn't it just be more effective if you created a mailing list instead since all you need is an email address?
    Actually it would be:
    PHP Code:
    <?php
    if($_POST['submit']) {
    $email htmlspecialchars($_POST['email']);
    mail('[email protected]','putYourSubjectHere','their email address: '.$email)
    echo 
    'Thanks for signing up';
    } else {
    <
    form action="" method="post">
    Enter your email here: <input type="text" name="email" /> <br />
    <
    input type="submit" name="submit" value="Submit!" />
    </
    form>
    }
    ?>
    I'm not crazy, ask my toaster.

  6. #6
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    my bad on the errors in that code. try this:

    http://totalbasketball.herobo.com/test/form.php
    http://totalbasketball.herobo.com/test/form.phps

    edit - tested + working. just add the regex and style
    Last edited by Trigs; 06-07-2010 at 01:04 AM.

  7. #7
    Join Date
    Oct 2005
    Location
    Spain, Valencia
    Posts
    20,492
    Tokens
    3,575
    Habbo
    GoldenMerc

    Latest Awards:

    Default

    says some trouble on sending with that one

  8. #8
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    What? Was there an error or something? BTW the form.php uses my email so you won't get it. I got it so it's working. Just use the source and change the info within mail();

  9. #9
    Join Date
    Oct 2005
    Location
    Spain, Valencia
    Posts
    20,492
    Tokens
    3,575
    Habbo
    GoldenMerc

    Latest Awards:

    Default

    http://smstopaypal.com/
    Yep i've changed it but it still says theirs problems

  10. #10
    Join Date
    Oct 2007
    Posts
    824
    Tokens
    71

    Latest Awards:

    Default

    Where?

Page 1 of 3 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
  •