<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CammaBlog &#187; PHP</title>
	<atom:link href="http://www.camma.ch/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.camma.ch</link>
	<description>die Informationsschnippsel-Sammlung eines Streifzugs durch die Weiten des Webs</description>
	<lastBuildDate>Fri, 27 May 2011 04:36:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP: Server-OS ermitteln</title>
		<link>http://www.camma.ch/2010/05/29/php-server-os-ermitteln/</link>
		<comments>http://www.camma.ch/2010/05/29/php-server-os-ermitteln/#comments</comments>
		<pubDate>Sat, 29 May 2010 06:19:55 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.camma.ch/?p=1715</guid>
		<description><![CDATA[Auf meinem Streifzug durchs Web bin ich auf die phpgangsta.de Seite gestossen: www.phpgangsta.de/mit-php-das-server-betriebssystem-erkennen In diesem Beitrag wird detailliert erkl&#228;rt mit welchen Methoden das Server-Betriebssystem ausgelesen werden kann. Related Posts: PHP Shell &#8211; Linux Shell via PHP Script Automatisiertes MySQL Backup Die 10 besten PHP Frameworks PHP Programmierung mit Klassen PHP ausf&#252;hrliches Error Reporting Twitter It!]]></description>
			<content:encoded><![CDATA[<p>Auf meinem Streifzug durchs Web bin ich auf die phpgangsta.de Seite gestossen:</p>
<p><a href="http://www.phpgangsta.de/mit-php-das-server-betriebssystem-erkennen">www.phpgangsta.de/mit-php-das-server-betriebssystem-erkennen</a></p>
<p>In diesem Beitrag wird detailliert erkl&#228;rt mit welchen Methoden das Server-Betriebssystem ausgelesen werden kann.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2009/08/12/php-shell-linux-shell-via-php-script/' title='PHP Shell &#8211; Linux Shell via PHP Script'>PHP Shell &#8211; Linux Shell via PHP Script</a></li>
<li><a href='http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/' title='Automatisiertes MySQL Backup'>Automatisiertes MySQL Backup</a></li>
<li><a href='http://www.camma.ch/2009/04/02/die-10-besten-php-frameworks/' title='Die 10 besten PHP Frameworks'>Die 10 besten PHP Frameworks</a></li>
<li><a href='http://www.camma.ch/2009/02/06/php-programmierung-mit-klassen/' title='PHP Programmierung mit Klassen'>PHP Programmierung mit Klassen</a></li>
<li><a href='http://www.camma.ch/2009/01/29/php-ausfuhrliches-error-reporting/' title='PHP ausf&#252;hrliches Error Reporting'>PHP ausf&#252;hrliches Error Reporting</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=1715&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22PHP%3A%20Server-OS%20ermitteln%22%20http%3A%2F%2Ftinyurl.com%2F37kcub5" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2010/05/29/php-server-os-ermitteln/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Shell &#8211; Linux Shell via PHP Script</title>
		<link>http://www.camma.ch/2009/08/12/php-shell-linux-shell-via-php-script/</link>
		<comments>http://www.camma.ch/2009/08/12/php-shell-linux-shell-via-php-script/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 19:28:08 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Webdesign]]></category>
		<category><![CDATA[Webservice]]></category>

		<guid isPermaLink="false">http://www.camma.ch/?p=1288</guid>
		<description><![CDATA[Heute bin ich per Zufall &#252;ber PHP Shell gestolpert. Bei der PHPShell handelt es sich um ein PHP]Script von Martin Geisler welche Webhosting-Kunden ohne SSH-Zugriff eine Shell-&#196;hnliche Oberfl&#228;che zur Verf&#252;gung stellt. PHP Shell kann unter phpshell.sourceforge.net als .zip oder .tar.bz2 heruntergeladen werden. Die Installation ist denkbar einfach. Es m&#252;ssen die zwei Files phpshell.php und config.php [...]]]></description>
			<content:encoded><![CDATA[<p>Heute bin ich per Zufall &#252;ber PHP Shell gestolpert. Bei der PHPShell handelt es sich um ein PHP]Script von Martin Geisler welche Webhosting-Kunden ohne SSH-Zugriff eine Shell-&#196;hnliche Oberfl&#228;che zur Verf&#252;gung stellt.</p>
<p>PHP Shell kann unter <a href="http://phpshell.sourceforge.net/" target="_blank">phpshell.sourceforge.net</a> als .zip oder .tar.bz2 heruntergeladen werden. Die Installation ist denkbar einfach. Es m&#252;ssen die zwei Files phpshell.php und config.php auf den Webserver &#252;bertragen werden. In der Datei config.php muss ein Benutzer angelegt werden, der auf die PHP Shell Zugriff hat. Um das Passwort des Benutzers zu verschl&#252;sseln, gibt es zus&#228;tzlich die Datei pwhash.php. Die Datei pwhash.php aufrufen, Benutzername und Passwort eingeben und danach diese in die config.php einf&#252;gen.</p>
<div id="attachment_1289" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.camma.ch/wp-content/uploads/2009/08/phpshell_pwhash.png"><img src="http://www.camma.ch/wp-content/uploads/2009/08/phpshell_pwhash-300x172.png" alt="pwhash.php" title="phpshell_pwhash" width="300" height="172" class="size-medium wp-image-1289" /></a><p class="wp-caption-text">pwhash.php</p></div>
<p>Als zus&#228;tzlichen Schutz empfiehlt es sich auf jeden Fall das Verzeichnis in dem sich phpshell befindet mit einem anderen Namen zu benennen sowie per .htaccess vor unbefugtem Zugriff zu sch&#252;tzen.<br />
Genutzt werden k&#246;nnen die meisten nicht-interaktiven Programme, welche auf dem Webserver installiert sind und sich auch mit einer normalen Shell nutzen lie&#223;en. Interaktive Programme, wie Editoren (z.B. vim) k&#246;nnen nicht genutzt werden. Hierf&#252;r gibt es jedoch eine <a href="http://tobias-unger.de/download/" target="_blank">Erweiterung der PHPShell von Tobias Unger</a> welche von seiner Website  <a href="http://tobias-unger.de/download/" target="_blank">downgeloaded</a> werden kann. </p>
<p><a href="http://www.camma.ch/wp-content/uploads/2009/08/phpshell.png"><img src="http://www.camma.ch/wp-content/uploads/2009/08/phpshell-300x265.png" alt="phpshell" title="phpshell" width="300" height="265" class="aligncenter size-medium wp-image-1291" /></a></p>
<p>Wie auf dem PrintScreen oben zu erkennen ist, lassen sich mit PHPShell auch ohne Probleme Shellscripte aufrufen. In diesem Fall ein <a href="http://www.camma.ch/2009/07/21/bash-script-zum-erstellen-eines-file-und-mysql-backup-mit-ftp-upload/" target="_blank">Backupscript</a> das jeden Tag den Webspace auf einen externen FTP Server backupt.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2010/02/27/vertraege-in-der-internetbranche/' title='Vertr&#228;ge in der Internetbranche'>Vertr&#228;ge in der Internetbranche</a></li>
<li><a href='http://www.camma.ch/2009/09/08/htaccess-rewrite-rules/' title='.htaccess ReWrite Rules'>.htaccess ReWrite Rules</a></li>
<li><a href='http://www.camma.ch/2009/09/07/jqtouch-jquery-fuers-iphone/' title='jQTouch, jQuery f&#252;r&#8217;s iPhone'>jQTouch, jQuery f&#252;r&#8217;s iPhone</a></li>
<li><a href='http://www.camma.ch/2009/07/10/browsershots-printscreens-einer-webseite-mit-verschiedenen-browsern/' title='Browsershots &#8211; PrintScreens einer Webseite mit verschiedenen Browsern'>Browsershots &#8211; PrintScreens einer Webseite mit verschiedenen Browsern</a></li>
<li><a href='http://www.camma.ch/2009/01/26/e-mailadressen-verschlusseln/' title='E-Mailadressen verschl&#252;sseln'>E-Mailadressen verschl&#252;sseln</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=1288&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22PHP%20Shell%20-%20Linux%20Shell%20via%20PHP%20Script%22%20http%3A%2F%2Ftinyurl.com%2Fqqzect" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/08/12/php-shell-linux-shell-via-php-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatisiertes MySQL Backup</title>
		<link>http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/</link>
		<comments>http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 04:39:52 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.camma.ch/?p=888</guid>
		<description><![CDATA[Im Moment besch&#228;ftige ich mich mit dem automatisierten Backup von MySQL sowie Webseiteninhalten. Eine M&#246;glichkeit zum Backupen von MySQL DBs ist der MySQL Administrator. Er kann auch automatisiert Backups erstellen. Nachteil dieser L&#246;sung ist, dass ein PC/Mac laufen muss, damit das Backup automatisiert &#252;ber den Cronjob ausgef&#252;hrt wird. Ein MySQL Backup kann jedoch auch &#252;ber [...]]]></description>
			<content:encoded><![CDATA[<p>Im Moment besch&#228;ftige ich mich mit dem automatisierten Backup von MySQL sowie Webseiteninhalten.</p>
<p>Eine M&#246;glichkeit zum Backupen von MySQL DBs ist der MySQL Administrator. Er kann auch automatisiert Backups erstellen. Nachteil dieser L&#246;sung ist, dass ein PC/Mac laufen muss, damit das Backup automatisiert &#252;ber den Cronjob ausgef&#252;hrt wird.</p>
<p>Ein MySQL Backup kann jedoch auch &#252;ber ein Shell Script oder ein PHP Script erstellt werden. Dieses wird dann vom Server mit Cronjob regelm&#228;ssig aufgerufen:</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<a href="http://www.php.net/system"><span style="color: #990000;">system</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; <a href="http://www.php.net/sprintf"><span style="color: #990000;">sprintf</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'mysqldump --opt -h%s -u%s -p&quot;%s&quot; %s | gzip &gt; %s/backup.sql.gz'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$dbhost</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$dbuser</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$dbpwd</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$dbname</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/getenv"><span style="color: #990000;">getenv</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'DOCUMENT_ROOT'</span><span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>Wer es ein wenig detaillierter haben will, findet im <a href="http://www.selfphp.de/kochbuch/kochbuch.php?code=56" target="_blank">selfphp Kochbuch</a> Hilfe.</p>
<p>Ein weiteres sehr gutes Script findet sich bei <a href="http://www.dagondesign.com/articles/automatic-mysql-backup-script/" target="_blank">DragonDesign</a>. Ich werde dieses Backupscript als Grundlage f&#252;r meine Weiterentwicklung gebrauchen.</p>
<p>Folgende Punkte will ich zus&#228;tzlich integrieren:</p>
<ul>
<li>Backup vordefinierter Ordner</li>
<li>Komprimieren des File und MySQL Backups in einem Archiv</li>
<li>Automatisiertes Hochladen des Backups auf einen entfernten FTP Server</li>
</ul>
<p>Je nach dem wie gut mein Hack ist, werde ich das Script danach hier zum Download anbieten.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2009/01/29/php-ausfuhrliches-error-reporting/' title='PHP ausf&#252;hrliches Error Reporting'>PHP ausf&#252;hrliches Error Reporting</a></li>
<li><a href='http://www.camma.ch/2009/01/26/e-mailadressen-verschlusseln/' title='E-Mailadressen verschl&#252;sseln'>E-Mailadressen verschl&#252;sseln</a></li>
<li><a href='http://www.camma.ch/2010/11/17/sql-replace/' title='SQL Replace'>SQL Replace</a></li>
<li><a href='http://www.camma.ch/2010/10/20/perfide-masche-um-ein-trojaner-virus-unter-zu-jubeln/' title='Perfide Masche um ein Trojaner / Virus unter zu jubeln'>Perfide Masche um ein Trojaner / Virus unter zu jubeln</a></li>
<li><a href='http://www.camma.ch/2010/05/29/php-server-os-ermitteln/' title='PHP: Server-OS ermitteln'>PHP: Server-OS ermitteln</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=888&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22Automatisiertes%20MySQL%20Backup%22%20http%3A%2F%2Ftinyurl.com%2Fpe6aav" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Die 10 besten PHP Frameworks</title>
		<link>http://www.camma.ch/2009/04/02/die-10-besten-php-frameworks/</link>
		<comments>http://www.camma.ch/2009/04/02/die-10-besten-php-frameworks/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 20:04:53 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.camma.ch/?p=790</guid>
		<description><![CDATA[In der PHP Zone von DZone wurde heute ein Artikel mit den 10 besten PHP Frameworks ver&#246;ffentlicht. Vorgestellt werden Yii CodeIgniter CakePHP PHPDevShell Akelos Symfony Prado Zend ZooP QPHP Related Posts: PHP: Server-OS ermitteln PHP Shell &#8211; Linux Shell via PHP Script Automatisiertes MySQL Backup PHP Programmierung mit Klassen PHP ausf&#252;hrliches Error Reporting Twitter It!]]></description>
			<content:encoded><![CDATA[<p>In der <a href="http://php.dzone.com/news/top-10-php-frameworks">PHP Zone von DZone</a> wurde heute ein Artikel mit den <a href="http://php.dzone.com/news/top-10-php-frameworks">10 besten PHP Frameworks</a> ver&#246;ffentlicht.</p>
<p>Vorgestellt werden</p>
<ul>
<li><a href="http://www.yiiframework.com/" target="_blank">Yii</a></li>
<li><a href="http://www.codeigniter.com/" target="_blank">CodeIgniter</a></li>
<li><a href="http://www.cakephp.org/" target="_blank">CakePHP</a></li>
<li><a href="http://www.phpdevshell.org/" target="_blank">PHPDevShell</a></li>
<li><a href="http://www.akelos.org/" target="_blank">Akelos</a></li>
<li><a href="http://www.symfony-project.com/" target="_blank">Symfony</a></li>
<li><a href="http://www.pradosoft.com/" target="_blank">Prado</a></li>
<li><a href="http://framework.zend.com/home" target="_blank">Zend</a></li>
<li><a href="http://www.zoopframework.com/" target="_blank">ZooP</a></li>
<li><a href="http://qphp.net/" target="_blank">QPHP</a></li>
</ul>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2010/05/29/php-server-os-ermitteln/' title='PHP: Server-OS ermitteln'>PHP: Server-OS ermitteln</a></li>
<li><a href='http://www.camma.ch/2009/08/12/php-shell-linux-shell-via-php-script/' title='PHP Shell &#8211; Linux Shell via PHP Script'>PHP Shell &#8211; Linux Shell via PHP Script</a></li>
<li><a href='http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/' title='Automatisiertes MySQL Backup'>Automatisiertes MySQL Backup</a></li>
<li><a href='http://www.camma.ch/2009/02/06/php-programmierung-mit-klassen/' title='PHP Programmierung mit Klassen'>PHP Programmierung mit Klassen</a></li>
<li><a href='http://www.camma.ch/2009/01/29/php-ausfuhrliches-error-reporting/' title='PHP ausf&#252;hrliches Error Reporting'>PHP ausf&#252;hrliches Error Reporting</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=790&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22Die%2010%20besten%20PHP%20Frameworks%22%20http%3A%2F%2Ftinyurl.com%2Fpkhrqd" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/04/02/die-10-besten-php-frameworks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Programmierung mit Klassen</title>
		<link>http://www.camma.ch/2009/02/06/php-programmierung-mit-klassen/</link>
		<comments>http://www.camma.ch/2009/02/06/php-programmierung-mit-klassen/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 16:43:02 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.camma.ch/2009/02/06/php-programmierung-mit-klassen/</guid>
		<description><![CDATA[Wer mit PHP programmiert kommt bald einmal nicht um Klassen herum. Eine gute Anleitung wie man Klassen baut, findet sich auf PHP.net Klassen und Objekte mit PHP 5 Related Posts: PHP: Server-OS ermitteln PHP Shell &#8211; Linux Shell via PHP Script Automatisiertes MySQL Backup Die 10 besten PHP Frameworks PHP ausf&#252;hrliches Error Reporting Twitter It!]]></description>
			<content:encoded><![CDATA[<p>Wer mit PHP programmiert kommt bald einmal nicht um Klassen herum. Eine gute Anleitung wie man Klassen baut, findet sich auf PHP.net</p>
<p><a href="http://www.php.net/manual/de/language.oop5.php" target="_blank">Klassen und Objekte mit PHP 5</a></p>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2010/05/29/php-server-os-ermitteln/' title='PHP: Server-OS ermitteln'>PHP: Server-OS ermitteln</a></li>
<li><a href='http://www.camma.ch/2009/08/12/php-shell-linux-shell-via-php-script/' title='PHP Shell &#8211; Linux Shell via PHP Script'>PHP Shell &#8211; Linux Shell via PHP Script</a></li>
<li><a href='http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/' title='Automatisiertes MySQL Backup'>Automatisiertes MySQL Backup</a></li>
<li><a href='http://www.camma.ch/2009/04/02/die-10-besten-php-frameworks/' title='Die 10 besten PHP Frameworks'>Die 10 besten PHP Frameworks</a></li>
<li><a href='http://www.camma.ch/2009/01/29/php-ausfuhrliches-error-reporting/' title='PHP ausf&#252;hrliches Error Reporting'>PHP ausf&#252;hrliches Error Reporting</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=405&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22PHP%20Programmierung%20mit%20Klassen%22%20http%3A%2F%2Ftinyurl.com%2Fpwub3r" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/02/06/php-programmierung-mit-klassen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP ausf&#252;hrliches Error Reporting</title>
		<link>http://www.camma.ch/2009/01/29/php-ausfuhrliches-error-reporting/</link>
		<comments>http://www.camma.ch/2009/01/29/php-ausfuhrliches-error-reporting/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 15:19:25 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Webdesign]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.camma.ch/?p=318</guid>
		<description><![CDATA[Der erste Schritt um eine PHP Anwendung abzusichern ist das aktivieren eines Features zum loggen der Anwendungsfehler. Anwendungsfehler geben oft R&#252;ckschl&#252;sse auf die Angreifbarkeit der Anwendung. Beispiel: Viele der register global &#228;hnlichen Fehler k&#246;nnen einfach entdeckt werden wenn man das Error-Report Level erh&#246;ht. Hier der Code zum dies zu machen: error_reporting&#40;E_ALL &#124; E_STRICT&#41;; &#160; // [...]]]></description>
			<content:encoded><![CDATA[<p>Der erste Schritt um eine PHP Anwendung abzusichern ist das aktivieren eines Features zum loggen der Anwendungsfehler. Anwendungsfehler geben oft R&#252;ckschl&#252;sse auf die Angreifbarkeit der Anwendung.<br />
Beispiel: Viele der register global &#228;hnlichen Fehler k&#246;nnen einfach entdeckt werden wenn man das Error-Report Level erh&#246;ht.</p>
<p>Hier der Code zum dies zu machen:</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.php.net/error_reporting"><span style="color: #990000;">error_reporting</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">E_ALL</span> <span style="color: #339933;">|</span> <span style="color: #009900; font-weight: bold;">E_STRICT</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; <span style="color: #666666; font-style: italic;">// in PHP 4.x E_ALL </span><br />
<a href="http://www.php.net/ini_set"><span style="color: #990000;">ini_set</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;display_errors&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.php.net/ini_set"><span style="color: #990000;">ini_set</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;log_errors&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.php.net/ini_set"><span style="color: #990000;">ini_set</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;error_log&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;/home/user/logs/app_xyz.php.log&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Die erste Linien ist zum aktivieren des Loggings aller Errors. (E_ALL in PHP 4.0 oder E_ALL | E_STRICT in PHP 5.0 and h&#246;her) Sie zeigen alle Warnungen, Fatal Error, und informationen &#252;ber alle nicht initialsierten Variablen. Die zweite Linie deaktivert das zeigen der Fehler.</p>
<p>Um dieses Logging zu aktivieren, muss der obenstehende Code nur in den Kopf der entsprechenden PHP Applikation kopiert werden.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/' title='Automatisiertes MySQL Backup'>Automatisiertes MySQL Backup</a></li>
<li><a href='http://www.camma.ch/2009/01/26/e-mailadressen-verschlusseln/' title='E-Mailadressen verschl&#252;sseln'>E-Mailadressen verschl&#252;sseln</a></li>
<li><a href='http://www.camma.ch/2010/10/20/perfide-masche-um-ein-trojaner-virus-unter-zu-jubeln/' title='Perfide Masche um ein Trojaner / Virus unter zu jubeln'>Perfide Masche um ein Trojaner / Virus unter zu jubeln</a></li>
<li><a href='http://www.camma.ch/2010/05/29/php-server-os-ermitteln/' title='PHP: Server-OS ermitteln'>PHP: Server-OS ermitteln</a></li>
<li><a href='http://www.camma.ch/2010/04/02/cms-made-simple-versionen-in-nagios-monitoren/' title='CMS Made Simple Versionen in Nagios monitoren'>CMS Made Simple Versionen in Nagios monitoren</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=318&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22PHP%20ausf%C3%BChrliches%20Error%20Reporting%22%20http%3A%2F%2Ftinyurl.com%2Fqysmul" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/01/29/php-ausfuhrliches-error-reporting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>E-Mailadressen verschl&#252;sseln</title>
		<link>http://www.camma.ch/2009/01/26/e-mailadressen-verschlusseln/</link>
		<comments>http://www.camma.ch/2009/01/26/e-mailadressen-verschlusseln/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 07:29:56 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Webdesign]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.camma.ch/?p=283</guid>
		<description><![CDATA[Um E-Mailadressen auf Webseiten zu verschl&#252;sseln gibt es verschiedene M&#246;glichkeiten. Eine davon werde ich hier n&#228;her anschauen. Genutzt wird die Methode von mehreren CMS Systemen. Unter anderem auch von Typo3. Sie besteht aus zwei Teilen. Die E-Mailadresse wird mittels PHP verschl&#252;sselt. Mittels JavaScript wird die Adresse beim Klick darauf entschl&#252;sselt und mittels mailto: Link direkt [...]]]></description>
			<content:encoded><![CDATA[<p>Um E-Mailadressen auf Webseiten zu verschl&#252;sseln gibt es verschiedene M&#246;glichkeiten. Eine davon werde ich hier n&#228;her anschauen.</p>
<p>Genutzt wird die Methode von mehreren CMS Systemen. Unter anderem auch von Typo3. Sie besteht aus zwei Teilen. Die E-Mailadresse wird mittels PHP verschl&#252;sselt. Mittels JavaScript wird die Adresse beim Klick darauf entschl&#252;sselt und mittels mailto: Link direkt im Mailprogramm ge&#246;ffnet.</p>
<p>PHP Teil:</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?</span><br />
<span style="color: #000000; font-weight: bold;">function</span> encrypt_email<span style="color: #009900;">&#40;</span><span style="color: #000088;">$addi</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$r</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$addi</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'mailto:'</span><span style="color: #339933;">.</span><span style="color: #000088;">$addi</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <a href="http://www.php.net/strlen"><span style="color: #990000;">strlen</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$addi</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #339933;">++</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$n</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/ord"><span style="color: #990000;">ord</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$addi</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$n</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">8364</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$n</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">128</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$r</span> <span style="color: #339933;">.=</span> <a href="http://www.php.net/chr"><span style="color: #990000;">chr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$n</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;javascript:linkTo_UnCryptMailto('&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$r</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;')&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span> <br />
<br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>Der JavaScript-Teil:</p>
<div class="codecolorer-container javascript mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span> <span style="color: #339933;">&lt;!--</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span> UnCryptMailto<span style="color: #009900;">&#40;</span> s <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> n <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> r <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> s.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n <span style="color: #339933;">=</span> s.<span style="color: #660066;">charCodeAt</span><span style="color: #009900;">&#40;</span> i <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> n <span style="color: #339933;">&gt;=</span> <span style="color: #CC0000;">8364</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n <span style="color: #339933;">=</span> <span style="color: #CC0000;">128</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; r <span style="color: #339933;">+=</span> String.<span style="color: #660066;">fromCharCode</span><span style="color: #009900;">&#40;</span> n <span style="color: #339933;">-</span> <span style="color: #CC0000;">1</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> r<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span> linkTo_UnCryptMailto<span style="color: #009900;">&#40;</span> s <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; location.<span style="color: #660066;">href</span><span style="color: #339933;">=</span>UnCryptMailto<span style="color: #009900;">&#40;</span> s <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #006600; font-style: italic;">// --&gt; </span><br />
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></div>
<p>Der JavaScript Teil wird im Header der Seite eingef&#252;gt.</p>
<p>Die Anwendung:</p>
<div class="codecolorer-container html4strict mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;? echo encrypt_email(&quot;</span>info@example.ch<span style="color: #ff0000;">&quot;); ?&gt;</span></span>&quot;&gt;info auf example punkt ch<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;</span></div></div>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2010/03/03/wordpress-robots-txt-einrichten/' title='Wordpress robots.txt einrichten'>WordPress robots.txt einrichten</a></li>
<li><a href='http://www.camma.ch/2009/08/12/php-shell-linux-shell-via-php-script/' title='PHP Shell &#8211; Linux Shell via PHP Script'>PHP Shell &#8211; Linux Shell via PHP Script</a></li>
<li><a href='http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/' title='Automatisiertes MySQL Backup'>Automatisiertes MySQL Backup</a></li>
<li><a href='http://www.camma.ch/2009/01/29/php-ausfuhrliches-error-reporting/' title='PHP ausf&#252;hrliches Error Reporting'>PHP ausf&#252;hrliches Error Reporting</a></li>
<li><a href='http://www.camma.ch/2009/01/23/php-showcode/' title='PHP ShowCode'>PHP ShowCode</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=283&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22E-Mailadressen%20verschl%C3%BCsseln%22%20http%3A%2F%2Ftinyurl.com%2Fope4n6" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/01/26/e-mailadressen-verschlusseln/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP ShowCode</title>
		<link>http://www.camma.ch/2009/01/23/php-showcode/</link>
		<comments>http://www.camma.ch/2009/01/23/php-showcode/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 05:49:22 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Webdesign]]></category>

		<guid isPermaLink="false">http://www.camma.ch/?p=266</guid>
		<description><![CDATA[Wenn man den Inhalt eines Files oder z.B. den Inhalt eines DB-Memofeldes mit Syntax und Zeilennummern ausgeben will, kann man die Funktion ShowCode verwenden: &#60;? function showCode&#40;$code&#41; &#123; &#160; &#160; $code = highlight_string&#40;$code, true&#41;; &#160; &#160; $code = explode&#40;&#34;&#60;br /&#62;&#34;, $code&#41;; &#160; &#160; &#160; $i = &#34;1&#34;; &#160; &#160; foreach &#40;$code as $line =&#62; $syntax&#41; [...]]]></description>
			<content:encoded><![CDATA[<p>Wenn man den Inhalt eines Files oder z.B. den Inhalt eines DB-Memofeldes mit Syntax und Zeilennummern ausgeben will, kann man die Funktion ShowCode verwenden:</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?</span><br />
<span style="color: #000000; font-weight: bold;">function</span> showCode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$code</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$code</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/highlight_string"><span style="color: #990000;">highlight_string</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$code</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$code</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/explode"><span style="color: #990000;">explode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$code</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<br />
&nbsp; &nbsp; <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$code</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$line</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$syntax</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;font color='black'&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$i</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/font&gt; &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$syntax</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br&gt;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>Die Funktion kann folgendermassen gebraucht werden:</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?</span><br />
<span style="color: #666666; font-style: italic;">// Ausgeben einer Datei</span><br />
showCode<span style="color: #009900;">&#40;</span>openfile<span style="color: #009900;">&#40;</span><span style="color: #000088;">$path</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$file</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// Ausgeben einer Variablen</span><br />
showCode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$inhalt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2009/08/12/php-shell-linux-shell-via-php-script/' title='PHP Shell &#8211; Linux Shell via PHP Script'>PHP Shell &#8211; Linux Shell via PHP Script</a></li>
<li><a href='http://www.camma.ch/2009/01/26/e-mailadressen-verschlusseln/' title='E-Mailadressen verschl&#252;sseln'>E-Mailadressen verschl&#252;sseln</a></li>
<li><a href='http://www.camma.ch/2010/10/18/jquery-iframe-resizing/' title='jQuery iFrame resizing'>jQuery iFrame resizing</a></li>
<li><a href='http://www.camma.ch/2010/06/11/html-newsletter-erstellen/' title='HTML Newsletter erstellen'>HTML Newsletter erstellen</a></li>
<li><a href='http://www.camma.ch/2010/05/29/php-server-os-ermitteln/' title='PHP: Server-OS ermitteln'>PHP: Server-OS ermitteln</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=266&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22PHP%20ShowCode%22%20http%3A%2F%2Ftinyurl.com%2Frba853" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/01/23/php-showcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel 2007 Dokumente aus PHP erzeugen</title>
		<link>http://www.camma.ch/2009/01/20/excel-2007-dokumente-aus-php-erzeugen/</link>
		<comments>http://www.camma.ch/2009/01/20/excel-2007-dokumente-aus-php-erzeugen/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 05:51:46 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Webservice]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.camma.ch/2009/01/20/excel-2007-dokumente-aus-php-erzeugen/</guid>
		<description><![CDATA[Am 5. Januar ist die Version 1.6.5 von PHPExcel erschienen. PHPExcel stellt Klassen zum erzeugen und bearbeiten von Excel-Tabellen bereit. So kann man Zellen mit Werten, Formeln, und Hyperlinks f&#252;llen. Zellen k&#246;nnen benannt und die Schriftart definiert werden. Zudem k&#246;nnen Grafiken platziert werden. Auch ein Passwort Schutz l&#228;sst sich mit PHPExcel erzeugen. Die Tabellen k&#246;nnen [...]]]></description>
			<content:encoded><![CDATA[<p>Am 5. Januar ist die Version 1.6.5 von <a href="http://www.codeplex.com/PHPExcel/Release/ProjectReleases.aspx?ReleaseId=10714" target="_blank">PHPExcel</a> erschienen. <a href="http://www.codeplex.com/PHPExcel/Release/ProjectReleases.aspx?ReleaseId=10714" target="_blank">PHPExcel</a> stellt Klassen zum erzeugen und bearbeiten von Excel-Tabellen bereit. So kann man Zellen mit Werten, Formeln, und Hyperlinks f&#252;llen. Zellen k&#246;nnen benannt und die Schriftart definiert werden. Zudem k&#246;nnen Grafiken platziert werden.</p>
<p>Auch ein Passwort Schutz l&#228;sst sich mit <a href="http://www.codeplex.com/PHPExcel/Release/ProjectReleases.aspx?ReleaseId=10714" target="_blank">PHPExcel</a> erzeugen. Die Tabellen k&#246;nnen mit den entsprechenden Meta-Informationen f&#252;r den Autor, Titel und Beschreibung f&#252;llen.</p>
<p><a href="http://www.codeplex.com/PHPExcel/Release/ProjectReleases.aspx?ReleaseId=10714" target="_blank">Download von PHPExcel</a></p>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2010/05/29/php-server-os-ermitteln/' title='PHP: Server-OS ermitteln'>PHP: Server-OS ermitteln</a></li>
<li><a href='http://www.camma.ch/2009/08/12/php-shell-linux-shell-via-php-script/' title='PHP Shell &#8211; Linux Shell via PHP Script'>PHP Shell &#8211; Linux Shell via PHP Script</a></li>
<li><a href='http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/' title='Automatisiertes MySQL Backup'>Automatisiertes MySQL Backup</a></li>
<li><a href='http://www.camma.ch/2009/04/02/die-10-besten-php-frameworks/' title='Die 10 besten PHP Frameworks'>Die 10 besten PHP Frameworks</a></li>
<li><a href='http://www.camma.ch/2009/02/06/php-programmierung-mit-klassen/' title='PHP Programmierung mit Klassen'>PHP Programmierung mit Klassen</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=226&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22Excel%202007%20Dokumente%20aus%20PHP%20erzeugen%22%20http%3A%2F%2Ftinyurl.com%2Fpzpgyb" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/01/20/excel-2007-dokumente-aus-php-erzeugen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Ordner l&#246;schen</title>
		<link>http://www.camma.ch/2009/01/17/php-ordner-loschen/</link>
		<comments>http://www.camma.ch/2009/01/17/php-ordner-loschen/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 08:06:17 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.camma.ch/?p=179</guid>
		<description><![CDATA[Mit folgender Funktion kann man mit PHP Ordner inkl Inhalt l&#246;schen oder nur den Inhalt eines Ordners l&#246;schen: &#60;? // $dir = the target directory // $DeleteMe = if true delete also $dir, if false leave it alone // // SureRemoveDir('EmptyMe', false); // SureRemoveDir('RemoveMe', true); function SureRemoveDir&#40;$dir, $DeleteMe&#41; &#123; &#160; &#160; if&#40;!$dh = @opendir&#40;$dir&#41;&#41; return; [...]]]></description>
			<content:encoded><![CDATA[<p>Mit folgender Funktion kann man mit PHP Ordner inkl  Inhalt l&#246;schen oder nur den Inhalt eines Ordners l&#246;schen:</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?</span><br />
<span style="color: #666666; font-style: italic;">// $dir = the target directory </span><br />
<span style="color: #666666; font-style: italic;">// $DeleteMe = if true delete also $dir, if false leave it alone </span><br />
<span style="color: #666666; font-style: italic;">// </span><br />
<span style="color: #666666; font-style: italic;">// SureRemoveDir('EmptyMe', false); </span><br />
<span style="color: #666666; font-style: italic;">// SureRemoveDir('RemoveMe', true); </span><br />
<br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> SureRemoveDir<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">,</span> <span style="color: #000088;">$DeleteMe</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$dh</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/opendir"><span style="color: #990000;">opendir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">!==</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$obj</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/readdir"><span style="color: #990000;">readdir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dh</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$obj</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'.'</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$obj</span><span style="color: #339933;">==</span><span style="color: #0000ff;">'..'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!@</span><a href="http://www.php.net/unlink"><span style="color: #990000;">unlink</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$obj</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> SureRemoveDir<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$obj</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <br />
<br />
&nbsp; &nbsp; <a href="http://www.php.net/closedir"><span style="color: #990000;">closedir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dh</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$DeleteMe</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">@</span><a href="http://www.php.net/rmdir"><span style="color: #990000;">rmdir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>gefunden auf <a href="http://www.php.net/function.unlink" target="_blank">php.net</a><br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2010/05/29/php-server-os-ermitteln/' title='PHP: Server-OS ermitteln'>PHP: Server-OS ermitteln</a></li>
<li><a href='http://www.camma.ch/2009/08/12/php-shell-linux-shell-via-php-script/' title='PHP Shell &#8211; Linux Shell via PHP Script'>PHP Shell &#8211; Linux Shell via PHP Script</a></li>
<li><a href='http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/' title='Automatisiertes MySQL Backup'>Automatisiertes MySQL Backup</a></li>
<li><a href='http://www.camma.ch/2009/04/02/die-10-besten-php-frameworks/' title='Die 10 besten PHP Frameworks'>Die 10 besten PHP Frameworks</a></li>
<li><a href='http://www.camma.ch/2009/02/06/php-programmierung-mit-klassen/' title='PHP Programmierung mit Klassen'>PHP Programmierung mit Klassen</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=179&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22PHP%20Ordner%20l%C3%B6schen%22%20http%3A%2F%2Ftinyurl.com%2Fr9btb9" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/01/17/php-ordner-loschen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Debugging mit einer MessageBox</title>
		<link>http://www.camma.ch/2009/01/15/php-debugging-mit-einer-messagebox/</link>
		<comments>http://www.camma.ch/2009/01/15/php-debugging-mit-einer-messagebox/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 18:24:22 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.camma.ch/2009/01/15/php-debugging-mit-einer-messagebox/</guid>
		<description><![CDATA[Vom Job her sch&#228;tze ich die Funktion einer MessageBox um Scripte zu debuggen, bzw zum schauen was zu welcher Zeit in einer Variable ist. Dies habe ich nun nach PHP adaptiert und eine Funktion gebaut die den Inhalt einer Variablen ausgeben kann: &#60;? function mgb &#40;$value&#41; &#123; &#160; &#160; $value = preg_replace&#40;&#34;/\r\n&#124;\r&#124;\n/s&#34;, &#34;\\n&#34;, $value&#41;; ?&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Vom Job her sch&#228;tze ich die Funktion einer MessageBox um Scripte zu debuggen, bzw zum schauen was zu welcher Zeit in einer Variable ist.</p>
<p>Dies habe ich nun nach PHP adaptiert und eine Funktion gebaut die den Inhalt einer Variablen ausgeben kann:</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?</span><br />
<span style="color: #000000; font-weight: bold;">function</span> mgb <span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$value</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>|<span style="color: #000099; font-weight: bold;">\r</span>|<span style="color: #000099; font-weight: bold;">\n</span>/s&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>n&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;&gt;<br />
&nbsp; &nbsp; alert (&quot;<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;);<br />
&nbsp; &nbsp; &lt;/script&gt;<br />
<span style="color: #000000; font-weight: bold;">&lt;?</span><br />
<span style="color: #009900;">&#125;</span> <br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2010/05/29/php-server-os-ermitteln/' title='PHP: Server-OS ermitteln'>PHP: Server-OS ermitteln</a></li>
<li><a href='http://www.camma.ch/2009/08/12/php-shell-linux-shell-via-php-script/' title='PHP Shell &#8211; Linux Shell via PHP Script'>PHP Shell &#8211; Linux Shell via PHP Script</a></li>
<li><a href='http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/' title='Automatisiertes MySQL Backup'>Automatisiertes MySQL Backup</a></li>
<li><a href='http://www.camma.ch/2009/04/02/die-10-besten-php-frameworks/' title='Die 10 besten PHP Frameworks'>Die 10 besten PHP Frameworks</a></li>
<li><a href='http://www.camma.ch/2009/02/06/php-programmierung-mit-klassen/' title='PHP Programmierung mit Klassen'>PHP Programmierung mit Klassen</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=174&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22PHP%20Debugging%20mit%20einer%20MessageBox%22%20http%3A%2F%2Ftinyurl.com%2Fojv2c8" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/01/15/php-debugging-mit-einer-messagebox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Umlaute in der PHP mail() Funktion</title>
		<link>http://www.camma.ch/2009/01/08/umlaute-in-der-php-mail-funktion/</link>
		<comments>http://www.camma.ch/2009/01/08/umlaute-in-der-php-mail-funktion/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 06:47:50 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[mail()]]></category>

		<guid isPermaLink="false">http://blog.blattertech.ch/?p=95</guid>
		<description><![CDATA[Dieses Problem kennen wahrscheinlich die meisten Benutzer welche die mail() Funktion von PHP benutzen und das Subject im Formular definieren lassen, bzw als Absendernamen einen Namen mit Umlauten benutzen m&#246;chten. Mit diesem Code kann die mail() Funktion mit Umlauten umgehen: &#60;?php $From = &#34;J&#252;rgen M&#252;sterm&#228;n &#34;; $Subject = &#34;Viele Umlaute: &#228;&#246;&#252; und ein &#223; nat&#252;rlich!&#34;; [...]]]></description>
			<content:encoded><![CDATA[<p>Dieses Problem kennen wahrscheinlich die meisten Benutzer welche die mail() Funktion von PHP benutzen und das Subject im Formular definieren lassen, bzw als Absendernamen einen Namen mit Umlauten benutzen m&#246;chten.</p>
<p>Mit diesem Code kann die mail() Funktion mit Umlauten umgehen:</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <br />
<span style="color: #000088;">$From</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Jürgen Müstermän &quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$Subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Viele Umlaute: äöü und ein ß natürlich!&quot;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$header</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;MIME-Version: 1.0<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$header</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;From: =?ISO-8895-15?Q?&quot;</span><span style="color: #339933;">.</span><a href="http://www.php.net/imap_8bit"><span style="color: #990000;">imap_8bit</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$From</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;?=<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<br />
<a href="http://www.php.net/mail"><span style="color: #990000;">mail</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test@test.net&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;=?ISO-8859-15?Q?&quot;</span><span style="color: #339933;">.</span><a href="http://www.php.net/imap_8bit"><span style="color: #990000;">imap_8bit</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$Subject</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;?=<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$body</span>,<span style="color: #006699; font-weight: bold;">$headers</span>);<br />
?&gt;</span></div></div>
<p>Wenn in PHP das IMAP Modul nicht enigebaut ist, funktioniert die PHP Funktion &#8220;imap_8bit&#8221; nicht. Deshalb empfehle ich an dieser Stelle als Ersatz diese Funktion:</p>
<div class="codecolorer-container php mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000000; font-weight: bold;">function</span> quoted_printable_encode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sText</span><span style="color: #339933;">,</span><span style="color: #000088;">$bEmulate_imap_8bit</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #666666; font-style: italic;">// split text into lines</span><br />
<span style="color: #000088;">$aLines</span><span style="color: #339933;">=</span><a href="http://www.php.net/explode"><span style="color: #990000;">explode</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/chr"><span style="color: #990000;">chr</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">13</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><a href="http://www.php.net/chr"><span style="color: #990000;">chr</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$sText</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$i</span><br />
<span style="color: #000088;">$sLine</span> <span style="color: #339933;">=&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$aLines</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/strlen"><span style="color: #990000;">strlen</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sLine</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">===</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// do nothing, if empty</span><br />
<br />
<span style="color: #000088;">$sRegExp</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/[^\x09\x20\x21-\x3C\x3E-\x7E]/e'</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// imap_8bit encodes x09 everywhere, not only at lineends,</span><br />
<span style="color: #666666; font-style: italic;">// for EBCDIC safeness encode !&quot;#$@[\]^`{|}~,</span><br />
<span style="color: #666666; font-style: italic;">// for complete safeness encode every character :)</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$bEmulate_imap_8bit</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #000088;">$sRegExp</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/[^\x20\x21-\x3C\x3E-\x7E]/e'</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$sReplmt</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'sprintf( &quot;=%02X&quot;, ord ( &quot;$0&quot; ) ) ;'</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$sLine</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/preg_replace"><span style="color: #990000;">preg_replace</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$sRegExp</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sReplmt</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sLine</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// encode x09,x20 at lineends</span><br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$iLength</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/strlen"><span style="color: #990000;">strlen</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sLine</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$iLastChar</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/ord"><span style="color: #990000;">ord</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sLine</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$iLength</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;!!!!!!!!</span><br />
<span style="color: #666666; font-style: italic;">// imap_8_bit does not encode x20 at the very end of a text,</span><br />
<span style="color: #666666; font-style: italic;">// here is, where I don't agree with imap_8_bit,</span><br />
<span style="color: #666666; font-style: italic;">// please correct me, if I'm wrong,</span><br />
<span style="color: #666666; font-style: italic;">// or comment next line for RFC2045 conformance, if you like</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bEmulate_imap_8bit</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">==</span><a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$aLines</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
<br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$iLastChar</span><span style="color: #339933;">==</span><span style="color: #208080;">0x09</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">||</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$iLastChar</span><span style="color: #339933;">==</span><span style="color: #208080;">0x20</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$sLine</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$iLength</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'='</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$sLine</span> <span style="color: #339933;">.=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$iLastChar</span><span style="color: #339933;">==</span><span style="color: #208080;">0x09</span><span style="color: #009900;">&#41;</span>?<span style="color: #0000ff;">'09'</span><span style="color: #339933;">:</span><span style="color: #0000ff;">'20'</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span> &nbsp; &nbsp;<span style="color: #666666; font-style: italic;">// imap_8bit encodes x20 before chr(13), too</span><br />
<span style="color: #666666; font-style: italic;">// although IMHO not requested by RFC2045, why not do it safer :)</span><br />
<span style="color: #666666; font-style: italic;">// and why not encode any x20 around chr(10) or chr(13)</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$bEmulate_imap_8bit</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$sLine</span><span style="color: #339933;">=</span><a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' =0D'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'=20=0D'</span><span style="color: #339933;">,</span><span style="color: #000088;">$sLine</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">//$sLine=str_replace(' =0A','=20=0A',$sLine);</span><br />
<span style="color: #666666; font-style: italic;">//$sLine=str_replace('=0D ','=0D=20',$sLine);</span><br />
<span style="color: #666666; font-style: italic;">//$sLine=str_replace('=0A ','=0A=20',$sLine);</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// finally split into softlines no longer than 76 chars,</span><br />
<span style="color: #666666; font-style: italic;">// for even more safeness one could encode x09,x20</span><br />
<span style="color: #666666; font-style: italic;">// at the very first character of the line</span><br />
<span style="color: #666666; font-style: italic;">// and after soft linebreaks, as well,</span><br />
<span style="color: #666666; font-style: italic;">// but this wouldn't be caught by such an easy RegExp</span><br />
<a href="http://www.php.net/preg_match_all"><span style="color: #990000;">preg_match_all</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'/.{1,73}([^=]{0,2})?/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sLine</span><span style="color: #339933;">,</span> <span style="color: #000088;">$aMatch</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$sLine</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/implode"><span style="color: #990000;">implode</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'='</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/chr"><span style="color: #990000;">chr</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">13</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><a href="http://www.php.net/chr"><span style="color: #990000;">chr</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$aMatch</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// add soft crlf's</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// join lines into text</span><br />
<span style="color: #b1b100;">return</span> <a href="http://www.php.net/implode"><span style="color: #990000;">implode</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/chr"><span style="color: #990000;">chr</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">13</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><a href="http://www.php.net/chr"><span style="color: #990000;">chr</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$aLines</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>Quelle <a href="http://www.php.net/imap_8bit">PHP.net Kommentar von UMU</a></p>
<p>Wer sich f&#252;r die ISO 8859-1 Codierung interessiert, den Verweise ich auf die <a href="http://www.zid.tuwien.ac.at/zidline/zl04/images/iso-8859-1.pdf">Tabelle ISO 8859-1 (PDF)</a><br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2010/05/29/php-server-os-ermitteln/' title='PHP: Server-OS ermitteln'>PHP: Server-OS ermitteln</a></li>
<li><a href='http://www.camma.ch/2009/08/12/php-shell-linux-shell-via-php-script/' title='PHP Shell &#8211; Linux Shell via PHP Script'>PHP Shell &#8211; Linux Shell via PHP Script</a></li>
<li><a href='http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/' title='Automatisiertes MySQL Backup'>Automatisiertes MySQL Backup</a></li>
<li><a href='http://www.camma.ch/2009/04/02/die-10-besten-php-frameworks/' title='Die 10 besten PHP Frameworks'>Die 10 besten PHP Frameworks</a></li>
<li><a href='http://www.camma.ch/2009/03/22/zugangsdaten-der-gaengigen-mailprovider/' title='Zugangsdaten der g&#228;ngigen Mailprovider'>Zugangsdaten der g&#228;ngigen Mailprovider</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=95&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22Umlaute%20in%20der%20PHP%20mail%28%29%20Funktion%22%20http%3A%2F%2Ftinyurl.com%2Fq4hckh" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/01/08/umlaute-in-der-php-mail-funktion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Die 10 gr&#246;ssten Schwachstellen in PHP</title>
		<link>http://www.camma.ch/2009/01/04/die-10-grossten-schwachstellen-in-php/</link>
		<comments>http://www.camma.ch/2009/01/04/die-10-grossten-schwachstellen-in-php/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 14:50:05 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.blattertech.ch/?p=54</guid>
		<description><![CDATA[Auf DZone habe ich eine interessante Aufstellung der 10 gr&#246;ssten PHP Schwachstellen gefunden: PHP Code: Top Ten Security Vulnerabilities Related Posts: PHP: Server-OS ermitteln PHP Shell &#8211; Linux Shell via PHP Script Automatisiertes MySQL Backup Die 10 besten PHP Frameworks PHP Programmierung mit Klassen Twitter It!]]></description>
			<content:encoded><![CDATA[<p>Auf DZone habe ich eine interessante Aufstellung der 10 gr&#246;ssten PHP Schwachstellen gefunden:</p>
<p><a title="PHP Code: Top Ten Security Vulnerabilities" href="http://php.dzone.com/news/php-code-top-ten-security-vuln" target="_blank">PHP Code: Top Ten Security Vulnerabilities</a><br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2010/05/29/php-server-os-ermitteln/' title='PHP: Server-OS ermitteln'>PHP: Server-OS ermitteln</a></li>
<li><a href='http://www.camma.ch/2009/08/12/php-shell-linux-shell-via-php-script/' title='PHP Shell &#8211; Linux Shell via PHP Script'>PHP Shell &#8211; Linux Shell via PHP Script</a></li>
<li><a href='http://www.camma.ch/2009/04/24/automatisiertes-mysql-backup/' title='Automatisiertes MySQL Backup'>Automatisiertes MySQL Backup</a></li>
<li><a href='http://www.camma.ch/2009/04/02/die-10-besten-php-frameworks/' title='Die 10 besten PHP Frameworks'>Die 10 besten PHP Frameworks</a></li>
<li><a href='http://www.camma.ch/2009/02/06/php-programmierung-mit-klassen/' title='PHP Programmierung mit Klassen'>PHP Programmierung mit Klassen</a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=54&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22Die%2010%20gr%C3%B6ssten%20Schwachstellen%20in%20PHP%22%20http%3A%2F%2Ftinyurl.com%2Fqaptfn" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/01/04/die-10-grossten-schwachstellen-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CMSMS: Externe Links &#252;ber eine interne Seite schleusen</title>
		<link>http://www.camma.ch/2009/01/01/cms-made-simple-externe-links-uber-eine-interne-seite-schleusen/</link>
		<comments>http://www.camma.ch/2009/01/01/cms-made-simple-externe-links-uber-eine-interne-seite-schleusen/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 16:43:29 +0000</pubDate>
		<dc:creator>Lukas Blatter</dc:creator>
				<category><![CDATA[CMS Made Simple]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[CMS]]></category>

		<guid isPermaLink="false">http://wp.blattertech.ch/?p=34</guid>
		<description><![CDATA[Vor kurzem habe ich aufgrund eines Post im CMS Made Simple Forum zwei Funktionen geschrieben mit denen man dies bewerkstelligen kann. Die erste Funktion wird zur Erstellung des externen Links verwendet: {exturl cmspage=&#34;extpage&#34; exturl=&#34;http://example.com&#34;} Mit dem Parameter &#8220;cmspage&#8221; wird angegeben auf welche Seite der Link umgeleitet wird. Der Parameter &#8220;exturl&#8221; enth&#228;lt den Link. Bevor der [...]]]></description>
			<content:encoded><![CDATA[<p>Vor kurzem habe ich aufgrund eines Post im <a href="http://forum.cmsmadesimple.org/index.php/topic,29306.msg139594.html#msg139594">CMS Made Simple Forum</a> zwei Funktionen geschrieben mit denen man dies bewerkstelligen kann.</p>
<p>Die erste Funktion wird zur Erstellung des externen Links verwendet:</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">{exturl cmspage=&quot;extpage&quot; exturl=&quot;http://example.com&quot;}</div></div>
<p>Mit dem Parameter &#8220;cmspage&#8221; wird angegeben auf welche Seite der Link umgeleitet wird. Der Parameter &#8220;exturl&#8221; enth&#228;lt den Link. Bevor der Besucher auf die verlinkte Seite gehen kann, wird er so auf die Seite mit dem Alias &#8220;extpage&#8221; geleitet. Auf dieser Seite wird der Tag</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">{exturlpage}</div></div>
<p>eingef&#252;gt. Dieser ist f&#252;r die Weiterleitung auf die externe Seite verantwortlich.</p>
<p>Die beiden Funktionen m&#252;ssen in den /plugin Ordner der CMS Made Simple installation abgelegt werden.</p>
<p><a href="http://wp.blattertech.ch/wp-content/uploads/2009/01/exturl.zip">Download exturl Funktion</a></p>
<p>Ich lehne jegliche Verantwortung f&#252;r Fehler in der Programmierung oder sch&#228;den welche durch die Installation oder den Betrieb der Funktionen entstanden sind ab.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://www.camma.ch/2010/05/29/php-server-os-ermitteln/' title='PHP: Server-OS ermitteln'>PHP: Server-OS ermitteln</a></li>
<li><a href='http://www.camma.ch/2010/02/27/vertraege-in-der-internetbranche/' title='Vertr&#228;ge in der Internetbranche'>Vertr&#228;ge in der Internetbranche</a></li>
<li><a href='http://www.camma.ch/2010/02/15/typo3-cache-automatisch-loeschen/' title='Typo3: Cache automatisch l&#246;schen'>Typo3: Cache automatisch l&#246;schen</a></li>
<li><a href='http://www.camma.ch/2009/10/08/47-massnahmen-um-eine-typo3-installation-sicher-zu-machen/' title='47 Massnahmen um eine Typo3 Installation sicher zu machen'>47 Massnahmen um eine Typo3 Installation sicher zu machen</a></li>
<li><a href='http://www.camma.ch/2009/10/04/cms-made-simple-1-6-6-bonde-erschienen/' title='CMS Made Simple 1.6.6 &#8220;Bonde&#8221; erschienen '>CMS Made Simple 1.6.6 &#8220;Bonde&#8221; erschienen </a></li>
</ul>
<img src="http://www.camma.ch/?ak_action=api_record_view&id=34&type=feed" alt="" /><span class="post-twitter" ><a href="http://twitter.com/home?status=Reading%20%20%22CMSMS%3A%20Externe%20Links%20%C3%BCber%20eine%20interne%20Seite%20schleusen%22%20http%3A%2F%2Ftinyurl.com%2Fqseawz" title="Twitter It!" rel="nofollow">Twitter It!</a></span>]]></content:encoded>
			<wfw:commentRss>http://www.camma.ch/2009/01/01/cms-made-simple-externe-links-uber-eine-interne-seite-schleusen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

