'.$input[$rand_keys[0]].' + '.$input[$rand_keys[1]].' = ';
$add = md5($input[$rand_keys[0]] + $input[$rand_keys[1]]);
echo '
';
}
function valid_captcha()
{
// if (md5($_POST['reponse']) == $_POST['captcha'])
if (md5(get_post('reponse')) == get_post('captcha'))
return true;
else
return false;
}
//
// escape_string
// Action: Escape a string
// Call: escape_string (string string)
//
function escape_string ($string)
{
if (get_magic_quotes_gpc () == 0)
{
$search = array ("/'/", "/\"/", "/;/");
$replace = array ("\\\'", "\\\"", "\\;");
$escaped_string = preg_replace ($search, $replace, $string);
}
else
{
$escaped_string = $string;
}
return $escaped_string;
}
//
// get_post
// Action: Get a variable from POST
// Call: get_post('var');
//
function get_post ($string)
{
if (($_SERVER['REQUEST_METHOD'] == "POST") && isset($_POST[$string]))
{
return escape_string($_POST[$string]);
}
else
{
return NULL;
}
}
//
// get_get
// Action: Get a variable from GET
// Call: get_get('var');
//
function get_get ($string)
{
if (($_SERVER['REQUEST_METHOD'] == "GET") && isset($_GET[$string]))
{
return escape_string($_GET[$string]);
}
else
{
return NULL;
}
}
// Pour le menu parse_ini_file();
function searchini() {
return dirname(__FILE__)."/menu.ini";
}
function domenu() {
$menu = parse_ini_file(searchini(),true);
$topmenu = $menu['topmenu'];
$out = ""; // Out text for menu
if (count($topmenu)> 10) {
return "Error Too mutch lines in top menu (max 4)";
}
// Top menu
$out .= "\n";
// Bottom menu
/*
$out .= "\n";
*/
print $out;
}
// Page
// Do the page with the right title
function page($titre) {
printheader($titre);
domenu();
print "\n";
}
// finpage
// ajoute les tags en fin de page
function finpage(){
require("bottom.inc.php");
}
?>