Location: PHPKode > scripts > 2BGal > 2bgal/admin/fonctions.inc.php
<?php
function galconnecte($serveur,$utilisateur,$motdepasse,$database)
{
	$connect = @mysql_connect("$serveur", "$utilisateur", "$motdepasse");
	if (!$connect)
	{
		return(2);
	}
	elseif (!@mysql_select_db("$database",$connect))
	{
		return(3);
	}
	else
	{
		return(1);
	}
}

function admerreurRC($errno)
{
	//redirection vers la page d'erreur
	echo "<script language='JavaScript'>document.location.replace('login.php?errno=".$errno."');</script>\n";
	die();
}

function stayoninclude()
{
	//cause une erreur fatale si le fichier n'est pas inclus depuis index.php

	if (@ini_get('register_globals'))
	{
		if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS']))
			exit('globals ?!');

		//Check superglobals for contamination and to prevent session hijacking
		//@author Jan Pedersen <hide@address.com>
		//@copyright (c) 2000-2005 The Xoops Project - www.xoops.org
		$vars_array = array('GLOBALS','_SESSION','_GET','_POST','_COOKIE','_REQUEST','_SERVER','_ENV','_FILES','lang','serveur','utilisateur','motdepasse','database','tbl_alist','tbl_ilist','formatdate','display_tricritere','display_triordre','taille_mini','mini_gdversion','mini_gd20quality','dispinfos3exif');
		foreach ($vars_array as $bad_global)
		{
			if (isset($_REQUEST[$bad_global]))
			{
				$_REQUEST[$bad_global] = NULL;
			}
		}
	}
}
?>
Return current item: 2BGal