Web Standards
  Home arrow Web Standards arrow Page 2 - Configuring Servers and Databases with Chr...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WEB STANDARDS

Configuring Servers and Databases with Chrome
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-06-12

    Table of Contents:
  • Configuring Servers and Databases with Chrome
  • The server-side response
  • When Things Go Wrong
  • Adding a Database
  • Creating account tables

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Configuring Servers and Databases with Chrome - The server-side response


    (Page 2 of 5 )

    PHP scripts result in text being returned to a browser in one of two ways:

    1. Any text not bracketed by the PHP directives
      <?phpand?>is passed directly to the browser.
    2. PHP statements within the PHP tags send text to the browser through a function such asecho().

    The parameters sent to a script from a browser’sGETrequest arrive as values in an associative array named$_GET. To assign a PHP variable (a token that begins with$) a parameter from aGETrequest, we would write:

      $myValue = $_GET['keyString']

    For now, our command processor script will presume only valid commands, and compare the command against our temporarily hardcoded strings to return atrueorfalseresponse to the client. We can use any text editor to create the doCommand.php file:

      <?php
      $cmd    = trim($_GET['command']);
      $uName  = trim($_GET['un']);
      $uPass  = trim($_GET['pd']);

      echo check_user($uName,$uPass);

      function check_user($name,$pass) {
        
    if (($name == 'XULuser') &&
             ($pass == 'XULpass'))
             return 'retcode=true';
             else return 'retcode=false'; 
       
    }

      ?>

    Save this file in the Apache document root directory.

    The code illustrates assignment of theGETparameters to global variables. Thetrimfunction takes care of any leading or trailing spaces that may have been entered. The script then passes the username and password to a comparison function that returnstrueorfalse, which is echoed back to the client.

    Repeating the same launch of ournewssearch chrome package will yield the same results with our client-only code, but we are now operating in client/server mode.

    More Web Standards Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "Programming Firefox," published by...
     

    Buy this book now. This article is excerpted from chapter four of Programming Firefox, written by Kenneth C. Feldt (O'Reilly, 2007; ISBN: 0596102437). Check it out today at your favorite bookstore. Buy this book now.

    WEB STANDARDS ARTICLES

    - Completing a Configuration for Chrome and a ...
    - Getting Connected with Firefox and Chrome
    - Configuring Servers and Databases with Chrome
    - Configuring Firefox for Chrome and a Server
    - Designing the Elements of a Web Page
    - Matching div heights with CSS and JavaScript
    - Forms
    - Get Down With Markup
    - If I Said You Had a Beautiful Body...
    - Web Standards in Dreamweaver Part 3
    - Web Standards in Dreamweaver, Part 2
    - Web Forms
    - Making Lists Using XHTML
    - Web Standards in Dreamweaver, Part 1







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek