<?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>BOALT Blog &#187; GoDaddy</title>
	<atom:link href="http://www.boalt.com/blog/tag/godaddy/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.boalt.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 26 May 2010 19:03:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tips from the Experts: Tricks for Using cURL with GoDaddy.com</title>
		<link>http://www.boalt.com/blog/2009/08/tips-from-the-experts-tricks-for-using-curl-with-godaddy-com/</link>
		<comments>http://www.boalt.com/blog/2009/08/tips-from-the-experts-tricks-for-using-curl-with-godaddy-com/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 16:43:38 +0000</pubDate>
		<dc:creator>Daniel Beck</dc:creator>
				<category><![CDATA[Information Architecture]]></category>
		<category><![CDATA[cURL]]></category>
		<category><![CDATA[GoDaddy]]></category>

		<guid isPermaLink="false">http://www.boalt.com/blog/?p=770</guid>
		<description><![CDATA[
Last week I was working on a project where I needed a PHP script to download a file that was hosted on a GoDaddy account. I was able to view the file fine in my browser, but when I tried to download the file with PHP I would always get an error. I’m sure other [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style=""><script type="text/javascript" src="http://button.topsy.com/widget/retweet-small?url=http://www.boalt.com/blog/2009/08/tips-from-the-experts-tricks-for-using-curl-with-godaddy-com/&amp;title=Tips+from+the+Experts%3A+Tricks+for+Using+cURL+with+GoDaddy.com&amp;theme=blue&amp;txt_tweet=tweet&amp;txt_retweet=retweet"></script></div><p>Last week I was working on a project where I needed a PHP script to download a file that was hosted on a GoDaddy account. I was able to view the file fine in my browser, but when I tried to download the file with PHP I would always get an error. I’m sure other people have encountered this and hopefully this will help you out:</p>
<p>When you first request a file hosted on GoDaddy, the server does an extra step to revent simple scripts from cpying files. The process looks like this:</p>
<p style="text-align: left; padding-left: 60px;"><strong>My computer</strong>:</p>
<p style="text-align: left; padding-left: 90px;"><span style="color: #ff0000;"><span style="color: #000000;">I want </span>www.example.com/index.html</span></p>
<p style="text-align: left; padding-left: 60px;"><strong>GoDaddy Server:</strong></p>
<p style="text-align: left; padding-left: 90px;"><span style="color: #ff0000;">www.example.com/index.html <span style="color: #000000;">is actually at</span> www.example.com/index.html?23421</span></p>
<p style="text-align: left; padding-left: 60px;"><strong>My computer</strong>:</p>
<p style="text-align: left; padding-left: 90px;"><span style="color: #ff0000;"><span style="color: #000000;">Ok, I want</span> www.example.com/index.html/24321</span></p>
<p style="text-align: left; padding-left: 60px;"><strong>GoDaddy Server:</strong></p>
<p style="text-align: left; padding-left: 90px;"><span style="color: #ff0000;"><span style="color: #000000;">Actually, </span>www.example.com/index,html?23421 <span style="color: #000000;">is at </span>www.example.com/index.htm</span>l</p>
<p style="text-align: left; padding-left: 60px;"><strong>My computer</strong>:</p>
<p style="text-align: left; padding-left: 90px;"><span style="color: #ff0000;"><span style="color: #000000;">I want</span> www.example.com/index.html</span></p>
<p style="text-align: left; padding-left: 60px;"><strong>GoDaddy Server:</strong></p>
<p style="text-align: left; padding-left: 90px;"><span style="color: #ff0000;"><span style="color: #000000;">Ok, here is the file you wante</span><span style="color: #000000;">d</span></span><span style="color: #000000;">.</span></p>
<p>The GoDaddy server will initially say the file is at another location (with an HTTP 302 status message) as test to see if the program requesting the file is legit. If you then request that new file, the server says, &#8220;Just kidding. The file&#8217;s at the location you originally requested: and then it gives you the file. A web browser will automatically handle these requests so this process in invisible to the user. But PHP scripts that use cURL don&#8217;t do this by default. All you need is the following line in your code:</p>
<p><strong>curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);</strong></p>
<p>This also explains trouble we&#8217;ve had integrating with third part API&#8217;s like <a href="http://www.twilio.com" target="_blank">Twilio.com</a> (which by the way is an awesome telephony api). With Twilio, when someone calls a pohone number you&#8217;ve set up, the Twilio server requests XML documents from your webserver that tells it what to say or how to act. Unfortunately, at the time of writing, Twilio, doesn&#8217;t check for this redirection trick, so we&#8217;ve had to use another webhost for our Twilio application.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.boalt.com/blog/2009/08/tips-from-the-experts-tricks-for-using-curl-with-godaddy-com/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
