Jump to content

How to use an object to another page?


jeboy

Recommended Posts

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);

Link to comment
https://forums.phpfreaks.com/topic/104497-how-to-use-an-object-to-another-page/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.