News
Linksys Cisco annoying redirect on WRT54G2
- Details
- Category: Programming
- Published on Tuesday, 11 May 2010 11:46
- Written by Marek
- Hits: 85
http://<yoursite>/basic.htm
Count files in directory
- Details
- Category: Programming
- Published on Sunday, 01 November 2009 15:24
- Written by Marek
- Hits: 80
PHP: Passing objects in sessions
- Details
- Category: Programming
- Published on Saturday, 25 June 2005 06:00
- Written by Marek
- Hits: 167
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];
?>
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
- Details
- Category: Programming
- Published on Saturday, 25 June 2005 06:00
- Written by Marek
- Hits: 161
<?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";
}
?>

