This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Status: 301 Moved Permanently", false, 301); | |
header("Location: http://www.exemple.net/repertoire/page.php"); | |
exit(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function seo_name($title) { | |
return preg_replace('/[^a-z0-9_-]/i', '', strtolower(str_replace(' ', '-', trim($title)))); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="http://le-saint-homme.fr/wp-comments-post.php" method="post" id="commentform" class="comment-form" novalidate=""> | |
<p class="comment-form-comment"> | |
<label for="comment">Commentaire</label> | |
<textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" required="required"></textarea></p><p class="form-submit"><input name="submit" type="submit" id="submit" class="submit" value="Laisser un commentaire"> <input type="hidden" name="comment_post_ID" value="116" id="comment_post_ID"> | |
<input type="hidden" name="comment_parent" id="comment_parent" value="0"> | |
</p><input type="hidden" id="_wp_unfiltered_html_comment_disabled" name="_wp_unfiltered_html_comment" value=""><script>(function(){if(window===window.parent){document.getElementById('_wp_unfiltered_html_comment_disabled').name='_wp_unfiltered_html_comment';}})();</script> | |
</form> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fake_df(){ | |
header("X-Robots-Tag: nofollow", true); | |
} | |
// utilisation (ATTENTION: à utiliser avant affichage de la page sinon ERROR) | |
fake_df |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
-------------------------------------------- | |
$title contains the title of the page you're sending | |
$url is the url of the page | |
$debug true print out the debug and show xml call and answer | |
-------------------------------------------- | |
the output is an array with two elements: | |
status: ok / ko | |
msg: the text response from pingomatic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function scrape_links($url){ | |
$pageData = file_get_contents($url); | |
if(preg_match_all( | |
'/<a\s+href=["\']([^"\']+)["\']/i', | |
$pageData, | |
$links, | |
PREG_PATTERN_ORDER)){ | |
return array_unique($links[1]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_site_kw($url){ | |
$meta = get_meta_tags($url); | |
$keywords = $meta['keywords']; | |
$keywords = @explode(',', $keywords ); | |
$keywords = array_map( 'trim', $keywords ); | |
$keywords = array_filter( $keywords ); | |
return $keywords; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function racine_referer() | |
{ | |
if (!isset($_SERVER['HTTP_REFERER'])){ | |
return false; | |
}else{ | |
$parser_url = parse_url(trim($_SERVER['HTTP_REFERER'])); | |
return trim($parser_url[host] ? $parser_url[host] : array_shift(explode('/', $parser_url[path], 2))); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Is_bot | |
* traque la présence d'un bot par plage d'ip | |
* | |
* @param string $ip | |
* @param array $array_bots | |
* @return string|false | |
*/ | |