jeboy Posted May 7, 2008 Share Posted May 7, 2008 How can I use an object to another page? This is my code but didn't work: 1st Page $peter = new employee; $peter->setPosition('programmer'); $safePeter = urlencode(serialize($peter)); <a href="url2.php?employee=<?php echo $safePeter; ?>">Next Page</a> 2nd Page $employee = urldecode(unserialize($_GET['employee'])); var_dump($employee); Quote Link to comment Share on other sites More sharing options...
benphp Posted May 7, 2008 Share Posted May 7, 2008 Yer better off using cookies/sessions. Quote Link to comment Share on other sites More sharing options...
jeboy Posted May 7, 2008 Author Share Posted May 7, 2008 Is the class definition needed in the second page? Quote Link to comment Share on other sites More sharing options...
trq Posted May 7, 2008 Share Posted May 7, 2008 Yes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.