473,322 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Passing objects form one page to another

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
Nov 8 '06 #1
1 2096
Hello Marcel,
Is it possible to transfer objects derived from a class form one page to
another?
Have you tried passing it using session?

--
Binny V A
http://www.bin-co.com/
Nov 8 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rob Meade | last post by:
Hi all, At work we have 2 servers in a cluster for our web apps. One problem we have experienced (along with many others!) - is that if a user is logged into one of the applications on server...
4
by: Jason Us | last post by:
Does anyone have experience with passing variables from an ASP page to a JSP page. The way it currently works in passing the SSN in the URL. This cannot be good. I thought that storing a...
4
by: bateman | last post by:
Hi, I have a rather puzzling problem, have asked the ASP experts at work with no joy and its driving me mad! I'll explain the steps in more detail below but the general problem is I am manually...
2
by: Richard | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** HI, I am working on a project where I need to input data to a (local) HTML page using multiple form elements, such as text,...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
6
by: Garma | last post by:
According to what I have learnt so far, instantiating global objects should be the last resort. Is there any reasons why so? Sometimes some objects or their pointers have to be shared among...
1
by: Iyigun Cevik | last post by:
I'm passing my form to another page by using Server.Transfer method. I wrote readonly properties for each textbox in the first page, and i'm getting values of these textboxes from second page from...
3
by: Lee | last post by:
Hi All How can I pass options from one webpage into another webpage. When the user clicks on the hyperlink I want them to be go to the next page but I need to pass in a number that the next...
1
by: rfr | last post by:
I have a need to use a single version of a Visitor Response Feedback Form on numerous HTML documents. Rather than have numerous versions of this, one on each HTML document, it makes more sense to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.