Jump to content

[Guide] How to Write PHP Script


EdenEternal

Recommended Posts

Hello Ladies i want to share guide about how to write php script.it's very easy. so let's start. say for example we need top pvp kills script.

first create config.php and write there this:

 

<?php
$L2JBS_config["mysql_host"]="localhost";	// MySQL Host 	["localhost"]
$L2JBS_config["mysql_port"]="3306";		// MySQL Port			["3306"]
$L2JBS_config["mysql_db"]="l2jdb";		// MySQL Database	["l2jdb"]
$L2JBS_config["mysql_login"]="root";		// MySQL User			["root"]	
$L2JBS_config["mysql_password"]="root";	// MySQL Password			["root"]
include("_config_procs.php");
error_reporting(0);
?>

 

now create _config_procs.php

 

<?php
  $link = mysql_connect($L2JBS_config['mysql_host'].":".$L2JBS_config['mysql_port'], $L2JBS_config['mysql_login'], $L2JBS_config['mysql_password']);
  if (!$link)
die("Couldn't connect to MySQL");
  @mysql_select_db($L2JBS_config['mysql_db'], $link);
error_reporting(0);

?>

 

now create toppvp.php and write there this:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>TOP PvP Script By Leki</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<style type="text/css">

<!--

body,td,th {

color: #CCCCCC;

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

}

body {

background-color: #000000;

}

-->

</style>

</head>

<body>

<table style="border: 1px solid; border-color: #444444; background-color:#222222;" align="center" width="100%">

  <tr>

    <th class='Stil7' colspan="5" align="center" width="100%">Top 100 PvP</th>

  </tr>

  <tr>

    <th width="1%" style="border: 1px solid; border-color: #444444; background-color:#222222;">ID</th>

    <th width="10%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Character </th>

    <th width="2%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Level </th>

    <th width="6%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> PvP </th>

    <th width="6%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Status </th>

  </tr>

 

  <?php

require("Config.php");

$activity = mysql_query("MySQL Query");

$i = 1;

 

while($row = mysql_fetch_array($activity))

 

{

if (!($i%2)) echo "<tr bgcolor='#000000' align='center'>";

else

echo "<tr bgcolor='#161616' align='center'>";

echo "<td>"."<center>".$i."</center>"."</td>";

echo "<td>"."<center>".$row['char_name']."</center>"."</td>";

echo "<td>"."<center>".$row['level']."</center>"."</td>";

echo "<td>"."<center>".$row['pvpkills']."</center>"."</td>";

echo "<td>"."<center>".$row['online']."</center>"."</td>";

$i++;

}

?>

</table>

</body>

</html>

 

now we need MySQL query. so open Navicat. go to your database and then open characters table.now click File -> Query Table. Then Query Builder.now we need to select fields. we need 4 field. character name,character object id, character pvpkills , characters level and of course character online status.

So for my database(La2Base Interlude) i have this fields: obj_id,char_name,level,pvpkills,online.

 

when you select your fields, again click on Query Editor. you see your sql script

i have this

 

SELECT

characters.obj_Id,

characters.char_name,

characters.level,

characters.pvpkills,

characters.online

FROM characters

 

now we need to specify now many player must be in top script and how to order.. so add this to your sql script

 

ORDER BY characters.pvpkills DESC LIMIT 10

 

so we have

 

SELECT

characters.obj_Id,

characters.char_name,

characters.level,

characters.pvpkills,

characters.online

FROM characters

ORDER BY characters.pvpkills DESC LIMIT 10

 

so copy and paste in our php script this sql query

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>TOP PvP Script By Leki</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<style type="text/css">

<!--

body,td,th {

color: #CCCCCC;

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

}

body {

background-color: #000000;

}

-->

</style>

</head>

<body>

