<?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>Two Drifters &#187; PHP</title>
	<atom:link href="http://blog.ideaday.de/max/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ideaday.de/max</link>
	<description>Off to see the world.</description>
	<lastBuildDate>Sun, 05 Feb 2012 16:48:05 +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>amMap for MediaWiki</title>
		<link>http://blog.ideaday.de/max/2011/08/ammap-for-mediawiki/</link>
		<comments>http://blog.ideaday.de/max/2011/08/ammap-for-mediawiki/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 14:06:40 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[amMap]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[MediaWiki]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SurfNext]]></category>

		<guid isPermaLink="false">http://blog.ideaday.de/max/2011/08/ammap-for-mediawiki/</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2011/08/ammap-for-mediawiki/' addthis:title='amMap for MediaWiki '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>For my worldwide Internet access project surfnext.com I developed an extension for MediaWiki to use amMap. What is amMap? amMap is a pretty cool Flash-based map which allows you to display geographical information. Check out the examples on amMap.com. It has been used on many pages world-wide, and now &#8211; thanks to SurfNext's needs &#8211; [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2011/08/ammap-for-mediawiki/' addthis:title='amMap for MediaWiki ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2011/08/ammap-for-mediawiki/' addthis:title='amMap for MediaWiki '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>For my <a title="Worldwide Internet access at your fingertips" href="http://www.surfnext.com/">worldwide Internet access project</a> surfnext.com I developed an extension for MediaWiki to use <a href="http://ammap.com/">amMap</a>.</p>
