Sep 03

PHP Robot visit

No comment - Post a comment

วันนี้มีโค้ด php แนะนำมาฝาก สำหรับเช็ค robot ที่เข้ามาเก็บข้อมูลจากเว็บไซต์เราไป Index ลง Search Engine เหมาะสำหรัับคนที่ทำ SEO อย่างยิ่งครับ  รายละเอียดและชื่อโปรแกรม วิธีการติดตั้ง อยู่ด้านล่างนี้ครับ

PHP Robot Visit

http://www.stevedawson.com/downloads/robotvisit.zip

Check when the search engines are visiting your website

Author: Steve Dawson ผู้พัฒนา

Download PHP Robot Visit Script

» Read more after the jump →

Many people ask how do you create a template system in PHP. It is true their are many different ways, but this will hopefully show you the basic understanding of this type of method.

First, let us understand the varibles in both the main .html page, and in the php scripts.
In this example <% main %> is the varible used in the main HTML template.
Next, the varibles in the index.php file are as follows:

» Read more after the jump →

ban.php (replace €€€€€€ by the redirection URL, for example a void page an image or anything else) <?php

$filename = “ban.txt”;
$handle = fopen($filename, “r”);
$string = fread($handle, filesize($filename));
fclose($handle);

$sArr = explode(“\n”,$string);

//get user IP address
$userip = $_SERVER['REMOTE_ADDR'];

//check for banned IP address
if (in_array($userip, $sArr)) {
echo “<script type=\”text/javascript\” language=\”javascript\”>”;
echo “window.open(\”€€€€€€\”,\”_top\”);”;
echo “</script>”;
}
?> » Read more after the jump →

เข้า admin แล้ว
เข้าที่เมนู Contens> All Content Items มี error ดังนี้

DB function failed with error number 1054
Unknown column ‘c.access’ in ‘on clause’ SQL=SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS frontpage, s.title AS section_name, v.name AS author FROM mos_content AS c, mos_categories AS cc, mos_sections AS s LEFT JOIN mos_groups AS g ON g.id = c.access LEFT JOIN mos_users AS u ON u.id = c.checked_out LEFT JOIN mos_users AS v ON v.id = c.created_by LEFT JOIN mos_content_frontpage AS f ON f.content_id = c.id WHERE c.state >= 0 AND c.catid=cc.id AND cc.section=s.id AND s.scope=’content’ ORDER BY s.title, c.catid, cc.ordering, cc.title, c.ordering LIMIT 0,10

» Read more after the jump →