Jump to content

Recommended Posts

Posted

Hey guys!I`m bored and have nothing to do,so many people have problems with they'r site coding (php) and i wanted to let u know the basics..

First of all , most of it wants a SQL connection.You can create it using this :

<?php
$user = "root"; //Your MySQL user
$pass = "pass"; //Your MySQL Password
$db = "hack"; //Your MySQL database
$host = "localhost"; // Your MySQL address (its as default)
$connection = mysql_connect($host, $user, $pass) or die("Error with MySQL connecting"); // AIO connect
$db = mysql_select_db($db,$connection)or die("Error with MySQL connecting2"); // database connect
$chars="set character set latin1"; //set chars
mysql_query($chars); // mysql query for chars
?>

Its a simple SQL connector.So we are proceeding.. How to read SQL file thru web? Its simple one ,just configurate it by your needs.

But you need a config file like conf.php and including it in each page ,so this file can connect to mysql.

just type

<?php include "FILE.php"; ?> 

So here just change FILE to conf (like i said) and it will include it in each page you write that.

<?php
include "conf.php";

$query="SELECT * FROM reports ORDER by id DESC LIMIT 1"; // Selection of SQL table and column
$result=mysql_query($query); // Getting query
while ( $r = mysql_fetch_array( $result )){ // The result
$some1=$r['some1']; // Description
$some2=$r['some2']; // Description
$some3=$r['some3']; // Description
$some4=$r['some4']; // Description
echo"<br>$some1";
echo "<br>$some2";
echo "<br>$some3";
echo "<br>$some4";
}
?>

Easy one ,Huh?

So enough mysql.. Lets do some other basics.

Like in other sites they have a config.php file.Why do they need it?

I use it to make a called VARS.These are like

 <?php $var1 = "Hello world!I`m php!"; 
echo "$var1"; ?>

$var1 is the displaying text and this after it is the real text.I am using ECHO to get the var into a text.You can do same for other functions ,but this is basic.

Okay a simple protection i`ll post below.Everyone knows what it means and its useful for some pages you don't want users to view.Here is it

<?php
include('conf.php');
session_start();
$name[] = "user1"; $pass[] = "pass1"; // Username for login 1
$name[] = "user2"; $pass[] = "pass2"; // Username for login 2
//You can add as much users you want.

function loginform(){ //The form that unlogged users will use
echo '<fieldset style="padding: 2">';
echo '<legend>Login</legend>';
echo '<form method=post action="?">';
echo 'Name: <input type=text name=username value="' . $_POST[username] . '">'; //The name
echo '<br>';
echo 'Pass: <input type=password name=pass>'; //The password
echo '<br>';
echo '<input type=submit name="s1" value="Login">'; // The submit button
echo '</form>';
echo '</fieldset>';
}


if($_GET['action'] == "logout"){ // Logging out
$_SESSION['loggedin'] = false;
$_SESSION['username'] = "";
}

if($_SESSION['loggedin'] == false){ // Protection from NULL logins
if(!$_POST['s1']){
loginform();
}else{

$tmpname = $_POST['username']; #the username the user has submitted
$tmppass = $_POST['pass']; #the password the user has submitted

$t = count($name); #count the total users
$i = 0;

while($i <= $t){
if($tmpname == $name[$i] && $tmppass == $pass[$i]){ //Checking

$_SESSION['loggedin'] = true;
$_SESSION['username'] = $name[$i];
header('Location: ?'); #reload the page
}
$i++;
}
echo "Your attempt is invalid."; //If something is wrong
loginform(); #show the form
}
die; // if something is wrong , destroy it
}
?>

<center><br>Welcome <?php echo $_SESSION['username']; ?>
<br><a href="?action=logout">Logout</a> . </center>
<br>

I included some other things like Logout and stuff.. So anyway a simple code ,who records all IP's viewed the page you included it.

<?php
$file = fopen('ipadmin.txt', 'a'); // opens ,create a new file with storage
fwrite($file,$_SERVER['REMOTE_ADDR']."\n"); // Ip storing
fclose($file); // Close the file
echo "<br><b>Your ip was stored successfuly.</b>"; // if successful
?>

This will record every IP viewed your page in a file called ipadmin.txt . You can change it ofcourse.

Okay one more script.I called it Redirecting script ,because its redirecting u :D Here it is :

<?php
$url = ''; // ULR GOES HERE EDIT IT!
while (list($var,$val) = each($HTTP_GET_VARS))
$url .= "&$var=$val";
$i = strpos($url, "&url=");
if ($i !== false)
$url = substr($url, $i + 5);
if (substr($url, 0, 4) == "www.") 
$url = "http://" . $url;
print("<html><head><meta http-equiv=refresh content='0;url=$url'></head><body>\n");
print("<table border=0 width=100% height=100%><tr><td><h2 align=center>Currently moving to:<br>\n");
print("$url</h2></td></tr></table></body></html>\n");
?> 

It can be done alot easyer ,but this is with PHP.Html is ALOT easyer.

How to get some info's from another site? Another simple code.

<?php
$url="http://BLABLA.com/INFO.php"; // Edit this link to get the info from.
$string = file_get_contents($url);
$edno=explode('<div align="left">',$string);
$dve=explode('</div></td>',$edno[1]);
echo $dve[0];
?> 

 

Okay i think you learned the basics.. If you wanna just write them to remember them faster lol :D

Lol i`m making this topic about 16 mins :D Anyway thanks for viewing it.

