<?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>DeDu</title>
	<atom:link href="http://www.dedu.ch/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.dedu.ch</link>
	<description>Der Blog von Matthias Dunkel</description>
	<lastBuildDate>Wed, 01 Sep 2010 08:44:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Quicktime deinstallieren</title>
		<link>http://www.dedu.ch/?p=299</link>
		<comments>http://www.dedu.ch/?p=299#comments</comments>
		<pubDate>Wed, 01 Sep 2010 08:44:34 +0000</pubDate>
		<dc:creator>DeDu</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://www.dedu.ch/?p=299</guid>
		<description><![CDATA[Viele wissen schon gar nicht mehr, was Quicktime ist. Eigentlich braucht es auch niemand, aber immer wenn man sich mal wieder ITunes installiert, wird es mit auf die Harddisk gepackt. Warum weiss ich nicht. Aber warum ich es mir jetzt deinstalliert habe schon: http://www.heise.de/security/meldung/Backdoor-in-Quicktime-entdeckt-1069969.html]]></description>
			<content:encoded><![CDATA[<p>Viele wissen schon gar nicht mehr, was Quicktime ist. Eigentlich braucht es auch niemand, aber immer wenn man sich mal wieder ITunes installiert, wird es mit auf die Harddisk gepackt. Warum weiss ich nicht. Aber warum ich es mir jetzt deinstalliert habe schon: <a href="http://www.heise.de/security/meldung/Backdoor-in-Quicktime-entdeckt-1069969.html" target="_blank">http://www.heise.de/security/meldung/Backdoor-in-Quicktime-entdeckt-1069969.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dedu.ch/?feed=rss2&amp;p=299</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Aufsteller des Tages :P</title>
		<link>http://www.dedu.ch/?p=280</link>
		<comments>http://www.dedu.ch/?p=280#comments</comments>
		<pubDate>Mon, 30 Aug 2010 16:15:10 +0000</pubDate>
		<dc:creator>DeDu</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Infos die keiner lesen will]]></category>

		<guid isPermaLink="false">http://www.dedu.ch/?p=280</guid>
		<description><![CDATA[Einfach bis zum schluss schauen:]]></description>
			<content:encoded><![CDATA[<p>Einfach bis zum schluss schauen:</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/pHG40AdYfJ0?fs=1&amp;hl=de_DE"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/pHG40AdYfJ0?fs=1&amp;hl=de_DE" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dedu.ch/?feed=rss2&amp;p=280</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Meine top IPhone Apps</title>
		<link>http://www.dedu.ch/?p=248</link>
		<comments>http://www.dedu.ch/?p=248#comments</comments>
		<pubDate>Mon, 30 Aug 2010 13:57:54 +0000</pubDate>
		<dc:creator>DeDu</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://www.dedu.ch/?p=248</guid>
		<description><![CDATA[Hier wollte ich euch mal meine top IPhone Apps vorstellen. Opera Mini Ich benutze Safari schon lange nicht mehr. Statdessen verwende ich Opera Mini, den man im App Store findet. Abgesehen davon, dass er, wie ich finde, um einiges schneller ist, hat er auch viele nützliche Funktionen und ist einfacher zu bedienen. Auch formatiert er [...]]]></description>
			<content:encoded><![CDATA[<p>Hier wollte ich euch mal meine top IPhone Apps vorstellen.</p>
<h2>Opera Mini</h2>
<p><a href="/wp-content/p_480_320_0C0688FA-1419-44A5-8C78-9DCA4BC29C30.jpeg"><img class="alignleft size-thumbnail wp-image-249" title="OperaMini" src="/wp-content/p_480_320_0C0688FA-1419-44A5-8C78-9DCA4BC29C30-150x150.jpg" alt="Printscreen vom Opera Mini auf dem IPhone" width="150" height="150" /></a>Ich benutze Safari schon lange nicht mehr. Statdessen verwende ich <a href="http://www.opera.com/mobile/" target="_blank">Opera Mini</a>, den man im App Store findet.</p>
<p>Abgesehen davon, dass er, wie ich finde, um einiges schneller ist, hat er auch viele nützliche Funktionen und ist einfacher zu bedienen. Auch formatiert er einige Websiten so, das man sie mit dem IPhone viel einfacher lesen kann.</p>
<p>Preis: Gratis (Stand: 30.08.2010)</p>
<div style="clear: both;"></div>
<h2>Search.ch</h2>
<p><a href="/wp-content/p_480_320_84F8B859-34FD-4513-9774-512FB7E7A4B3.jpeg"><img class="alignleft size-thumbnail wp-image-250" title="Search.ch App" src="/wp-content/p_480_320_84F8B859-34FD-4513-9774-512FB7E7A4B3-150x150.jpg" alt="" width="150" height="150" /></a>Das <a href="http://about.search.ch/archives/2010/01/11/die-iphone-app-von-search-ch-ist-da/">Serch.ch</a> ist ein  nüzliches App, um Telefonnummern in der Schweiz zu suchen. Dazu findet man zusäzlich noch Informationen über den ÖV und das Wetter.</p>
<p>Preis: Gratis (Stand: 30.08.2010)</p>
<div style="clear: both;"></div>
<h2>Gulli:news</h2>
<p><a href="/wp-content/p_480_320_CB8651BD-6176-4A8C-BADF-BE1616A2C6D8.jpeg"><img class="alignleft size-thumbnail wp-image-263" title="Gulli:News" src="/wp-content/p_480_320_CB8651BD-6176-4A8C-BADF-BE1616A2C6D8-150x150.jpg" alt="" width="150" height="150" /></a>Mit diesem App kann man einfach und bequem die News von Gulli.com lesen (wie der Name schon verrät <img src='http://www.dedu.ch/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  ). Der Inhalt wird für&#8217;s IPhone optimiert angezeigt, und man sieht auch die letzten Kommentare zum Artikel.</p>
<p>Preis: Gratis (Stand: 30.08.2010)</p>
<div style="clear: both;"></div>
<h2>Byline</h2>
<p><a href="/wp-content/p_480_320_E8EC76A7-44EE-4A58-8B03-703531510BC8.jpeg"><img class="alignleft size-thumbnail wp-image-266" title="Bilyne" src="/wp-content/p_480_320_E8EC76A7-44EE-4A58-8B03-703531510BC8-150x150.jpg" alt="" width="150" height="150" /></a>Byline ist mein lieblings App um RSS-Feeds zu lesen. Es kann mit Google Reader und anderen Diesnsten synchronisiert werden. Der Inhalt wird schön leserlich dargestellt, und es gibt eine coole &#8220;swap-Funktion&#8221;, um von Artikel zu Artikel zu springen.</p>
<p>Die Gratisversion blendet ein wenig Werbung ein, wenn man das nicht will, kann man sich die Vollversion für 5.50 CHF erwerben (Stand 31.08.2010).</p>
<div style="clear: both;"></div>
<p><a href="/wp-content/p_480_320_B6304ECF-CA63-4C9F-B3F6-8F16DFA53F3F.jpeg"><img class="alignleft size-thumbnail wp-image-268" title="Bilyne Swap-Funktion" src="/wp-content/p_480_320_B6304ECF-CA63-4C9F-B3F6-8F16DFA53F3F-150x150.jpg" alt="" width="150" height="150" /></a></p>
<div style="clear: both;"></div>
<h2>Facebook</h2>
<p><a href="/wp-content/p_480_320_BDAF5A57-1611-4739-B88A-05EDB1AAA55F.jpeg"><img class="alignleft size-thumbnail wp-image-291" title="Facebook App Homescreen" src="/wp-content/p_480_320_BDAF5A57-1611-4739-B88A-05EDB1AAA55F-150x150.jpg" alt="" width="150" height="150" /></a>Für alle Facebooksuchties das absolute musthave App. Seit dem letzten Update noch einfacher und konfortabler zu handhaben. Allerdings sollte man sich vor &#8220;Facebook Orte&#8221; achten, ansonsten wissen deine Freunde in Facebook immer, wo du dich gerade befindest <img src='http://www.dedu.ch/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Preis: Gratis (Stand 31.08.2010)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dedu.ch/?feed=rss2&amp;p=248</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PHP] Backdoor&#8217;s in PHP</title>
		<link>http://www.dedu.ch/?p=227</link>
		<comments>http://www.dedu.ch/?p=227#comments</comments>
		<pubDate>Thu, 12 Aug 2010 13:08:32 +0000</pubDate>
		<dc:creator>DeDu</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://www.dedu.ch/?p=227</guid>
		<description><![CDATA[Hier zeige ich euch, wie ihr in eurer Webaplikation einen Backdoor erstellen könnt. Mit einem Backdoor hat man die Möglichkeit, Befehle auf der Applikation auszuführen, obwohl man z.B. den Server nicht mehr unter Kontrolle hat, weil er gehackt wurde. Ich schreibe mir dazu meist noch ein Script, das mir die gesamten Daten (aus der DB)  [...]]]></description>
			<content:encoded><![CDATA[<p>Hier zeige ich euch, wie ihr in <em><strong>eurer</strong></em> Webaplikation einen Backdoor erstellen könnt. Mit einem Backdoor hat man die Möglichkeit, Befehle auf der Applikation auszuführen, obwohl man z.B. den Server nicht mehr unter Kontrolle hat, weil er gehackt wurde.</p>
<p>Ich schreibe mir dazu meist noch ein Script, das mir die gesamten Daten (aus der DB)  zum Download anbietet, und danach die DB löscht. Dazu kann man auch noch eine <a href="http://de.wikipedia.org/wiki/Htaccess" target="_blank">.htaccess Datei</a> erstellen, die den Zugriff übers Internet sperrt.</p>
<p>So kann man bei einer Übernahme des Servers gebührend zurückschlagen, und den Server z.B. neu aufsetzen und konfigurieren.</p>
<p>Nochwas: Misbraucht dieses Wissen nicht! Erstellt einen Backdoor nur auf eurer eigenen Applikation, und gebt diese nicht weiter. Schützt den Backdoor (ich zeige euch wie). Ich übernehme keine Haftung für irgendwelche Schäden die ihr mit diesem Wissen anrichtet.</p>
<p><span id="more-227"></span></p>
<h2>Los geht&#8217;s</h2>
<p>Zuerst müssen wir uns fragen, was unser Backdoor bewirken soll. Wie ich oben schon erwähnt habe, wollen wir Code ausführen (lassen). Dazu gibt es eine praktische Funktion: <a href="http://php.net/manual/de/function.eval.php" target="_blank">eval()</a></p>
<p>Jetzt müssen wir uns fragen, wie wir den Code, der ausgeführt werden soll, an die Applikation schicken. Ich schlage hier GET vor.</p>
<p>Und nun müssen wir uns Gedanken über die Sicherheit machen. Hier schlage ich euch eine Passwortabfrage vor.</p>
<p>Ich will den Code also wie folgt ausführen können: dieDateiMitDemBackdoor.php?bdpw=einPasswort&amp;cmd=echo(&#8220;Ich verwende einen Backdoor!&#8221;);</p>
<p>Ich zeige euch einfach mal den Code, den ihr möglichst versteckt auf der Applikation einbinden müsst:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;cmd&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;bdpw&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;bdpw&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;einPasswort&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
       <span style="color: #990000;">eval</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">stripslashes</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;cmd&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Wenn also das Passwort und die Befehle existieren, und das Passwort stimmt, werden die Befehle ausgeführt. Das stripslashes() braucht man, weil die Befehle mit GET übergeben wurden.</p>
<p>Das Passwort könnte man auch nur md5 Verschlüsselt akzeptieren.</p>
<p>Um nun ein Script auszuführen, wie ich oben schon erwähnt habe, kann man dieses einfach über include() einbinden. Also: dieDateiMitDemBackdoor.php?bdpw=einPasswort&amp;cmd=include(&#8220;LoeschAllesRunter.php&#8221;);</p>
<h2>So findet man einen Backdoor im Code</h2>
<p>Du hast eine Applikation und vermutest einen Backdoor? Um das zu überprüfen durchsuchst du am besten alle Dateien nach einem der folgenden Funktionen:</p>
<ul>
<li>eval()</li>
<li>system()</li>
<li>exec()</li>
<li>passthru()</li>
</ul>
<p>Ich werde versuchen, diese Liste immer möglichst zu ergänzen.</p>
<h2>Anmerkung</h2>
<p>Ihr seid noch keine &#8220;Hacker&#8221; weil ihr nun einen Backdoor &#8220;Programmieren&#8221; könnt.</p>
<p>Baut sowas nur dann ein, wenn ihr denkt, das man einen Backdoor gebrauchen kann! Das Risiko, das jemand anders diesen Backdoor benutzt ist relativ gross.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dedu.ch/?feed=rss2&amp;p=227</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PHP] Eine (fremde) Webseite durchsuchen</title>
		<link>http://www.dedu.ch/?p=219</link>
		<comments>http://www.dedu.ch/?p=219#comments</comments>
		<pubDate>Thu, 12 Aug 2010 09:51:24 +0000</pubDate>
		<dc:creator>DeDu</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://www.dedu.ch/?p=219</guid>
		<description><![CDATA[Hier werde ich euch ein kleines Script vorstellen, mit dem ihr eine Seite nach Informationen durchsuchen könnt. Damit meine ich, das man eine Seite einliest, die Informationen mit einem RegEx heraussucht und danach verwenden kann. Fangen wir mit dem einlesen der Seite an: //Config //------ $link = &#34;http://www.dedu.ch/&#34;; // Zu durchsuchende Website $pattern = &#34;~\(.*)\~&#34;; [...]]]></description>
			<content:encoded><![CDATA[<p>Hier werde ich euch ein kleines Script vorstellen, mit dem ihr eine Seite nach Informationen durchsuchen könnt. Damit meine ich, das man eine Seite einliest, die Informationen mit einem RegEx heraussucht und danach verwenden kann.</p>
<p><span id="more-219"></span></p>
<p>Fangen wir mit dem einlesen der Seite an:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//Config</span>
<span style="color: #666666; font-style: italic;">//------</span>
<span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.dedu.ch/&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Zu durchsuchende Website</span>
<span style="color: #000088;">$pattern</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;~\(.*)\~&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Der anzuwendede Pattern</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Script</span>
<span style="color: #666666; font-style: italic;">//------</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//liest File ein:</span>
<span style="color: #000088;">$site</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$link</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$site</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Link konnte nicht gelesen werden...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Zuerst wird der Inhalt der Website mit file_gets_contents() eingelesen. Mit Inhalt meine ich hier den Quelltext, also das HTML der Seite.</p>
<p>Als nächstes wollen wir mit unserem Pattern suchen:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//Config</span>
<span style="color: #666666; font-style: italic;">//------</span>
<span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.dedu.ch/&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Zu durchsuchende Website</span>
<span style="color: #000088;">$pattern</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;~\(.*)\~&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Der anzuwendede Pattern</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Script</span>
<span style="color: #666666; font-style: italic;">//------</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//liest File ein:</span>
<span style="color: #000088;">$site</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$link</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$site</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Link konnte nicht gelesen werden...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Sucht mit dem Pattern</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_match_all</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pattern</span><span style="color: #339933;">,</span> <span style="color: #000088;">$site</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #339933;">,</span> PREG_SET_ORDER<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span> <span style="color: #339933;">==</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;strong&gt;Keine Resultate...&lt;/strong&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Jetzt habe ich also alle Treffer in der Variable $result drinn. $result ist ein Array.</p>
<p>Es wird alles gefunden, was im RegEx in Klammern &#8220;()&#8221; steht. Was RegEx ist, und wie es funktioniert werde ich euch hier nicht erklären. Google wird euch schon helfen <img src='http://www.dedu.ch/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Hier noch das gesamte Script, mit ein paar Änderungen, die euch das Resultat auch noch direkt in einer Tabelle ausgeben:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//Config</span>
<span style="color: #666666; font-style: italic;">//------</span>
<span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.dedu.ch/&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Zu durchsuchende Website</span>
<span style="color: #000088;">$pattern</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;~\&lt;a.*rel=<span style="color: #000099; font-weight: bold;">\&quot;</span>(.*)<span style="color: #000099; font-weight: bold;">\&quot;</span>.*\&gt;(.*)\&lt;/a\&gt;~&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Der anzuwendede Pattern</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Script</span>
<span style="color: #666666; font-style: italic;">//------</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;h1&gt;Ergebniss&lt;/h1&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Link: &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$link</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br/&gt;Pattern: &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pattern</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//liest File ein:</span>
<span style="color: #000088;">$site</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$link</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$site</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Link konnte nicht gelesen werden...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Sucht mit dem Pattern</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_match_all</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pattern</span><span style="color: #339933;">,</span> <span style="color: #000088;">$site</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #339933;">,</span> PREG_SET_ORDER<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span> <span style="color: #339933;">==</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Keine Resultate...&lt;/b&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//Suche die Maximale Anzahl an treffern:</span>
<span style="color: #000088;">$max</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$max</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$max</span> <span style="color: #339933;">=</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Schreibt eine Tabelle:</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;table&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;tr&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$x</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$max</span><span style="color: #339933;">;</span><span style="color: #000088;">$x</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;td&gt;&lt;b&gt;Gesamter String&lt;/b&gt;&lt;/td&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;td&gt;&lt;b&gt;Treffer in Pattern &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$x</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/b&gt;&lt;/td&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/tr&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$array</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$x</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;tr style='background:#E1E1E0;'&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$array</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key2</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;td&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/td&gt;&quot;</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$x</span><span style="color: #339933;">++;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #666666; font-style: italic;">//Füllt noch leere zellen ein</span>
        <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$y</span><span style="color: #339933;">=</span><span style="color: #000088;">$x</span><span style="color: #339933;">;</span><span style="color: #000088;">$y</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$max</span><span style="color: #339933;">;</span><span style="color: #000088;">$y</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;td&gt; &lt;/td&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/tr&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;/table&gt;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>So siehts aus</h3>
<p><a href="/wp-content/ScreenShot011.png"><img class="aligncenter size-medium wp-image-224" title="ScreenShot011" src="/wp-content/ScreenShot011-300x158.png" alt="" width="300" height="158" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dedu.ch/?feed=rss2&amp;p=219</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP: Mein Downloadscript</title>
		<link>http://www.dedu.ch/?p=209</link>
		<comments>http://www.dedu.ch/?p=209#comments</comments>
		<pubDate>Tue, 10 Aug 2010 07:39:18 +0000</pubDate>
		<dc:creator>DeDu</dc:creator>
				<category><![CDATA[Entwicklung]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.dedu.ch/?p=209</guid>
		<description><![CDATA[Wollt ihr ein File zum Download anbieten, aber wenn ihr darauf verlinkt, wird es nicht gedownloadet sondern geöffnet? Dann hab ich hier eine Lösung für euch. Hier erstmal den Code: &#60;?php &#160; /* * Dieses Script in eine PHP-Datei kopieren. Nehmen wir mal an die Datei heisst getFile.php * Wenn ich jertr eine Datei Downloaden [...]]]></description>
			<content:encoded><![CDATA[<p>Wollt ihr ein File zum Download anbieten, aber wenn ihr darauf verlinkt, wird es nicht gedownloadet sondern geöffnet? Dann hab ich hier eine Lösung für euch.</p>
<p>Hier erstmal den Code:<br />
<span id="more-209"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/*
 * Dieses Script in eine PHP-Datei kopieren. Nehmen wir mal an die Datei heisst getFile.php
 * Wenn ich jertr eine Datei Downloaden möchte, rufe ich die Datei wiefolgt auf: getFile.php?q=dieDatei.avi
 * Wobei &quot;dieDatei.avi&quot; natürlich die Datei ist, die Gedownloadet werden soll.
 * die Variable $dateiPfad muss angepass werden. Wenn sich alle Dateien die du Downloaden möchtest im
 * Verzeichniss &quot;downloads&quot; befinden, muss du dort $dateiPfad = &quot;downloads/&quot;; schreiben. Den Slash nicht vergessen...
 *
 * Lizenz beachten: http://www.dedu.ch/?p=209
 */</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Config</span>
<span style="color: #000088;">$dateiPfad</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Hier den Pfad zum Ordner angeben, in dem die Dateien liegen! z.B. Pic/download/</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Script</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;q&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;q&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">//RegEx für Filname</span>
    <span style="color: #000088;">$pattern</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;~^[a-zA-Z0-9_-]+\.[a-zA-Z]+$~&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pattern</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;q&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$cPfad</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dateiPfad</span><span style="color: #339933;">.</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;q&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">is_file</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cPfad</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cPfad</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-Type: application/octet-stream&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-Disposition: attachment; filename=<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;q&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #990000;">readfile</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cPfad</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Kein gültiges File, oder File existiert nicht...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Keine gültige Datei...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Parameter 'q' fehlt...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h2>Verwendung und Installation</h2>
<p>Kopiert den Code in ein neues PHP-File. Nennt dieses z.B. getFile.php</p>
<p>Alle Dateien die ihr nun darüber Downloaden wollt, müssen im selben Ordner liegen. Diesen müsst ihr in der Variable $dateiPfad angeben. Liegen eure Dateien aber im selben Ordner wie das Script, lasst ihr die Variable einfach leer.</p>
<p>Aber wie Downloade ich nun darüber? Wenn ihr euer File getFile.php genannt habt, und ihr eine Datei Namens &#8220;download01.txt&#8221; downloaden wollt, muss der aufruf der Datei getFile.php wiefolgt aussehen:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;getFile.php?q=download01.txt&quot;&gt;Download&lt;/a&gt;</pre></div></div>

<p>Die Dateinamen müssen natürlich angepasst werden&#8230;</p>
<h2>Lizenz</h2>
<p><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img style="border-width: 0;" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" alt="Creative Commons Lizenzvertrag" /></a><br />
<span>PHP Downloadscript</span> von <a rel="cc:attributionURL" href="http://www.dedu.ch">Matthias Dunkel</a> steht unter einer <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution-ShareAlike 3.0 Unported Lizenz</a>.<br />
Beruht auf einem Inhalt unter <a rel="dc:source" href="http://www.dedu.ch/?p=209">www.dedu.ch</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dedu.ch/?feed=rss2&amp;p=209</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Meine top Cheat Sheets</title>
		<link>http://www.dedu.ch/?p=192</link>
		<comments>http://www.dedu.ch/?p=192#comments</comments>
		<pubDate>Tue, 20 Jul 2010 08:38:12 +0000</pubDate>
		<dc:creator>DeDu</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://www.dedu.ch/?p=192</guid>
		<description><![CDATA[Heute ist wieder mal so ein Tag. Ihr wisst schon, einer, an dem man alles plötzlich vergessen hat, oder einem nichts mehr einfällt. Aber zum Glück habe ich meine &#8220;Cheat Sheets&#8221;. Das sind (meist) A4 Blätter, die als Referenz zu einem Thema gebraucht werden können. Hier möchte ich euch aufzeigen, welche ich benutze, oder welche [...]]]></description>
			<content:encoded><![CDATA[<p>Heute ist wieder mal so ein Tag. Ihr wisst schon, einer, an dem man alles plötzlich vergessen hat, oder einem nichts mehr einfällt. Aber zum Glück habe ich meine &#8220;Cheat Sheets&#8221;. Das sind (meist) A4 Blätter, die als Referenz zu einem Thema gebraucht werden können.</p>
<p>Hier möchte ich euch aufzeigen, welche ich benutze, oder welche ich für nüzlich halte.</p>
<p><span id="more-192"></span></p>
<h2>Cheat Sheets</h2>
<h3>PHP</h3>
<p>Ein Cheat Sheet, das ich viel verwende. Habe es <a href="http://www.addedbytes.com/cheat-sheets/php-cheat-sheet/" target="_blank">hier</a> gefunden. Auf dieser Seite findet man noch Tonnen von anderen Cheat Sheets, und ich werde euch sicher noch ein paar weitere von dieser Seite vorstellen. Es ist aber darauf zu achten, das es auf dieser Seite manchmal alte <em>und</em> neue Versionen gibt.</p>
<p><a href="http://refcardz.dzone.com/refcardz/php" target="_blank">Eine gute Referenz</a> ist auch <a href="http://refcardz.dzone.com/refcardz/php" target="_blank">dieses</a> Cheat Sheet, das sich aber über mehrere Seiten erstrekt.</p>
<h3>Regex</h3>
<p>Wieder ein Cheat Sheet von <a href="http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/" target="_blank">AddedBytes über Regular Expressions</a>. Ich mag dieses speziell, da es auch Beispiele enthält.</p>
<p><a href="http://regexlib.com/CheatSheet.aspx" target="_blank">Hier</a> noch eine HTML-Version über Regex (.NET).</p>
<h3>CSS</h3>
<p>Das <a href="http://www.addedbytes.com/cheat-sheets/css-cheat-sheet/" target="_blank">&#8220;must have&#8221; Css Cheat Sheet</a>.</p>
<p><a href="http://lesliefranke.com/files/reference/csscheatsheet.html" target="_blank">Hier</a> noch eine HTML-Version, die ein paar grundlegende Sachen enthält, aber nicht zu stark ins Detail geht.</p>
<h3>JavaScript</h3>
<p>Ein JavaScript <a href="http://www.addedbytes.com/cheat-sheets/javascript-cheat-sheet/" target="_blank">Cheat Sheet von AddedBytes</a>.</p>
<h4>JQuery</h4>
<p>Ein tolles <a href="http://labs.impulsestudios.ca/jquery-cheat-sheet" target="_blank">Cheat Sheet über JQuery</a> in der Version 1.4, kompakt auf einer A4 Seite mit vielen schön geordneten Befehlen.</p>
<h3>HTML</h3>
<p>Ich glaube zwar kaum, das man dazu ein Cheat Sheet braucht, wer es aber totzdem will: <a href="http://www.addedbytes.com/cheat-sheets/html-cheat-sheet/" target="_blank">Klick mich!</a></p>
<h3>Shortcuts</h3>
<p><a href="/wp-content/7.gif"><img class="aligncenter size-medium wp-image-202" title="Vorschau Cheat Sheet Shortcuts" src="/wp-content/7-300x175.gif" alt="" width="300" height="175" /></a></p>
<p><a href="http://www.computerarts.co.uk/tutorials/new_media/keyboard_shortcut_cards" target="_blank">Hier</a> findet ihr gleich sechs Cheat Sheet, mit Shortcuts zu folgenden Programmen:</p>
<ul>
<li>3DS max</li>
<li>cinema 4d R8</li>
<li>Freehand</li>
<li>Illustrator</li>
<li>Indesign</li>
<li>Photoshop</li>
</ul>
<p>Sehr schön gestaltet, und sehr entfehlenswert.</p>
<h2>Das Wort zum Schluss</h2>
<p>Ich werde versuchen, diesen Artikel immer aktuell zu halten, und neue Cheat Sheets hinzuzufügen, falls ich welche finde.</p>
<p>Und denkt an die Umwelt, und druckt nicht einfach alles aus. Sucht euch die paar besten aus. Wenn ihr zuviel habt, braucht ihr zu lange um die gewünschte Infos zu finden <img src='http://www.dedu.ch/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dedu.ch/?feed=rss2&amp;p=192</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP: Eine Suche realisieren</title>
		<link>http://www.dedu.ch/?p=183</link>
		<comments>http://www.dedu.ch/?p=183#comments</comments>
		<pubDate>Wed, 30 Jun 2010 12:25:17 +0000</pubDate>
		<dc:creator>DeDu</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://www.dedu.ch/?p=183</guid>
		<description><![CDATA[Muss man sich in deiner PHP-Applikation durch riesige Listen kämpfen, um den richtigen Eintrag zu finden? Dann wird es höchste Zeit für eine Suche! Ich setze in diesem Tutorial vorraus, das ihr ein wenig MySQL beherrscht, sowie PHP und ihr HTML im schlaf könnt. Nehmen wir mal an, wir hätten in der Datenbank eine Tabelle [...]]]></description>
			<content:encoded><![CDATA[<p>Muss man sich in deiner PHP-Applikation durch riesige Listen kämpfen, um den richtigen Eintrag zu finden? Dann wird es höchste Zeit für eine Suche!</p>
<p>Ich setze in diesem Tutorial vorraus, das ihr ein wenig MySQL beherrscht, sowie PHP und ihr HTML im schlaf könnt.</p>
<p><span id="more-183"></span></p>
<p>Nehmen wir mal an, wir hätten in der Datenbank eine Tabelle mit Adressen. Wenn wir alle Adressen raussuchen wollen, sieht ja das dann irgendwie so aus (angenommen wir hätten verschiedene Seiten):</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">FROM</span> adresse
<span style="color: #990099; font-weight: bold;">LIMIT</span> <span style="color: #008080;">0</span><span style="color: #000033;">,</span><span style="color: #008080;">20</span></pre></div></div>

<p>So kriegen wir die ersten zwanzig Einträge der Datenbank (unsortiert). Dieses Resultat wir dan z.B. in eine Liste &#8220;umgewandelt&#8221;. Wie das geht, werde ich euch hier nicht erklären <img src='http://www.dedu.ch/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Nun erstellt doch bitte euer Suchfeld in HTML (Ich setze vorraus, das ihr das könnt).  Fertig? Gut, machen wir weiter <img src='http://www.dedu.ch/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Ich habe meinem Suchfeld den Namen &#8220;suche&#8221; gegeben, mit dem man nach einem Namen in der Datenbank suchen kann. Um eine Sucher zu realisieren, brauchen wir eigentlich nichts anderes zu tun, als die SQL-Abfrage zu verändern:</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">FROM</span> adresse
<span style="color: #990099; font-weight: bold;">WHERE</span> name <span style="color: #CC0099; font-weight: bold;">LIKE</span> <span style="color: #008000;">'<span style="color: #008080; font-weight: bold;">%</span>ma<span style="color: #008080; font-weight: bold;">%</span>'</span>
<span style="color: #990099; font-weight: bold;">LIMIT</span> <span style="color: #008080;">0</span><span style="color: #000033;">,</span><span style="color: #008080;">20</span></pre></div></div>

<p>Mit diesem &#8220;WHERE&#8221; habe ich eigentlich schon meine Suche erstell. Zur Erklärung: Das Prozentzeichen heisst soviel wie &#8220;Irgendetwas&#8221;. Es nimmt also alle Eiträge die zuerst &#8220;irgendwas&#8221; (oder nichts) haben, dannach &#8220;ma&#8221; und dann wieder &#8220;irgendwas&#8221; (oder eben nichts). Findet z.B. Matthias; Max; Asamat;Oma;&#8230;</p>
<p>Das ganze mit PHP sieht dann irgendwie so aus:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;suche&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;suche&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM adresse
              WHERE name LIKE '%&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;suche&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;%'
              LIMIT &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;seite&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">*</span><span style="color:#800080;">20.</span><span style="color: #0000ff;">&quot;,20&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM adresse
              LIMIT &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;seite&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">*</span><span style="color:#800080;">20.</span><span style="color: #0000ff;">&quot;,20&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Hier verarbeitet ihr eure Daten...</span></pre></div></div>

<p>Das Script macht folgendes: Mit der if-Abfrage wird &#8220;geschaut&#8221;, ob eine Suche ausgeführt wurde. Falls ja, wird das SQL mit der Suche (wie oben beschrieben) &#8220;zusammengebastelt&#8221;, falls nein, das ganz normale SQL verwendet. Das mit dem &#8220;$_GET["seite"]&#8221; ist für die verschiedenen Seiten, und hat mit diesem Tutorial nichts zu tun.</p>
<p>Ich hoffe, ich konnte euch eine Idee vermitteln, wie man eine Suche realisiert, und das es euch geholfen hat.</p>
<p>Danke fürs lesen, Fragen wie immer in die Kommentare <img src='http://www.dedu.ch/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dedu.ch/?feed=rss2&amp;p=183</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lebens ToDo Liste</title>
		<link>http://www.dedu.ch/?p=177</link>
		<comments>http://www.dedu.ch/?p=177#comments</comments>
		<pubDate>Tue, 29 Jun 2010 11:41:10 +0000</pubDate>
		<dc:creator>DeDu</dc:creator>
				<category><![CDATA[Infos die keiner lesen will]]></category>

		<guid isPermaLink="false">http://www.dedu.ch/?p=177</guid>
		<description><![CDATA[Obwohl dieses Thema überhaupt nicht auf diesen Blog passt, werde ich hier meine Lebens ToDo-List posten. (Ich entschuldige mich schon jetzt für den folgenden Text ) Was das ist? Wie der Namen schon sagt, ist es Liste von dingen, die ich Leben noch tun will. Achja, meine Liste wird wohl keine sehr klugen Ideen beinhalten, [...]]]></description>
			<content:encoded><![CDATA[<p>Obwohl dieses Thema überhaupt nicht auf diesen Blog passt, werde ich hier meine Lebens ToDo-List posten. (Ich entschuldige mich schon jetzt für den folgenden Text <img src='http://www.dedu.ch/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p>Was das ist? Wie der Namen schon sagt, ist es Liste von dingen, die ich Leben noch tun will.</p>
<p>Achja, meine Liste wird wohl keine sehr klugen Ideen beinhalten, und könnte auf manche Personen anstössig wirken. Falls Sie keinen Sinn für Humor haben, Sarkasmus und Ironie nicht verstehen, bitte ich Sie diese Seite zu verlassen <img src='http://www.dedu.ch/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Ich übernehme keinerlei Haftung, falls ihr Hirn beim weiterlesen Schaden nimmt. Bitte keine Ideen übernehmen, und nicht ausführen.</p>
<p>Wenn Sie beim oberen Paragraphen gelacht oder geschmunzelt haben, dürfen Sie sich die Liste anschauen.</p>
<p><span id="more-177"></span></p>
<h2>The list</h2>
<ul>
<li>Mich mit Wasserballönen (schreibt man das so?) an den Garten des Nachbaren anschleichen, und seine laute Soundanlage bewerfen.</li>
<li>Mit einem Plüschtierhund in der Stadt gassie gehen.</li>
<li><span style="text-decoration: line-through;">Bei einer Durchsage im Supermarkt auf die Knie fallen, und laut &#8220;Die Stimmen, sie sind wieder da!&#8221; schreien.</span></li>
<li>In einer Bar das Bier eines Wildfremden trinken (wenn er anwesend ist).</li>
<li>Der Polizei auf einem PostIt eine Busse an die Windschutzscheibe kleben.</li>
<li>Den Busfahrer wie einen Txifahrer behandeln.</li>
<li>An der Migros-Kasse Verhandeln, und danach mit Yeng (oder so) bezahlen.</li>
<li>Gleichzeitig Babynahrung und Kondome kaufen.</li>
<li>Bei der Arbeit anrufen und behaupten, man könne heute nicht zur Arbeit erscheinen, weil seine neue Lieblingsserie heute Startet.</li>
<li>Vom Mond springen (WTF?)</li>
<li>Ein Bier kaufen und nicht trinken.</li>
<li>Drei Chikennuggets-Menüs-Medium-mit-neun-Nuggets-und-Cola-und-Sweet&#8217;n'Sour-Sauce in 20min essen.</li>
<li>Fett werden.</li>
<li>Nebens Klo scheissen.</li>
<li>Facebook Profil löschen.</li>
<li>Laptop ause&#8217;m Fenster werfen.</li>
<li>Handy kaufen und beim Weg ausem Laden in de Müll schmeissen</li>
<li>18 werden.</li>
</ul>
<p>Weitere kranke Ideen folgen <img src='http://www.dedu.ch/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dedu.ch/?feed=rss2&amp;p=177</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP: Mehrdimensionalen Array sortieren</title>
		<link>http://www.dedu.ch/?p=153</link>
		<comments>http://www.dedu.ch/?p=153#comments</comments>
		<pubDate>Tue, 29 Jun 2010 08:07:47 +0000</pubDate>
		<dc:creator>DeDu</dc:creator>
				<category><![CDATA[Entwicklung]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.dedu.ch/?p=153</guid>
		<description><![CDATA[In diesem Post werde ich euch zeigen, wie man mit PHP einen mehrdimensionalen Array sortiert.]]></description>
			<content:encoded><![CDATA[<p>In diesem Post werde ich euch zeigen, wie man mit PHP einen mehrdimensionalen Array sortiert.</p>
<p><span id="more-153"></span></p>
<p>Als erstes nehmen wir einen mehrdimensionalen Array:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$foo</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;zeit 1&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">120</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;zeit 2&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">90</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;zeit 3&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">345</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;zeit 4&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">256</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;zeit 5&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">257</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;zeit 6&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1023</span><span style="color: #009900;">&#41;</span>
	  <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Als Beispiel habe ich einfach mal einen Array mit Zeiten (in Sekunden) genommen. Wie man sieht, ist dieser nach den &#8220;Zeitnamen&#8221; sortiert, und nicht nach den Zeiten ansich. Dies wollen wir jetzt ändern, so das die grösste Zeit ganz oben im Array steht.</p>
<p>Ich Zeige euch jetzt erstmal den ganzen Code, und werde ihn dan erklären.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">		<span style="color: #666666; font-style: italic;">//Unser mehrdimensionaler Array:</span>
		<span style="color: #000088;">$foo</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
					<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;zeit 1&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">120</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
					<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;zeit 2&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">90</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
					<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;zeit 3&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">345</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
					<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;zeit 4&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">256</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
					<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;zeit 5&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">257</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
					<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;zeit 6&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1023</span><span style="color: #009900;">&#41;</span>
				<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">//Ausgeben (ungeordnet):</span>
		<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$foo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">//Ordnen:</span>
		<span style="color: #000088;">$tmp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">Array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Temporaeres Array</span>
                <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$foo</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$ma</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #000088;">$tmp</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$ma</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #990000;">array_multisort</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tmp</span><span style="color: #339933;">,</span> SORT_DESC<span style="color: #339933;">,</span> <span style="color: #000088;">$foo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">//Ausgeben (geordnet):</span>
		<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$foo</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Um noch etwas klarzustellen. Rauskopieren und verwenden ist zwar erlaubt, bringt euch aber nichts <img src='http://www.dedu.ch/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  Lest lieber die folgende Beschreibung, und <em>versteht</em>, was da gemacht wird.</p>
<p>Also, am anfang steht der Array. Danach gebe ich mit print_r den Array zur kontrolle aus. (Ihr müsst eventuell noch ein &lt;pre&gt;-Tag darum machen, damit ihr die Ausgabe richtig sehen könnt.)</p>
<p>Jetzt kommt der spannende Teil <img src='http://www.dedu.ch/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Als erstes wird ein Temporäres Array erzeugt ($tmp), das nur für die Sortierung gebraucht wird. Jetz nehme ich in einer foreach-Schlaufe jede Zeit und schreibe sie in das $tmp-Array.</p>
<p>Jetzt stehen im Temporären Array also nur die Zeiten drinn. Jetzt können wir mit der Funktion <a href="http://ch2.php.net/manual/de/function.array-multisort.php" target="_blank">array_multisort</a> erst das Array $tmp ordnen, und diese &#8220;Ordnung&#8221; dann auf unser mehrdimensianles Array übertragen. Wie das genau funktioniert, kann ich euch nicht erklären (also was die Funktion array_multisort genau macht). Wenn es jemand weis, kann er gerne einen Kommentar hier lassen <img src='http://www.dedu.ch/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Wenn wir uns denn Array nun Ausgeben lassen, sehen wir, das er geordnet ist. Mann kann nun auch das &#8220;SORT_DESC&#8221; in &#8220;SORT_ASC&#8221; umändern, um den Array entweder absteigend oder aufsteigen zu ordnen. Mehr Informationen darüber erhaltet iht <a href="http://ch2.php.net/manual/de/function.array-multisort.php" target="_blank">hier</a>.</p>
<p>Fragen und Kritik (oder Lob) wie immer in die Kommentare <img src='http://www.dedu.ch/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Danke für&#8217;s lesen, und ich hoffe, es hat euch geholfen!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dedu.ch/?feed=rss2&amp;p=153</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
