Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Registering?

  1. #1
    New Coder
    Join Date
    Jul 2007
    Location
    UK
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Registering?

    Hi, on my website when you register you have to tick the boxs to say that you are over 13 and you agree to the terms of service, how would i make it so you cannot register until you have tick the 2 boxes.

    I have this:

    Code:
    <script language=JavaScript>
    
    function over13check(a)
    {if (a.over_13.checked == false )
    {alert('You must be over 13 to register on SMGames.');
    return false;}
    else
    return true;}
    
    function toscheck(t)
    {if (t.tos.checked == false )
    {alert('You must accept the Terms of Service in order to register.');
    return false;}
    else
    return true;}
    </script>
    But its not working, what else would i need.


    Also i need help with another thing, there are 2 password boxes, one for your password and one for confirm password, how would i make it so they have to match, does it have something to do with variables? can anyone help me?
    http://www.smgames.staticfire.co.uk Under construction, Currently hiring mods and admins anyone interested pm me.

  • #2
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts

    Wrong Forum

    Try posting this in the javascript forum as they can better suite your needs there. Also you might want to post your <html> form for so they can see your password and confirm password names or index.
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.

  • #3
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Posts
    624
    Thanks
    20
    Thanked 19 Times in 18 Posts
    Hi there ... I suggest you repost in the javascript forum and post the HTML too (all you've got there is the javascript).

  • #4
    Regular Coder
    Join Date
    Mar 2007
    Location
    Quebec
    Posts
    261
    Thanks
    6
    Thanked 7 Times in 7 Posts
    What the other two said ^^

    As for password confirmation, you could use an if statement.
    PHP Code:
    <?php
    $password 
    $_POST['password']; //transferred from html form where the password field is called password
    $confirm_password $_POST['confirm_password']; //transferred from form where confirm password field is called confirm_password

    if($password != $confirm_password) {
      echo 
    "Passwords do not match!";
    }else{
      
    proceed with whatever you want to happen here
    }
    ?>


  •  

    Posting Permissions

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