How To make admin page with database


Account Login Details for the Demo page are:
  • User Name: swashata; Password: swashata;OR
  • User Name: admin; Password: admin
If you want to understand the coding behind the login system, then read on below…

#0: Strategy Used behind the Login System:

Here we shall use 5 files for making the whole system.file structure
  • config.php: The main file for holding the information related to the admin MySQL table. We shall discuss in brief how to create the table. For information do check the MySQL posts.
  • admin.php: For administrative functions. It will redirect to login.php if not authorized already;
  • login.php: A webpage for displaying form of login. It will submit the form to check_login.phpwhere it will be processed further;
  • check_login.php: A PHP script to check the login details from the MySQL Table. If successfully matched, then it will register the Session, else will redirect back to the login.php file with error message;
  • logout.php: It will delete the session, and will redirect back to login.php file with success message;

#1: Setting up the MySQL Table:

We shall use a MySQL table like this for storing administrator information:
iduser_nameuser_pass
1adminadmin
2swashataswashata
Basically we shall encrypt the password inside the table. Just for the demonstration I have showed the passwords above…
Now create a Database and inside it create a table login_admin with the following MySQL query command:
?
1
2
3
4
5
6
7
CREATE TABLE login_admin
(
id INT NOT NULL AUTO_INCREMENT,
user_name VARCHAR(100),
user_pass VARCHAR(200),
PRIMARY KEY (id)
)
Now insert the two user information inside the table with the following command:
?
01
02
03
04
05
06
07
08
09
10
11
INSERT INTO login_admin (user_name, user_pass)
VALUES
(
‘swashata’, SHA(‘swashata’)
)
INSERT INTO login_admin (user_name, user_pass)
VALUES
(
‘admin’, SHA(‘admin’)
)
Now your MySQL table is ready for use!

#2: Setting up the config.php file:

As mentioned before, it just contains all the necessary MySQL Database connection information. Here is the code for this file:
?
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
<?php
/**********************************************************************
 *Contains all the basic Configuration
 *dbHost = Host of your MySQL DataBase Server... Usually it is localhost
 *dbUser = Username of your DataBase
 *dbPass = Password of your DataBase
 *dbName = Name of your DataBase
 **********************************************************************/
$dbHost = 'localhost';
$dbUser = 'Data Base User Name';
$dbPass = 'Data Base Password';
$dbName = 'Data Base Name';
$dbC = mysqli_connect($dbHost, $dbUser, $dbPass, $dbName)
        or die('Error Connecting to MySQL DataBase');
?>
Just save this file with the above codes.

#3: Code behind the login.php File:

It shows up the login form and moves it to check_login for further processing!
?
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
<!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" xml:lang="en" lang="en">
<head>
    <title>Login Demo</title>
</head>
<body>
<?php
    $login_form = <<<EOD
<form name="login" id="login" method="POST" action="check_login.php">
<p><label for="username">Please Enter Username: </label><input type="text" size="100" name="username" id="username" value="Enter Username here" /></p>
<p><label for="password">Please Enter Password: </label><input type="password" size="40" name="password" id="password" value="abracadabra" /></p>
<p><input type="submit" name="submit" id="submit" value="Submit"/> <input type="reset" name="reset" id="reset" value="reset"/></p>
</form>
EOD;
$msg = $_GET['msg'];  //GET the message
if($msg!='') echo '<p>'.$msg.'</p>'; //If message is set echo it
echo "<h1>Please enter your Login Information</h1>";
echo $login_form;
?>
</body>
</html>
The $msg variable is used to show any message to the user using GET method.

#4: Code Behind the check_login.php file:

?
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
define(DOC_ROOT,dirname(__FILE__)); // To properly get the config.php file
$username = $_POST['username']; //Set UserName
$password = $_POST['password']; //Set Password
$msg ='';
if(isset($username, $password)) {
    ob_start();
    include(DOC_ROOT.'/config.php'); //Initiate the MySQL connection
    // To protect MySQL injection (more detail about MySQL injection)
    $myusername = stripslashes($username);
    $mypassword = stripslashes($password);
    $myusername = mysqli_real_escape_string($dbC, $myusername);
    $mypassword = mysqli_real_escape_string($dbC, $mypassword);
    $sql="SELECT * FROM login_admin WHERE user_name='$myusername' and user_pass=SHA('$mypassword')";
    $result=mysqli_query($dbC, $sql);
    // Mysql_num_row is counting table row
    $count=mysqli_num_rows($result);
    // If result matched $myusername and $mypassword, table row must be 1 row
    if($count==1){
        // Register $myusername, $mypassword and redirect to file "admin.php"
        session_register("admin");
        session_register("password");
        $_SESSION['name']= $myusername;
        header("location:admin.php");
    }
    else {
        $msg = "Wrong Username or Password. Please retry";
        header("location:login.php?msg=$msg");
    }
    ob_end_flush();
}
else {
    header("location:login.php?msg=Please enter some username and password");
}
?>
As you can see it registers $_SESSION['name'] superglobal variable along with session_register and then redirects to admin.php. Now lets see what the admin.php file has to protect it from unauthorized use! Also note that if username and password do not match, then it redirects back to thelogin.php file with an error $msg.