<p><strong>What is amMap?</strong></p>
<p>amMap is a pretty cool <strong>Flash-based</strong> map which allows you to display geographical information. Check out the examples on <a href="http://www.ammap.com/">amMap.com</a>. It has been used on many pages world-wide, and now &#8211; thanks to SurfNext's needs &#8211; it is coming to MediaWiki!</p>
<p><strong>What is MediaWiki?</strong></p>
<p>It is the Wiki software which is behind <a href="http://www.wikipedia.org/">Wikipedia</a> and many other major wikis. <a title="All possibilities to get online" href="http://www.surfnext.com/">SurfNext.com</a> is also based on MediaWiki. Ah, the power of free software!</p>
<p><strong>Why Flash, why amMap?</strong></p>
<p>Because there is no free JavaScript-based map out there, which is not based on tiles. (Please post a link if you know any vector-based JavaScript map !!!)</p>
<p>Unfortunately iDevices (iPhone, etc) do not have Flash capabilities. Thus, you can't see the amMap on them.</p>
<p>Android has Flash support.</p>
<p><strong>Download &amp; Credits</strong></p>
<p><A HREF="http://ideadayblog.ideaday.netdna-cdn.com/max/wp-content/uploads/2011/08/snAmmap-0.5.zip">Download version 0.5</A>. (amMap v. 2.5.7 is included).</p>
<p>amMap requires you to leave the link to amMap (inside the map) intact, or to <a href="http://www.amcharts.com/buy">buy a commercial license</a>.</p>
<p>I ask you to provide a back-link to my project <a href="http://www.surfnext.com">SurfNext.com</a>, if this extension is of value to you.</p>
<p><strong>This extension is still in early beta, use at your own risk.</strong> Post comments about the extension on this blog page, thank you!</p>
<p><strong>Installation</strong></p>
<p>snAmmap <strong>requires MediaWiki 1.17 or higher</strong>, as it uses <a href="http://www.mediawiki.org/wiki/ResourceLoader">ResourceLoader</a>. (Feel free to fork a version for earlier MediaWikis).</p>
<p>An alternative, of course, is to upgrade your Wiki. It is advisable, as the new release sports significant speed enhancements.</p>
<ul>
<li>
<div>Put the snAmmap folder in your extensions folder.</div>
</li>
<li>
<div>Add <em>require_once("$IP/extensions/snAmmap/snAmmap.php");</em> to your LocalSettings.php</div>
</li>
<li>
<div>If you want to, you can create <strong>custom data and settings files</strong> and put them somewhere in your Wiki installation path. (i.e. a folder <em>custom</em>)</div>
</li>
</ul>
<p><strong>Usage</strong></p>
<p>Currently snAmmap only supports one map per page. After you have installed the extension, use the following tag in your Wiki where you want to include the map:</p>
<blockquote><p>&lt;ammap height="500px" width="500px" bgcolor="#FFFFFF" data_file="/custom/data.xml" settings_file="/custom/settings.xml"&gt;Placeholder text&lt;/ammap&gt;</p></blockquote>
<p>None of the tag's attributes are required, there are sensible defaults for them (falling back on the data_file and settings_file provided with amMap, for instance.)</p>
<ul dir="ltr">
<li>
<div>height =&gt; sets the height of the map. Can be a percentage</div>
</li>
<li>
<div>width =&gt; sets the width. Can also be a percentage.</div>
</li>
<li>
<div>bgcolor =&gt; sets the initial background color, which can be modified in the settings file later.</div>
</li>
<li>
<div>data_file =&gt; sets the path (URL!) for the data_file. Can be a full URL with hostname, but you have to enable cross-site scripting, which is dangerous. Use a file from your server, preferably.</div>
</li>
<li>
<div>settings_file =&gt; sets the path for the settings_file</div>
</li>
</ul>
<p>See the <a href="http://ammap.com/docs/">documentation </a> of amMap for more details and information what you can modify.</p>
<p><strong>Live Example</strong></p>
<p><a href="http://www.surfnext.com/">SurfNext.com </a> uses the snAmmap extension on the main page in conjunction with custom data and settings files for a map which links to Wiki pages. It also has a dropdown menu from which you can select the individual countries by name, which also links to the Wiki pages.</p>
<p>SurfNext shows you how to obtain Internet access everywhere in the world. Feel free to join and participate!</p>
<p>Feel free to comment about SurfNext on this blog page.</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2011/08/ammap-for-mediawiki/' addthis:title='amMap for MediaWiki ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ideaday.de/max/2011/08/ammap-for-mediawiki/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apache 2 not starting</title>
		<link>http://blog.ideaday.de/max/2011/03/apache-2-not-starting/</link>
		<comments>http://blog.ideaday.de/max/2011/03/apache-2-not-starting/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 17:57:32 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[Apache2]]></category>
		<category><![CDATA[eAccelerator]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[problem]]></category>

		<guid isPermaLink="false">http://blog.ideaday.de/max/2011/03/apache-2-not-starting/</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2011/03/apache-2-not-starting/' addthis:title='Apache 2 not starting '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>After doing a apt-get upgrade your Apache does not start / does not serve connections? Read on! somesystem.root# /etc/init.d/apache2 start Starting web server: apache2[Tue Mar 22 18:18:02 2011] (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logsfailed! Binding to adress 0.0.0.0:80 means accepting [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2011/03/apache-2-not-starting/' addthis:title='Apache 2 not starting ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2011/03/apache-2-not-starting/' addthis:title='Apache 2 not starting '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>After doing a apt-get upgrade your Apache does not start / does not serve connections? <strong>Read on!</strong></p>
