[thelist] passing object vars - php

Simon Watkins handymanorama at gmail.com
Sat May 13 03:32:01 CDT 2006


Hi,

I have a php file from which I need to pass out some variables
(actually an object).

They are being passed to another php file which is generating an image
based on this data.

At the moment I am doing something like:

<?php

$my_inst = new my_obj;
$my_inst -> method1("a", "b", "c");
$my_inst -> method2(1,2,3)
$str = base64_encode(serialize($my_inst));
echo "img src=\"image.php?v=$str\" alt=\"php generated image\"";

?>

and then in the image file:

<?php

$object = unserialize(base64_decode($_GET['v']));

?>

This is working ok but I am new to this sort of stuff and have the
feeling that this is not a particularly effective way of achieving
what I want -
(1) it generates a very long url as the object potentially contains
quite a lot of data.
(2) The image file doesn't really know what sort of object it has.

TIA any pointers,

Simon.



More information about the thelist mailing list