*a constant parallactic paradox, sublime*

Random and Semi-Worldly

La Tour Eiffel – 23 Shots of…

This slideshow requires JavaScript.

27 Shots of Amsterdam – By Day and Night

“Those who danced were thought to be quite insane by those who could not hear the music.” – Angela Monet

This slideshow requires JavaScript.


This post was originally titled "PHP Developer Essentials" which was what I really wanted to post instead of "PHP Essentials". But as I was at it, I got really bored and I realize, I really just wanted to list all my favorite or let me just say "mostly used" php functions.

But to preserve the efforts, let me just leave what I have already typed here—Creating a session with PHP.

Creating a Session


$login_name = $_POST[‘username’];
$login_password = $_POST[‘password’];
if($login_name==’admin’ && $login_password==’@dm!n’){
   $_SESSION[‘user’] = $_POST[‘username’];
   header("Location: ‘home.html’");
   die("Authentication Failed");

What this simple program does, is get post data from a form that uses the POST method and defined the URL of this code as the form target. The form will look like:

<form action=’login.php’ method=’post’>
Username: <input type=’text’ name=’username’>
Password: <input type=’password’ name=’password’>
<input type=’submit’ value=’Login’>

After retrieving post data, it will validate the user inputs then start a session and store the login data (username) in a session variable called (user). It will then set the window location to the home page using the header() function.