<blockquote>
<p><strong>somesystem.root# /etc/init.d/apache2 start</strong><br />
Starting web server: apache2[Tue Mar 22 18:18:02 2011]<br />
<em>(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80<br />
no listening sockets available, shutting down<br />
Unable to open logs<br /></em>failed!</p>
</blockquote>
<p>Binding to adress <em>0.0.0.0:80</em> means accepting all connections. There is nothing wrong here, nor probably in the Apache setup files &#8211; which have been correct before.</p>
<p>The error can be caused by Apache 2 <strong>already running!</strong> Try <strong>ps awx</strong> to see all processes, look for Apache 2 and perhaps rotatelogs.</p>
<p>After killing the processes using <strong>kill -9 pid_one pid_two</strong> (replace pid_one pid_two with the appropriate process ids &#8211; you can specify multiple at once) try starting apache again (using <strong>apache2ctl -k start</strong> for instance).</p>
<p>This time Apache should start without problems. <strong>But it will not serve requests, and the Apache PID may not be written</strong>. (Thus, apache2ctl will assume that Apache is not yet running!)</p>
<p>Check your error log for the last entries. In my case the following entry was the key to fixing the problem:</p>
<blockquote>
<p><em>PHP Warning: [eAccelerator] This build of "eAccelerator" was compiled for PHP version 5.2.6-1+lenny3. Rebuild it for your PHP version (5.2.6-1+lenny10) or download precompiled binaries.</em></p>
<p><em>in Unknown on line 0<br />
PHP Fatal error: Unable to start eAccelerator module in Unknown on line 0</em></p>
</blockquote>
<p>PHP's error was blocking the whole Apache! The quick solution for this particular problem (yours may be different) was to edit <strong>/etc/php5/apache2/php.ini</strong> and comment the lines setting up eAccelerator. (You need to use ";" as comment character for this file).</p>
<p>After the fix, killing the running Apache process(es), and starting Apache again, it resumed normal operation.</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2011/03/apache-2-not-starting/' addthis:title='Apache 2 not starting ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ideaday.de/max/2011/03/apache-2-not-starting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery AJAX &amp; Internet Explorer</title>
		<link>http://blog.ideaday.de/max/2010/05/jquery-ajax-internet-explorer/</link>
		<comments>http://blog.ideaday.de/max/2010/05/jquery-ajax-internet-explorer/#comments</comments>
		<pubDate>Wed, 26 May 2010 14:47:45 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.ideaday.de/max/2010/05/jquery-ajax-internet-explorer/</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/05/jquery-ajax-internet-explorer/' addthis:title='jQuery AJAX &#38; Internet Explorer '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>Internet Explorer getJSON trouble This piece of code initially did not work for me on IE: $.getJSON("../inc/exercise_ajax.php?" + $(this).serialize(), function(json) FireFox worked without problems. The reason is that my JSON code was not well-formed. It had a comma (',') too much. Here's the code which I use in PHP to create my JSON (braces omitted): [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/05/jquery-ajax-internet-explorer/' addthis:title='jQuery AJAX &#38; Internet Explorer ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/05/jquery-ajax-internet-explorer/' addthis:title='jQuery AJAX &amp; Internet Explorer '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p><strong>Internet Explorer getJSON trouble</strong></p>
<p>This piece of code initially did not work for me on IE:</p>
<blockquote>
<p>$.getJSON("../inc/exercise_ajax.php?" + $(this).serialize(), function(json)</p>
</blockquote>
<p>FireFox worked without problems.</p>
<p>The reason is that my JSON code was not well-formed. It had a comma (',') too much.</p>
<p>Here's the code which I use in PHP to create my JSON (braces omitted):</p>
<blockquote>
<p>foreach($answers as $question =&gt; $answer){<br />
 $outstr .= '"q'.$question.'": ';<br />
 if (isset($_GET[$question])){<br />
 if ($_GET[$question] == $answer) $outstr .= 'true';<br />
 else $outstr .= 'false';<br />
 } else $outstr .= 'null';<br />
 $outstr .= ',';<br />
 }<br />
<strong>echo chop($outstr,',');</strong></p>
</blockquote>
<p>You have to chop off the trailing comma &#8211; if you don't, IE will choke on it and your callback function won't be executed.</p>
<p><strong>Internet Explorer &amp; AJAX caching</strong></p>
<p>Yes, Internet Explorer caches your requests. You've got to empty the browser cache before testing the fix I mentioned. Also, you should append a unique parameter to suppress caching, i.e. the current timestamp. Example:</p>
<blockquote>
<p>  var now = new Date();<br />
  // submit with AJAX<br />
  $.getJSON("../inc/exercise_ajax.php?ts=" + now.getTime() + '&amp;' + $(this).serialize(), function(json)</p>
</blockquote>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/05/jquery-ajax-internet-explorer/' addthis:title='jQuery AJAX &amp; Internet Explorer ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ideaday.de/max/2010/05/jquery-ajax-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding content to the head of Lectora HTML output</title>
		<link>http://blog.ideaday.de/max/2010/05/adding-content-to-the-head-of-lectora-html-output/</link>
		<comments>http://blog.ideaday.de/max/2010/05/adding-content-to-the-head-of-lectora-html-output/#comments</comments>
		<pubDate>Sun, 23 May 2010 13:20:14 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Lectora]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.ideaday.de/max/2010/05/adding-content-to-the-head-of-lectora-html-output/</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/05/adding-content-to-the-head-of-lectora-html-output/' addthis:title='Adding content to the head of Lectora HTML output '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>There's the possibility to add an "external HTML object". If you choose "header scripting", your content would be added to the &#60;script&#62; section of Lectora in the header. In most cases that's not what you want to achieve. There's another strange option "Top of file scripting" which simply inserts your content just before the &#60;!DOCTYPE&#62; [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/05/adding-content-to-the-head-of-lectora-html-output/' addthis:title='Adding content to the head of Lectora HTML output ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/05/adding-content-to-the-head-of-lectora-html-output/' addthis:title='Adding content to the head of Lectora HTML output '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>There's the possibility to add an "external HTML object". If you choose <strong>"header scripting"</strong>, your content would be added to the &lt;script&gt; section of Lectora in the header. In most cases that's <strong>not</strong> what you want to achieve. There's another strange option "Top of file scripting" which simply inserts your content just before the &lt;!DOCTYPE&gt; tag. The only use I can see for this is for PHP scripting which needs to be done before any output was sent to the browser (i.e. header modification).</p>
<p>What you want to choose <strong>to include arbitrary content to the &lt;HEAD&gt; section</strong> of Lectora generated HTML documents is the <strong>"META Tag"</strong> option. Unfortunately, this does not allow to include external .txt files, so you have to paste your code in Lectora's input window. (You would have needed to update the .txt file anyways, as Lectora stays with the initial .txt file version instead of updating it from the hard disk every time. That way it's not really a big loss that you can't use .txt files.)</p>
<p>And there IS a way to include a file's contents in the header. Just drop a PHP file somewhere on your server and include it using the following as a "meta tag":</p>
<blockquote>
<p>&lt;?php include('your/path/to/header.php');?&gt;</p>
</blockquote>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/05/adding-content-to-the-head-of-lectora-html-output/' addthis:title='Adding content to the head of Lectora HTML output ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ideaday.de/max/2010/05/adding-content-to-the-head-of-lectora-html-output/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding aliases to Concrete5 pages programmatically.</title>
		<link>http://blog.ideaday.de/max/2010/04/adding-aliases-to-concrete5-pages-programmatically/</link>
		<comments>http://blog.ideaday.de/max/2010/04/adding-aliases-to-concrete5-pages-programmatically/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 12:28:39 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[Concrete 5]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[alias]]></category>
		<category><![CDATA[Concrete5]]></category>
		<category><![CDATA[explanation]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.ideaday.de/max/2010/04/adding-aliases-to-concrete5-pages-programmatically/</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/04/adding-aliases-to-concrete5-pages-programmatically/' addthis:title='Adding aliases to Concrete5 pages programmatically. '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>Suppose, you want to provide legacy URLs when porting the page to a new version. I need to do this, as I am writing the IdeaDay Import Wizard. An example: The new page will be under /my/new/page You want a legacy alias under /legacy_path/legacy_name There is a function $page-&#62;addCollectionAlias($c); which will alias your Collection UNDER [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/04/adding-aliases-to-concrete5-pages-programmatically/' addthis:title='Adding aliases to Concrete5 pages programmatically. ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/04/adding-aliases-to-concrete5-pages-programmatically/' addthis:title='Adding aliases to Concrete5 pages programmatically. '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>Suppose, you want to provide legacy URLs when porting the page to a new version. I need to do this, as I am writing the IdeaDay Import Wizard.</p>
<p>An example:</p>
<ul>
<li>
<div>The new page will be under /my/new/page</div>
</li>
<li>
<div>You want a legacy alias under /legacy_path/legacy_name</div>
</li>
</ul>
<p>There is a function <strong>$page-&gt;addCollectionAlias($c);</strong> which will alias your Collection UNDER another Collection (essentially adding the page with the same name elsewhere). We could use this, but would need to work around the new page's name and cHandle (which will change: page != legacy_name)</p>
<p>How does C5 handle this internally, when editing page aliases?</p>
<p>/concrete/startup/process.php contains the code (look for else if ($_POST['update_metadata']) and continue to read).</p>
<p>It essentially sets $data['ppURL'] to the aliases (new AND old), and uses $page-&gt;update($data);</p>
<p>There is one important thing to consider: to add a new path, the key needs to be a string! This had me baffled for one hour.</p>
<p><strong>So, the entire code to add one new alias, AND keep all the old ones will be:</strong></p>
<blockquote>
<p>  $this_page_paths = $in_pg-&gt;getPagePaths();  <br />
  $new_paths = array();<br />
  foreach($this_page_paths as $path){<br />
   if (!$path['ppIsCanonical']) {<br />
    $new_paths[$path['ppID']] = $path['cPath'];<br />
   }<br />
  }<br />
  $new_paths['add_path'] = $add_alias;<br />
  $data = array();<br />
  $data['ppURL'] = $new_paths;<br />
  $in_pg-&gt;update($data);</p>
</blockquote>
<p>$in_pg is the page you want to add the alias to. It is important that you check for the path being canonical, else your main page path will be overwritten (and the page will be redirecting to /). The new path ($add_alias) is added with a string (it does not matter which string you use).</p>
<p>We could use <strong>rescanPagePaths</strong> to do it directly, but we should not: update fires <strong>on_page_update</strong> events, for instance.</p>
<p>Now to the second part: modifying .htaccess to provide compatibility.</p>
<blockquote>
<p> RewriteRule ^(.*)\.phtml(.*)$ $1$2 [L]</p>
</blockquote>
<p>By adding this rule you will be stripping out .phtml from your links -&gt; thus, compatibility with the following path from our example would be preserved:</p>
<blockquote>
<p>/legacy_path/legacy_name.phtml</p>
</blockquote>
<p>This rewriting is necessary, as Concrete does not allow dots (.) in page paths &#8211; it replaces them by an underscore.</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/04/adding-aliases-to-concrete5-pages-programmatically/' addthis:title='Adding aliases to Concrete5 pages programmatically. ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ideaday.de/max/2010/04/adding-aliases-to-concrete5-pages-programmatically/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Concrete5 errors</title>
		<link>http://blog.ideaday.de/max/2010/03/concrete5-errors/</link>
		<comments>http://blog.ideaday.de/max/2010/03/concrete5-errors/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 20:06:40 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[Concrete 5]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[Concrete5]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[explanation]]></category>
		<category><![CDATA[Fehler]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.ideaday.de/max/2010/03/concrete5-errors/</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/03/concrete5-errors/' addthis:title='Concrete5 errors '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>Fatal error: Class 'CollectionAttributeKey' not found in (&#8230;)/concrete/models/collection.php on line 183 This class is defined in concrete5.3.3.1\concrete\models\attribute\categories\collection.php The problem is easily resolved by loading the appropriate model in your code: Loader::model('attribute/categories/collection');<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/03/concrete5-errors/' addthis:title='Concrete5 errors ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/03/concrete5-errors/' addthis:title='Concrete5 errors '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p><strong>Fatal error: Class <em>'CollectionAttributeKey'</em> not found in (&#8230;)/concrete/models/collection.php on line 183<br /></strong></p>
<p>This class is defined in <em>concrete5.3.3.1\concrete\models\attribute\categories\collection.php</em></p>
<p>The problem is easily resolved by loading the appropriate model in your code:</p>
<p><em>Loader::model('attribute/categories/collection');</em></p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/03/concrete5-errors/' addthis:title='Concrete5 errors ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ideaday.de/max/2010/03/concrete5-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Concrete5 :: interacting with the database</title>
		<link>http://blog.ideaday.de/max/2010/03/concrete5-interacting-with-the-database/</link>
		<comments>http://blog.ideaday.de/max/2010/03/concrete5-interacting-with-the-database/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 09:02:29 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[Concrete 5]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Concrete5]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.ideaday.de/max/2010/03/concrete5-interacting-with-the-database/</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/03/concrete5-interacting-with-the-database/' addthis:title='Concrete5 :: interacting with the database '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>The C5 API has a class Database in the core package (libraries/database.php). Alas, this is not the documentation we're looking for (we're looking for query, etc. methods, which are not present there). Actually the methods used come directly from the included ADODB librarary. You can download a documentation here. Usage: //Load the Database Layer. $db [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/03/concrete5-interacting-with-the-database/' addthis:title='Concrete5 :: interacting with the database ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/03/concrete5-interacting-with-the-database/' addthis:title='Concrete5 :: interacting with the database '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>The C5 <a title="C5 API" href="http://concrete5.org/api/" target="_blank">API</a> has a class <strong>Database</strong> in the <strong>core</strong> package (<em>libraries/database.php</em>). Alas, this is not the documentation we're looking for (we're looking for query, etc. methods, which are not present there).</p>
<p>Actually the methods used come directly from the included ADODB librarary. You can download a documentation <a title="Documentation for AdoDB which Concrete5 runs on" href="http://adodb.sourceforge.net/#docs" target="_blank">here</a>.</p>
<p><strong>Usage:</strong></p>
<blockquote>
<p>//Load the Database Layer.<br />
$db = Loader::db();<br />
//quote the string we'll be inserting (use get_magic_quotes_gpc() as second parameter to avoid double escaping!)<br />
$source = $db-&gt;qstr($source, get_magic_quotes_gpc());<br />
$content = $db-&gt;qstr($content);<br />
$sql = "insert into IdImportWizardSources (source, content) ";<br />
$sql .= "values ($source,$content)";<br />
if ($db-&gt;Execute($sql)===false) {<br />
//error handling<br />
echo 'error inserting: ' .$db-&gt;ErrorMsg();<br />
}</p>
</blockquote>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/03/concrete5-interacting-with-the-database/' addthis:title='Concrete5 :: interacting with the database ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ideaday.de/max/2010/03/concrete5-interacting-with-the-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FormHelper select</title>
		<link>http://blog.ideaday.de/max/2010/03/formhelper-select/</link>
		<comments>http://blog.ideaday.de/max/2010/03/formhelper-select/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 12:59:33 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[Concrete 5]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[Concrete5]]></category>
		<category><![CDATA[explanation]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.ideaday.de/max/2010/03/formhelper-select/</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/03/formhelper-select/' addthis:title='FormHelper select '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>Not understanding the Concrete 5 API comment on the select function of the Form Helper, I looked into the source: /** * Renders a select field. First argument is the name of the field. Second is an associative array of key =&#62; display. Second argument is either the value of the field to be selected [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/03/formhelper-select/' addthis:title='FormHelper select ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/03/formhelper-select/' addthis:title='FormHelper select '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>Not understanding the Concrete 5 API comment on the select function of the Form Helper, I looked into the source:</p>
<blockquote>
<p>/**<br />
 * Renders a select field. First argument is the name of the field. Second is an associative array of key =&gt; display. Second argument is either the value of the field to be selected (and if it's blank we check post) or a misc. array of fields<br />
 * @param string $key<br />
 * @return $html<br />
 */<br />
 <strong>public function select($key, $values, $valueOrArray = false, $miscFields = array())</strong></p>
</blockquote>
<p>Select builds a SELECT Dopdown with OPTIONS. That much I already understood from the API.</p>
<p>Here's my explanation of the parameters passed in to select:</p>
<ul>
<li>
<div><strong>$key</strong>: the name of the element to be created.</div>
</li>
<li>
<div><strong>$values</strong>: an array of options, stored as $k=&gt;$value. Used like this:<br />
 <em>'&lt;option value="' . $k . '" ' . $selected . '&gt;' . $value . '&lt;/option&gt;';</em></div>
</li>
<li>
<div><strong>$valueOrArray</strong>: this can either be set to the default value to be selected (use the option value, not the displayed text between the tags) OR it can be an array and is used as the array to populate <strong>$miscFields</strong> (see explanation there), omitting the default value. A bit unusual perhaps, probably it's a timesaver when you code these forms a lot.</div>
</li>
<li>
<div><strong>$miscFields</strong>: An associative array ($k =&gt; $value): insert additional keys into the tag (i.e. multiple="multiple"</div>
</li>
</ul>
<p>The fun in using select is, it STORES your settings between sessions. Boy, I should have used it earlier, when hand-coding this for other parts of the project.</p>
<p>Another note on <strong>ValidationErrorHelper</strong>:</p>
<blockquote>
<p>/**<br />
   * Returns whether or not this error helper has more than one error registered within it.<br />
   * @return bool<br />
   */<br />
  public function has() {<br />
   return (count($this-&gt;error) &gt; 0);<br />
  }</p>
</blockquote>
<p>As one can read from the source above, the Validation Helper returns whether there are errors (even if it is only one) or there are none!</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/03/formhelper-select/' addthis:title='FormHelper select ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ideaday.de/max/2010/03/formhelper-select/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server Management Software</title>
		<link>http://blog.ideaday.de/max/2010/03/server-management-software/</link>
		<comments>http://blog.ideaday.de/max/2010/03/server-management-software/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 16:41:00 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[German]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[Administration]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Server Control Panel]]></category>

		<guid isPermaLink="false">http://blog.ideaday.de/max/2010/03/server-management-software/</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/03/server-management-software/' addthis:title='Server Management Software '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>Wir sind dazu bereit, den nächsten Schritt zu gehen und die Verwaltung des Webservers von manuell auf semi-manuell umzustellen. Unser Mailsystem wird nach wie vor vom Websystem abgekoppelt laufen &#8211; auf Zimbra-Basis. Für den Webserver selber rüsten wir eine Server Management Software nach. Sie muß einen typischen LAMP Server unterstützen (Linux &#8211; Debian / Apache [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/03/server-management-software/' addthis:title='Server Management Software ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/03/server-management-software/' addthis:title='Server Management Software '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p>Wir sind dazu bereit, den nächsten Schritt zu gehen und die Verwaltung des Webservers von manuell auf semi-manuell umzustellen.</p>
<p>Unser Mailsystem wird nach wie vor vom Websystem abgekoppelt laufen &#8211; auf Zimbra-Basis.</p>
<p>Für den Webserver selber rüsten wir eine Server Management Software nach. Sie muß einen typischen LAMP Server unterstützen (Linux &#8211; Debian / Apache / MySQL / PHP)</p>
<p><strong>Hier sind die Kandidaten:</strong></p>
<ol>
<li>
<div><a title="SysCP Server Management" href="http://www.syscp.org/" target="_blank">SysCP</a></p>
<p>Gut dokumentiert, aktive Community, interessanter Funktionsumfang (inklusive Resellern die ihre Kunden selbst administrieren können usw.), deutsches User Interface verfügbar.</p>
<p>Natürlich Open Source.</p>
</div>
</li>
<li>
<div><a href="http://en.wikipedia.org/wiki/Lxadmin" target="_blank">Kloxo / HyperVM</a></p>
<p>Interessant für unser Setup (OpenVZ, mehrere VPMs, &#8230;); allerdings evtl. nur auf englisch und massiver Overkill. Es heißt, dass es als Open Source released wurde, jedoch ist auf der Firmenseite etwas von Lizenzkosten die Rede &#8230;</p>
</div>
</li>
<li>
<div><a href="http://www.virtualmin.com/">http://www.virtualmin.com/</a></p>
<p>Virtualmin ist eine weitere Möglichkeit. Hier sticht ebenfalls keine Sprachunterstützung heraus, das System ist komplex und deckt z.B. detaillierte CPU Leistung usw. Statistiken ab.</p>
<p>Unterstützt einen hohen Grad von Sicherheit bei PHP &#8211; die Prozesse werden unter dem jeweiligen User ausgeführt, mit suexec und mod_fastcgi. Siehe auch: <a href="http://en.wikipedia.org/wiki/Webmin">http://en.wikipedia.org/wiki/Webmin</a></p>
</div>
</li>
<li>
<div><a href="http://openlsm.sourceforge.net/demo.php" target="_blank">OpenLSM</a></p>
<p>Eine indische Software mit einer schönen, aber leider nicht so informativen Webseite. In der Feauture Liste schaut das Produkt gut aus &#8211; Anlegen von Resellern, Monitoring, &#8230; Unterstützt auch Subversion.</p>
</div>
</li>
<li>
<div><a href="http://www.vhcs.net/index.html" target="_blank">VHCS</a></p>
<p>Obwohl auf anderen Seiten behauptet wird, dass das Projekt tot sei, ist es nicht so. Die Jungs arbeiten gerade an Release 2.6, der Web 2.0 in VHCS bringen soll. Das Interface schaut übersichtlich und aufgeräumt aus.</p>
</div>
</li>
<li>
<div><a href="http://www.openpanel.com/" target="_blank">OpenPanel</a></p>
<p>Schaut sehr, sehr gut aus &#8211; ein JavaScript zentriertes UserInterface. Leider ist es seit Juli 2008 in Beta 0.9.5 stehen geblieben. Eine 1.0 steht fast vor der Tür &#8211; sie wird Debian 5.0 unterstützen. Definitiv einen Blick wert &#8211; auch wenn es erstmal nur in Englisch ist.<br />
Wird von  <a href="http://www.panelsix.com/" target="_blank">PanelSix</a> entwickelt, hier ist die <a href="http://documentation.openpanel.com/index.php/Main_Page" target="_blank">Doku</a>.</p>
</div>
</li>
</ol>
<p>Hier ist noch ein <a href="http://en.wikipedia.org/wiki/Comparison_of_web_hosting_control_panels" target="_blank">Überblick</a> auf Wikipedia (EN).</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/03/server-management-software/' addthis:title='Server Management Software ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ideaday.de/max/2010/03/server-management-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL</title>
		<link>http://blog.ideaday.de/max/2010/02/mysql/</link>
		<comments>http://blog.ideaday.de/max/2010/02/mysql/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 15:22:13 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[German]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[Fehler]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP error]]></category>

		<guid isPermaLink="false">http://blog.ideaday.de/max/2010/02/mysql/</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/02/mysql/' addthis:title='MySQL '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>[25-Feb-2010 16:15:46] PHP Warning: mysql_real_escape_string() [&#60;a href='function.mysql-real-escape-string'&#62;function.mysql-real-escape-string&#60;/a&#62;]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in &#8230; on line 38 [25-Feb-2010 16:15:46] PHP Warning: mysql_real_escape_string() [&#60;a href='function.mysql-real-escape-string'&#62;function.mysql-real-escape-string&#60;/a&#62;]: A link to the server could not be established in &#8230; on line 38 (&#8230;) Lösung des Problems: die Funktion mysql-real-escape-string erfordert eigentlich zwei Parameter: zuerst [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/02/mysql/' addthis:title='MySQL ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://blog.ideaday.de/max/2010/02/mysql/' addthis:title='MySQL '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><blockquote>
<p>[25-Feb-2010 16:15:46] PHP Warning: mysql_real_escape_string() [&lt;a href='function.mysql-real-escape-string'&gt;function.mysql-real-escape-string&lt;/a&gt;]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in &#8230; on line 38<br />
[25-Feb-2010 16:15:46] PHP Warning: mysql_real_escape_string() [&lt;a href='function.mysql-real-escape-string'&gt;function.mysql-real-escape-string&lt;/a&gt;]: A link to the server could not be established in &#8230; on line 38<br />
(&#8230;)</p>
</blockquote>
<p><strong>Lösung des Problems:<br /></strong> die Funktion mysql-real-escape-string erfordert eigentlich zwei Parameter: zuerst den $unescaped_string, dann die resource $link_identifier. Lässt man zweiteres weg, versucht MySQL die aktuell zuletzt geöffnete Verbindung zu benutzen.</p>
<p>Ich habe in meinem Skript den Zugang zur Datenbank erst danach geöffnet. (Das ist der wichtigste Unterschied zwischen mysql_escape_string und mysql_real_escape_string &#8211; ersteres erfordert KEINEN Zugriff auf die Datenbank!)</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://blog.ideaday.de/max/2010/02/mysql/' addthis:title='MySQL ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ideaday.de/max/2010/02/mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/44 queries in 0.017 seconds using disk: basic
Object Caching 1156/1254 objects using disk: basic
Content Delivery Network via ideadayblog.ideaday.netdna-cdn.com

Served from: blog.ideaday.de @ 2012-02-06 18:15:47 -->
