<?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>1-800-HOSTING Blog &#187; drupal</title>
	<atom:link href="http://blog.800hosting.com/tag/drupal/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.800hosting.com</link>
	<description>Inside 1-800-HOSTING</description>
	<lastBuildDate>Mon, 19 Jul 2010 21:04:46 +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>PHP Script Tips and Resources</title>
		<link>http://blog.800hosting.com/2010/02/php-script-tips-and-resources/</link>
		<comments>http://blog.800hosting.com/2010/02/php-script-tips-and-resources/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 17:30:41 +0000</pubDate>
		<dc:creator>David Tooke</dc:creator>
				<category><![CDATA[Fun Stuff]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[free php scripts]]></category>
		<category><![CDATA[google crawler]]></category>
		<category><![CDATA[googlebot]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[osCommerce]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.800hosting.com/?p=1205</guid>
		<description><![CDATA[ PHP is a language absolutely made for websites. PHP code can be inserted into an html page to enable dynamic creation. Many content management systems like Drupal, Joomla, and osCommerce  use PHP together with MySQL to build webpages.
You can use PHP to detect crawling activity, rotate images/banners, and process forms. Here is an example [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://static.php.net/www.php.net/images/php.gif" alt="php" /> PHP is a language absolutely made for websites. <a title="php" href="http://php.net/" target="_blank">PHP</a> code can be inserted into an html page to enable dynamic creation. Many content management systems like Drupal, Joomla, and osCommerce  use PHP together with MySQL to build webpages.<span id="more-1205"></span></p>
<p>You can use PHP to detect crawling activity, rotate images/banners, and process forms. Here is an example of code that will email you whenever Google crawler Googlebot visits your page by detecting the useragent. You could expand the code to include other crawlers, add date and time stamp, and validate the IP to exclude impostors. I left that stuff out for simplicity and because you can  get that info from your webstats/logs. Just copy and paste this code in your web page to try it out. Note that the page may have to end with .php file extension to work, it depends on how your web server is setup.</p>
<blockquote><p>&lt;?<br />
if(eregi(&#8220;Googlebot&#8221;,$_SERVER['HTTP_USER_AGENT'])){</p>
<p>//put your email address below<br />
$address=youname@yourdomain.com;<br />
$subject=&#8221;Google visited &#8220;.$_SERVER[’HTTP_HOST’];<br />
$message=&#8221;Googlebot visited today.&#8221;;<br />
mail($address, $subject, $message);<br />
}<br />
?&gt;</p></blockquote>
<p>Here is an example of how to display  random images in a web page, it will pick one of the three banners each time the page loads. You could easily add more cases here or change the img src line to make this a random text function.</p>
<blockquote><p>&lt;?<br />
$randomimage = Rand (1,3) ;</p>
<p>//put your image name at bannerx<br />
switch ($randomimage)<br />
{<br />
case 1:<br />
&#8220;banner1&#8243;;<br />
break;</p>
<p>case 2:<br />
&#8220;banner2&#8243;;<br />
break;</p>
<p>case 3:<br />
&#8220;banner3&#8243;;<br />
break;<br />
}</p>
<p>echo &#8216;&lt;img src=&#8221;&#8216;$randomimage.&#8217;&#8221; border=0&gt;&#8217;;</p>
<p>?&gt;</p></blockquote>
<p>Another cool thing you can do is filter form data to by blocking bad words, banning ip addresses, and setting a timer with a cookie. There is nothing worse than having your website form spammed. You can get the visitor&#8217;s IP address with a built in php function and then check it against a list of bad IP addresses you have stored in a list called an <em>array</em>. You can modify this to include words by replacing the IP addresses with words. This is useful if there is a relatively small number of abusers. In the case of larger numbers, blocking at the server level using <a title="iptables wikipedia definition" href="http://en.wikipedia.org/wiki/Iptables" target="_blank">iptables</a> or a firewall may work better for you.</p>
<p>Here is the code for blocking IPs and you can add more IPs to the array if needed:</p>
<blockquote><p>&lt;?<br />
$banned_ip_addresses = array(&#8216;4.2.5.5&#8242;, &#8216;64.43.67.19&#8242;, &#8216;207.22.32.152&#8242;);</p>
<p>if(in_array($_SERVER['REMOTE_ADDR'], $banned_ip_addresses))<br />
{<br />
echo &#8220;You are banned.&#8221;;<br />
} else {<br />
continue with form processing&#8230;<br />
}</p></blockquote>
<p>If you are having problems with abusive surfers filling out your forms with constantly changing ip addresses, you can stop them by adding a cookie. A cookie is a small piece of code sent to the user&#8217;s pc to identify them.  Note that not all browsers will accept cookies, but most will. Once the cookie is set, you check for the existence of it in your form processing. Here is an example:</p>
<blockquote><p>//this sets time to 7200 seconds, 2 hours<br />
&lt;?<br />
setcookie(&#8220;userx&#8221;, &#8220;cookie1&#8243;, time()+7200);<br />
?&gt;</p>
<p>Then add the code below to find out if this person has been on your page before:</p>
<p>&lt;?<br />
if (isset($_COOKIE1["userx"])){<br />
echo &#8220;You have already filled out this form recently&#8221;;</p>
<p>} else {<br />
continue with form processing&#8230;<br />
}<br />
?&gt;</p></blockquote>
<p>There is a plethora of PHP support websites on the Internet. My longtime favorite is  <a title="php freaks forum" href="http://www.phpfreaks.com/forums/" target="_blank">PHP Freaks Forum</a> where you can post  technical questions and read responses. Another good one is the <a title="digital point php forum" href="http://forums.digitalpoint.com/forumdisplay.php?f=37" target="_blank">Digital Point PHP Forum</a>. If you are looking for scripts then visit <a title="hotscripts" href="http://www.hotscripts.com/category/php/scripts-programs/" target="_blank">Hotscripts</a>, where you will find many, some free and some paid. Also check out <a title="free scripts directory" href="http://gscripts.net/" target="_blank">Free Scripts Directory</a>,  <a title="script repository" href="http://www.sitescripts.com/PHP/" target="_blank">Script Repository</a>, and <a title="php resource index" href="http://php.resourceindex.com/Complete_Scripts/" target="_blank">PHP Resource Index</a>. They have scripts for: counters, auctions, voting, calculators, searching, support ticketing, etc.</p>
<p>PHP works fine on both Linux and Windows systems. If you have a Linux box then chances are good that it is already installed; if not, visit <a title="php" href="http://php.net/" target="_blank">php.net</a> to download it. PHP is not standard on Windows but it can be installed. If you need technical support we can help you with installing or upgrading.</p>
<p>PHP is very powerful. In an upcoming post I will explain how to speed it up using accelerators, pull data from a database, write it to a webpage, and add functionality using extensions.</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.800hosting.com/2009/12/drupal-free-website-building-tool/" title="Drupal &#8211; Free Website Building Tool">Drupal &#8211; Free Website Building Tool</a></li><li><a href="http://blog.800hosting.com/2009/05/linux-shell-insights-volume-2/" title="Linux Shell Insights: Volume 2">Linux Shell Insights: Volume 2</a></li><li><a href="http://blog.800hosting.com/2009/05/linux-shell-insights-volume-1/" title="Linux Shell Insights: Volume 1">Linux Shell Insights: Volume 1</a></li><li><a href="http://blog.800hosting.com/2010/01/mysql-version-6-preview/" title="MySQL Version 6 Preview">MySQL Version 6 Preview</a></li><li><a href="http://blog.800hosting.com/2009/12/a-little-security-goes-a-loooong-way/" title="A Little Security Goes a LOOOONG Way">A Little Security Goes a LOOOONG Way</a></li><li><a href="http://blog.800hosting.com/2009/11/linux-tip-setting-up-key-based-authentication/" title="Linux Tip: Setting up key-based authentication.">Linux Tip: Setting up key-based authentication.</a></li><li><a href="http://blog.800hosting.com/2009/06/do-i-need-a-dedicated-database-server/" title="Do I need a dedicated database server?">Do I need a dedicated database server?</a></li><li><a href="http://blog.800hosting.com/2009/06/new-laptop-with-windows-vista/" title="New Laptop with Windows Vista">New Laptop with Windows Vista</a></li><li><a href="http://blog.800hosting.com/2009/06/memory_cache_in_linux/" title="Linux: Low memory &#8211; feature or a bug?">Linux: Low memory &#8211; feature or a bug?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.800hosting.com/2010/02/php-script-tips-and-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal &#8211; Free Website Building Tool</title>
		<link>http://blog.800hosting.com/2009/12/drupal-free-website-building-tool/</link>
		<comments>http://blog.800hosting.com/2009/12/drupal-free-website-building-tool/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 17:56:08 +0000</pubDate>
		<dc:creator>David Tooke</dc:creator>
				<category><![CDATA[Company]]></category>
		<category><![CDATA[Industry]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[1-800-HOSTING]]></category>
		<category><![CDATA[content management]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://blog.800hosting.com/?p=950</guid>
		<description><![CDATA[The Drupal content management system is software that makes it easy to build a great looking website. With Drupal, you can create pages using templates and easily add content using the admin control panel. In my opinion, it is a good choice for all types of sites such as blogs, portals, corporate or government sites.
Drupal [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.800hosting.com/2009/12/drupal-free-website-building-tool/"><img class="alignright size-full wp-image-963" title="drupal-logo" src="http://blog.800hosting.com/wp-content/uploads/2009/12/drupal-logo.jpg" alt="drupal-logo" width="91" height="105" /></a>The <a title="Drupal" href="http://drupal.org/" target="_blank">Drupal </a>content management system is software that makes it easy to build a great looking website. With Drupal, you can create pages using templates and easily add content using the admin control panel. In my opinion, it is a good choice for all types of sites such as blogs, portals, corporate or government sites.<span id="more-950"></span></p>
<p>Drupal is based on a system of templates where you can use the built-in ones or make your own. It has some cool features built in such as chat forums, rss, video and podcasting options. Currently, there are thousands of websites using Drupal such as <a title="Spread Firefox" href="http://www.spreadfirefox.com/" target="_blank">Spread Firefox</a>, <a title="The White House" href="http://www.whitehouse.gov/" target="_blank">The White house</a>, and <a title="The Onion" href="http://www.theonion.com/content/index" target="_blank">The Onion</a>. There are many more listed on <a title="Drupal Sites" href="http://www.drupalsites.net/" target="_blank">Drupal Sites</a>. Drupal is an open source software package licensed under the GNU GPL and runs great on a Linux server with Apache, PHP, and MySQL. We here at 1-800-Hosting are Drupal friendly and can help with installation as well as well hosting technical support like unix file permissions, phpinfo(), mod_security, php file size and memory limits.</p>
<p>The best thing I like about Drupal is that it can be extended with <a title="drupal modules" href="http://drupalmodules.com/" target="_blank">third party modules</a> in order to add functions. You can add search, instant messenger, cron, voting, image browsing, slideshow, google analytics, e-commerce, and chat room. If you&#8217;re looking for an easy way to get a website up and running without the hassles of back-end development, take a look at Drupal. It can make building a site a little easier without getting lost in the interweb fray.</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://blog.800hosting.com/2010/02/php-script-tips-and-resources/" title="PHP Script Tips and Resources">PHP Script Tips and Resources</a></li><li><a href="http://blog.800hosting.com/2009/05/linux-shell-insights-volume-2/" title="Linux Shell Insights: Volume 2">Linux Shell Insights: Volume 2</a></li><li><a href="http://blog.800hosting.com/2009/05/linux-shell-insights-volume-1/" title="Linux Shell Insights: Volume 1">Linux Shell Insights: Volume 1</a></li><li><a href="http://blog.800hosting.com/2010/01/employee-appreciation-and-the-lost-art-of-the-road-trip/" title="Employee Appreciation and the Lost Art of the Road Trip">Employee Appreciation and the Lost Art of the Road Trip</a></li><li><a href="http://blog.800hosting.com/2010/01/a-resolution-to-keep-resolutions/" title="A Resolution to Keep Resolutions">A Resolution to Keep Resolutions</a></li><li><a href="http://blog.800hosting.com/2009/12/happy-holidays/" title="Happy Holidays!">Happy Holidays!</a></li><li><a href="http://blog.800hosting.com/2009/12/a-little-security-goes-a-loooong-way/" title="A Little Security Goes a LOOOONG Way">A Little Security Goes a LOOOONG Way</a></li><li><a href="http://blog.800hosting.com/2009/12/using-mac-as-a-work-pc-the-first-6-months/" title="Using Mac as a Work PC, the First 6 Months">Using Mac as a Work PC, the First 6 Months</a></li><li><a href="http://blog.800hosting.com/2009/11/hosted-microsoft-exchange/" title="Hosted Microsoft Exchange?">Hosted Microsoft Exchange?</a></li><li><a href="http://blog.800hosting.com/2009/11/linux-tip-setting-up-key-based-authentication/" title="Linux Tip: Setting up key-based authentication.">Linux Tip: Setting up key-based authentication.</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.800hosting.com/2009/12/drupal-free-website-building-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
