Jump to content
  • 0

[HELP] PHP !!


Question

Posted

Kalispera

 

8a i8ela an 3eri kapios na m dosi 1on ena guide pos mporw na sindesw tin db me ta static tou site m opos top pvp /top pk / online player / hero/ olympiad points / castle / Seige Date / Boss Status xwris diskw kai an exei kapios etima na m ta dosi an ginete h na mou dosete na guide pos ta ri8mizw !!!

 

 

12 answers to this question

Recommended Posts

  • 0
Posted

orea, as ipo8esoume oti sta arxeia tou site kaneis ena fakelo /config/ k mesa kaneis ena arxeio stats.php

k mesa grafeis auta:

<?php

   $db_user = "USER"; 
   $db_pass = "PSW"; 
   $db_name = "DATABASE"; 
   $db_serv = "SQL_SERVER"; 

   $res = mysql_connect ( $db_serv, $db_user, $db_pass ) or die ("Coudn't connect to [$db_serv]"); 
   $resdb = mysql_select_db ( "$db_name",$res ); 

   return $res; 

?>

ta siblirwneis opos prepei

eki 8a ine ta info gia na sindeode auta p 8a dixnoun ta stats me tin database

--------------------------------------------------------------------------------------------

meta, se opia selida valeis stats, 8a prepei na exis mesa auto to code(sto top):

<?php include "config/stats.php" ?>

kai auta:

<?php

mysql_connect($db_serv,$db_user,$db_pass) or die(mysql_error());

mysql_select_db($db_name) or die(mysql_error());

 

istera grafeis ti 8eleis na diavazei apo tin database

oriste merika paradeigmata:

//Total Accounts
$query = ("SELECT * FROM accounts WHERE accesslevel>=0");

$result = mysql_query($query) or die(mysql_error());

$acc2=mysql_numrows($result);

//GMs Online
$query = ("SELECT * FROM characters WHERE accesslevel=200 and online=1");

$result = mysql_query($query) or die(mysql_error());

$GM=mysql_numrows($result);

//Online Players
$query = ("SELECT * FROM characters WHERE accesslevel<=0 and online=1");

$result = mysql_query($query) or die(mysql_error());

$online=mysql_numrows($result);

//Total Characters
$query = ("SELECT * FROM characters WHERE accesslevel>=0");

$result = mysql_query($query) or die(mysql_error());

$char2=mysql_numrows($result);

//Total clans
$get_config_data="SELECT clan_id FROM clan_data";

$query = ("SELECT clan_id FROM clan_data WHERE clan_id>0");

$result = mysql_query($query) or die(mysql_error());

$clan2=mysql_numrows($result);

auta p ine stin teleutea seira ka8e code px sto "$clan2=mysql_numrows($result);" to clan2 ine to name m t opio 8a grafete to ka8eti sto file, auto to alazeis an 8es...

telos klineis to code tou connect me:

mysql_close();

mysql_connect($db_serv,$db_user,$db_pass) or die (mysql_error());

mysql_select_db($db_name) or die(mysql_error());
?>

 

k afou ine ola gramena, gia na di3eis px sto site tous total characters grafeis:

Total Characters: <?php print ("$char2"); ?>

