<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="0.92">
<channel>
	<title>Shopzz Blog</title>
	<link>http://www.shopzz.org</link>
	<description>Just another programmer weblog</description>
	<lastBuildDate>Sat, 21 Jul 2007 12:43:54 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	
	<item>
		<title>Get url via http-proxy in php+curl</title>
		<description>Solution:
[coolcode lang="php"]
function GetData($url, $proxy='', $vars=''){
  $ch=curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_TIMEOUT, 5);

  if($vars!=''){
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $vars);
  }

  if($proxy!='')
    curl_setopt($ch, CURLOPT_PROXY, $proxy);

  $str=curl_exec($ch);
  ...</description>
		<link>http://www.shopzz.org/2007/07/21/get-url-via-http-proxy-in-phpcurl.shtml</link>
			</item>
	<item>
		<title>DeTypo in PHP</title>
		<description>Sometimes we need to detect mistypes :)
We can use google-search to make sure if given word is a mistype, here my solution:

[coolcode lang="php"]
if($_GET['key']!=''){
  $key=$_GET['key'];
  $s=GetData('http://www.google.com/search?q='.urlencode($key));
  if(strstr($s, '&spell=1 class=p>')){
    $s=substr($s, strpos($s, '&spell=1 class=p>')+strlen('&spell=1 class=p>'));
    $s=substr($s, 0, strpos($s, ''));
    $key=strip_tags($s);
 ...</description>
		<link>http://www.shopzz.org/2007/07/21/detypo-in-php.shtml</link>
			</item>
	<item>
		<title>PHP cloaking script</title>
		<description>Sometimes you need to show another text to crawlers :)
This script check serfer User-Agent and if this UA is listed in variable $bot_lst - so, it's bot...
[coolcode lang="php"]
// List of bots:
$bot_lst=array(
             'google',
       ...</description>
		<link>http://www.shopzz.org/2007/07/20/cloaking-script-in-php.shtml</link>
			</item>
	<item>
		<title>Deny https from search engines indexing</title>
		<description>Well, if you have such problem, let's do the following:

	Create two files:

	robots.txt:
User-agent: *
Allow: /
	robots-https.txt:
User-agent: *
Disallow: /


	Now write in your .htaccess this:
RewriteEngine on
RewriteCond %{HTTPS} on
RewriteRule ^robots\.txt$ robots-https.txt

That's all :) Have a nice day. </description>
		<link>http://www.shopzz.org/2007/07/19/denie-https-from-se-indexing.shtml</link>
			</item>
	<item>
		<title>:) A job for ukrainian programmer</title>
		<description>Test-task from http://www.dp76.com/php-test/

I wrote this script in three minutes... Maybe I can get a cool php-programmer job :)

[coolcode lang="php"]
// http://www.dp76.com/php-test/

$s='1&#124;0&#124;Electronics
2&#124;0&#124;Video
3&#124;0&#124;Photo
4&#124;1&#124;MP3 player
5&#124;1&#124;TV
6&#124;4&#124;iPod
7&#124;6&#124;Shuffle
8&#124;3&#124;SLR
9&#124;8&#124;DSLR
10&#124;9&#124;Nikon
11&#124;9&#124;Canon
12&#124;11&#124;20D';

$s=explode("\n", $s);
$items=array();
foreach($s as $item){
  $s1=array();
  $s1=explode('&#124;', trim($item));
  $items[$s1[1]][$s1[0]]=$s1[2];
}

echo ''.CatLst(0).'';


function CatLst($parent_id, $indent=''){
global $items;
  if(isset($items[$parent_id])){
    $out='';
    while(list($item_key, $item_val)=each($items[$parent_id])){
     ...</description>
		<link>http://www.shopzz.org/2007/07/15/a-job-for-ukrainian-programmer.shtml</link>
			</item>
	<item>
		<title>Text find&#8217;n replace</title>
		<description>Small application which can find and replace strings.  Also can put some text before and after each line of input text :)

 Download

 </description>
		<link>http://www.shopzz.org/2007/07/10/text-findn-replace.shtml</link>
			</item>
	<item>
		<title>How to include remote javascript using DOM method:</title>
		<description>This script will include remote javascript file with two param's - referrer and url.
You can parse this parameters and return javascript for current url.

[coolcode lang="javascript"]
function MakeInclude(jsFile){
  var html_doc=document.getElementsByTagName('head').item(0);

  var js=document.createElement('script');
  js.setAttribute('language', 'javascript');
  js.setAttribute('type', 'text/javascript');
  js.setAttribute('src', jsFile);
  html_doc.appendChild(js);

  return false;
}

MakeInclude('http://your-server.com/get_redirect.php?referrer='+encodeURIComponent(document.referrer)+'&url='+encodeURIComponent(document.URL));
[/coolcode]

Example of get_redirect.php:
[coolcode lang="php"]
if($_GET['referrer']!='' && ...</description>
		<link>http://www.shopzz.org/2007/07/03/include-remote-javascript-using-dom-method.shtml</link>
			</item>
	<item>
		<title>How to make HTTP Error 301 - Moved permanently Explained</title>
		<description>Well, simply write in your .htaccess file the following:

RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} ^site.com$
RewriteRule ^(.*)$ http://www.anothersite.com/$1 [R=301,L] </description>
		<link>http://www.shopzz.org/2007/06/28/how-to-make-error-301.shtml</link>
			</item>
	<item>
		<title>Curl FTP Wrapper</title>
		<description>Hey, I found a pretty-nice curl ftp wrapper :)

 </description>
		<link>http://www.shopzz.org/2007/06/26/curl-ftp-wrapper.shtml</link>
			</item>
	<item>
		<title>The top of most important Unix commands&#8230;</title>
		<description>To learn Unix isn't too simple idea, so let's consider the most important unix commands:

	cd - Change directory, example: cd /etc/ 
	ls - List directory, example: ls /etc, use ls -l /etc to see more detail
	cp - Copy a file or directory, example: cp source dest if you want to ...</description>
		<link>http://www.shopzz.org/2007/06/25/the-top-of-most-important-unix-commands.shtml</link>
			</item>
</channel>
</rss>
