I have a javascript form that converts an http get to a post. The string before being posted is serialized and I can unserialize it on an on-line tool on the internet:
Here is the url http string:
file:///Tiger_HD/Library/WebServer/Documents/clientsidepost2.html?q=a:3:{i:0;s:49:"44502%20Loneoak%2C%20Lancaster%2C%20CA%2C%2093534";i:1;s:50:"3537%203rd%20St%2C%20Ridgefield%2C%20WA%2C%2098642";i:2;s:58:"931%20Alabama%20St%2C%20san%20francisco%2C%20CA%2C%2094110";}
here is my javascript conversion form:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>Get to Post Proxy</title>
<script type ="text/javascript">
function Get2Post() {
var frm = document.forms['pgform'];
var q = window.location.search.substring(1).split('=');
frm.elements['q'].value = decodeURIComponent(q[1]);
}
window.onload = Get2Post;
</script>
</head>
<body>
<form name="pgform"
action="http://XX.XX.XX.XX/pooglemap2.php"
method="post">
<input type="hidden" name="q">
</form>
</body>
</html>
the php page gets called and the string gets posted and the $addr looks just like the serialized string "q" that was passed:
THis is the beginning of my php code:
$addr = $_POST['q'];
var_dump($addr);
echo "adrr" . "\n\n". "<p>";
$addrArray= unserialize($addr);
var_dump($addrArray);
echo "addArray" . "\n\n"."<p>";
This is the error I get:
string(151) "a:3:{i:0;s:49:"44502 Loneoak, Lancaster, CA, 93534";i:1;s:50:"3537 3rd St, Ridgefield, WA, 98642";i:2;s:58:"931 Alabama St, san francisco, CA, 94110";}" adrr
Notice: unserialize() [function.unserialize]: Error at offset 64 of 151 bytes in /Library/WebServer/Documents/pooglemap2.php on line 14
bool(false) addArray
The problem this serialized string copied from the web browser output doesn't unserialize in the text wizard tool on the web [http://tools.perceptus.ca/text-wiz.php]
It has a problem on offset 64 which may be the second address?
a:3:{i:0;s:49:"44502 Loneoak, Lancaster, CA, 93534";i:1;s:50:"3537 3rd St, Ridgefield, WA, 98642";i:2;s:58:"931 Alabama St, san francisco, CA, 94110";}
What could be happening in the $_POST that messes up the string?It looks exactly the same as the original one that does unserialize?
tia,