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?
| SitePoint Sponsor |

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?

Well, then you would do your database call through your chosen method, i.e.:
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.PHP Code:$result = mysql_query("SELECT id, name FROM myTable");
while ($row = mysql_fetch_array($result)) {
echo '#' . $row['id'] . ': ' . $row['name'] . '<br />';
}
Bookmarks