To avoid the common pitfalls in email retrieval, Jochen Staerk discusses how to recieve and process email using
PHP Tutorials
Whether just getting started or an expert, this vast collection of PHP tutorials will help you create dynamic content for powerful web-based applications in no time.
To avoid the common pitfalls in email retrieval, Jochen Staerk discusses how to recieve and process email using
By Justin Grant on July 30, 2000 The Extensible Markup Language is definitely something that most developers will want to add to their toolbox. XML is a W3C standard that is open, language neutral, API-neutral, streamable, textual, human-readable and is a way of bringing structured data to the web. XML…
By Justin Grant on July 30, 2000 Let’s look at the XML document that is parsed by the ‘Newsboy’ class. mynews.xml <?xml version=”1.0″ standalone=”no”?> <!DOCTYPE NewsBoy SYSTEM “NewsBoy.dtd”> <NewsBoy> <story> <date>03/31/2000</date> <slug>Sooo Busy !</slug> <text> I haven’t posted anything here for a while now as I have been busy with…
By Justin Grant on July 30, 2000 Let’s look at the code for the PHP class that actually parses this document. <?php /* NewsBoy: a News system for the web written in PHP by Justin Grant (Web: jusgrant.cjb.net or justin.host.za.net Mail: [email protected]) 25 March V0.0.2 Converted Newsboy to a PHP class, allowing the layout to be easily modified. Also added made the HTML that is genrated a little easier to read. 24 March V0.0.1 Just completed the intial version, very rough and basic. */ class newsboy { var $xml_parser; var $xml_file; var $html; var $open_tag ; var $close_tag ; //Class Constructor function newsboy() { $this->xml_parser = “”; $this->xml_file = “”; $this->html = “”; $this->open_tag = array( //these are the default settings but they are quite easy to modify “NEWSBOY” => “n<!– XML Starts here –>n<TABLE COLS=1 CELLPADDING=5>”, “STORY” => “<TR><TD BGCOLOR=#222222>”, “DATE” => “<FONT COLOR=#BBBB00>”, “SLUG” => “<FONT COLOR=#00AACC><B> ”, “TEXT” => “<FONT COLOR=#AAAAAA>”, “PIC” => “”, “NEWLINE” => “” ); $this->close_tag = array(…
By Justin Grant on July 30, 2000 How do you use this class in a PHP script ? It’s very simple actually. Here is an example: First the class definition needs to be included in the script: require (CLASS_DIR.”class.Newsboy.php”); Then, we create an instance of the class and set the…
By Justin Grant on July 30, 2000 Summary In this brief article we have covered the following in regards to processing XML with PHP: Simple XML document structure defining simple tag definitions for the XML parser setting simple options for the XML parser registering callback functions with the XML parser…
By Justin Grant on July 30, 2000 In the startElement and closeElement (the functions called on an open and close tag, respectively) the corresponding array is queried with the name of the tag used as the index key. If the variable exists with that keyname then the value is retrieved…
By Justin Grant on October 24, 2000 In my last article I covered the use of the expat functions available to PHP for parsing XML documents using the SAX method. The sample code was a class that read the XML document and generated the HTML to present the data in…
By Justin Grant on October 24, 2000 The basic Sablotron extension module functions available to PHP4 are listed and briefly explained below : PHP4 Sablotron extension module v0.21 functions $processor = xslt_create_processor(); Creates and returns an instance of the Sablotron XSLT Processor xslt_destroy_processor($processor); Destroys the specified instance of…