#5: Code behind admin.php file:

?
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
<?php
session_start(); //Start the session
define(ADMIN,$_SESSION['name']); //Get the user name from the previously registered super global variable
if(!session_is_registered("admin")){ //If session not registered
header("location:login.php"); // Redirect to login.php page
}
else //Continue to current page
header( 'Content-Type: text/html; charset=utf-8' );
?>
<!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" xml:lang="en" lang="en">
<head>
    <title>Welcome To Admin Page Demonstration</title>
</head>
<body>
    <h1>Welcome To Admin Page <?php echo ADMIN /*Echo the username */ ?></h1>
    <p><a href="logout.php">Logout</a></p> <!-- A link for the logout page -->
    <p>Put Admin Contents</p>
</body>
</html>
I have put comments every where! So you will be able to easily understand the code! Basically, here you need to be creative to put the admin contents properly! What ever it is, it will only be shown to authorized users. Also we have set a constant ADMIN to fetch the username from the super global variable $_SESSION[‘name’] and we can echo it where ever we want!

#6: Logging out with logout.php

It is used to destroy the current session. It is very simple!
?
1
2
3
4
5
<?php
session_start(); //Start the current session
session_destroy(); //Destroy it! So we are logged out now
header("location:login.php?msg=Successfully Logged out"); // Move back to login.php with a logout message
?>
Save the file with the above code and you are done!

Adobe After Effects CS6


Adobe After Effects CS6

Crack Release June 2012

Password : faridblaster
This file has been downloaded 84221 times. 



The release of After Effects CS6 is proof that Adobe actually listens to customer requests and stays current with the needs of today’s filmmakers, editors, and motion graphics artists. Beyond this release's impressive list of new features, there are much-needed and long-awaited performance improvements.
Adobe has implemented several structural developments like the new ray-traced 3D rendering engine and Global Performance Cache that it rebuilt from the ground up, providing not only faster performance, but increased professional capabilities. New tools such as the 3D Camera Tracker, Rolling Shutter Repair, and variable mask edge feathering are serious professional compositing tools. The enhanced integration between After Effects CS6 and other Adobe tools makes the workflow faster and more fluid than before.

GREATLY IMPROVED PERFORMANCE

The Global Performance Cache feature is the newfound power under the hood that makes After Effects CS6 perform better even on older Macs. This is a set of technologies that work together: a global RAM cache, a persistent disk cache, and a new graphics pipeline.
The global RAM cache employs reusable frames recognized anywhere on the timeline not just adjacent frames as well as duplicated layers or sub-comps. Cached frames are restored after an Undo/Redo operation, when layers are hidden or revealed, or when timeline settings return to a previous state. The feature allows users to experiment or “nudge” elements without a performance penalty should they change their mind or accidentally hit something that would normally wipe out the RAM preview and force a re-render.


Selecting a dedicated solid state drive (SSD) on your system—whether an internal drive on a tower or an external USB or Thunderbolt drive—to be used as your disk cache, will greatly boost performance without further taxing your system hard drive. Additionally, this cache contains frames from all projects you have opened in the same or earlier sessions, so disk cached frames from one project will be retrieved for reuse in other projects that use those same frames.
After Effects CS6 also better harnesses OpenGL and your video card, resulting in a more responsive and immediate playback of large compositions—especially on larger displays. (Adobe says that earlier tests by Nvidia yielded acceleration by a factor of 1.5 to 2.5 times, with some graphic functions being up to 16 times faster than before.)


NEW 3D EXTRUSIONS, BENDABLE FOOTAGE, AND RAY-TRACING

Adobe has totally reworked the After Effects CS6 3D environment. Text and shape layers can now be extruded with beveled edges, and footage clips, images, and solid layers or even sub-comps can be bent in 3D space. And all 3D objects can interact with each other to cast shadows, reflections, transparency, specular and diffused light, and more. Ray-traced rendering enhances the 3D objects with much more realism than ever before, with environment mapping and light refraction through transparent materials.


