i trying use localstorage variable in php function decided use jquery post() so. afterwards, want echo data original file , set inside global variable. have 3 files connect each other (its bit complicated).
quick_match.php
datastring = ""; $.post("ajaxctrl.php", {action: "doquickmatch", numcard: localstorage['numcard'], ui: "<?php echo $_request['ui']; ?>"}, function(data){ datastring = data; }); ajaxctrl.php
if($action == "doquickmatch") { //start quick match $result = $user->getquickmatch($numcard); echo $result; } user.php
(a big query here guarantee works) // perform query $result = mysql_query($query); //hold array objects in string $string = ""; // iterate through results , print while ($row = mysql_fetch_assoc($result)) { $string .= '{ image: \'http://personals.poz.com'.$row['my_photo'].'\', user_id: \''.$row['id'].'\', user_prof: \'http://127.0.0.1/personalz.poz/v2/member.php?username='.$row['id'].'\'};'; } return $string; after of this, i'm supposed use string , split can array , continue on doing. however, callback keeps on returning nothing not sure did wrong. can offer insight please? thank in advance.
Comments
Post a Comment