PHP interesse |
|
Dit is mijn complete script:
<link rel="stylesheet" type="text/css" media="screen" href="../images/skin/basic/formate.css" />
<?php //settings.php :: Configuracion del juego
include("../gegevens.php");
define('INSIDE', true);
$gamenaam_root_path = '../';
include($gamenaam_root_path . 'extension.inc');
include($gamenaam_root_path . 'common.'.$phpEx);
if(!check_user()){ header("Location: login.php"); }
if($user['authlevel']!="5"&&$user['username']!="$admin1"){ header("Location: ../login.php");}
//includeLang('options');
$lang['PHP_SELF'] = 'options.'.$phpEx;
$dpath = (!$user["dpath"]) ? DEFAULT_SKINPATH : $user["dpath"];
//Bovenstaande moet in ieder admin script worden geplaatst.
?>
</head>
<table align="center" width=100%>
<tr><td class="subTitle">Maak Hulp Admin</b></td></tr>
<tr><td class="mainTxt">
<body style="; margin: 0px;">
<center><br>
<FORM METHOD=post ACTION="">
gebruikersnaam:<br>
<INPUT name="admin" type="text" VALUE="" maxlength="16" style="width: 100;"><center>
<br><br>Maak Hulp Admin<br>
<INPUT name="submit2" type="submit" VALUE="Maak Hulp admin">
<br><br>Maak Normaal<br>
<INPUT name="submit1" type="submit" VALUE="Maak Normaal">
<br></FORM>
</center>
</table>
<?PHP
echo "
</body>
</font>
</html>";
?>
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
$speler = $_POST['wie'];
if(isset($_POST['submit2']))
{
$insert = "UPDATE `ugml_users` SET `authlevel` = 5 WHERE `username`='".$_POST['wie']."'";
$insert_now = mysql_query($insert) or die("FOUT : " . mysql_error());
if($insert_now)
{
print 'U hebt '.$_POST['wie'].' hulpadmin gemaakt.';
}
else
{
print 'Kon '.$_POST['wie'].' geen hulpadmin maken.';
}
exit;
}
if (isset($_POST['submit1']))
{
$insert = "UPDATE `ugml_users` SET `authlevel` = 0 WHERE `username`='".$_POST['wie']."'";
$insert_now = mysql_query($insert) or die("FOUT : " . mysql_error());
if($insert_now)
{
print 'U hebt '.$_POST['wie'].' nu hulpadmin gemaakt.';
}
else
{
print 'Kon '.$_POST['wie'].' geen hulpadmin maken.';
}
exit;
}
?>
</body>
</html>
<link rel="stylesheet" type="text/css" media="screen" href="../images/skin/basic/formate.css" /> <?php //settings.php :: Configuracion del juego include("../gegevens.php"); $gamenaam_root_path = '../'; include($gamenaam_root_path . 'extension.inc'); include($gamenaam_root_path . 'common.'.$phpEx); if(!check_user ()){ header("Location: login.php"); } if($user['authlevel']!="5"&&$user['username']!="$admin1"){ header("Location: ../login.php");} //includeLang('options'); $lang['PHP_SELF'] = 'options.'.$phpEx; $dpath = (!$user["dpath"]) ? DEFAULT_SKINPATH : $user["dpath"]; //Bovenstaande moet in ieder admin script worden geplaatst. ?> </head> <table align="center" width=100%> <tr><td class="subTitle">Maak Hulp Admin</b></td></tr> <tr><td class="mainTxt"> <body style="; margin: 0px;"> <center><br> <FORM METHOD=post ACTION=""> gebruikersnaam:<br> <INPUT name="admin" type="text" VALUE="" maxlength="16" style="width: 100;"><center> <br><br>Maak Hulp Admin<br> <INPUT name="submit2" type="submit" VALUE="Maak Hulp admin"> <br><br>Maak Normaal<br> <INPUT name="submit1" type="submit" VALUE="Maak Normaal"> <br></FORM> </center> </table> <?PHP </body> </font> </html>"; ?> <?php $speler = $_POST['wie']; if(isset($_POST['submit2'])) { $insert = "UPDATE `ugml_users` SET `authlevel` = 5 WHERE `username`='".$_POST['wie']."'"; if($insert_now) { print 'U hebt '.$_POST['wie'].' hulpadmin gemaakt.'; } else { print 'Kon '.$_POST['wie'].' geen hulpadmin maken.'; } } if (isset($_POST['submit1'])) { $insert = "UPDATE `ugml_users` SET `authlevel` = 0 WHERE `username`='".$_POST['wie']."'"; if($insert_now) { print 'U hebt '.$_POST['wie'].' nu hulpadmin gemaakt.'; } else { print 'Kon '.$_POST['wie'].' geen hulpadmin maken.'; } } ?> </body> </html>
Hoe moet ik deze dan aanpassen volgens jullie?
Alvast bedankt, |