While these significant 3D enhancements have been made, it’s clear that Adobe isn’t trying to compete in the 3D modeling or application space. The tools provided only generate some more realistic results without the need to rely on third-party plug-ins for basic animations and motion graphics, but you will still need something like Zaxworks to produce 3D elements featuring bump mapping and sophisticated texturing.
You can’t import 3D models with this release, nor will the Live 3D layers from Photoshop CS5.5 work with this new 3D environment: They never truly worked interactively with other 3D elements in previous versions, so no real loss there. I do wish Adobe would have included at least some simple primitive shape objects to build on.
The ray-tracer replaces the older scanline-based Classic 3D renderer, which supports refined rendering of soft shadows, light falloff, DOF, motion blur, and project through lights. The specular highlights can be intensified and focused on any object, and reflections can display focus and blur for added realism.

8 maut menjelang hari raya


Kemalangan membabitkan dua bas

 satu van di tiga lokasi



KUALA LUMPUR: Lapan maut dan 22 lagi cedera dalam tiga kemalangan berasingan di Lawas, Sarawak; Kinabatangan, Sabah dan Kuala Krai, Kelantan - tragedi yang lazimnya berlaku menjelang Aidilfitri. 


Di Lawas, keriangan membeli-belah pada saat akhir menyambut lebaran buat 12 bersaudara berakhir apabila lima dari mereka maut selepas van sapu yang dinaiki terbabas di Kilometer 5, Jalan Sundar-Trusan, petang kelmarin. 

Mereka yang maut dalam kejadian pada jam 5.50 petang itu, dua beranak, Maria Awang, 37, dan anaknya yang juga pelajar Politeknik Kuching, Khairulnisa Najwa Omar, 18, manakala bapanya, Omar Abdul Rahman, 40, cedera parah dan dirawat di Hospital Queen Elizabeth, Kota Kinabalu.

Turut meninggal dunia akibat kecederaan parah di kepala dan dada ialah pemandu van, Mohammad Tasia, 45, serta dua penumpang lain, Nurzaimah Mohd Taib, 12, dan Nurulhusnah Ezati Imra, 17.

Di Kinabatangan, perjalanan 10 jam untuk pulang ke kampung menyambut Aidilfitri bertukar tragedi dengan tiga penumpang maut, manakala tiga lagi parah apabila bas ekspres dinaiki terbabas dalam kemalangan di Kilometer 121 Jalan Sandakan-Lahad Datu di sini, awal semalam.

Dalam kejadian jam 2.50 pagi itu, pemandu bas ekspres dari Kota Kinabalu ke Tawau itu dipercayai gagal mengawal kenderaannya selepas memintas sebuah kenderaan lain sebelum berpusing beberapa kali lalu terbalik. 
Kemalangan berlaku ketika cuaca hujan dan bas dilaporkan dipandu laju. Bas berkenaan bertolak dari Terminal Bas Bandaraya Utara, Inanam kira-kira jam 8 malam kelmarin dan sepatutnya tiba di Tawau jam 6 pagi.

Ia membawa 31 pelajar Universiti Teknologi Mara (UiTM) cawangan Kota Kinabalu, tujuh orang awam, seorang pemandu dan dua pembantu pemandu.

Mangsa yang maut dikenali sebagai Usman Sulaiman, 46, dari Kampung Sungai Tongkang, Tawau; Jabar Maidin, 54, dan Piyan Ardian Shah Osman, 23. Mayat dihantar ke Hospital Kinabatangan untuk bedah siasat.

Penumpang yang cedera parah dikenali sebagai Freddie Mandalis, 20; Beneditus Pogu, 27; dan Rahamiti Nurdin, 35, yang menerima rawatan di Hospital Duchess Of Kent, Sandakan.

Sementara itu di Kuala Krai, 10 penumpang dan dua pemandu dalam perjalanan dari Kota Bharu ke Gua Musang hampir maut apabila bas dinaiki terbabas dan berpusing tiga kali sebelum jatuh ke tepi cerun, dipercayai untuk mengelak kenderaan pacuan empat roda dari arah bertentangan, semalam.

Dalam kejadian kira-kira jam 7.30 pagi di Kilometer 119, Kota Bharu-Gua Musang, pemandu utama bas berkenaan, Raja Mohd Adli Raja Ibrahim, 38, tercampak keluar, manakala penumpang lain mengalami kecederaan pada bahagian badan, muka serta kaki, dan dikejarkan ke Hospital Kuala Krai.

Difahamkan bas Transnasional berkenaan disewa khas untuk membawa kakitangan awam iaitu Lembaga Kemajuan Kelantan Selatan (KESEDAR), Jabatan Kerja Raya (JKR), dan Agensi Anti Dadah Kebangsaan (AADK) itu bergerak dari Kota Bharu pada jam 5.45 pagi menuju ke Gua Musang.