Mijn stap!
Verbeterde / veranderde sql-tabellen
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
CREATE TABLE `hash` (
`id` int(11) NOT NULL auto_increment,
`hash` text collate latin1_german2_ci NOT NULL,
`hash_id` text collate latin1_german2_ci NOT NULL,
`user` text collate latin1_german2_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci AUTO_INCREMENT=110 ;
CREATE TABLE bugs (
`id` int(11) unsigned NOT NULL auto_increment,
`bug` varchar(100) default 0,
`pagina` varchar(100) default 0,
`user` varchar(12) collate latin1_german2_ci NOT NULL default '',
`email` varchar(100) default 0,
`status` varchar(100) default 0,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci AUTO_INCREMENT=5 ;
CREATE TABLE `leden` (
`id` int(15) NOT NULL auto_increment,
`user` varchar(12) collate latin1_german2_ci NOT NULL default '',
`email` varchar(100) default 0,
`pass` text collate latin1_german2_ci NOT NULL,
`status` varchar(255) collate latin1_german2_ci NOT NULL default 'lid',
`status_id` varchar(255) collate latin1_german2_ci NOT NULL default '100',
`ip` text collate latin1_german2_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci AUTO_INCREMENT=5 ;
Inloggen.php klein beetje veranderd, dus post ik het hier niet
Uitloggen werkte eerst niet, nu gefixed
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
<?
ob_start();
session_start();
include ("config.php");
error_reporting(E_ALL);
if (!isset($_SESSION['login'])){
echo "<div class="Tekst">Je moet eerst inloggen om te kunnen uitloggen!</div>";
} else {
if (isset($_GET['actie'])&&$_GET['actie'] == "uitloggen"){
setcookie("id", "", time()-3600);
setcookie("hash", "", time()-3600);
setcookie("hash_id", "", time()-3600);
setcookie("pass", "", time()-3600);
$_SESSION = array();
session_destroy();
echo "<div class="Header_tekst">Succesvol uitgelogd! Je wordt over 5 seconden doorgestuurt naar de index pagina. Als je niet kunt wachten klik <a href="index.php">hier</a>.</div><meta http-equiv="refresh" content="5;URL=index.php" /></div>";
}
else
{
echo '<div class="Header_tekst">Weet je zeker dat je wilt uitloggen? <a href="?pagina=uitloggen&actie=uitloggen">Ja</a> <a href="index.php">Nee</a></div>';
}
}
?>
ingelogd.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
<?
ob_start();
session_start();
include ("config.php");
include ("global.php");
if (isset($_SESSION['login'])){
$query = "SELECT * FROM leden WHERE id='".htmlspecialchars(mysql_real_escape_string($_COOKIE['id']))."'";
$result=mysql_query($query) or die (mysql_error());
$sql = mysql_fetch_assoc($result);
echo "Welkom $sql[user]! <br>";
if($sql[status_id] >=400) {
// Betatester menu
echo "Bug melden -";
}
if($sql[status_id] >=500) {
//Moderator menu
echo " Betatesterbeheer -";
}
if($sql[status_id] >=600) {
// Admin menu
echo " systeembeheer - Adminpanel";
}
echo " <a href="uitloggen.php">Uitloggen</a>";
} else {
echo "Je hebt geen rechten om deze pagina te bekijken! ";
}
?>
Edit:
bugmelden.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
54
<?
ob_start();
session_start();
include ("config.php");
include ("global.php");
$query = "SELECT * FROM leden WHERE id='".htmlspecialchars(mysql_real_escape_string($_COOKIE['id']))."'";
$result=mysql_query($query) or die (mysql_error());
$sql = mysql_fetch_assoc($result);
if (isset($_SESSION['login'])){
if (isset($_POST['submit'])) {
if (empty($_POST['pagina']))
{
$error .= "Je hebt geen pagina ingevuld.<br>";
}
if (empty($_POST['bug']))
{
$error .= "Je hebt geen bug ingevuld.<br>";
} else {
mysql_query("INSERT INTO bugs (id, bug, pagina, user, email, status) VALUES ('', '" . $_POST['bug']."', '" . $_POST['pagina']."', '" . $_POST['user']."', '" . $_POST['email']."', 'Niet gefixt')");
echo "Je bug is succesvol gemeld!<br>";
echo "<a href="ingelogd.php"> Terug </a><br><br>";
exit;
}
}
if (isset($error))
{
echo "<b>fout!:</b><br>";
echo $error . "<br>";
echo "<a href="javascript:history.back(-1)">Ga terug</a>";
}
echo "<b>Bug melden</b>";
?>
<br>
<form action="<?=$_SERVER['PHP_SELF']?>" method="POST">
<input type="hidden" name="user" value=" <? echo $sql[user]; ?>">
<input type="hidden" name="email" value=" <? echo $sql[user]; ?>">
Pagina waar de bug op staat<br>
<input name='pagina' type='text'> <Br>
Bug en/of error<Br>
<textarea name='bug' type='text' rows=2 cols=50></textarea>
<input type="submit" name="submit" value="submit"><BR>
</form>
<?
} else {
echo "Je hebt geen rechten om deze pagina te bekijken! ";
}
?>
Was ik vergeten
Zo, Thomas is weer
[Laatst bewerkt door Basjee op donderdag 1 maart 2007, om 21:08]