<table style="border: 1px solid; border-color: #444444; background-color:#222222;" align="center" width="100%">

  <tr>

    <th class='Stil7' colspan="5" align="center" width="100%">Top 100 PvP</th>

  </tr>

  <tr>

    <th width="1%" style="border: 1px solid; border-color: #444444; background-color:#222222;">ID</th>

    <th width="10%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Character </th>

    <th width="2%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Level </th>

    <th width="6%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> PvP </th>

    <th width="6%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Status </th>

  </tr>

 

  <?php

require("Config.php");

$activity = mysql_query("SELECT

characters.obj_Id,

characters.char_name,

characters.level,

characters.pvpkills,

characters.online

FROM characters

ORDER BY characters.pvpkills DESC LIMIT 10");

$i = 1;

 

while($row = mysql_fetch_array($activity))

 

{

if (!($i%2)) echo "<tr bgcolor='#000000' align='center'>";

else

echo "<tr bgcolor='#161616' align='center'>";

echo "<td>"."<center>".$i."</center>"."</td>";

echo "<td>"."<center>".$row['char_name']."</center>"."</td>";

echo "<td>"."<center>".$row['level']."</center>"."</td>";

echo "<td>"."<center>".$row['pvpkills']."</center>"."</td>";

echo "<td>"."<center>".$row['online']."</center>"."</td>";

$i++;

}

?>

</table>

</body>

</html>

 

now we need to discuss online and offline characters yes?

so replace this

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>TOP PvP Script By Leki</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<style type="text/css">

<!--

body,td,th {

color: #CCCCCC;

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

}

body {

background-color: #000000;

}

-->

</style>

</head>

<body>

<table style="border: 1px solid; border-color: #444444; background-color:#222222;" align="center" width="100%">

  <tr>

    <th class='Stil7' colspan="5" align="center" width="100%">Top 100 PvP</th>

  </tr>

  <tr>

    <th width="1%" style="border: 1px solid; border-color: #444444; background-color:#222222;">ID</th>

    <th width="10%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Character </th>

    <th width="2%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Level </th>

    <th width="6%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> PvP </th>

    <th width="6%" style="border: 1px solid; border-color: #444444; background-color:#222222;"> Status </th>

  </tr>

 

  <?php

require("Config.php");

$activity = mysql_query("SELECT

characters.obj_Id,

characters.char_name,

characters.level,

characters.pvpkills,

characters.online

FROM characters

ORDER BY characters.pvpkills DESC LIMIT 10");

$i = 1;

 

while($row = mysql_fetch_array($activity))

 

{

if (!($i%2)) echo "<tr bgcolor='#000000' align='center'>";

else

echo "<tr bgcolor='#161616' align='center'>";

echo "<td>"."<center>".$i."</center>"."</td>";

echo "<td>"."<center>".$row['char_name']."</center>"."</td>";

echo "<td>"."<center>".$row['level']."</center>"."</td>";

echo "<td>"."<center>".$row['pvpkills']."</center>"."</td>";

if ($row['online'] == 1)

echo "<td>"."<center>Online</center>"."</td>";

else

echo "<td>"."<center>Offline</center>"."</td>";

$i++;

}

?>

</table>

</body>

</html>

 

So it's look like this:

 

37668565.png

 

Finish. I think i deserve karma  :P

Link to comment
Share on other sites

Man i think is wrong way to learn How to Write PHP Script.

 

If someone want to write php script let go to php.net to learn the basics for php language and after let read a tutorial for sql language and finaly lets write a php script.

 

This is my opinion...

Link to comment
Share on other sites

  • 2 months later...

damn i know 000000 about this,whaen you say create config.php file,you mean how?Say i create a php file,i add the code in there?What i add to website...I dont undersatnd a thing,if anyone with video guide or else pls post..

Link to comment
Share on other sites

  • 2 weeks later...

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
Reply to this topic...

×   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

    • In every mobius source there should be a readme file with all the links you need (system, client, IDEs etc). Best of luck!
    • I didnt say i dont know anything but i couldnt find a place to start. a guy here mentioned l2jmobius which is a good place to start. so i searched for it and its actually what i wanted. Now i just need to find a clean client to start. I know how to program and how to do changed to client but its hard to find clean clients. I dont really want to make my server exactly like gracia final. I just want to test out the clients and decide which one works better for me. I dont really like the awakening classes and the newest races. Can you please provide me with a couple of links of different clients so i can test them out before i start my project? As i said i cant really find any clean install client. Thank you in advance
    • OUR OFFICIAL WEBSITE / FORUM - MILLENNIUM-HOOK.NET CHEAT DESCRIPTION: Our cheat for Fortnite game has proven itself in the best way among players, the cheat has good optimization, a beautiful visual appearance and has extensive functionality. And reliable protection and HWID Spoofer give our cheat even more advantages over competitors! SUPPORTED ANTI-CHEATS: (read more on official website) - Easy Anti-Cheat (EAC): Undetected & Safe - BattlEye AC: Undetected & Safe - Hyperion AC: Undetected & Safe Our Fortnite cheat has a limited number of slots to ensure greater product security! (Available slots check on official website) FEATURES: AIMBOT: - Aim bone - Silent aim - Smooth - Fov - Distance - Key ESP: - Players - Loot - Vehicles - Traps - Other MISC: - No bloom - No spread - Vehicle flight - Instarevive - Aim while Jumping - Teleport to players within 4m (10m with pickaxe) or teleport downed players to you. - Teleport key - Fov changer REQUIREMENTS: - Included HWID Spoofer: Yes - Stream Bypass: No (Engineering works. Will be available again soon). - Supported game modes: Windowed, Borderless - Supported platforms: Steam / Uplay / Epic Games - Supported CPU: Intel & AMD - Supported OS: Windows 10 (1903,1909,2004,20H2,21H1, 22H2), Windows 11 (All version). Supported OS change and are added periodically. More check on official website.   IN-GAME SCREENSHOTS:   - Check on the official website.
    • OUR OFFICIAL WEBSITE / FORUM - MILLENNIUM-HOOK.NET CHEAT DESCRIPTION: We are offering the best in market Division 2 hacks without detection. If you are wondering where to get the best cheats and hacks for The Division 2, you are at the right place! Our private TD2  hack has been completely undetected since we released it! Also, our cheat has all the most necessary functions such as aimbot, esp, etc. And the limited slots will give even more security to our product. SUPPORTED ANTI-CHEATS: (read more on official website) - Easy Anti-Cheat (EAC): Undetected & Safe - FairFight AC: Undetected & Safe Our The Division 2 cheat has a limited number of slots to ensure greater product security! (Available slots check on official website) FEATURES: AIMBOT: - Enable aim - No recoil - Silent aim - Aim distance - Aim fov - Draw aim fov - Fov change - Weakspot - Aim hitbox - Head - Neck - Chest - Random ESP: - Enable visuals - Enable radar - Skeleton - Weakspot - Pre-rendering - ESP distance - Radar distance - Auto - Enemy - Name - Blacklist - Whitelist - Custom color - Clear whitelist - Clear blacklist MISC: - Auto fire/Triggerbot - Rapid of fire rate - Shotgun of fire rate - Magic bullets - Fast reload - Unlimited ammo - Shoot in safehouse - Accelerate - Noclip REQUIREMENTS: - Included HWID Spoofer: Yes - Stream Bypass: Yes - Supported game modes: Windowed, Borderless - Supported platforms: Steam / Uplay / Epic Games - Supported CPU: Intel & AMD - Supported OS: Windows 10 (1903,1909,2004,20H2,21H1, 22H2), Windows 11 (All version). Supported OS change and are added periodically. More check on official website.   IN-GAME SCREENSHOTS:   - Check on the official website.
    • 50% discount for the next 3 copies Price 150 , will try for test server not guaranteed
  • Topics

×
×
  • Create New...