I`ll make an advanced guide after a few days.

Posted

Thanks for the comments guys, i'll continue it on monday because im typing from my iPhone , so cant make it now. I'll create advanced one too, just to come back to home :/ thanks again for comments.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Hi everyone,   I’m currently playing Lineage 2 on the L2Damage server and I’d like to know the current status of botting tools there. With all the server updates and protections, many tools stop working or get detected pretty fast, so I wanted to ask the community:   Is anyone currently using any bot on L2Damage that still works reliably? Have you had any success with tools like Adrenaline, L2Walker, L2Tower, or similar? Any general experience or feedback about what’s still usable on this server?   I know every server has different protections, so any up-to-date info or personal experience would be appreciated.   Thanks in advance.
    • Hey Dexters! Https://lineage2dex.com SKADI server starting TODAY! ✅ On 18:00 (UTC +2) We allow you to login for create character! To restrict your name and transfer ToDs/Starter packs in game. Make it before start! On start, we can have problems with WEB! It is IMPORTANT to prepare everything for starting the game RIGHT NOW, do not postpone for later, during the opening there may be problems with the web part of the project and you simply can not register. ## [ - REGISTRATION AND FILES](https://lineage2dex.com/en/start) ✨ Get a +15% bonus on all TOD orders! The bonus is active until February 1st, 23:00 and also applies to UNION. ✅ What you need to know at the start: ➡️ All Epic Raid Bosses dead on start. Re-spawn time you can check in game ALT+B Raid tab ➡️ All other RBs (for difficult 1 location) alive on server start (including Sub and Nobl RB) ➡️ Max enchant for items +10, this limits will be change with server time ➡️ Difficulty 1 locations are available ➡️ Locations drop Basic and Advanced tier resources, allowing you to craft B and A grade equivalent gear ➡️ School of Dark Arts — PvP zone with x5 drop. Its intance Zone, to enter it you need make TP from GateKeeper. If you will teleport on it by map, you will go on regular zone, not pvp ➡️ Only B-grade equivalent equipment is available for purchase (common, its dont have durability) ➡️ Tier 1 talents are available to learn ➡️ Talent Point Shop is available [ - Roadmap](https://wiki.lineage2dex.com/road-map/en) [ - Basic server description](https://wiki.lineage2dex.com/general-description-skadi-x100/en) Thank you for participating in the beta! All players who spent more than 1 hour on the beta server will receive useful items for autofarming and equipment repair. The rewards will be granted to the first character on the same account that participated in the beta. All items will be placed in the Quest Inventory. Good luck everyone! And have a fun on new Skadi server!
    • ## [1.5.1] - 2026-01-30   ### 🐛 Bug Fixes - **Top Voters**: Top voters list now loads correctly for inactive servers (previously showed "Server not found"). - **View Counter**: Server info page view count now records correctly for inactive servers.   ### 🔄 Improvements - **My Servers – Hide/Active**: The hide/active toggle now works correctly and is only shown when the server is approved (active) by an admin. Owner hide/show is separate from admin status. Toggling no longer causes a full page refresh. - **Accessibility**: Form fields across the site now have proper labels and IDs for screen readers and autofill — server info edit form, add server form, My Servers edit, Admin Panel (Email, Vote System, pricing, filters, logs), and related inputs. ## [1.5.2] - 2026-01-30   ### ✨ New Features - **Server Type**: Replaced the old "Server Options" checkboxes with a single-choice **Server Type** selection: Normal, MultiSkill, GvE, Olympiad, PvP, and Stacksub. Choose one type that best describes your server. - **Server Type in Edit Forms**: You can now change the server type when editing a server — in **My Servers → Edit** and in **Admin Panel → Servers → Edit Server**.   ### 🔄 Improvements - **Sidebar Filters**: Server type filters (MultiSkill, GvE, Olympiad, PvP, Stacksub) are now single-choice — selecting one clears the previous selection. Order updated to: VIP L2 Servers, Low Rate, then the server type options. VIP L2 Servers and Low Rate remain independent toggles. - **Rate Display**: Server rows now show full rate values (e.g. x50000) without truncation. - **My Servers – Edit Modal**: Edit form layout restored with slightly tighter spacing so it fits better on screen.   ### 🗑️ Removed - **International Option**: Removed from the Add Server form; server type options are now simplified.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..