-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsparks.php
47 lines (41 loc) · 1.18 KB
/
sparks.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
<?php
$addtyp = $_POST['wattoadd'];
$dbname = file_get_Contents('settings/dbase');
$dbhost = file_get_Contents('settings/dbhost');
$dbuser = file_get_Contents('settings/dbuser');
$dbpass = file_get_Contents('settings/dbpass');
$error = "Error connecting to database";
$dbhandle = mysqli_connect($dbhost,$dbuser,$dbpass,$dbname);
if(!$dbhandle) die ($error);
if($addtyp == 'GROUP')
{
$grp = $_POST['gname'];
$gps = $_POST['gpass'];
if($grp != '' and $gps != '')
{
if(mysqli_query($dbhandle,"INSERT into GRPLIST VALUES ('$grp','$gps')"))
{
$qry = "CREATE TABLE $grp(ID TEXT, USER TEXT," .
"TEXT TEXT)";
if(mysqli_query($dbhandle,$qry))
{
header('location:robosoft.php');
}
}
}
}
else if($addtyp == 'USER')
{
$uname = $_POST['uname'];
$mygrp = $_POST['mygrp'];
$upass = $_POST['upass'];
if($uname != '' and $mygrp != '' and $upass != '')
{
if(mysqli_query($dbhandle,"INSERT into USERS VALUES ('$uname','$upass','$mygrp')"))
{
header('location:robosoft.php');
}
}
}
mysqli_close($dbhandle);
?>