I have a list of businesses and owners that I am databasing. I have them listing on a page @ [url]www.richmediaproductions.com/list.php[/url] Is there a way I can have text above the first instance of each that is just a title saying business and member accordingly that will dynamically re-sort my list alphabetically depending on which heading is clicked? By default I have them sorting by company name. I thought it might be possible using javascript? but I’m not sure as I don’t know JS well at all…
@jabezJun 20.2005 — #From Chapter 71 of the php manual.
//QUOTE
5. How can I pass a variable from Javascript to PHP?
Since Javascript is (usually) a client-side technology, and PHP is (usually) a server-side technology, and since HTTP is a "stateless" protocol, the two languages cannot directly share variables.
It is, however, possible to pass variables between the two. One way of accomplishing this is to generate Javascript code with PHP, and have the browser refresh itself, passing specific variables back to the PHP script. The example below shows precisely how to do this -- it allows PHP code to capture screen height and width, something that is normally only possible on the client side.
<?php
if (isset($_GET['width']) AND isset($_GET['height'])) {
// output the geometry variables
echo "Screen width is: ". $_GET['width'] ."<br />n";
echo "Screen height is: ". $_GET['height'] ."<br />n";
} else {
// pass the geometry variables
// (preserve the original query string
// -- post variables will need to handled differently)