Monday, June 19, 2006

Session in PHP mystery solved

As the problem that I posted yesterday, I finally found what went wrong in that particular thing. In PHP, wherever page that you need session, session_start() has to be called. This is solved as I include the auth.php in all my pages, yet the main problem of the session variable is the session_register(). The session_register() is used for older version of php (3.0 or below) and what I am using now is php5.1, which supports $_SESSION super variable. When you called your session_register(), the $_SESSION super variable would not work as what you expected. Thus by removing the session_register() and replace it with $_SESSION super variable, and whole things works as what I want. :)

Previous code:


auth.php
<?php
session_start(); //start session when your auto_start_session is 0 (off) in your php.ini
session_register($auth); //register global variable 'auth' into session variable
session_register($username); //register username as session variable too.
?>



Corrected code:


auth.php
<?php
session_start(); //start session when your auto_start_session is 0 (off) in your php.ini
$_SESSION['auth'] = $auth; //register global variable 'auth' into session variable
$_SESSION['username'] = $username; //register username as session variable too.
?>

Sunday, June 18, 2006

Session in PHP

Hmm... whole day of today, I've been playing with the session using PHP. As many of us know that Session handling in ASP.NET using the Microsoft Visual Studio .NET environment was pretty easy as it has a file which you can declare your session variables, and application level variables. In php, it doesn't offer such functions. Thus, all you have to do is create an extra php file and import to every page of your web applications. I was having problem to declaring the Session and retrieve the values from the session variables in the php pages. Hence, I decided to google around and it suggested me to do as below:


auth.php
<?php
session_start(); //start session when your auto_start_session is 0 (off) in your php.ini
session_register($auth); //register global variable 'auth' into session variable
session_register($username); //register username as session variable too.
?>


Well, when I try to access the variable in another page, it does appears to be null. So where have I gone wrong?

Saturday, June 17, 2006

Tokyo Drift

Yo.. Today me and few of my friends purposely went to 1Utama just to catch this movie as the GSC threatres in 1Utama has the THX sorround certified threatres. We love that cinema because it has very spacious seats and the sound system rocks.

We took the Putra LRT from Wangsa Maju to Kelana Jaya to catch the free shuttle that transport us to 1Utama. We wait at there for more than an hour if I've not mistaken because the schedule there says lunch break for half and hour. Why still need to wait for an hour and yet the bus isn't there? Well Rapid KL "rocks" because their schedule is just for display purpose only. XD If you really have rush hour, DON'T EVER TRUST THE SCHEDULE, or you get ourself waiting at the bus station like a fool. XD

Ok, back to the movie. This is the first american racing movie which not all about drag. Finally they understand that power wasn't everything like the previous two of their movie (Fast and Furious & Too Fast Too Furious). The scene where DK drift all the way from the lower level carpark to the rooftop, I like it very much. XD Although is a different type of movie from the InitialD (starring by Jay Chow), yet there is some shadow of it. The scene which the car feel from the top to downhill, and racing between a old car with a newer car. (Although the engine of the old car was from that wrecked Nissan).

Ok, the part that I don't like was about last few minutes of the movie where when both of then drifting, the DK keep banging on the car but still can maintain the stability. It was kinda fake for me, as it was nearly impossible for a car under drift can control their car after hit by another car. Afterall what we expected to see is how crazy their car is modified and the designs. Luckily, it doesn't dissapoint us. For those car modders freak, you can get alots of inspirations from the movie maybe. XD

Hmm... back to life, there is a funny thing about bus shuttle that we took to Kelana Jaya. The bus driver start their engine at the engine placed back of the bus instead of using the ignition in the bus. How advance we are, in Malaysia. Hahaha.... I wonder which place has their bus starts engine at the back rather than using the ignition, other than here. XD

Friday, June 16, 2006

Technical Support that men needs

Dear Tech Support:

Last year I upgraded from Girlfriend 7.0 to Wife 1.0. I soon noticed that the new program began unexpected child processing that took up a lot of space and valuable resources.

In addition, Wife 1.0 installed itself into all other programs and now monitors all other system activity. Applications such as Poker Night 10.3, Football 5.0 , Hunting and Fishing 7.5 , and Racing 3.6.I can't seem to keep Wife 1.0 in the background while attempting to run my favorite applications.

I'm thinking about going back to Girlfriend 7.0, but the uninstall doesn't work on Wife 1.0. Please help!

Thanks,

Troubled User.....

_____________________________________

REPLY:Dear Troubled User:

This is a very common problem that men complain about.Many people upgrade from Girlfriend 7.0 to Wife 1.0, thinking that it is just a Utilities and Entertainment program. Wife 1.0 is an OPERATING SYSTEM and is designed by its Creator to run EVERYTHING!!! It is also impossible to delete Wife 1.0 and to return to Girlfriend 7.0.

It is impossible to uninstall, or purge the program files from the system once installed.You cannot go back to Girlfriend 7.0 because Wife 1.0 is designed to not allow this. Look in your Wife 1.0 manual under Warnings-Alimony/Child Support.

I recommend that you keep Wife 1.0 and work on improving the situation. I suggest installing the background application "Yes Dear" to alleviate software augmentation.The best course of action is to enter the command C:APOLOGIZE! Because ultimately you will have to give the APOLOGIZE command before the system will return to normal anyway.

Wife 1.0 is a great program, but it tends to be very high maintenance. Wife 1.0 comes with several support programs, such as Clean and Sweep 3.0, Cook It 1.5 and Do Bills 4.2.However, be very careful how you use these programs.

Improper use will cause the system to launch the program Nag Nag 9.5. Once this happens, the only way to improve the performance of Wife 1.0 is to purchase additional software. I recommend Flowers 2.1 and Diamonds 5.0!

WARNING!!! DO NOT, under any circumstances, install Secretary With Short Skirt 3.3 . This application is not supported by Wife 1.0 and will cause irreversible damage to the operating system!

Best of luck,

Tech Support

Monday, June 05, 2006

Posting from Microsoft Word 2007 Beta

This post is posted using Microsoft Word 2007 Beta2.