RegisterPage [Help]

    • RegisterPage [Help]

      Hallo erstmal <:.

      Habe wieder ein Problem, und zwar ich brauche dringend eine Register Page für Offi Files.

      Habe die hier:

      PHP-Quellcode

      1. <title>Flyff Server ~ Registration Page</title>
      2. <body>
      3. <body background="">
      4. <font face="Geneva, Arial, Helvetica, Sans-Serif">
      5. <font size="3">
      6. <?php
      7. ini_set('display_errors', 0);
      8. $connection = mssql_connect('', '', '');
      9. if(!connection || !mssql_select_db('ACCOUNT_DBF', $connection))
      10. {
      11. die('Unable to connect or select database!');
      12. }
      13. $checkusername = $_POST['Username'];
      14. $query = mssql_query("SELECT account FROM ACCOUNT_TBL WHERE account = '$checkusername'");
      15. $result = mssql_fetch_row($query);
      16. if(isset($_POST['submit'])){
      17. if($_POST['Username'] == ""){
      18. $error = '<font color="red"><b>Please enter a username.</b></font>';
      19. }
      20. else if($result[0] == $checkusername){
      21. $error = '<font color="red"><b>This username already exists. Please choose another one.</b></font>';
      22. }
      23. else if($_POST['Password'] == ""){
      24. $error = '<font color="red"><b>Please enter a password.</b></font>';
      25. }
      26. else{
      27. $password = md5('nForceIsGay' . $_POST['Password']);
      28. $stmt = mssql_init('webCreateAcc', $connection);
      29. mssql_bind($stmt, '@account', $checkusername, SQLVARCHAR, false, false, 15);
      30. mssql_bind($stmt, '@password', $password, SQLVARCHAR, false, false, 36);
      31. mssql_bind($stmt, '@birthday', $checkusername, SQLVARCHAR, false, false, 120);
      32. mssql_bind($stmt, '@email', $checkusername, SQLVARCHAR, false, false, 120);
      33. mssql_execute($stmt) or die ("Could not complete the registration. Please try again.");
      34. mssql_free_statement($stmt);
      35. $error = '<font color="green"><b>Registration complete!</b></font>';
      36. }
      37. }
      38. echo '<form action="register.php" method="post">';
      39. echo '<center>Username:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="Username" /><br /><br /></center>';
      40. echo '<center>Password:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="password" name="Password" /><br /><br /></center>';
      41. echo '<center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="submit" value="Register" /></center>';
      42. echo '</form>';
      43. echo $error;
      44. ?>
      Alles anzeigen



      Mh, entweder habe ich was falsch gemacht, oder es geht einfach nicht o.ô.

      Kann mir jemand sagen ob des richtig is oder ob des der Falsche ist?

      Danke schon mal im vorraus x).

      Mfg
      Legendary
    • Werbung zur Unterstützung des Forums ( Bitte AddBlocker deaktivieren )

    • Legendary;50063 schrieb:

      Hallo erstmal <:.

      Habe wieder ein Problem, und zwar ich brauche dringend eine Register Page für Offi Files.

      Habe die hier:

      PHP-Quellcode

      1. <title>Flyff Server ~ Registration Page</title>
      2. <body>
      3. <body background="">
      4. <font face="Geneva, Arial, Helvetica, Sans-Serif">
      5. <font size="3">
      6. <?php
      7. ini_set('display_errors', 0);
      8. [COLOR="Red"]$connection = mssql_connect(''Test-pc", "sa'', "testpw'');[/COLOR]
      9. if(!connection || !mssql_select_db('ACCOUNT_DBF', $connection))
      10. {
      11. die('Unable to connect or select database!');
      12. }
      13. $checkusername = $_POST['Username'];
      14. $query = mssql_query("SELECT account FROM ACCOUNT_TBL WHERE account = '$checkusername'");
      15. $result = mssql_fetch_row($query);
      16. if(isset($_POST['submit'])){
      17. if($_POST['Username'] == ""){
      18. $error = '<font color="red"><b>Please enter a username.</b></font>';
      19. }
      20. else if($result[0] == $checkusername){
      21. $error = '<font color="red"><b>This username already exists. Please choose another one.</b></font>';
      22. }
      23. else if($_POST['Password'] == ""){
      24. $error = '<font color="red"><b>Please enter a password.</b></font>';
      25. }
      26. else{
      27. $password = md5('nForceIsGay' . $_POST['Password']);
      28. $stmt = mssql_init('webCreateAcc', $connection);
      29. mssql_bind($stmt, '@account', $checkusername, SQLVARCHAR, false, false, 15);
      30. mssql_bind($stmt, '@password', $password, SQLVARCHAR, false, false, 36);
      31. mssql_bind($stmt, '@birthday', $checkusername, SQLVARCHAR, false, false, 120);
      32. mssql_bind($stmt, '@email', $checkusername, SQLVARCHAR, false, false, 120);
      33. mssql_execute($stmt) or die ("Could not complete the registration. Please try again.");
      34. mssql_free_statement($stmt);
      35. $error = '<font color="green"><b>Registration complete!</b></font>';
      36. }
      37. }
      38. echo '<form action="register.php" method="post">';
      39. echo '<center>Username:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="Username" /><br /><br /></center>';
      40. echo '<center>Password:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="password" name="Password" /><br /><br /></center>';
      41. echo '<center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="submit" value="Register" /></center>';
      42. echo '</form>';
      43. echo $error;
      44. ?>
      Alles anzeigen



      Mh, entweder habe ich was falsch gemacht, oder es geht einfach nicht o.ô.

      Kann mir jemand sagen ob des richtig is oder ob des der Falsche ist?

      Danke schon mal im vorraus x).

      Mfg
      Legendary


      Ich glaube es Liegt am Roten, wenn da nix eingetragen wurde Bin mir aber da nicht Sicher ^^
    • Ja, dass weiß ich allerdings auch x).

      bei mir steht das dann o.ô also wenn ich auf die Seite gehen will.

      Quellcode

      1. Parse error: syntax error, unexpected '"' in C:\AppServ\www\register.php on line 9



      Hab nur noch ne Frage und zwar:

      PHP-Quellcode

      1. <?php
      2. ini_set('display_errors', 0);
      3. $connection = mssql_connect[COLOR="Red"]('MIKEYYYYYY\SQLEXPRESS', 'sa','' )[/COLOR];


      müssen da ' oder " hin o.ô? oder 2x '? ;D xD