News

Linksys Cisco annoying redirect on WRT54G2

If you have a WRT54G2 Cisco/Linksys router even with the Cisco Web Assitant disabled you may want to use this link to access your router, otherwise it will just keep redirecting to a website:
http://<yoursite>/basic.htm

Count files in directory

find . -type f |wc -l

PHP: Passing objects in sessions

The objects (arrays, classes and so on) can be passed via session variables, however in a multiserver environment the sessions have to be managed via a database.

Pass the object on first page:

<?php
session_start();

$_SESSION[$theobject] = $myobject;

?>

Receive the object on the second page:

<?php
session_start();
$passedobject=$_SESSION[$theobject];
?>

PHP: Cookies

Create cookie this way:
<?php
setcookie ("CookieName","Value");
//redirect to a main screen
header("Location: main.php");
?>

In the file main.php, test for the value:
<?php
if ($_COOKIE['CookieName'])
{
echo $_COOKIE['CookieName'];
}
else
{
echo "cookie could not be set";
}
?>
Joomla templates by a4joomla