(//Total characters(to script) 8a prepei na ine stin idia selida p 8a 8es na t di3eis, an ine alou apla vale eki p 8a ta dixneis ena:

<?php include "ToFilePouTaExeis.php" ?>

 

  • 0
Posted

lipon den skampazo mia apo php files kai tetia 8elo akrivos ayta edo  / top pvp /top pk / online player / hero/ olympiad points / castle / Seige Date / Boss Status / na dixni to site mou XORIS NA EXO DISKW kai den xero pos na to kano lipon mporis na mou ftiaxis gia arxi ena online player na to anixo na do pos to exis ftiaxi mpas kai ta katafero na ftiaxo kai ta ipolipa an den vglao akri kai etc 8a sou kano edo post... ayto ine eykolo na gini?

 

  • 0
Posted

pare gia online players

http://www.4shared.com/file/232887197/ec932b94/web.html

perasta ola mesa st site

ala3e kwdikous klp sto stats.php mesa sto confgi k meta perna t online-players.php opou 8es

an ta exis kanei swsta opou exis valei na dixnei to file 8a s dixnei:

Online Players: 1234  <-----oi online players

 

meta dn 8elei k pl mialo na ala3eis 2-3 pramata gia na dixnei ta hero, boss status ktl...

gia top pvp, pk 8a bei kapws etc

<?php 

function connect() 
{ 
include "config/stats.php";
}

$sexes = array('Male', 'Famale'); 
$online = array('0' => "<font color=#FF0000><b>OFFLINE</b></font>", '1' => "<font color=#035922><b>ONLINE</b></font>");
$klan = array('0' => "No Clan"); 

$FORM = "" ; 
$query_chars = "select char_name,level,sex,classid,pkkills from characters WHERE accesslevel=0 AND pkkills >= 1 order by pkkills desc limit 20;"; 
connect(); 
$link = mysql_query($query_chars); 
$i=1; 
$r=255; 
while ( $row=mysql_fetch_row($link) ) 
{ 
   $timer2=$row[4]/1000;
   $datetime2  = gmstrftime("%d.%m.%Y v %H:%M:%S", $timer2);
   $query = "select classname from char_templates where classid=$row[3]"; 
   $link2 = mysql_query($query); 
   $class = mysql_fetch_row($link2); 

   $FORM .= "<table><tr> 
   <td align=center><font color=#808080><b>  $i.</b></span></td>
   <td align=center><font color=#AE5C08>  $row[0]</td>
   <td align=center><font color=#808080><b>  Sex:</b></td>
   <td align=center><font color=#AE5C08>  ".$sexes[$row[2]]."</font></td>
   <td align=center><font color=#808080><b>  Class:</b></td>
   <td align=center><font color=#AE5C08>  ".$class[0]."</font></td>
   <td align=center><font color=#808080><b>  Pk:</b></td>
   <td class='Stil5' align=center><font color=#CC0099>  $row[4]</font></td><br>
   </tr></table>"; 
   $i++; 
   $r -= 0; 
}  

mysql_close(); 

echo $FORM; 

?>

 

PS: auto ine pio leptomeres, grafei k to filo k tin clan  tou char, to eixa ftia3ei palia k t ekana c/p

 

 

kai gia castle ine xese mesa diadikasia, akoma dn exw sini8isei p0s na to kanw swsta...

  • 0
Posted

Orea Os Edo Kai Kati Last Gia Na Katalavo

Edo ~~~ >    $db_serv = "Edo vazo px tin no-ip pia ip ? :S";

 

Sorry alla sou ipa ime asxetos apo ayta soz gia tin zalada

 

Kai edo pirazo kati Edo ~~~ >  $res = mysql_connect ( $db_serv, $db_user, $db_pass ) or die ("Coudn't connect to [$db_serv]");

   

i edo Edo ~~~ >  $resdb = mysql_select_db ( "$db_name",$res );

  • 0
Posted
  On 3/2/2010 at 4:51 PM, CaLeSty said:

Orea Os Edo Kai Kati Last Gia Na Katalavo

Edo ~~~ >     $db_serv = "Edo vazo px tin no-ip pia ip ? :S";

 

Sorry alla sou ipa ime asxetos apo ayta soz gia tin zalada

 

Kai edo pirazo kati Edo ~~~ >  $res = mysql_connect ( $db_serv, $db_user, $db_pass ) or die ("Coudn't connect to [$db_serv]");

   

i edo Edo ~~~ >  $resdb = mysql_select_db ( "$db_name",$res );

sto $db_serv vazeis tin ip stin opia ine i database, as ine k no-ip

sta ala dn alazeis tpt

 

  Quote

xMrPwN to kaname me tn Calesty kai leei oti dn mporei na mpei stin ip. i ip tou server einai l2insanity.no-ip.org

exete tin port tou mysql (3306) anixti sto router k se exeption (TCP&UDP) sto firewall tou pc?

an nai

veveo8eite oti to user p exete valei den ine grameno stin database ws "localhost"

an nai kante to "%" i kante ena neo user me host "%"

 

PS: %=any host, gia pio sigekrimena an 8elete valte ti dieu8insi tou site sto user

 

 

EDIT: pos epitrepete tetia pramata sto forum??? http://l2insanity.gr/forum/index.php?showtopic=52

=|

  • 0
Posted

Lipon Gia Na Min Pedovo esena kai emena alla kiros esena mporis na knais ena guide na doume pos ginete gia na li8i to 8ema psistovo pos 8a voi8isi kai alla pedia mesa sto forum

 

 

  On 3/2/2010 at 5:57 PM, xMrPwN said:

EDIT: pos epitrepete tetia pramata sto forum??? http://l2insanity.gr/forum/index.php?showtopic=52

=|

li8ike apla mas exoun mamisi me ayta den ta prolavenoume ayto malon tin glitose

 

  • 0
Posted
  On 3/2/2010 at 6:48 PM, CaLeSty said:

Lipon Gia Na Min Pedovo esena kai emena alla kiros esena mporis na knais ena guide na doume pos ginete gia na li8i to 8ema psistovo pos 8a voi8isi kai alla pedia mesa sto forum

 

ebneusmenos ap tin periptosi s ekana ena guide me c/p auta p s eipa prin xP

anyway epd me petixes k se kali dia8esi addare xmrpwn sto skype ;]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • ⚔️ Balance or Power? The community decides!   During spot hunting and battles, the Destroyer (under limits) can wipe out dozens of mobs in seconds, outperforming other classes. A player on Destroyer (with three windows) can monopolize top farming spots solo, while most other classes require additional characters to compete. Result: Resources end up concentrated in the hands of a single player rather than being distributed among multiple participants.   We propose discussing possible changes: Reducing the number of targets the Destroyer can hit under limits. Balancing vampirism by implementing progressive efficiency reduction based on the number of enemies attacked. These changes would preserve the class identity while making PvE more fair for everyone.   🎯 What do you think?
    • Newcomers always raise suspicion. At first, people look at the newcomer cautiously. “Who is this? Where did they come from? Are they here to stay?” That’s just how it is trust isn’t given right away. It’s the same with services, especially when it comes to your accounts, money, and verifications. But the truth is, every major player was once that “newbie” entering the chat. VibeSMS we’re new on the forum, but definitely not new to the game: — Fast and stable SMS verification — Numbers from 68+ countries — Rentals for PayPal, Telegram, Amazon, and dozens of other services — Prices starting at $0.1 per activation or $5–8/month for rental We don’t promise mountains from the sky. We simply make sure the code arrives quickly, and you get what you paid for. No extra words or surprises. Because in the world of SMS verifications, it’s not magic that counts, but reliability consistent speed, transparent pricing, and a service you can depend on every day.
    • sell adena l2rebon signature x1 - 1kk = 1.4 dollars l2reborn x10 - 500kk = 7 dollars E-Global x Lu4 - 1kk = 4 dollars DISCORD - GODDARDSHOP TELEGRAM - MMOPROMO
    • Locked. Not following the rules.
    • Put prices on your first post. Read the rules.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock