<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Convert ASP to PHP with ASPA</title>
	<atom:link href="http://www.sitepoint.com/blogs/2005/11/17/convert-asp-to-php-with-aspa/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sitepoint.com/blogs/2005/11/17/convert-asp-to-php-with-aspa/</link>
	<description>News, opinion, and fresh thinking for web developers and designers. The official podcast of sitepoint.com.</description>
	<lastBuildDate>Mon, 23 Nov 2009 12:09:39 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: dflock</title>
		<link>http://www.sitepoint.com/blogs/2005/11/17/convert-asp-to-php-with-aspa/comment-page-1/#comment-823766</link>
		<dc:creator>dflock</dc:creator>
		<pubDate>Sun, 09 Nov 2008 16:03:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1309#comment-823766</guid>
		<description>ASPA is now available here, if anyone wants it:

&lt;a href=&quot;http://rainbow.cs.unipi.gr/projects/aspa&quot; rel=&quot;nofollow&quot;&gt;http://rainbow.cs.unipi.gr/projects/aspa&lt;/a&gt;

It hasn&#039;t been updated in quite some time though.</description>
		<content:encoded><![CDATA[<p>ASPA is now available here, if anyone wants it:</p>
<p><a href="http://rainbow.cs.unipi.gr/projects/aspa" rel="nofollow">http://rainbow.cs.unipi.gr/projects/aspa</a></p>
<p>It hasn&#8217;t been updated in quite some time though.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.sitepoint.com/blogs/2005/11/17/convert-asp-to-php-with-aspa/comment-page-1/#comment-757455</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 08 Jul 2008 05:35:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1309#comment-757455</guid>
		<description>&lt;?php 
header(&quot;Content-type: text/xml&quot;); 
require(&quot;db.php&quot;); 

function parseToXML($htmlStr) 
{ 
$xmlStr=str_replace(&#039;&lt;&#039;,&#039;&#039;,&#039;&gt;&#039;,$xmlStr); 
$xmlStr=str_replace(&#039;&quot;&#039;,&#039;&quot;&#039;,$xmlStr); 
$xmlStr=str_replace(&quot;&#039;&quot;,&#039;&#039;&#039;,$xmlStr); 
$xmlStr=str_replace(&quot;&amp;&quot;,&#039;&amp;&#039;,$xmlStr); 
return $xmlStr; 
} 

// Get parameters from URL 
$center_lat = $_GET[&quot;lat&quot;]; 
$center_lng = $_GET[&quot;lng&quot;]; 
$radius = $_GET[&quot;radius&quot;]; 

// Opens a connection to a MySQL server 
$connection=mysql_connect (localhost, $username, $password); 
if (!$connection) { 
die(&#039;Not connected : &#039; . mysql_error()); 
} 

// Set the active MySQL database 
$db_selected = mysql_select_db($database, $connection); 
if (!$db_selected) { 
die (&#039;Can\&#039;t use db : &#039; . mysql_error()); 
} 

// Select all the rows in the markers table 
$query = sprintf(&quot;SELECT address, name, lat, lng, ( 3959 * acos( cos( radians(&#039;%s&#039;) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(&#039;%s&#039;) ) + sin( radians(&#039;%s&#039;) ) * sin( radians( lat ) ) ) ) AS distance FROM markers HAVING distance &lt; &#039;%s&#039; ORDER BY distance LIMIT 0 , 20&quot;, 
mysql_real_escape_string($center_lat), 
mysql_real_escape_string($center_lng), 
mysql_real_escape_string($center_lat), 
mysql_real_escape_string($radius)); 

$result = mysql_query($query); 
if (!$result) { 
die(&#039;Invalid query: &#039; . mysql_error()); 
} 

// Start XML file, echo parent node 
echo &quot;\n&quot;; 
// Iterate through the rows, printing XML nodes for each 
while ($row = @mysql_fetch_assoc($result)){ 
// ADD TO XML DOCUMENT NODE 
echo &#039; &#039;; 
echo &#039;name=&quot;&#039; . parseToXML($row[&#039;name&#039;]) . &#039;&quot; &#039;; 
echo &#039;address=&quot;&#039; . parseToXML($row[&#039;address&#039;]) . &#039;&quot; &#039;; 
echo &#039;lat=&quot;&#039; . $row[&#039;lat&#039;] . &#039;&quot; &#039;; 
echo &#039;lng=&quot;&#039; . $row[&#039;lng&#039;] . &#039;&quot; &#039;; 
echo &#039;distance=&quot;&#039; . $row[&#039;distance&#039;] . &#039;&quot; &#039;; 
echo &quot;/&gt;\n&quot;; 
} 

// End XML file 
echo &quot;\n&quot;; 


?&gt;</description>
		<content:encoded><![CDATA[<p>&lt;?php<br />
header(&#8221;Content-type: text/xml&#8221;);<br />
require(&#8221;db.php&#8221;); </p>
<p>function parseToXML($htmlStr)<br />
{<br />
$xmlStr=str_replace(&#8217;&lt;&#8217;,&#8221;,&#8217;&gt;&#8217;,$xmlStr);<br />
$xmlStr=str_replace(&#8217;&#8221;&#8216;,&#8217;&#8221;&#8216;,$xmlStr);<br />
$xmlStr=str_replace(&#8221;&#8216;&#8221;,&#8221;&#8217;,$xmlStr);<br />
$xmlStr=str_replace(&#8221;&amp;&#8221;,&#8217;&amp;&#8217;,$xmlStr);<br />
return $xmlStr;<br />
} </p>
<p>// Get parameters from URL<br />
$center_lat = $_GET["lat"];<br />
$center_lng = $_GET["lng"];<br />
$radius = $_GET["radius"]; </p>
<p>// Opens a connection to a MySQL server<br />
$connection=mysql_connect (localhost, $username, $password);<br />
if (!$connection) {<br />
die(&#8217;Not connected : &#8216; . mysql_error());<br />
} </p>
<p>// Set the active MySQL database<br />
$db_selected = mysql_select_db($database, $connection);<br />
if (!$db_selected) {<br />
die (&#8217;Can\&#8217;t use db : &#8216; . mysql_error());<br />
} </p>
<p>// Select all the rows in the markers table<br />
$query = sprintf(&#8221;SELECT address, name, lat, lng, ( 3959 * acos( cos( radians(&#8217;%s&#8217;) ) * cos( radians( lat ) ) * cos( radians( lng ) &#8211; radians(&#8217;%s&#8217;) ) + sin( radians(&#8217;%s&#8217;) ) * sin( radians( lat ) ) ) ) AS distance FROM markers HAVING distance &lt; &#8216;%s&#8217; ORDER BY distance LIMIT 0 , 20&#8243;,<br />
mysql_real_escape_string($center_lat),<br />
mysql_real_escape_string($center_lng),<br />
mysql_real_escape_string($center_lat),<br />
mysql_real_escape_string($radius)); </p>
<p>$result = mysql_query($query);<br />
if (!$result) {<br />
die(&#8217;Invalid query: &#8216; . mysql_error());<br />
} </p>
<p>// Start XML file, echo parent node<br />
echo &#8220;\n&#8221;;<br />
// Iterate through the rows, printing XML nodes for each<br />
while ($row = @mysql_fetch_assoc($result)){<br />
// ADD TO XML DOCUMENT NODE<br />
echo &#8216; &#8216;;<br />
echo &#8216;name=&#8221;&#8216; . parseToXML($row['name']) . &#8216;&#8221; &#8216;;<br />
echo &#8216;address=&#8221;&#8216; . parseToXML($row['address']) . &#8216;&#8221; &#8216;;<br />
echo &#8216;lat=&#8221;&#8216; . $row['lat'] . &#8216;&#8221; &#8216;;<br />
echo &#8216;lng=&#8221;&#8216; . $row['lng'] . &#8216;&#8221; &#8216;;<br />
echo &#8216;distance=&#8221;&#8216; . $row['distance'] . &#8216;&#8221; &#8216;;<br />
echo &#8220;/&gt;\n&#8221;;<br />
} </p>
<p>// End XML file<br />
echo &#8220;\n&#8221;; </p>
<p>?&gt;</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Brett</title>
		<link>http://www.sitepoint.com/blogs/2005/11/17/convert-asp-to-php-with-aspa/comment-page-1/#comment-750076</link>
		<dc:creator>Brett</dc:creator>
		<pubDate>Tue, 24 Jun 2008 17:03:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1309#comment-750076</guid>
		<description>http://storm.cs.unipi.gr/~anakreon/aspa.html has been taken offline :(. What else is their besides asp2php now?</description>
		<content:encoded><![CDATA[<p><a href="http://storm.cs.unipi.gr/~anakreon/aspa.html" rel="nofollow">http://storm.cs.unipi.gr/~anakreon/aspa.html</a> has been taken offline :(. What else is their besides asp2php now?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.sitepoint.com/blogs/2005/11/17/convert-asp-to-php-with-aspa/comment-page-1/#comment-89693</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Sat, 11 Nov 2006 16:10:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1309#comment-89693</guid>
		<description></description>
		<content:encoded><![CDATA[]]></content:encoded>
	</item>
	<item>
		<title>By: ava</title>
		<link>http://www.sitepoint.com/blogs/2005/11/17/convert-asp-to-php-with-aspa/comment-page-1/#comment-12522</link>
		<dc:creator>ava</dc:creator>
		<pubDate>Sun, 08 Jan 2006 08:25:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1309#comment-12522</guid>
		<description>response.redirect</description>
		<content:encoded><![CDATA[<p>response.redirect</p>]]></content:encoded>
	</item>
	<item>
		<title>By: kbglob - tecnologia para geeks, no para tu mamá &#187; Convertir ASP en PHP</title>
		<link>http://www.sitepoint.com/blogs/2005/11/17/convert-asp-to-php-with-aspa/comment-page-1/#comment-11079</link>
		<dc:creator>kbglob - tecnologia para geeks, no para tu mamá &#187; Convertir ASP en PHP</dc:creator>
		<pubDate>Tue, 22 Nov 2005 22:15:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1309#comment-11079</guid>
		<description>[...] Se que parece un chiste, y segun con que ojo lo mires lo es. Pero encontre algo dando vueltas que dice que te convierte ASP en PHP mas o menos aceptablemente. Se que hay algunos de ustedes que todavia tienen esas cosas en ASP y no quieren reescribirlas, asi que esto es mi aporte al mejor funcionamiento de internet y la prevencion de degradacion excesiva de procesadores. [...]</description>
		<content:encoded><![CDATA[<p>[...] Se que parece un chiste, y segun con que ojo lo mires lo es. Pero encontre algo dando vueltas que dice que te convierte ASP en PHP mas o menos aceptablemente. Se que hay algunos de ustedes que todavia tienen esas cosas en ASP y no quieren reescribirlas, asi que esto es mi aporte al mejor funcionamiento de internet y la prevencion de degradacion excesiva de procesadores. [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Conyard</title>
		<link>http://www.sitepoint.com/blogs/2005/11/17/convert-asp-to-php-with-aspa/comment-page-1/#comment-10932</link>
		<dc:creator>Richard Conyard</dc:creator>
		<pubDate>Fri, 18 Nov 2005 16:39:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1309#comment-10932</guid>
		<description>.Net .... shudder, I&#039;ll think I&#039;ll stick with scripted solutions, XML and XSLT.  Whoever thought it was a good idea over at Redmond to apply the same programming techniques of application interface building to web application interface building needs to be shot.

Thanks for your feedback though, I&#039;ll check those out.</description>
		<content:encoded><![CDATA[<p>.Net &#8230;. shudder, I&#8217;ll think I&#8217;ll stick with scripted solutions, XML and XSLT.  Whoever thought it was a good idea over at Redmond to apply the same programming techniques of application interface building to web application interface building needs to be shot.</p>
<p>Thanks for your feedback though, I&#8217;ll check those out.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: HarryF</title>
		<link>http://www.sitepoint.com/blogs/2005/11/17/convert-asp-to-php-with-aspa/comment-page-1/#comment-10931</link>
		<dc:creator>HarryF</dc:creator>
		<pubDate>Fri, 18 Nov 2005 16:35:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1309#comment-10931</guid>
		<description>&lt;blockquote&gt;
Looking at the approach I don’t think we’re going to get much automatic conversion except for the easiest of scripts,
&lt;/blockquote&gt;

By default agreed. What&#039;s interesting about ASPA in the XML transformation files. Perhaps a better explaination of how these work would be to say they&#039;re something like XSLT stylesheets.

Initially ASPA gives you a default set of &quot;transformation stylesheets&quot; which work for basic ASP syntax plus well known objects like ADO DB and translate to obvious PHP equivalents. For code embedded in HTML, that might at least be a time saver. To maintain parallel versions of a code base, as &lt;a href=&quot;http://www.joelonsoftware.com/articles/FogBugzIII.html&quot; rel=&quot;nofollow&quot;&gt;Joel does&lt;/a&gt;, that might already be a good enough start.

From there you need to adjust / extend those sheets to match the specific project you&#039;re converting. For example if the ASP code uses the &lt;a href=&quot;http://www.aspemail.com/&quot; rel=&quot;nofollow&quot;&gt;AspEmail&lt;/a&gt; component, you might translate that &lt;a href=&quot;http://phpmailer.sourceforge.net&quot; rel=&quot;nofollow&quot;&gt;phpmailer&lt;/a&gt; but adding the appropriate XML transformation file.

Where this seems a bit limited right now is the mappings seem to be &quot;one to one&quot; - it&#039;s not as flexible as something like XSLT in terms of how you relate elements of the source ASP to output PHP. That may be where something like jython could help, for embedding in the XML mapping files and providing greater control.

&lt;blockquote&gt;
 and certainly nothing going down the COM+ / DNA route.
&lt;/blockquote&gt;

There I can&#039;t really comment. There is &lt;a href=&quot;http://www.php.net/COM&quot; rel=&quot;nofollow&quot;&gt;this stuff&lt;/a&gt; but I guess if you&#039;re using things like COM+ in an ASP application, you&#039;d be more interested in moving to .NET.

Would imagine ASPA is more interesting to typical database driven applications that run on shared hosts.</description>
		<content:encoded><![CDATA[<blockquote><p>
Looking at the approach I don’t think we’re going to get much automatic conversion except for the easiest of scripts,
</p></blockquote>
<p>By default agreed. What&#8217;s interesting about ASPA in the XML transformation files. Perhaps a better explaination of how these work would be to say they&#8217;re something like XSLT stylesheets.</p>
<p>Initially ASPA gives you a default set of &#8220;transformation stylesheets&#8221; which work for basic ASP syntax plus well known objects like ADO DB and translate to obvious PHP equivalents. For code embedded in HTML, that might at least be a time saver. To maintain parallel versions of a code base, as <a href="http://www.joelonsoftware.com/articles/FogBugzIII.html" rel="nofollow">Joel does</a>, that might already be a good enough start.</p>
<p>From there you need to adjust / extend those sheets to match the specific project you&#8217;re converting. For example if the ASP code uses the <a href="http://www.aspemail.com/" rel="nofollow">AspEmail</a> component, you might translate that <a href="http://phpmailer.sourceforge.net" rel="nofollow">phpmailer</a> but adding the appropriate XML transformation file.</p>
<p>Where this seems a bit limited right now is the mappings seem to be &#8220;one to one&#8221; &#8211; it&#8217;s not as flexible as something like XSLT in terms of how you relate elements of the source ASP to output PHP. That may be where something like jython could help, for embedding in the XML mapping files and providing greater control.</p>
<blockquote><p>
 and certainly nothing going down the COM+ / DNA route.
</p></blockquote>
<p>There I can&#8217;t really comment. There is <a href="http://www.php.net/COM" rel="nofollow">this stuff</a> but I guess if you&#8217;re using things like COM+ in an ASP application, you&#8217;d be more interested in moving to .NET.</p>
<p>Would imagine ASPA is more interesting to typical database driven applications that run on shared hosts.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Conyard</title>
		<link>http://www.sitepoint.com/blogs/2005/11/17/convert-asp-to-php-with-aspa/comment-page-1/#comment-10930</link>
		<dc:creator>Richard Conyard</dc:creator>
		<pubDate>Fri, 18 Nov 2005 16:00:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1309#comment-10930</guid>
		<description>Looking at the approach I don&#039;t think we&#039;re going to get much automatic conversion except for the easiest of scripts, and certainly nothing going down the COM+ / DNA route.</description>
		<content:encoded><![CDATA[<p>Looking at the approach I don&#8217;t think we&#8217;re going to get much automatic conversion except for the easiest of scripts, and certainly nothing going down the COM+ / DNA route.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Maarten Manders</title>
		<link>http://www.sitepoint.com/blogs/2005/11/17/convert-asp-to-php-with-aspa/comment-page-1/#comment-10894</link>
		<dc:creator>Maarten Manders</dc:creator>
		<pubDate>Thu, 17 Nov 2005 23:06:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=1309#comment-10894</guid>
		<description>Thanks for the hints! Looks like we just need find someone willing to put it together.. ;-)

Here&#039;s some sample output of the ZS-embedded code analyzer:

&lt;code&gt;
Debug Strict (PHP 5): var: Deprecated. Please use the public/private/protected modifiers (line 68)
Variable $mysql appears only once (line 80)
The value of variable $mysql was never used (line 80)
Global variable $strMode  was used before it was defined (line 2)
Assignment in condition (line 200)
etc...
&lt;/code&gt;

I never use it, however, because I don&#039;t find it to be very useful. Making it a little bit smarter and able to scan whole projects would change my opinion.</description>
		<content:encoded><![CDATA[<p>Thanks for the hints! Looks like we just need find someone willing to put it together.. ;-)</p>
<p>Here&#8217;s some sample output of the ZS-embedded code analyzer:</p>
<code>
Debug Strict (PHP 5): var: Deprecated. Please use the public/private/protected modifiers (line 68)
Variable $mysql appears only once (line 80)
The value of variable $mysql was never used (line 80)
Global variable $strMode  was used before it was defined (line 2)
Assignment in condition (line 200)
etc...
</code>
<p>I never use it, however, because I don&#8217;t find it to be very useful. Making it a little bit smarter and able to scan whole projects would change my opinion.</p>]]></content:encoded>
	</item>
</channel>
</rss>
