Thanks for your help in the Vol I and Vol II of passing variables. I have put
up a quick little page to show the passing of variables and the correction
suggested here by Pevel. Kalian

http://24.11.192.82/objects/

sometimes seeing the solution is the best way to learn. I am only going to
leave it there for a few days so if it moves feel free to email me.

one last question. Since the object is serialized.... how would you suggest
getting to the next page form an href? I have this little question left from my
built sample




----- Original Message -----
From: "Pavel Kalian" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Php-General (E-mail)" <[EMAIL PROTECTED]>
Sent: Friday, May 11, 2001 12:56 AM
Subject: Re: [PHP] Passing Objects Vol II


In index2.php change the line $myInstance=urldecode (
unserialize($passedClass) ); to $myInstance=unserialize (
urldecode($passedClass) );  and you should be happy... I also assume you
have register_globals turned on in php.ini.

Pavel




----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Php-General (E-mail)" <[EMAIL PROTECTED]>
Sent: Friday, May 11, 2001 4:21 AM
Subject: [PHP] Passing Objects Vol II


> hmm well I tried it.... perhaps another step is in order. Once I can see
it
> work once I will be happy.
>
> //####################
> //   index.php contains:
> //####################
> <pre>
> <?php
>
>   include( "classes.inc" );
>   $myInstance=new Main( $REMOTE_HOST , "nick" , "zzyzx" , true);
>
>   echo $myInstance->client . "\n";
>   echo $myInstance->user . "\n";
>   echo $myInstance->password . "\n";
>   echo $myInstance->allowed . "\n";
>
> ?>
> <a href=" <?php  echo "index2.php?passedClass=" .
> urlencode(serialize($myInstance)) ; ?> "> Test </a>
> </pre>
>
> //####################
> //   index2.php contains:
> //####################
> <pre>
> <?php
>
>   include("classes.inc");
>   $myInstance=urldecode ( unserialize($passedClass) );
>
>   echo $myInstance->client . "\n";
>   echo $myInstance->user . "\n";
>   echo $myInstance->password . "\n";
>   echo $myInstance->allowed . "\n";
>
> ?>
> </pre>
>
> //####################
> //   classes.inc contains:
> //####################
> <?php
> class Main
> {
>
>     var $client;
>     var $user;
>     var $password;
>     var $allowed;
>
>     function Main( $client="0.0.0.0" , $user= "" , $password="" , $allowed
=
> false)
>     {
>         $this->client= $client;
>         $this->user = $user;
>         $this->password = $password;
>         $this->allowed = $allowed;
>     }
>
> }
> ?>
>
>
> //####################
> //   THE MSG I GET
> //####################
>
> Warning:  unserialize() failed at offset 3 of 130 bytes <path to file
here>
> on line 6
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to