Returning values to client

I understand how to print values to the client side using echo. But how can I return values from the server and receive them on the client side so I can manipulate them?

Not sure what you mean. Do you want to grab information, like from a database, manipulate it and then echo, or do you want to retrieve information so that you can edit it in HTML forms and then save it?

I’d like to reference it back on the client side so I can make another request on the server side

Well, then you would do your database call through your chosen method, i.e.:


$result = mysql_query("SELECT id, name FROM myTable");

while ($row = mysql_fetch_array($result)) {
    echo '#' . $row['id'] . ': ' . $row['name'] . '<br />';
}

Then you just substitute the echo line for your method allowing you to make your second request from the server, like a link or an HTML form.