Register for your free account! | Forgot your password?

You last visited: Today at 18:07

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] Ingamechat Php Script

Discussion on [Release] Ingamechat Php Script within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old 01/14/2012, 18:25   #16

 
Mythen's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 713
Received Thanks: 133
XSS soweit nicht möglich gemacht u. den Query angepasst:
Und oben den Unnötigen Inhalt enfernt....
PHP Code:
<?php 
error_reporting
(1);
    
define("MSQL_HOST""ip"); 
    
define("MSQL_USER""user"); 
    
define("MSQL_PASS""pass"); 
     
    
$connect = @mysql_connect(MSQL_HOSTMSQL_USERMSQL_PASS);     
    if(
$connect){ 
        
$limit 15
        
$sqlCmd "SELECT `3` as 'empire',`4` as 'shout',`1` as 'msgTime' FROM log.shout_log ORDER BY msgTime DESC LIMIT ".$limit
        
$sqlQry mysql_query($sqlCmd); 
        echo 
'<table><tr><th>Date</th><th>Post</th></tr>'
        while(
$row mysql_fetch_object($sqlQry)){ 
            echo 

                <tr> 
                    <td> 
                        '
.$row->msgTime.
                    </td> 
                    <td> 
            '

                if(
$row->empire == 1){ 
                    echo 
'<span style="color:red;">'.htmlspecialchars($row->shout).'</span>'
                } elseif(
$row->empire == 2){ 
                    echo 
'<span style="color:yellow;">'.htmlspecialchars($row->shout).'</span>'
                } elseif(
$row->empire == 3){ 
                    echo 
'<span style="color:blue;">'.htmlspecialchars($row->shout).'</span>'
                } 
            echo 

                    </td> 
                </tr> 
            '

        } 
        echo 
'</table>'
    } else { 
        echo 
"Error connecting to server"
    } 
?>
Mythen is offline  
Thanks
4 Users
Old 01/14/2012, 18:29   #17
 
.2good4you111's Avatar
 
elite*gold: 20
Join Date: Oct 2010
Posts: 1,303
Received Thanks: 457
Quote:
Originally Posted by Padrio View Post
3. Query ist falsch.
Also bei jedem so

Zeile 24 mit dem ersetzen:
PHP Code:
        $sqlCmd "SELECT `3` as 'empire',`4` as 'shout',`1` as 'msgTime' FROM log.shout_log ORDER BY msgTime DESC LIMIT ".$limit

Danke @ Mythen

Vorsicht XSS Lücke!
Nicht nur XSS, du könntest auch eigenen PHP Code ausführen.


@TE am besten du baust noch preg_match ein...
.2good4you111 is offline  
Old 01/14/2012, 18:31   #18

 
Mythen's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 713
Received Thanks: 133
Quote:
Originally Posted by .2good4you111 View Post
Nicht nur XSS, du könntest auch eigenen PHP Code ausführen.


@TE am besten du baust noch preg_match ein...
htmlspecialchars ist eine Wesentlich Bessere Funktion als preg_match........
Mythen is offline  
Old 01/14/2012, 19:21   #19
 
elite*gold: 0
Join Date: Aug 2009
Posts: 962
Received Thanks: 97
@SoNiice' man darf nur andere forennamen posten
lautlosertot is offline  
Old 01/14/2012, 19:42   #20
 
elite*gold: 0
Join Date: May 2009
Posts: 152
Received Thanks: 36
Danke euch beiden hat super geklapt bekommt ihr beide thx von mir
@Jak14*-Mythen-*
@Padrio
ixel4 is offline  
Old 01/15/2012, 14:09   #21
 
elite*gold: 0
Join Date: Sep 2010
Posts: 17
Received Thanks: 4
Quote:
Originally Posted by Jak14*-Mythen-* View Post
XSS soweit nicht möglich gemacht u. den Query angepasst:
Und oben den Unnötigen Inhalt enfernt....
PHP Code:
<?php 
error_reporting
(1);
    
define("MSQL_HOST""ip"); 
    
define("MSQL_USER""user"); 
    
define("MSQL_PASS""pass"); 
     
    
$connect = @mysql_connect(MSQL_HOSTMSQL_USERMSQL_PASS);     
    if(
$connect){ 
        
$limit 15
        
$sqlCmd "SELECT `3` as 'empire',`4` as 'shout',`1` as 'msgTime' FROM log.shout_log ORDER BY msgTime DESC LIMIT ".$limit
        
$sqlQry mysql_query($sqlCmd); 
        echo 
'<table><tr><th>Date</th><th>Post</th></tr>'
        while(
$row mysql_fetch_object($sqlQry)){ 
            echo 

                <tr> 
                    <td> 
                        '
.$row->msgTime.
                    </td> 
                    <td> 
            '

                if(
$row->empire == 1){ 
                    echo 
'<span style="color:red;">'.htmlspecialchars($row->shout).'</span>'
                } elseif(
$row->empire == 2){ 
                    echo 
'<span style="color:yellow;">'.htmlspecialchars($row->shout).'</span>'
                } elseif(
$row->empire == 3){ 
                    echo 
'<span style="color:blue;">'.htmlspecialchars($row->shout).'</span>'
                } 
            echo 

                    </td> 
                </tr> 
            '

        } 
        echo 
'</table>'
    } else { 
        echo 
"Error connecting to server"
    } 
?>

thx corrected issue
masdenqqq is offline  
Reply


Similar Threads Similar Threads
[HELP] game 2089 GM Private Chat
01/14/2012 - Metin2 Private Server - 5 Replies
Hello, I have a problem with GM's Private Chat; I use 2089 gamefile and the messages sended by GM player, do not arrive to destination. It is a launcher problem? Or what? Thanks for your attention.
Chat game
06/04/2011 - Main - 1 Replies
das ist mein selbstgemachtes chat spiel ihr könnt es jedem veraten . was ihr braucht : einen chat zwei bis unendlich spieler einen master der spielverlauf : der master schreibt fertig danach denkt sich jeder spieler ein wort aus und schreibt es (wichtig niemand soll jetzt schon posten !!! )
i want to change the chat text in game.
03/23/2011 - Archlord - 7 Replies
can anyone explain to me how to change the text in this crap game? :P
[Help]In Game chat images
01/28/2009 - EO PServer Hosting - 2 Replies
Good day, Recently the images for in game chat have gone missing. I'm talking about the images that say legion, whisper, team and so on. Can anyone help me with fixing these issues? Perhaps tell which folder I should be looking in. The images are in the chat folder but they just don't show up in game. Any help is greatly appreciated.
Game Chat
09/21/2008 - General Coding - 3 Replies
Hallo Leute Ich wollte mal fragen ob mir jemand ein Chat programm machen kann das nicht viel res friesst und wo man eine IP bekommt und sich damit einlogen muss.Weil icq ist mir zu verfressen! Sollte auf meinem FTP laufen um history zu speichern!!



All times are GMT +1. The time now is 18:08.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.