Home arrow Web Standards arrow Page 4 - Getting Connected with Firefox and Chrome
WEB STANDARDS

Getting Connected with Firefox and Chrome


In this third part of a four-part article series on configuring Firefox for Chrome and a server, you'll learn how to connect PHP to MySQL, call the MySQLi API, and more. This article is excerpted from chapter four of Programming Firefox, written by Kenneth C. Feldt (O'Reilly, 2007; ISBN: 0596102437). Copyright © 2007 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.

Author Info:
By: O'Reilly Media
Rating: 5 stars5 stars5 stars5 stars5 stars / 4
June 19, 2008
TABLE OF CONTENTS:
  1. · Getting Connected with Firefox and Chrome
  2. · Connecting PHP to MySQL
  3. · Calling the MySQLi API, continued
  4. · Troubleshooting

print this article
SEARCH DEVARTICLES

Getting Connected with Firefox and Chrome - Troubleshooting
(Page 4 of 4 )

 

There are many “moving parts” to this integration involving XUL source, PHP statements, and SQL statements. Most of the problems at this stage will involve either syntax or logic errors with PHP, or problems with the structured SQL statements. These errors can be difficult to track down, but these suggestions may help:

  1. Errors in PHP scripts often result in nothing being displayed on the browser screen. Try using the JavaScriptdumpfunction to unconditionally display the results of theXMLHttpRequest. Then change the PHP script to set a variable such as$returnStringto some suspect variable andechothe variable. If nothing is returned to the JavaScript function, the syntax error occurs prior to theechostatement. Otherwise, we can use the variable to help identify any other syntax errors.
  2. Errors with the SQL statements often involve syntax or an error in setting user privileges. When suspecting such problems, try using the MySQL command-line interface to type in a statement identical to the script-generated code to verify the expected results.
  3. When all else fails, continue to simplify the code (e.g., useSELECT * from tableName) or use PHP stubs to build a string ofdebug tracestatements that end up returned to the JavaScript function.

Serving XUL Files

Sometimes we may want to use a web server to deliver the XUL files. To implement our login user interface by placing the XUL file on our web server, do the following:

  1. Write a source XUL file that will be delivered upon a successful login and place that file along with stylesheets and JavaScript source files on the server.
  2. Configure the server to properly serve a XUL MIME type.
  3. Change the XUL file to a PHP script file.
  4. Add an HTML screen to read the user login and password.
  5. Modify our PHPdoCommandfunction to call the PHP script that delivers the XUL source.

Please check back next week for the conclusion to this article.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
WEB STANDARDS ARTICLES

- Mozilla Popcorn Maker 1.0 Makes Videos More...
- 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

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials