Open Tech Support
Open Tech Support Archives
Back to HomeCommunityReviewsGuidesDownloadsTech LinksMarketplaceContact Us
 »  SITE NAVIGATION
»  OTS Home
»  OTS Forums
»  OTS Archives

»  About our site
»  Search our site
»  Support our site

»  What is this site?
»  Who are we?
 
 
 »  ADVERTISMENT
 
  Pages: 1

PHP unseriailize() error help request

(Click here to view the original thread with full colors/images)


Posted by: LeGorfou

I have a problem with PHP coding with Mercurybpard which the support forum can't apparently help me with. The folllowing program fragent produces the same error on Solaris and Windows.

Could some one please give me a pointer as to what is wrong.

<?php
error_reporting(E_ALL);$arr = array("5" => "uu1", "12" => "lll2");

$arr[] = "56"; // This is the same as $arr[13] = 56;
// at this point of the script

$arr["x"] = "42"; // This adds a new element to
// the array with key "x"

var_dump($arr);
$arr1 = 'a:37:{s:14:\"admin_incoming\";s:0:\"\";s:14:\"admin_outgoing\";s:0:\"\";s:12:\"attach_types\";a:8:{i:0;s:3:\"jpg\";i:1;s:3:\"gif\";i:2;s:3:\"png\";i:3;s:3:\"bmp\";i:4;s:3:\"zip\";i:5;s:3:\"tgz\";i:6;s:2:\"gz\";i:7;s:3:\"rar\";}s:18:\"attach_upload_size\";i:25600;s:13:\"avatar_height\";i:75;s:18:\"avatar_upload_size\";i:5120;s:12:\"avatar_width\";i:75;s:10:\"banned_ips\";a:0:{}s:17:\"clickable_per_row\";i:3;s:6:\"closed\";b:0;s:10:\"closedtext\";s:80:\"We are upgrading to the latest version of MercuryBoard. Please check back later.\";s:11:\"cookie_path\";s:1:\"/\";s:13:\"cookie_prefix\";s:8:\"mercury_\";s:15:\"emailactivation\";b:0;s:9:\"flash_avs\";b:1;s:10:\"flood_time\";i:30;s:10:\"forum_name\";s:12:\"MercuryBoard\";s:9:\"hot_limit\";i:20;s:12:\"loc_of_board\";s:0:\"\";s:11:\"last_member\";s:0:\"\";s:14:\"last_member_id\";i:0;s:11:\"link_target\";s:6:\"_blank\";s:9:\"logintime\";i:31536000;s:10:\"mailserver\";s:9:\"localhost\";s:8:\"max_load\";d:0;s:7:\"members\";i:0;s:10:\"mostonline\";i:0;s:14:\"mostonlinetime\";i:0;s:13:\"output_buffer\";b:1;s:5:\"posts\";i:0;s:14:\"posts_per_page\";i:15;s:14:\"register_image\";b:0;s:10:\"servertime\";d:-5;s:6:\"topics\";i:0;s:15:\"topics_per_page\";i:20;s:18:\"vote_after_results\";b:0;s:12:\"default_skin\";s:7:\"default\";}';

$ser =serialize($arr1);
echo "<p>";
print_r($ser);
echo "<p>";

$arr3 = unserialize($arr1);
echo "<p>";
var_dump($arr3);
?>












array(4) { [5]=> string(3) "uu1" [12]=> string(4) "lll2" [13]=> string(2) "56" ["x"]=> string(2) "42" }
s:1283:"a:37:{s:14:\"admin_incoming\";s:0:\"\";s:14:\"admin_outgoing\";s:0:\"\";s:12:\"attach_types\";a:8:{i:0;s:3:\"jpg\";i:1;s:3:\"gif\";i:2;s:3:\"png\";i:3;s:3:\"bmp\";i:4;s:3:\"zip\";i:5;s:3:\"tgz\";i:6;s:2:\"gz\";i:7;s:3:\"rar\";}s:18:\"attach_upload_size\";i:25600;s:13:\"avatar_height\";i:75;s:18:\"avatar_upload_size\";i:5120;s:12:\"avatar_width\";i:75;s:10:\"banned_ips\";a:0:{}s:17:\"clickable_per_row\";i:3;s:6:\"closed\";b:0;s:10:\"closedtext\";s:80:\"We are upgrading to the latest version of MercuryBoard. Please check back later.\";s:11:\"cookie_path\";s:1:\"/\";s:13:\"cookie_prefix\";s:8:\"mercury_\";s:15:\"emailactivation\";b:0;s:9:\"flash_avs\";b:1;s:10:\"flood_time\";i:30;s:10:\"forum_name\";s:12:\"MercuryBoard\";s:9:\"hot_limit\";i:20;s:12:\"loc_of_board\";s:0:\"\";s:11:\"last_member\";s:0:\"\";s:14:\"last_member_id\";i:0;s:11:\"link_target\";s:6:\"_blank\";s:9:\"logintime\";i:31536000;s:10:\"mailserver\";s:9:\"localhost\";s:8:\"max_load\";d:0;s:7:\"members\";i:0;s:10:\"mostonline\";i:0;s:14:\"mostonlinetime\";i:0;s:13:\"output_buffer\";b:1;s:5:\"posts\";i:0;s:14:\"posts_per_page\";i:15;s:14:\"register_image\";b:0;s:10:\"servertime\";d:-5;s:6:\"topics\";i:0;s:15:\"topics_per_page\";i:20;s:18:\"vote_after_results\";b:0;s:12:\"default_skin\";s:7:\"default\";}";


Notice: unserialize(): Error at offset 6 of 1283 bytes in e:\apache\htdocs\test.php on line 139


bool(false)




 
Copyright 2000-2008 Open Tech Support.  All Rights Reserved.  Site Design and Development by Tolitz Rosel.