This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| echo <<<__xml | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <me>Hello from {$_SERVER['PHP_SELF']}</me> | |
| __xml; | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>AJAX pull XML Example</title> | |
| <style> | |
| textarea { | |
| outline: none; | |
| resize: none; | |
| width: 400px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>AJAX pull XML Example</title> | |
| <style> | |
| textarea { | |
| outline: none; | |
| resize: none; | |
| width: 400px; | |
| height: 400px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $xml = new DOMDocument(); | |
| $xml->load('cv2.xml'); | |
| if (!$xml->schemaValidate('EuropassSchema.xsd')) { | |
| echo libxml_display_errors(); | |
| } | |
| else { | |
| echo "Document is valid"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| libxml_use_internal_errors(true); | |
| $xml = new XMLReader; | |
| $xml->open('cv2.xml'); | |
| $xml->setSchema('EuropassSchema.xsd'); | |
| while (@$xml->read()) {}; | |
| if (count(libxml_get_errors ())==0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| libxml_use_internal_errors(true); | |
| $xml = new XMLReader; | |
| $xml->open('cv2.xml'); | |
| $xml->setSchema('EuropassSchema.xsd'); | |
| while (@$xml->read()) {}; | |
| if (count(libxml_get_errors ())==0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE IF NOT EXISTS `category` ( | |
| `categoryID` INT NOT NULL AUTO_INCREMENT , | |
| `catName` VARCHAR(48) NOT NULL , | |
| `catParent` INT NOT NULL , | |
| PRIMARY KEY (`categoryID`) ) | |
| ENGINE = InnoDB; | |
| CREATE TABLE IF NOT EXISTS `product` ( | |
| `productID` INT NOT NULL AUTO_INCREMENT , | |
| `prodName` VARCHAR(72) NOT NULL , |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| INSERT INTO `category` (`categoryID`, `catName`, `catParent`) VALUES | |
| (1, 'Kitchen and Home Appliances', 0), | |
| (2, 'Computers and Electronics', 0), | |
| (3, 'Sports and Outdoors', 0), | |
| (4, 'Garden and Outdoors', 0), | |
| (5, 'Irons', 1), | |
| (6, 'Cameras', 2), | |
| (7, 'Toasters', 1), | |
| (8, 'Kettles', 1), | |
| (9, 'Laptops', 2), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function returnTable ($con, $sql, $format, $imgwidth=200) { | |
| $con->query('SET NAMES utf8'); | |
| $result = $con->query($sql); | |
| $table = '<table>'; | |
| $table .= '<tr>'; | |
| foreach($format as $key=>$val) { | |
| $table .= "<th>$val</th>"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function returnTable ($con, $sql, $format) { | |
| $con->query('SET NAMES utf8'); | |
| $result = $con->query($sql); | |
| $table = '<table>'; | |
| $table .= '<tr>'; | |
| foreach($format as $key=>$val) { | |
| $table .= "<th>$val</th>"; |