Forum Moderators: coopster
<?php
if(strpos($w, "http://www.example.com") !== FALSE) // must use !== not !=
{
$w = $_GET['w'];
}
else
{
header("HTTP/1.0 404 Not Found");
exit;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
etc
if(strpos($w, "http://www.example.com") !== FALSE)
header("Status: 404 Not Found"); AddType x-mapp-php5 .php w is the URL where the link jumps to, so for example www.example.com/go.php?
if(strpos($w, "http://www.example.com") !== FALSE)
{
$w = $_GET['w'];
register_globalsbeing enabled. It might have been enabled by default in earlier versions of PHP 4, but in later versions it was disabled and it is certainly disabled by default in PHP 5 (security issues).
register_globalswould enable $w to be implicitly assigned the value of the w param in the URL. But the slightly confusing thing in your code is that the statement
$w = $_GET['w'];would then be superfluous.
<?php
$w = isset($_GET['w']) ? $_GET['w'] : null;
if (strpos($w, "http://www.example.com") === false)
{
header("HTTP/1.0 404 Not Found");
exit;
}
?>
if (preg_match( "/bcc:|cc:|multipart|[url|Content-Type:/i", implode($_POST))) {
$spam=true;
}
if (preg_match_all("/<a|http:/i", implode($_POST), $out) > 3) {
$spam=true;
}
if (preg_match( "/bcc:|cc:|multipart|[url|Content-Type:/i", implode($_POST))) { \[
Is PHP5 really worth it? :/