Reply to Passing objects form one page to another

Your name:

Reply:


Posted by Marcel on 11/08/06 12:16

Hello all,

Is it possible to transfer objects derived from a class form one page to
another?

I made 2 testscripts:

person.php
-------------------------------------
<?php

class person {

private $_name;

public function setName($name) {

$this->_name = $name;

}

public function getName() {

return $this->_name;

}

}


$p = new person();

$p->setName("Jim");

$safep = urlencode(serialize($p));

header("Location:person2.php?data=".$safep);

exit;

?>


person2.php
---------------------------------
<?php

class person {

private $_name;

public function setName($name) {

$this->_name = $name;

}

public function getName() {

return $this->_name;

}

}

$x = unserialize(urldecode($_GET['data']));

echo $x->getName();

?>

But this does not work for me....

Marcel

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация