Posts Tagged ‘these’

PHP:How to disable PHP magic quotes effect

Monday, June 30th, 2008

set_magic_quotes_runtime(FALSE);
if (get_magic_quotes_gpc()) {
/*
All these global variables are slash-encoded by default,
because    magic_quotes_gpc is set by default!
(And magic_quotes_gpc affects more than just $_GET, $_POST, and $_COOKIE)
*/
$_SERVER = stripslashes_array($_SERVER);
$_GET = stripslashes_array($_GET);
$_POST = stripslashes_array($_POST);
$_COOKIE = stripslashes_array($_COOKIE);
$_FILES = stripslashes_array($_FILES);
$_ENV = stripslashes_array($_ENV);
$_REQUEST = stripslashes_array($_REQUEST);
$HTTP_SERVER_VARS = stripslashes_array($HTTP_SERVER_VARS);
$HTTP_GET_VARS = stripslashes_array($HTTP_GET_VARS);
$HTTP_POST_VARS = stripslashes_array($HTTP_POST_VARS);
$HTTP_COOKIE_VARS = stripslashes_array($HTTP_COOKIE_VARS);
$HTTP_POST_FILES = stripslashes_array($HTTP_POST_FILES);
$HTTP_ENV_VARS = stripslashes_array($HTTP_ENV_VARS);
if (isset($_SESSION)) {    #These are unconfirmed (?)
$_SESSION = stripslashes_array($_SESSION, ”);
$HTTP_SESSION_VARS = stripslashes_array($HTTP_SESSION_VARS, ”);
}
/*
The $GLOBALS array is also slash-encoded, but when all the above are
changed, $GLOBALS is updated to reflect those changes.  (Therefore
$GLOBALS should never be modified directly).  $GLOBALS also contains
infinite recursion, so it’s dangerous…
*/
}
function stripslashes_array($data) {
if (is_array($data)){
foreach ($data as $key => $value){
$data[$key] = stripslashes_array($value);
}
return $data;
}else{
return stripslashes($data);
}
}

Tag Your Content

Thursday, June 19th, 2008

Technorati is the first place that you should be tagging posts. I actually recommend having the tags right on your page, pointing to the Technorati searches that you’re targeting. There are other good places to ping - del.icio.us and Flickr being the two most obvious (the only other one is Blogmarks, which is much smaller). Tagging content can also be valuable to help give you a “bump” towards getting traffic from big sites like Reddit, Digg & StumbleUpon (which requires that you download the toolbar, but trust me - it’s worth it). You DO NOT want to submit every post to these sites, but that one out of twenty (see tactic #18) is worth your while.

What is PageRank?

Thursday, June 19th, 2008

# “PageRank is [only] one of the methods Google uses to determine a page’s relevance or importance.” [PageRank Explained Correctly]

# “Google uses many factors in ranking. Of these, the PageRank algorithm might be the best known. PageRank evaluates two things: how many links there are to a web page from other pages, and the quality of the linking sites. With PageRank, five or six high-quality links from websites such as www.cnn.com and www.nytimes.com would be valued much more highly than twice as many links from less reputable or established sites.” [Google Librarian Central]

# “PageRank has only ever been an approximation of the quality of a web page and has never had anything to do with the measuring of the topical relevance of a web page. Topical relevance is measured with link context and on-page factors such as keyword density, title tag, and everything else.”