Cheap Web Hosting for Developers

PHP, MySQL, Java, Unix Cheap Web Hosting

266 CHAPTER 7 SIMPLEXML /* Initial entry

Filed under: PHP and XML — webmaster @ 07:03

266 CHAPTER 7 SIMPLEXML /* Initial entry point so load the PAD template created from DOM */ $sxetemplate = simplexml_load_file($padtemplate); } /* If in working state display the working template for editing or preview */ if (! $bSave) { print ‘

‘; /* Base64-encoded working template to allow XML to be passed in hidden field */ print ‘‘; if (!$bError && isset($_POST[’Preview’])) { /* Working template is valid and in preview mode. Allow additional editing or final Save */ print ‘     ’. ‘‘; print ‘     ’. ‘‘; } print ‘

‘ ; } else { /* Final PAD file has been saved - Just print message */ print “PAD File Saved as $savefile”; } } else { /* Application unable to retrieve the specification file - Error */ print “Unable to load PAD Specification File”; } ?> The important areas to look at within this application are the user variables and the defined functions. The remainder of the application just pieces it all together. You must set three user variables. The default values will work just as well, but you can change them with respect to your current setup. These are the three user variables: $padspec: Location of PAD specification file. By default it pulls from http://www.padspec.org, but you can have it reside locally; in that case, modify the value to point to your local copy. $padtemplate: Location of the PAD template generated by the DOM extension in Chapter 6. $savefile: Location to save the final generated PAD file to when done. The specification file is used in every step of the process, so the first thing the application does is have SimpleXML load it. Initially, none of the POST variables is set, and SimpleXML is

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Cheap Web Hosting services

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by Cheap Web Hosting