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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 25

Thread: Parse Error

  1. #1
    New Coder
    Join Date
    Jan 2005
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Parse Error

    Parse error: parse error, unexpected $ in /home2/fashong/public_html/signup.php on line 69

    PHP Code:
    <form method="POST" action="signup.php?action=signup">
                 Username:<br> <input type="text" name="username" size="20" maxlength="15"><br>
                 Password:<br> <input type="password" name="password" size="20" maxlength="15"><br>
          Verify Password:<br> <input type="password" name="verpassword" size="20" maxlength="15"><br>
                    Email:<br> <input type="text" name="email" size="20" maxlength="25"><br><br>


    Note: Your ip will be logged so please do not make multiple accounts<br><br>
    <input type="submit" name="action" value="Signup"></form>



    <?php

    IF ($action == "signup"){

    $ipcheck mysql_query("select * from users where IP='$IP'");
    IF (@
    mysql_numrows($ipcheck) > 0) {
    $ipused yes;
    }else{
    $ipused no;
    }

    IF (
    $password == "$verpassword") {
    $passwordmatch yes;
    }else{
    $passwordmatch no;
    }




    IF (
    $ipused == "no" && $passwordmatch == "yes"){

    $userupdate mysql_query("INSERT INTO users (id, username, email, password, status, ipaddress, age) VALUES ('', '$username', '$email', '$password', '', '$IP', '')");
    }else{
    echo 
    "You etheir have an account already, or your passwords do not match!";
    }

    ?>

  • #2
    New Coder
    Join Date
    Jan 2005
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Register Globals == 'on' because $username and etc work, no need for $_POST['username']

  • #3
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Need a } before the ?>

  • #4
    New Coder
    Join Date
    Jan 2005
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks

  • #5
    New Coder
    Join Date
    Jan 2005
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's not inserting into the db now, I will have to check on it tomorrow.

  • #6
    New Coder
    Join Date
    Jan 2005
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can't figure it out, I do not know what could be wrong, this is wierd.

  • #7
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    If you was using superglobals, it'd work

    Rename your submit button to something else as by the looks of it, the script is getting confused as to which 'action' variable it's meant to be checking 'signup' exists with, the submit button or the url and I'm guessing it's trying to find 'signup' from the submit button

  • #8
    Regular Coder
    Join Date
    Aug 2004
    Location
    The US of A
    Posts
    767
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fashong
    Register Globals == 'on' because $username and etc work, no need for $_POST['username']
    I'd turn that off for secuirty, but then again that's just me.

  • #9
    New Coder
    Join Date
    Jan 2005
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I changed the button value to "submit" and it still doesn't work

  • #10
    Regular Coder
    Join Date
    Aug 2004
    Location
    The US of A
    Posts
    767
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Change the name of the button.

  • #11
    New Coder
    Join Date
    Jan 2005
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fashong
    I changed the button value to "submit" and it still doesn't work
    I already did if you had read that (not to be mean or anything)

  • #12
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Have you connected to the db? I only see you querying it, not connecting

  • #13
    Regular Coder
    Join Date
    Aug 2004
    Location
    The US of A
    Posts
    767
    Thanks
    1
    Thanked 0 Times in 0 Posts
    He includes a file at the top of the script, I assume that it contains the MySQL connection call.

  • #14
    Regular Coder
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    528
    Thanks
    8
    Thanked 8 Times in 8 Posts
    You have a CAPITAL S for Signup in the button form, yet you are looking for action=signup... Make them the same! :-)

    Also.. don't have BOTH action=sigun.php?action=signup AND <input type="submit" name="action" value="signup"> You are giving the value twice.. pointless. Just have your action as "signup.php"
    Last edited by Taylor_1978; 06-18-2005 at 09:18 AM.

  • #15
    New Coder
    Join Date
    Jan 2005
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I know! I changed the value of the submit button to "submit" it still does not work


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