706Part IVConnectionstake advantage of (Free web hosting services) the zippier method, generally

706Part IVConnectionstake advantage of the zippier method, generally without even noticing that they ve had achoice. If not, at least you won t suffer the ignominy of totally locking them out of your site sfunctionality. A perfect example is the double-barreled pull-down menu for site navigation. JavaScript givesyou an instant redirect, whereas PHP provides the same result after a longer wait for thosewithout JavaScript-enabled browsers. This trick takes advantage of the fact that JavaScripthas event handlers (for example, onChange) that work off the structure of HTML forms with- out requiring an actual button-clicking submission. Therefore, the Submit button can bereserved for PHP s use. Listing 38-1 shows an HTML page that uses a JavaScript onChangeredirect and, if that doesn t work, a PHP form handler. Listing 38-1:A JavaScript and PHP navigation form (navigation.html)

The PHP form handler file, called redirect.php, need only have two lines:
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.

Leave a Reply