<?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>nessio.de &#124; Bennis Blog &#187; Script</title>
	<atom:link href="http://nessio.de/tag/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://nessio.de</link>
	<description>Rund ums Web - Development, Webseiten, Tools, Apps, Tipps &#38; Tricks</description>
	<lastBuildDate>Thu, 05 Jan 2012 10:37:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Automatisch Leuten bei Twitter folgen</title>
		<link>http://nessio.de/2009/06/02/automatisch-leuten-bei-twitter-folgen/</link>
		<comments>http://nessio.de/2009/06/02/automatisch-leuten-bei-twitter-folgen/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 14:08:22 +0000</pubDate>
		<dc:creator>Benni</dc:creator>
				<category><![CDATA[Dev / Codeschnipsel]]></category>
		<category><![CDATA[Follow]]></category>
		<category><![CDATA[followscript]]></category>
		<category><![CDATA[friendships]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP-Script]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[TwitterUser]]></category>
		<category><![CDATA[Xml]]></category>

		<guid isPermaLink="false">http://blog.nessio.net/?p=141</guid>
		<description><![CDATA[Viele TwitterUser versuchen möglichst viele User mit gleichen Interesse zu verfolgen. Dies alles manuell per Hand zu machen ist sehr Zeit aufwendig und anstrengend, weshalb ich mir ein PHP-Script gebaut habe, was dies automatisch tut. Als erstes müssen die User-Daten sowie die Such-Variable festgelegt werden. 1 2 3 $username = $_GET&#91;'user'&#93;; $password = $_GET&#91;'pw'&#93;; $search [...]]]></description>
			<content:encoded><![CDATA[<p>Viele TwitterUser versuchen möglichst viele User mit gleichen Interesse zu verfolgen. Dies alles manuell per Hand zu machen ist sehr Zeit aufwendig und anstrengend, weshalb ich mir ein PHP-Script gebaut habe, was dies automatisch tut.</p>
<p>Als erstes müssen die User-Daten sowie die Such-Variable festgelegt werden.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'user'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'pw'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$search</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'search'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Sollen die Parameter später nicht über die URL gefüllt werden, so muss das jeweilige $_GET['*']; durch &#8216;*&#8217;; ersetzt werden.</p>
<p>Um an die User mit gleichen Datensätzen zukommen, müssen wir erst mal ein XML-Generieren welches die Gewünschten Daten beinhaltet.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">simplexml_load_file</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://search.twitter.com/search.atom?q='</span><span style="color: #339933;">.</span><span style="color: #000088;">$search</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;amp;rpp=30'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Hier wird einfach nur nach dem Wort aus $search gesucht und das ganze in die Variable $result gespeichert, wobei die rpp=30 die Ergebnisse auf 30 begrenzt.</p>
<p>Um nun die 30 Einträge auszulesen verpacken wir das ganze in eine Schleife, geben die Twitter-API Adresse sowie den CURL Befehl an und fertig ist das automatische &#8220;Follow Script&#8221;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span> <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">30</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$follow</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #339933;">-&gt;;</span>entry<span style="color: #009900;">&#91;</span><span style="color: #000088;">$count</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;;</span>author<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;;</span>uri<span style="color: #339933;">,</span> <span style="color: #cc66cc;">19</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// The twitter API address</span>
<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://twitter.com/friendships/create.xml'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Set up and execute the curl process</span>
<span style="color: #000088;">$curl_handle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl_handle</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$url</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl_handle</span><span style="color: #339933;">,</span> CURLOPT_CONNECTTIMEOUT<span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl_handle</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl_handle</span><span style="color: #339933;">,</span> CURLOPT_POST<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl_handle</span><span style="color: #339933;">,</span> CURLOPT_POSTFIELDS<span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;screen_name=<span style="color: #006699; font-weight: bold;">$follow</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl_handle</span><span style="color: #339933;">,</span> CURLOPT_USERPWD<span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$username</span>:<span style="color: #006699; font-weight: bold;">$password</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$buffer</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl_handle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl_handle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// check for success or failure</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$buffer</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'message'</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;">'success
'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$count</span><span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Das Script wird mit folgendem befehl aufegrufen. (AChtung: meine Script Datei heißt followscript.php)</p>
<blockquote><p>http://www.host.de/followscript.php?user=<strong>Twitteruser</strong>&amp;pw=<strong>Userpw</strong>&amp;search=<strong>Suchbegriff</strong></p></blockquote>
<p>So das war&#8217;s! Solltet ihr Fehler finden oder andere Unstimmigkeiten meldet mir diese bitte, vielen dank!</p>
]]></content:encoded>
			<wfw:commentRss>http://nessio.de/2009/06/02/automatisch-leuten-bei-twitter-folgen/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>StudiVZ / MeinVZ Status mit Twitter aktualisieren</title>
		<link>http://nessio.de/2009/05/13/studivz-meinvz-status-mit-twitter-aktualisieren/</link>
		<comments>http://nessio.de/2009/05/13/studivz-meinvz-status-mit-twitter-aktualisieren/#comments</comments>
		<pubDate>Wed, 13 May 2009 17:59:09 +0000</pubDate>
		<dc:creator>Benni</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Information]]></category>
		<category><![CDATA[MeinVZ]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SchülerVZ]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[StudiVZ]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://blog.nessio.net/?p=105</guid>
		<description><![CDATA[Ich gehöre zu denen Leuten die ein Facebook, MeinVZ, &#8230;. etc. Profil haben. In fast jedem Social Network hat man die Möglichkeit einen &#8220;Was ich gerade mache&#8221;-Status mit 140 Zeichen zu hinterlassen. Aber dennoch ist es doof, diese in jedem manuell zu tun. Die beste Lösung für mich ist, dass alles Synchron von Twitter ausgeht. [...]]]></description>
			<content:encoded><![CDATA[<p>Ich gehöre zu denen Leuten die ein Facebook, MeinVZ, &#8230;. etc. Profil haben. In fast jedem Social Network hat man die Möglichkeit einen &#8220;Was ich gerade mache&#8221;-Status mit 140 Zeichen zu hinterlassen. Aber dennoch ist es doof, diese in jedem manuell zu tun. Die beste Lösung für mich ist, dass alles Synchron von Twitter ausgeht.</p>
<p>Es gibt zwei Möglichkeiten seinen Twitter Status in MeinVZ, StudiVZ oder SchülerVZ zu Updaten.<br />
Möglich ist dies durch eine Schwachstelle(?) in der Mobilen VZ-Anwendung. Die erste Möglichkeit ist das man den <a href="http://twitter.mehrblog.net/">Service</a> von <a href="http://twitter.mehrblog.net/">Mehrblog</a> benutzt. Wer jedoch Angst hat seine VZ und Twitter Daten woanders zu hinterlegen, für den kommt Möglichkeit zwei, ein PHP Script von wuestenigel in Betracht.</p>
<p>Login Informationen</p>
<blockquote><p><span style="color: #000080;">$loginStudi</span> = &#8220;<span style="color: #800000;">xxx</span>&#8220;; <span style="color: #008000;">// Deine VZ Loginname</span><br />
<span style="color: #000080;">$pwStudi</span> = &#8220;<span style="color: #800000;">xxx</span>&#8220;; <span style="color: #008000;">// Dein VZ Passwort</span><br />
<span style="color: #000080;">$loginTwitter</span> = &#8220;<span style="color: #800000;">xxx</span>&#8220;; <span style="color: #008000;">// Dein Twitter Benutzername</span></p></blockquote>
<p>Letzten Twitter Status auslesen</p>
<blockquote><p><span style="color: #000080;">$ch</span> = curl_init();<br />
curl_setopt(<span style="color: #000080;">$ch</span>, CURLOPT_URL, &#8220;<span style="color: #800000;">http://twitter.com/statuses/user_timeline/$loginTwitter.json</span>”&#8221;);<br />
curl_setopt(<span style="color: #000080;">$ch</span>, CURLOPT_HEADER, false);<br />
curl_setopt(<span style="color: #000080;">$ch</span>, CURLOPT_POST, <span style="color: #ff6600;">0</span>);<br />
curl_setopt(<span style="color: #000080;">$ch</span>, CURLOPT_RETURNTRANSFER, <span style="color: #ff6600;">1</span>);<br />
<span style="color: #000080;">$buffer</span> = curl_exec(<span style="color: #000080;">$ch</span>);<br />
<span style="color: #000080;">$json</span> = json_decode(<span style="color: #000080;">$buffer</span>);<br />
<span style="color: #000080;">$text</span> = <span style="color: #800000;">$json</span>[0]-&gt;text;</p></blockquote>
<p>Neue Session generieren</p>
<blockquote><p><span style="color: #000080;">$url</span> = &#8220;<span style="color: #800000;">http://m.studivz.net/op/studivz/de/mcat/login/</span>&#8220;; <span style="color: #008000;">// Fuer andere VZ&#8217;s bitte das Studivz durch meinvz oder schuelervz ersetzen</span><br />
curl_setopt(<span style="color: #000080;">$ch</span>, CURLOPT_URL,<span style="color: #000080;">$url</span>);<br />
curl_setopt(<span style="color: #000080;">$ch</span>, CURLOPT_USERAGENT, &#8220;<span style="color: #800000;">Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en)</span>&#8220;);<br />
<span style="color: #000080;">$buffer</span> = curl_exec(<span style="color: #000080;">$ch</span>);<br />
<span style="color: #000080;">$needle</span> = &#8220;<span style="color: #800000;">/op/studivz/de/mcat/login/;jsessionid=</span>&#8220;;<br />
<span style="color: #000080;">$session</span> = substr(<span style="color: #000080;">$buffer</span>,strpos(<span style="color: #000080;">$buffer</span>,<span style="color: #000080;">$needle</span>)+strlen(<span style="color: #000080;">$needle</span>),32);</p></blockquote>
<p>Einloggen</p>
<blockquote><p><span style="color: #000080;">$url</span> = &#8220;<span style="color: #800000;">http://m.studivz.net/op/studivz/de/mcat/login/;jsessionid=</span>&#8220;.<span style="color: #000080;">$session</span>; <span style="color: #008000;">// Fuer andere VZ&#8217;s bitte das Studivz durch meinvz oder schuelervz ersetzen</span><br />
curl_setopt(<span style="color: #000080;">$ch</span>, CURLOPT_URL,<span style="color: #000080;">$url</span>);<br />
curl_setopt (<span style="color: #000080;">$ch</span>, CURLOPT_POST, <span style="color: #ff6600;">1</span>);<br />
curl_setopt(<span style="color: #000080;">$ch</span>, CURLOPT_POSTFIELDS, &#8220;<span style="color: #800000;">username=<span style="color: #000080;">$loginStudi</span>&amp;password=<span style="color: #000080;">$pwStudi</span></span>&#8220;);<br />
<span style="color: #000080;">$buffer</span> = curl_exec(<span style="color: #000080;">$ch</span>);</p></blockquote>
<p>Aktualisierung durchführen</p>
<blockquote><p><span style="color: #000080;">$url </span>= &#8220;<span style="color: #800000;">http://m.studivz.net/op/studivz/de/mcat/status/senden/;jsessionid=</span>&#8220;.<span style="color: #000080;">$session</span>; <span style="color: #008000;">// Fuer andere VZ&#8217;s bitte das Studivz durch meinvz oder schuelervz ersetzen</span><br />
curl_setopt(<span style="color: #003366;">$ch</span>, CURLOPT_URL,<span style="color: #000080;">$url</span>);<br />
curl_setopt(<span style="color: #003366;">$ch</span>, CURLOPT_POSTFIELDS, &#8220;<span style="color: #800000;">text=</span><span style="color: #000080;">$text</span>&#8220;);<br />
<span style="color: #000080;">$buffer</span> = curl_exec(<span style="color: #000080;">$ch</span>);</p></blockquote>
<p>Dies Speichert man alles in eine PHP-Datei und lässt die regelmäßig von einem Cronjob ausführen. Wer keinen Cronjob hat, für den kommt <a href="http://www.cronjob.de">Cronjob.de</a> in Frage</p>
<ul>
<li><a href="http://twitter.mehrblog.net/index.php">StudiVZ, MeinVZ &amp; SchülerVZ mit Twitter aktualisieren</a></li>
<li><a href="http://blog.nessio.net/twitter-to-msn/">MSN Status mit Twitter aktualisieren</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://nessio.de/2009/05/13/studivz-meinvz-status-mit-twitter-aktualisieren/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Auf .htaccess passwortgeschützte Seiten mit PHP zugreifen</title>
		<link>http://nessio.de/2009/04/30/auf-htaccess-passwortgeschutzte-seiten-mit-php-zugreifen/</link>
		<comments>http://nessio.de/2009/04/30/auf-htaccess-passwortgeschutzte-seiten-mit-php-zugreifen/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 12:48:43 +0000</pubDate>
		<dc:creator>Benni</dc:creator>
				<category><![CDATA[Dev / Codeschnipsel]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[fclose]]></category>
		<category><![CDATA[Funktion]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Timeout]]></category>

		<guid isPermaLink="false">http://blog.nessio.net/?p=70</guid>
		<description><![CDATA[Mal wieder ein aktuelles Problem aus dem alttag. Eine Webseite wird mittel .htaccess geschützt, wie kann man trotzdem an geschützte PHP-Seiten rankommen? Auf der Suche nach der Funktion bin ich auf folgendes Script gestoßen welches Ohne Probleme funktioniert und die .htaccess Anmeldung übernimmt. Konfiguration der Parameter 1 2 3 4 $host = &#34;domain.tld&#34;; // Dein [...]]]></description>
			<content:encoded><![CDATA[<p>Mal wieder ein aktuelles Problem aus dem alttag. Eine Webseite wird mittel .htaccess geschützt, wie kann man trotzdem an geschützte PHP-Seiten rankommen? Auf der Suche nach der Funktion bin ich auf folgendes Script gestoßen welches Ohne Probleme funktioniert und die .htaccess Anmeldung übernimmt.</p>
<p>Konfiguration der Parameter</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$host</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;domain.tld&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Dein Host, z.B. admin.server.de oder geheim.de</span>
<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;/geheim/index.html&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Die URI, auf die dann zugegriffen werden soll</span>
<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;test&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Benutzername vom .htaccess</span>
<span style="color: #000088;">$pw</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;testpwd&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Passwort vom .htaccess</span></pre></td></tr></table></div>

<p>Der eigentliche Script Inhalt</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-type: text/html&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sock</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fsockopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$host</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">80</span><span style="color: #339933;">,</span> <span style="color: #000088;">$errno</span><span style="color: #339933;">,</span> <span style="color: #000088;">$errstr</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// 80 = Port, 5 = Timeout</span>
<span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sock</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;GET &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$url</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; HTTP/1.1<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sock</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Host: &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$host</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: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sock</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Authorization: Basic &quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">base64_encode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;:&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$pw</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: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sock</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Connection: close<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>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">feof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sock</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #990000;">fgets</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sock</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4096</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Antwort lesen</span>
<span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sock</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://nessio.de/2009/04/30/auf-htaccess-passwortgeschutzte-seiten-mit-php-zugreifen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

