Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Temat Zbiorczy Baza MSQL Navicat's


kookaina92

Rekomendowane odpowiedzi

Opublikowano

Siemano zakładam temat bo takiego jeszcze nie było a pewnie dużo osób bawiło się w stworzenie własnego servera Warrocka :)

 

W tym temacie dodajemy obsługę bazy MSQL czyli ( jak zrobić event itp..) może komuś się przyda lub ktoś ma swoje własne sprawdzone sposoby na ogarniecie bazy :) . Zakładając ten temat liczyłem się z dużą ilością hejtów wiec na nie nie będę zwracał uwagi :)

 

 

Pozdro 600!

Opublikowano

Nie sądzę by ktoś miał na ten temat pojęcie, jest to niepotrzebne. Gdybyś Ty chociaż do niego coś wniósł, ale nic nie ma, więc..

NU94p9A.gif


Wracam..


  • 2 tygodnie później...
Opublikowano

dodam register do strony:)o to on

 

ml>

<body background="background.jpg">

<title>walsna nazwa :) - Closed Beta Registration</title>

<?php

if(isset($_POST['username']) &&  isset($_POST['nickname']) &&  isset($_POST['mail']) &&  isset($_POST['pass']) && isset($_POST['pass2']))

{

include("connect.php");

    $tempUsername = strip_tags($_POST['username']);

    $tempPasswort = strip_tags($_POST['pass']);

    $Passwort_Confirm = strip_tags($_POST['pass2']);

    

    function chkEmail($email)

{

    // elimino spazi, "a capo" e altro alle estremitŕ della stringa

    $email = trim($email);

 

    // se la stringa č vuota sicuramente non č una mail

    if(!$email) {

        return false;

    }

 

    // controllo che ci sia una sola @ nella stringa

    $num_at = count(explode( '@', $email )) - 1;

    if($num_at != 1) {

        return false;

    }

 

    // controllo la presenza di ulteriori caratteri "pericolosi":

    if(strpos($email,';') || strpos($email,',') || strpos($email,' ')) {

        return false;

    }

 

    // la stringa rispetta il formato classico di una mail?

    if(!preg_match( '/^[\w\.\-]+@\w+[\w\.\-]*?\.\w{1,4}$/', $email)) {

        return false;

    }

 

    return true;

}

 

function randomsalt($lunghezza2=5){

    $caratteri_disponibili2 ="1234567890abcdefghijklmnopqrstuvwxyz";

    //$caratteri_disponibili ="abcdefghijklmnopqrstuvwxyz";

    $refer2 = "";

    for($i = 0; $i<$lunghezza2; $i++){

        $refer2 = $refer2.substr($caratteri_disponibili2,rand(0,strlen($caratteri_disponibili2)-1),1);

    }

    return $refer2;

}

function randomcode($lunghezza22=12){

    $caratteri_disponibili22 ="1234567890abcdefghijklmnopqrstuvwxyz";

    //$caratteri_disponibili ="abcdefghijklmnopqrstuvwxyz";

    $refer22 = "";

    for($i = 0; $i<$lunghezza22; $i++){

        $refer22 = $refer22.substr($caratteri_disponibili22,rand(0,strlen($caratteri_disponibili22)-1),1);

    }

    return $refer22;

}

function randomcodesess($lunghezza222=12){

    $caratteri_disponibili222 ="1234567890abcdefghijklmnopqrstuvwxyz";

    //$caratteri_disponibili ="abcdefghijklmnopqrstuvwxyz";

    $refer222 = "";

    for($i = 0; $i<$lunghezza222; $i++){

        $refer222 = $refer222.substr($caratteri_disponibili222,rand(0,strlen($caratteri_disponibili222)-1),1);

    }

    return $refer222;

}

//controllo e modifico le mail farlocche

$_POST['mail'] = str_replace("@nwldx.com", "", $_POST['mail']);

$_POST['mail'] = str_replace("@mailmetrash.com", "", $_POST['mail']);

$_POST['mail'] = str_replace("@anonymbox.com", "", $_POST['mail']);

$_POST['mail'] = str_replace("@mailcatch.com", "", $_POST['mail']);

$_POST['mail'] = str_replace("@no-spam.ws", "", $_POST['mail']);

$_POST['mail'] = str_replace("@yopmail.com", "", $_POST['mail']);

$_POST['mail'] = str_replace("@sharklasers.com", "", $_POST['mail']);

$_POST['mail'] = str_replace("@filzmail.com", "", $_POST['mail']);

$_POST['mail'] = str_replace("@mint.us.to", "", $_POST['mail']);

$_POST['mail'] = str_replace("@spambox.us", "", $_POST['mail']);

$_POST['mail'] = str_replace("@sofimail.com", "", $_POST['mail']);

$_POST['mail'] = str_replace("@noclickemail.com", "", $_POST['mail']);

$_POST['mail'] = str_replace("@mailinator.com", "", $_POST['mail']);

$_POST['mail'] = str_replace("@meltmail.com", "", $_POST['mail']);

$_POST['mail'] = str_replace("@TempEmail.net", "", $_POST['mail']);

$_POST['mail'] = str_replace("@dunflimblag.mailexpire.com", "", $_POST['mail']);

$_POST['mail'] = str_replace("@tittbit.in", "", $_POST['mail']);

$_POST['mail'] = str_replace("@temporaryemail.us", "", $_POST['mail']);

$_POST['mail'] = str_replace("@ixi.me", "", $_POST['mail']);

$_POST['mail'] = str_replace("@tempthe.net", "", $_POST['mail']);

$_POST['mail'] = str_replace("@emailthe.net", "", $_POST['mail']);

$_POST['mail'] = str_replace("@trashmail.ws", "", $_POST['mail']);

$_POST['mail'] = str_replace("@fakeinbox.com", "", $_POST['mail']);

$_POST['mail'] = str_replace("@jetable.org", "", $_POST['mail']);

//fine controllo

$usrsess=randomcodesess();

$code=randomcode();

$salt=randomsalt();

$nickname=strip_tags($_POST['nickname']);

$email = strip_tags($_POST['mail']);

$pass=strip_tags($_POST['pass']);

$timestamp = (time()+ 864000); //equivale a 7 giorni in piu oltre la data attuale

$orario = time(); //imposta il timestamp della data attuale

/*echo "Timestamp: ";

echo $timestamp;

echo "<br>Username: ";

echo $tempUsername;

echo "<br>password in chiaro: ";

echo $pass;

echo "<br>Password criptata: ";

echo $tempPasswort;

echo "<br>Salt: ";

echo $salt;

echo "<br>Nickname: ";

echo $nickname;

echo "<br>Email: ";

echo $email;

Die();*/

 

if($nickname) {

$nickname = str_replace("[GA]", "", $nickname);

if(chkEmail($email)) {

    

    if($Passwort_Confirm == $pass)

     {

      $tempUserLength = strlen($tempUsername);

      if($tempUserLength < 16)

      {

        if($tempUserLength > 3)

        {

        //controllo se esiste gia l'username

            $i_spieler="SELECT * FROM users where username='".$tempUsername."'";

            $i_spieler2=mysql_query($i_spieler)or die("MySQL ErrCode 1 - Username");

            $i_spieler3=mysql_fetch_array($i_spieler2);

        //controllo se esiste gia il nickname    

            $i_spieler1="SELECT * FROM users where nickname='".$nickname."'";

            $i_spieler21=mysql_query($i_spieler1)or die("MySQL ErrCode - Nickname");

            $i_spieler31=mysql_fetch_array($i_spieler21);

        //controllo se esiste gia la mail    

            $i_spieler11="SELECT * FROM users where email='".$email."'";

            $i_spieler211=mysql_query($i_spieler11)or die("MySQL ErrCode - Nickname");

            $i_spieler311=mysql_fetch_array($i_spieler211);

            

            if($i_spieler311)

            {

        echo '<table><br>

                    <center><b><font color="red">This nickname has already taken!.</font><br><br>

<a href="Register2.php">Go Back</a></table></font>';

            }

            else

            {

                

                $userQuery = "INSERT INTO users(username,password,salt,nickname,email,premium,dinar,exp,kills,deaths,premiumExpire,cash) VALUES ('$tempUsername','$tempPasswort','$salt','$nickname','$email',3,100000,0,0,0,'$timestamp','20000')";

                mysql_query($userQuery) or die("MySQL ErrCode 2 - Account");

                

               $idnuovo="SELECT id FROM users where username='". $tempUsername ."'";

            $iricevuto=mysql_query($idnuovo)or die("MySQL ErrCode 3 - ExistUsername");

            $idecuip=mysql_fetch_array($iricevuto);

 

$idnumero= $idecuip['id'];

 

$equip = "INSERT INTO equipment(ownerid) VALUES ('".$idnumero."')";

                mysql_query($equip) or die("MySQL ErrCode 4 - Equipment");

    

        echo '<table><br>

                    <center><b><font color="lime">Registered successfully! Now you can login!</font><br><br>

<a href="index.php">Go Back</a></table></font></center>';//header('Location: registerdone.php'); exit;

        }

 

        }

        else

        {

        echo '<table><br>

                    <center><b><font color="red">Username length is too short (min 4 characters)!</font><br><br>

<a href="index.php">Go Back</a></table></font></center>'; //header('Location: registerfail2.php'); exit;

        }

      }

      else

      {

        echo '<table><br>

                    <center><b><font color="red">Username too long (max 15 characters)!</font><br><br>

<a href="index.php">Go Back</a></table></font></center>'; //header('Location: registerfail3.php'); exit;    

      }

     }else

      {

        echo '<table><br>

                    <center><b><font color="red">Both password aren not same!</font><br><br>

<a href="index.php">Go Back</a></table></font></center>'; //header('Location: registerfail3.php'); exit;    

      }

      }

else {

    echo '<table><br>

                    <center><b><font color="red">This email is not accepted or invalid from the system!</font><br><br>

<a href="index.php">Go Back</a></table></font></center>';

}

}

else {

    echo '<table><br>

                    <center><b><font color="red">You did not put the nickname!</font><br><br>

<a href="index.php">Go Back</a></table></font></center>';

}

}

