cvs: presentations /slides/intro forms2.xml forms3.xml idea.xml new_apc.xml php5q2.xml sltut_ref.xml syntax.xml tech_bench6.xml ws3.xml ws5.xml

From: Date: Thu, 08 Sep 2005 08:15:09 +0000
Subject: cvs: presentations /slides/intro forms2.xml forms3.xml idea.xml new_apc.xml php5q2.xml sltut_ref.xml syntax.xml tech_bench6.xml ws3.xml ws5.xml
Groups: php.pres 
Request: Send a blank email to pres+get-1177@lists.php.net to get a copy of this message
rasmus Thu Sep 8 04:15:09 2005 EDT Added files: /presentations/slides/intro forms3.xml sltut_ref.xml ws5.xml Modified files: /presentations/slides/intro forms2.xml idea.xml new_apc.xml php5q2.xml syntax.xml tech_bench6.xml ws3.xml Log: A couple of new slides for Sri Lanka talks

http://cvs.php.net/diff.php/presentations/slides/intro/forms2.xml?r1=1.2&r2=1.3&ty=u Index: presentations/slides/intro/forms2.xml diff -u presentations/slides/intro/forms2.xml:1.2 presentations/slides/intro/forms2.xml:1.3 --- presentations/slides/intro/forms2.xml:1.2 Mon Jul 1 04:24:23 2002 +++ presentations/slides/intro/forms2.xml Thu Sep 8 04:15:09 2005 @@ -1,18 +1,11 @@ <slide title="Form Handling"> -<example title="Traditional Form Handling" result="1"><![CDATA[<form action="<?=$PHP_SELF?>" method="POST"> +<example title="Traditional Form Handling" result="1"><![CDATA[<form action="action.php" method="POST"> Your name: <input type=text name=name><br> You age: <input type=text name=age><br> <input type=submit> </form>]]></example> -<example title="Receiving Script" result="1" condition="name"><![CDATA[Hi <?echo $name?>. -You are <?echo $age?> years old.]]></example> +<example title="action.php" result="1" condition="name"><![CDATA[Hi <?php echo $_POST['name']?>. +You are <?php echo $_POST['age']?> years old.]]></example> -<blurb title="Register Globals"> -Some feel that automatically populating the symbol table with user-supplied data can lead -to insecure programs, which to some extent is correct. To combat this the -register_globals setting is off by default in PHP 4.2 and later. -</blurb> -<example><![CDATA[Hi <?echo $_POST['name'] ?>. -You are <?echo $_POST['age'] ?> years old.]]></example> </slide> http://cvs.php.net/diff.php/presentations/slides/intro/idea.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/intro/idea.xml diff -u presentations/slides/intro/idea.xml:1.1 presentations/slides/intro/idea.xml:1.2 --- presentations/slides/intro/idea.xml:1.1 Fri Apr 29 19:18:12 2005 +++ presentations/slides/intro/idea.xml Thu Sep 8 04:15:09 2005 @@ -36,13 +36,14 @@ </blurb> <example type="php" fontsize="1.4em"><![CDATA[<html><body><table> <?php - mysql_connect("host","user","passwd") or die(mysql_error()); - $res = mysql_db_query("my_db","SELECT * FROM my_table") or die(mysql_error()); + mysql_connect('host','user','passwd') or die(mysql_error()); + $res = mysql_db_query('my_db','SELECT * FROM my_table') + or die(mysql_error()); while(($row = mysql_fetch_row($res))) { - echo "<tr>"; + echo '<tr>'; for ($i=0 ; $i < mysql_num_fields($res); $i++) - printf("<td>%s</td>\n",$row[$i]); - echo "</tr>"; + echo "<td>{$row[$i]}</td>\n"; + echo '</tr>'; } ?> </table></body></html>]]></example> http://cvs.php.net/diff.php/presentations/slides/intro/new_apc.xml?r1=1.3&r2=1.4&ty=u Index: presentations/slides/intro/new_apc.xml diff -u presentations/slides/intro/new_apc.xml:1.3 presentations/slides/intro/new_apc.xml:1.4 --- presentations/slides/intro/new_apc.xml:1.3 Fri Apr 29 19:12:30 2005 +++ presentations/slides/intro/new_apc.xml Thu Sep 8 04:15:09 2005 @@ -20,8 +20,9 @@ <!-- Cheating to make sure the slide will work without APC --> <example hide="1" result="1"><![CDATA[<?php $a = array(1,2,3); - echo "<pre>"; var_dump($a); echo "</pre>"; $b = $a; + $a = 0; + echo "<pre>"; var_dump($a); echo "</pre>"; echo "<pre>"; var_dump($b); echo "</pre>"; ?>]]></example> http://cvs.php.net/diff.php/presentations/slides/intro/php5q2.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/intro/php5q2.xml diff -u presentations/slides/intro/php5q2.xml:1.1 presentations/slides/intro/php5q2.xml:1.2 --- presentations/slides/intro/php5q2.xml:1.1 Fri Jan 14 11:12:14 2005 +++ presentations/slides/intro/php5q2.xml Thu Sep 8 04:15:09 2005 @@ -1,18 +1,18 @@ <slide title="PHP5 XML"> -<example title="All XML handling based on libxml2" result="0"><![CDATA[<?php +<example title="All XML handling based on libxml2" result="0" marginright="1em"><![CDATA[<?php $dom = new domDocument; $dom->load('data.xml'); ?>]]></example> -<example title="XSL" result="0"><![CDATA[<?php +<example title="XSL" result="0" marginright="1em"><![CDATA[<?php $domxsl = domDocument::load('stylesheet.xsl'); $proc = new xsltProcessor; $proc->importStyleSheet($domxsl); echo $proc->transformToXML($dom); ?>]]></example> -<example title="XPath" result="0"><![CDATA[<?php +<example title="XPath" result="0" marginright="1em" fontsize="1.8em"><![CDATA[<?php $ctx = new domXPath($dom); $result = $ctx->query( '/breakfast_menu/food[@itemno > 3]/price/text()'); @@ -22,11 +22,49 @@ } ?>]]></example> -<example title="SimpleXML" result="0"><![CDATA[<?php +<example title="SimpleXML" result="0" marginright="1em" fontsize="1.8em"><![CDATA[<?php $menu = simplexml_load_file('menu.xml'); foreach ($menu->food as $item) { echo "{$item->price}\t{$item->name}<br />\n"; } ?>]]></example> +<example title="SimpleXML" result="0" fontsize="1.4em" marginright="1em"><![CDATA[<?xml version="1.0" encoding="ISO-8859-1"?> +<breakfast_menu> + <food> + <name>Belgian Waffles</name> + <price>$5.95</price> + <description>two of our famous Belgian Waffles with + plenty of real maple syrup</description> + <calories>650</calories> + </food> + <food> + <name>Strawberry Belgian Waffles</name> + <price>$7.95</price> + <description>light Belgian waffles covered with strawberries + and whipped cream</description> + <calories>900</calories> + </food> + <food> + <name>Berry-Berry Belgian Waffles</name> + <price>$8.95</price> + <description>light Belgian waffles covered with an assortment of + fresh berries and whipped cream</description> + <calories>900</calories> + </food> + <food> + <name>French Toast</name> + <price>$4.50</price> + <description>thick slices made from our homemade bread</description> + <calories>600</calories> + </food> + <food> + <name>Homestyle Breakfast</name> + <price>$6.95</price> + <description>two eggs, bacon or sausage, toast, and + our ever-popular hash browns</description> + <calories>950</calories> + </food> +</breakfast_menu>]]></example> + </slide> http://cvs.php.net/diff.php/presentations/slides/intro/syntax.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/intro/syntax.xml diff -u presentations/slides/intro/syntax.xml:1.1 presentations/slides/intro/syntax.xml:1.2 --- presentations/slides/intro/syntax.xml:1.1 Sun Jun 30 21:38:36 2002 +++ presentations/slides/intro/syntax.xml Thu Sep 8 04:15:09 2005 @@ -1,5 +1,5 @@ <slide title="Language Syntax"> -<example title="C-Like Syntax" fontsize="1.8em" width="40em"><![CDATA[<? +<example title="C-Like Syntax" fontsize="1.8em" width="50em"><![CDATA[<? for ($loop = -5; $loop < 5; $loop++) { if ($i < 0) { echo "-"; http://cvs.php.net/diff.php/presentations/slides/intro/tech_bench6.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/intro/tech_bench6.xml diff -u presentations/slides/intro/tech_bench6.xml:1.1 presentations/slides/intro/tech_bench6.xml:1.2 --- presentations/slides/intro/tech_bench6.xml:1.1 Fri Jan 14 11:12:15 2005 +++ presentations/slides/intro/tech_bench6.xml Thu Sep 8 04:15:09 2005 @@ -45,6 +45,26 @@ } ?>]]></example> +<example title="Original XSL" fontsize="1.8em"><![CDATA[<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns="http://www.w3.org/TR/xhtml1/strict"> + <xsl:template match="/"> + <xsl:for-each select="breakfast_menu/food"> + <div style="background-color:teal;color:white;padding:4px"> + <span style="font-weight:bold;color:white"> + <xsl:value-of select="name"/> + </span> + - <xsl:value-of select="price"/> + </div> + <div style="margin-left:20px;margin-bottom:1em;font-size:10pt"> + <xsl:value-of select="description"/> + <span style="font-style:italic"> + (<xsl:value-of select="calories"/> calories per serving) + </span> + </div> + </xsl:for-each> + </xsl:template> +</xsl:stylesheet>]]></example> <break lines="1" /> http://cvs.php.net/diff.php/presentations/slides/intro/ws3.xml?r1=1.1&r2=1.2&ty=u Index: presentations/slides/intro/ws3.xml diff -u presentations/slides/intro/ws3.xml:1.1 presentations/slides/intro/ws3.xml:1.2 --- presentations/slides/intro/ws3.xml:1.1 Tue Apr 12 17:39:05 2005 +++ presentations/slides/intro/ws3.xml Thu Sep 8 04:15:09 2005 @@ -37,7 +37,7 @@ fclose($stream); rename($tmpf, $tmp); } -$obj = simplexml_load_file(file_get_contents($tmp)); +$obj = simplexml_load_file($tmp); ?>]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/intro/forms3.xml?r=1.1&p=1 Index: presentations/slides/intro/forms3.xml +++ presentations/slides/intro/forms3.xml <slide title="Form Handling"> <example title="Traditional Form Handling" result="0"><![CDATA[<form action="action.php" method="POST"> Your name: <input type=text name=name><br> You age: <input type=text name=age><br> <input type=submit> </form>]]></example> <example hide="1" result="1"><![CDATA[<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF'])?>" method="POST"> Your name: <input type=text name=name><br> You age: <input type=text name=age><br> <input type=submit> </form>]]></example> <example title="action.php" result="1" condition="name"><![CDATA[<?php $name = htmlspecialchars($_POST['name']); $age = htmlspecialchars($_POST['age']); ?> Hi <?php echo $name ?>. You are <?php echo $age ?> years old.]]></example> </slide> http://cvs.php.net/co.php/presentations/slides/intro/sltut_ref.xml?r=1.1&p=1 Index: presentations/slides/intro/sltut_ref.xml +++ presentations/slides/intro/sltut_ref.xml <slide title="Resources"> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <blurb> </blurb> <link fontsize="3em" marginleft="3em" leader="Slides: " href="http://talks.php.net/sltut"/> <link fontsize="3em" marginleft="3em" leader="APC: " href="http://cvs.php.net/pecl/apc"/> <link fontsize="3em" marginleft="3em" leader="FTC: " href="http://www.ftc.gov/infosecurity/"/> <link fontsize="3em" marginleft="3em" leader="Yahoo: " href="http://developer.yahoo.com/"/> </slide> http://cvs.php.net/co.php/presentations/slides/intro/ws5.xml?r=1.1&p=1 Index: presentations/slides/intro/ws5.xml +++ presentations/slides/intro/ws5.xml <slide title="Flickr API"> <blurb> Flickr also has a REST interface </blurb> <example title="REST Query to get public photos" result="0" fontsize="1em"><![CDATA[http://flickr.com/services/rest/?method=flickr.people.getPublicPhotos&user_id=56053642@N00&api_key=...]]></example> <example title="Returned XML" result="0" fontsize="1.4em"><![CDATA[<?xml version="1.0" encoding="utf-8" ?> <rsp stat="ok"> <photos page="1" pages="1" perpage="100" total="2"> <photo id="39006009" owner="56053642@N00" secret="f2086066d5" server="33" title="IMG_7564.JPG" ispublic="1" isfriend="0" isfamily="0" /> <photo id="39006000" owner="56053642@N00" secret="4ec57bd51f" server="28" title="IMG_7551.JPG" ispublic="1" isfriend="0" isfamily="0" /> </photos> </rsp>]]></example> <example fontsize="1.2em" title="We can parse it like this"><![CDATA[<?php function photo_url($p, $size='s', $ext='jpg') { return "http://photos{$p['server']}.flickr.com/{$p['id']}_{$p['secret']}_{$size}.{$ext}"; } $xml = simplexml_load_file($url); $perpage = $xml->photos['perpage']; $total = $xml->photos['total']; foreach($xml->photos->photo as $photo) { echo '<a href="'.$photo_url($photo.'m').'">'; echo '<img src="'.$photo_url($photo).'" height="75" width="75" />'; echo '<br />'.$photo['title'].'</a><br />'; } ?>]]></example> </slide>
« previous php.pres (#1177) next »