Hi All
I’ve succeeded in writing a cookie and saving form data to it.
Now to read the data back.
I have a PHP file (below) but was wondering how does one return the values in JSON or any other format so that I can populate notifier1?
<?php $email = $_COOKIE['email']; $name = $_COOKIE['name']; $ip = $_COOKIE['ip']; $province = $_COOKIE['province']; $muni = $_COOKIE['muni']; $muni_name = $_COOKIE['muni_name']; $rates_no = $_COOKIE['rates_no']; $mobile_no = $_COOKIE['mobile_no']; $email_ST = $_COOKIE['st']; $node_id = $_COOKIE['node_id']; ?>Usually, I end of a select PHP with this
----------------------------------------------------------
$values = mysqli_query($dbc, “SELECT DISTINCT bus_prof FROM bus_dir”);
$rows = array();
while($r = mysqli_fetch_assoc($values)) {
- $rows = $r;*
}
}
print json_encode($rows);
exit;
?>
--------------------------------------------------------
Im assuming its something similar???
or I thought to populate an array
function dofoo() {
$array["a"] = "Foo";
$array["b"] = "Bar";
$array["c"] = "Baz";
return $array;
}
$foo = dofoo();