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 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    May 2005
    Location
    united kingdom
    Posts
    8,084
    Tokens
    595

    Latest Awards:

    Default What is wrong with this PHP script? ASAP+REP!

    PHP Code:
    <a href="register.php">Register Here</a>
    </
    td></tr></table></form></center>");
    }
    if ("
    $_POST['login'];") 
    {
    $username=$_POST["username"];
    $password=md5($_POST["password"]); 
    Error I'm getting:

    Parse error: syntax error, unexpected T_STRING in /home/more/public_html/DB/login.php on line 28

    Line 28 is the if function
    Last edited by myke; 10-03-2008 at 11:32 AM.

    drink up this bottle of yeah
    and P A I N T your body on me


  2. #2
    Join Date
    Oct 2007
    Location
    UK
    Posts
    471
    Tokens
    0

    Default

    I'm a bit rusty with php, but try this:
    PHP Code:
    <a href="register.php">Register Here</a>
    </
    td></tr></table></form></center>");
    }
    if (isset(
    $_POST['login'])) {
    $username = $_POST["username"];
    $password = md5($_POST["password"]); 
    I assume you were trying to check if it had been submitted.

  3. #3
    Join Date
    May 2005
    Location
    united kingdom
    Posts
    8,084
    Tokens
    595

    Latest Awards:

    Default

    no, didn't work !

    +rep for tring !

    drink up this bottle of yeah
    and P A I N T your body on me


  4. #4
    Join Date
    May 2005
    Location
    united kingdom
    Posts
    8,084
    Tokens
    595

    Latest Awards:

    Default

    sorry, can't edit, sorted.

    drink up this bottle of yeah
    and P A I N T your body on me


  5. #5
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Quote Originally Posted by SyrupyMonkey View Post
    sorry, can't edit, sorted.
    Basically in PHP if your using a echo or placing a string (I think your echoing) you have a problem with (ref="register.php">), think about it, you've started it off with echo(" <<-- and your ending it with "); "register.php" Your basically ending it there, and then starting it again, so to fix this;

    PHP Code:
    echo("<a href=\"register.php\">"); 
    or
    PHP Code:
    echo('<a href="register.php">'); 
    or
    PHP Code:
    echo("<a href=register.php>"); 
    all will work, and let you use a href tag in a PHP code.

    Hope that helped

    I just re-read it and i saw a few more errors in the coding

    if statements, I shall explain as you've really and the only word i found to explain this is f**ked it up big time.

    if statements are very easy, and its the basic of coding on a whole, once you understand it, you can basically build anything.

    PHP Code:
    $string "Bob";
    $string2 5;
    ## code 1
    if($string == "Bob")
    {
    echo(
    "True");
    }
    else
    {
    echo(
    "False");
    }

    ## code 2
    if($string2 == 2)
    {
    echo(
    "False");
    }
    else
    {
    echo(
    "True");

    Code #1 would be result on the page "True" and Code #2 would result "False" In strings/vars you can place numbers without quotes, but if its text, you need to quote it, and ALWAYS finish off VARS/STRINGS with ; or your code will fail.

    What you've done wrong is basically go a bit too far with the syntax
    PHP Code:
    if ("$_POST['login'];"
    the correct version would be

    PHP Code:
    if ($_POST['login']) 
    I tend not to do coding like that, so Id probably do
    PHP Code:
    if($_POST['login'] == ""
    ^^ That should work, good luck!
    Last edited by Protege; 10-03-2008 at 04:20 PM. Reason: Re-read code
    Hi, names James. I am a web developer.

  6. #6
    Join Date
    Jan 2007
    Location
    England, Uk, World, Universe,
    Posts
    1,012
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <a href=register.php>Register Here</a>
    </
    td></tr></table></form></center>");
    }
    if ("
    $_POST['login'];") 
    {
    $username=$_POST["username"];
    $password=md5($_POST["password"]);  
                     } 
    try that =]
    my sig ran away,

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

    Latest Awards:

    Default

    @^: Oh come on!

    PHP Code:
    <a href="register.php">Register Here</a>
    </
    td></tr></table></form></center>");
    }

    if( 
    $_POST["login"]  /* isset() can be used */ ) 
    {

        
    $username = $_POST["username"];
        
    $password = md5( $_POST["password"] ); 

  8. #8
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    roflmao at this failure
    USE ' over " if you want " use escape it with \
    <a href='register.php'>Register Here</a>
    </td></tr></table></form></center>");
    }

    if($_POST["login"])
    {

    $username = $_POST["username"];
    $password = md5( $_POST["password"] );
    How could this hapen to meeeeeeeeeeeeeee?lol.

  9. #9
    Join Date
    Mar 2008
    Posts
    173
    Tokens
    0

    Default

    PHP Code:
    <a href="register.php">Register Here</a>
    </td>
    </tr>
    </table>
    </form>
    </center>
    <?php
    if ($_POST ['login']) {
        
    $username $_POST ["username"];
        
    $password md5 $_POST ["password"] );
        
    // DO THE REST OF YOUR **** HERE //


    }
    ?>

  10. #10
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    by the looks of the ); ending in, he's already in an echo/print so you'd have to keep in php
    How could this hapen to meeeeeeeeeeeeeee?lol.

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
  •