J
JRough
By way of explanation, I get a serialized address list output from a
database sent to my local html-javascript client. This is the
string:
file:///Tiger_HD/Library/WebServer/Documents/clientsidepost.html?q=a:4:{i:0;s:49:%2244502%20Loneoak%2C%20Lancaster%2C%20CA%2C%2093534%22;i:1;s:50:%223537%203rd%20St%2C%20Ridgefield%2C%20WA%2C%2098642%22;i:2;s:58:%22931%20Alabama%20St%2C%20san%20francisco%2C%20CA%2C%2094110%22;i:3;s:0:%22%22;}
I want the local html-javascript client form to convert it to a post
and send it to my php server page. The location.search should get the
one parameter,
the q=xxxxxx and put it in the first array index which I named q then
it should post the q value so I now have a post I can use to plot
address points on google maps. I get a response from the php page
but it is not a getting a value for 'q'. I can put the results when I
click submit if you want below or even show you my php page which
works with a get but I need a post because of url length
restrictions. Any help is appreciated,
<html>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>Demo</title>
<script type ="text/javascript">
var gp=new Array();
var loc=location.search;
if (loc){
loc=loc.substring(1);
var parms=loc.split('&');
for(var i=0;i<parms.length;i++){
nameValue=parms.split('=');
gp[nameValue[0]]=unescape(nameValue[1]);
}
}
var q= gp['q'] ;
</script>
</head>
<body onload="
var frm = document.forms['pgform'];
frm.elements['q'].value = q;
document.forms['pgform'].submit();
">
<form name="pgform" action="http://192.168.1.64/pooglemap2.php"
method="post">
Serialized Address List:
<textarea name="q"></textarea>
<script type ="text/javascript">
</script>
<input type="submit" value="show map">
document.write(q.value);
</form>
</body>
</html
--results from php--
( I need the $addr to have the serialized string in it :-(
setAPIKey("ABQIAAAA9Bwvj_jq9ffNHGrXz9VO7xQcgR4zkW-"); $addr = $_POST
['q']; var_dump($addr); echo "adrr" . "\n\n". "
"; $addrDecode =urldecode($addr); $addrArray= unserialize
($addrDecode); var_dump($addrArray); echo "unserialized" . "\n\n"."
"; foreach($addrArray as $key => $value){ $map->addAddress($value); }
$map->printGoogleJS(); ?> showMap(); ?>
database sent to my local html-javascript client. This is the
string:
file:///Tiger_HD/Library/WebServer/Documents/clientsidepost.html?q=a:4:{i:0;s:49:%2244502%20Loneoak%2C%20Lancaster%2C%20CA%2C%2093534%22;i:1;s:50:%223537%203rd%20St%2C%20Ridgefield%2C%20WA%2C%2098642%22;i:2;s:58:%22931%20Alabama%20St%2C%20san%20francisco%2C%20CA%2C%2094110%22;i:3;s:0:%22%22;}
I want the local html-javascript client form to convert it to a post
and send it to my php server page. The location.search should get the
one parameter,
the q=xxxxxx and put it in the first array index which I named q then
it should post the q value so I now have a post I can use to plot
address points on google maps. I get a response from the php page
but it is not a getting a value for 'q'. I can put the results when I
click submit if you want below or even show you my php page which
works with a get but I need a post because of url length
restrictions. Any help is appreciated,
<html>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>Demo</title>
<script type ="text/javascript">
var gp=new Array();
var loc=location.search;
if (loc){
loc=loc.substring(1);
var parms=loc.split('&');
for(var i=0;i<parms.length;i++){
nameValue=parms.split('=');
gp[nameValue[0]]=unescape(nameValue[1]);
}
}
var q= gp['q'] ;
</script>
</head>
<body onload="
var frm = document.forms['pgform'];
frm.elements['q'].value = q;
document.forms['pgform'].submit();
">
<form name="pgform" action="http://192.168.1.64/pooglemap2.php"
method="post">
Serialized Address List:
<textarea name="q"></textarea>
<script type ="text/javascript">
</script>
<input type="submit" value="show map">
document.write(q.value);
</form>
</body>
</html
--results from php--
( I need the $addr to have the serialized string in it :-(
setAPIKey("ABQIAAAA9Bwvj_jq9ffNHGrXz9VO7xQcgR4zkW-"); $addr = $_POST
['q']; var_dump($addr); echo "adrr" . "\n\n". "
"; $addrDecode =urldecode($addr); $addrArray= unserialize
($addrDecode); var_dump($addrArray); echo "unserialized" . "\n\n"."
"; foreach($addrArray as $key => $value){ $map->addAddress($value); }
$map->printGoogleJS(); ?> showMap(); ?>