Change User Levels
Hey Everybody! I have made an tutorial on changing your user levels i used some of jamvinces2k tutorial but not really that much.
Now to get started.
First the requirements:
Php usersystem
PHP 4
MYSQL
A Brain
A text Editor
Now, it's time to start working if you fit those requirments
Make an file called changelevel.php
And put
PHP Code
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
<?
ob_start(); //starts cookies
session_start();//starts sessions
include("config.php"); //includes the config file for all the database information
if ($logged[level] == 6) { //makes sure the user is an admin
if (!$_POST[update])
//what if it does
{
//ends function that is on top of this line
//echo starts an echo there on the line below
echo("<form method=\"POST\">
<font size=1>Username:
<input size=\"25\" type=\"text\" name=\"name\" value=\"Username\"><br><br>
Level:
<input size=\"25\" type=\"text\" name=\"level\" value=\"levelhere\">
<input size=\"25\" type=\"submit\" value=\"Submit\" name=\"update\">
</form>");
//ends the echo
}
else
{
//makes it different page like cases recommeneded to learn if else.
$username= htmlspecialchars(addslashes($_POST[name]));
$level= htmlspecialchars(addslashes($_POST[level]));
//posts it and uses safes.
echo ("$username has sucessfully changed levels");
//displays an echo to show it's done
$update = mysql_query("Update members set level = '$level' where username = '$username'");
//inserts it all into the database
}
//ends an function
}
//ends an function
?>
Enjoy any support tell me below!