RE: Passing ARRAY through URL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Help.  I've tried to pass large array through URL but it keep telling
me
> page
> can not be displayed:

If you get "page not found" then it's not an issue with your code. Does
page2.php really exist? What does the URL look like when it says page
cannot be found? Is this a PHP or HTML error that you get?

> <? // page1.php
> $mList = arrary();
		^^^^
assuming this is a typo

> ...    // fill array with values
> $mList = urlencode( serialize( $mList ) );
> header( "location: page2.php?mL=$mList" );

To be entirely correct, it should be "Location" with a capitol L, and a
full URL (not relative) as the address.

> ?>
> 
> <? // page2.php
> $mList = stripslashes( unserialize( $mL ) );

Reverse this. Stripslashes() first, then unserialize(). 

> print_r( $mList );
> ?>

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux