-
Notifications
You must be signed in to change notification settings - Fork 1
/
db_con_func_mysqli.php
53 lines (42 loc) · 1.1 KB
/
db_con_func_mysqli.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?
//echo"DB CON FUNC geladen<BR>";
/*
$host = "localhost"; //Connectvariablen
$user = "root";
$pass = "";
$db = "";
*/
// variablenbezeichner
foreach ($_REQUEST as $variablenbezeichner => $variableninhalt)
{
$variablenname = $variablenbezeichner;
$$variablenname = $variableninhalt;
//echo "variablenname ". $variablenname." variableninhalt ".$variableninhalt."<br>";
}
$PHP_SELF=$_SERVER['PHP_SELF'];
//echo "PHP_SELF ".$PHP_SELF."<br>";
// mysql connect
function connect($host,$user,$pass,$db)
{
$conn=mysqli_connect($host,$user,$pass,$db);
if($conn)
{
//echo("MySQL-Verbindung steht: <BR>");
}
else
{
die("MySQL-Verbindung steht nicht: ");
}
return $conn;
}
function deconnect($conn)
{
return mysqli_close($conn);
}
function setze_session($session)
{
srand((double)microtime()*1000000);
if(!isset($session)){ $session = md5(uniqid($UNIQUE_ID));}
return $session;
}
?>