else

{

?><center>

<table>

</td><td>

          <form action='index.php' method='post'>

     <table border='0'>

     <center><tr><td><b><font color='red'>Register for wlasna nazwa !</td><td>

     </td></tr></center></table>

     <table border='0'>

     <tr><td><b><font color='white'>Username:</td><td>

     <input type='text' name='username' maxlength='15'>

     </td></tr>

     <tr><td><b><font color='white'>Nick in Game:</td><td>

     <input type='text' name='nickname' maxlength='15'>

     </td></tr>

     <tr><td><b><font color='white'>Email:</td><td>

     <input type='text' name='mail' maxlength='25'>

     </td></tr>

     <tr><td><b><font color='white'>Password: (max 10 char)</td><td>

     <input type='password' name='pass' maxlength='10'>

     </td></tr>

     <tr><td><b><font color='white'>Confirm Password: (max 10 char)</td><td>

     <input type='password' name='pass2' maxlength='10'>

     </td></tr>

     <tr><th colspan=2><input type='submit' name='submit'

    value='Register'></th></tr> </table></font>

     </form>    

    

    </th></tr> </table></font></center>

    <?php

    }

    ?>

<form action='index.php' method='post'>

     <table border='0'>

     <center><tr><td><b><font color='red'></td><td>

     </td></tr></center></table>

