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

    • 🚀 IronLock Shield - Closed Beta Update Hello everyone, Since our first announcement, IronLock Shield has received several major protection upgrades. IronLock Shield is a security platform developed specifically for Lineage II Interlude servers, focused on launcher integrity, runtime protection, session security, and anti-bot hardening. Current protection features: ✓ Secure Launcher Architecture ✓ HWID-Based Licensing ✓ Signed Launcher Session System ✓ Gateway Session Verification ✓ Automatic Session Revoke on Critical Detection ✓ Replay Protection with Nonce Validation ✓ Runtime Integrity Verification ✓ Secure Update System Client-side protections: ✓ Anti-Debug Protection ✓ Anti-Dump Protection ✓ DLL Injection Detection ✓ Manual Map Detection ✓ Remote Thread Detection ✓ Runtime Patch Detection ✓ Suspicious Handle Detection ✓ Memory Read / Write Guard ✓ Strict DLL Hash / Allowlist Control ✓ Launcher Self-Protection ✓ Watchdog Protection Bot and automation hardening: ✓ Adrenaline / Memory Reader Hardening ✓ Runtime Decoy Memory Regions ✓ Fake Pointer-Chain / Offset Noise ✓ Per-Build Mutation System ✓ Pointer Scan Disruption ✓ Virtual Keyboard Input Detection ✓ Hookless Virtual Mouse Click Detection ✓ Raw Input Based Mouse Verification Server and gateway security: ✓ Signed Launcher-to-Server Requests ✓ Build ID Binding ✓ HWID Binding ✓ IP / Session Binding ✓ Expired Session Blocking ✓ Revoked Session Blocking ✓ Gateway Runtime Session Checks ✓ Critical Detection Reporting Panel Recent improvements: ✓ Improved protection against memory-reading bots ✓ Added decoy pointer-chain memory traps ✓ Added per-build mutation data ✓ Added stricter process handle policy ✓ Added hookless virtual mouse click detection ✓ Improved watchdog stability to reduce false positives ✓ Improved session revoke logic for critical detections ✓ Updated website and protection feature list IronLock Shield is currently in closed beta. Selected Lineage II Interlude server owners can receive 1 month of free access in exchange for testing and feedback. Website: https://ilshield.com If you are interested, feel free to send me a private message or contact me through Discord. Thank you.
    • Contacts for communication. Telegram https://t.me/a_dvertising_man Telegram short link @a_dvertising_man   Delta Chat https://i.delta.chat/#11D46642C67CF6BDD4BD6430EB8AE99106CC54D7&v=3&i=u1npSLMZpUfcnWi5FGHNBn-1&s=GjBgI7oXKcuCXGl1acvt0tcp&a=p2norrc0e%40nine.testrun.org&n=advertisingman Hello. I participate in "forum deal" in role middleman. Paid services in graphic design,garant service(https link to profile) is provided only from buyer. Please write me in messenger for contact who are you by nationality and in which country you live.   I will not conduct deals with buyers and sellers from Ukraine. I do not cooperate with country Ukraine. If you Ukrainian by nationality or live in Ukraine,ignore this topic. If you other nationality: paid service from garant service buyer pays using own money.   Garant service(https link to profile) provided only from buyer. Buyer provides address guarantor service(https link to profile) or multiple addresses guarantors services. If seller don't like this garant service address(seller may doubt whether he will receive money from this garant service),then buyer offers another address garant service or multiple addresses guarantors services. If neither address seller doesn't like,then buyer is leaving from me.   Buyer deposits full amount to payment details guarantor service, plus my commission(my percent above amount for service in graphic design). In "forum questionnaire" buyer writes: payment details from seller,payment details seller i will send to buyer in advance via messenger.   Paid creation avatar and banner(price depends from complexity work). Paid creation visuals for music releases,for promo art(price depends from complexity work). Original posters using stock images(price depends from complexity work). Design for social media:covers,previews(price depends from complexity work). Other paid services in graphic design(price depends from complexity work).  
  • 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..