I've just written the easiest script in the world, but still I can't get it to work, and it's mighty strange. Here's the deal, what I want to do is to use jQuery to catch some input field values and serialize them with jQuery's serialize(); I then send the serialized string to the server to unserialize it. Here's the output I get from the serializing in jQuery, this is what I send to the server.
field1=value1&field2=value2&field3=value3
And here's the function;
public function unserialize_input()
{
$str = $this->input->post("user_values");
$unserialized = unserialize($str);
var_dump($unserialized);
}
as I said, if I go "echo $str;" I get "field1=value1&field2=value2&field3=value3", so the string should be unserializable. How ever, I always get the same error message and the var_dump($unserialized); always returns bool(false);
Here's the error message I get from CodeIgniter, the framework I'm using for PHP.
Severity: Notice
Message: unserialize() [<ahref='function.unserialize'>function.unserialize</a>]: Error at offset 0 of 41 bytes
bool(false)
I'm using MAMP and running this locally at the moment, I read something about magic_quotes_gpc being OFF could cause this locally, but it's enabled. Any idea what might be wrong would be helpful. Thanks.