Ejemplo n.º 1
0
function doSystemTest()
{
	function output($description, $succ, $resStr) {
		echo "<tr><td class=\"TestDesc\">$description</td><td ";
		echo ($succ)? "class=\"TestSucc\">$resStr[0]</td></tr>" : "class=\"TestFail\">$resStr[1]</td></tr>";
	}
	output("PHP version >= 4.0.5", phpversion_int() >= 40005, array("Yes", "No"));
	output("mysql_connect() available", function_exists("mysql_connect"), array("Yes", "No"));
	if (phpversion_int() >= 40302 && substr($_SERVER["SERVER_SOFTWARE"], 0, 6) == "Apache" && function_exists("apache_get_modules")){
		if (in_array("mod_security2", apache_get_modules()))
			output("Mod Security 2 installed", false, array("No", "Yes"));
	}
}
Ejemplo n.º 2
0
            $query = stripslashes($query);
        }
        $res = mysql_query($query, $conn);
        $errno = mysql_errno();
        $affectedrows = mysql_affected_rows($conn);
        $insertid = mysql_insert_id($conn);
        $numfields = mysql_num_fields($res);
        $numrows = mysql_num_rows($res);
        EchoResultSetHeader($errno, $affectedrows, $insertid, $numfields, $numrows);
        if ($errno > 0) {
            echo GetBlock(mysql_error());
        } else {
            if ($numfields > 0) {
                EchoFieldsHeader($res, $numfields);
                EchoData($res, $numfields, $numrows);
            } else {
                if (phpversion_int() >= 40300) {
                    echo GetBlock(mysql_info($conn));
                } else {
                    echo GetBlock("");
                }
            }
        }
        if ($i < count($_POST["q"]) - 1) {
            echo "";
        } else {
            echo "";
        }
        mysql_free_result($res);
    }
}