In this Tutorial i will explain the basics of how to secure a lava script:
- Lets Remove the Sessions The easiest way of removing the session in lava is to use
session_start();
lets put that at the beginning of every page right after the <?php ok that still dont removes the sessions right? Thats what we do next Wapdesire right from the start checks if a session is already existing in a database we need to delete that and start a new session :
if (isset($_SESSION['sid']))
{
mysql_query("DELETE FROM ibwf_ses WHERE id='$_SESSION[sid]'");
unset($_SESSION['sid']);
}
else
{
$_SESSION['sid'] = $sid;
}
ok now we go to every page again you will note the
$sid = $_GET['sid'];
there we are going to change it to
$sid = $_SESSION['sid'];
after we have done that you can securly remove the &sid=$sid from the links We have just removed the sessions from the url congrats 2. Secure posted data like you might have noted there are a lot of $_GET or $_POST statements lets secure them here is a simple function that will do the job simply put it in core.php
function getget($name, $def = '') {
if (isset($_REQUEST[$name]))
return $_REQUEST[$name];
else
return $def;
}
and instead of $_GET or post we use
$pass = getget('pass', $pass);
$user = getget('user', $user);
for example
- Lets secure the gallery
use phpthumb for gallery simply look in google for phpthumb then in user profiles or in gallery use it the way how to use it is discribed in the phpthumb file
hope this helps you guys
foreach ($_SERVER as $server => $value)
{
echo "$server is $value<br />";
}