</body>

</html>

</body>

trzeba połączyć skrypt z baza ale to już dacie rade  ! zaraz wezmę się za ranking :P

<div id="content">            

<div class="con-ui con-top"><h2>Ranking</h2></div>

 

<div class="con-ui con-post">

<div class="con-wrapper">

 

    

 

    

 

<table width="100%">

 

    <tr>

        <th class="topLine">#</th>

        <th class="topLine">Nickname</th>

        <th class="topLine">Level</th>

        <th class="topLine">EXP</th>

        <th class="topLine">KD</th>

        <th class="topLine">Premium</th>

        <th class="topLine">Status</th>

    </tr>

 

    <tr>

        <td class="thell" align="center"><img src="img/user1.png" title="ist Platz 1"></td>

        <td class="thell" align="center"></td>

        <td class="thell" align="center"><img src="./img/level/rank100.png" width="17px" height="17px">(100)</td>

        <td class="thell" align="center">0</td>

        <td class="thell" align="center">0</td>

        <td class="thell" align="center">0</td>

        <td class="thell" align="center"><font color="Red">Ofline</font></td>

    </tr>

    <tr>

        <td class="thell" align="center"><img src="img/user2.png" title=" ist Platz 1"></td>

        <td class="thell" align="center"></td>

        <td class="thell" align="center"><img src="./img/level/rank100.png" width="17px" height="17px">(100)</td>

        <td class="thell" align="center">0</td>

        <td class="thell" align="center">0</td>

        <td class="thell" align="center">0</td>

        <td class="thell" align="center"><font color="Green">Online</font></td>

    </tr>

    

 

    

</table>

 

 

 

 

 

</div>

</div>

<div class="con-ui con-bt"></div>

 

</div>

macie taki na szybko wieczorem zrobię lepszy  iż w nocy nie chciało mi się go dokańczać :P

jak ktoś zainteresowany gotową stroną proszę pisać pw   powiem co i jak :)

Po pierwsze, kod nie jest Twój, nawet go nie przejrzałeś. 

Po drugie ktoś będzie miał inne nazwy tabelek i już wywali błąd.

 

Tak będzie z każdym skryptem na stronę. 

 

Obsługa bazy wcale nie jest trudna. Wystarczy przeczytać nazwę tabelki i wiadomo że w event są eventy, w notice są wiadomości systemowe na pasku, w items są przedmioty w grze i tak dalej.. 

Opublikowano

po 1 ty to już nie bojuj bo gówno wiesz a po 2 to  kod jest w polowie moj a po 3 napisałem niżej że to nie jest kompletna część :) a po 4 jesteś blabla modernatorem jakiego świat widział

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...