Hey Everybody!
I have been learning alot of php and i decided to show what i learn't from all these nice tutorails people made. As an tutorial. This is my first tutorial on P2L. So, i hope you enjoy it.
<?
ob_start(); //starts cookies
session_start();//starts sessions
include("config.php"); //includes the config file for all the database information
if ($logged[level] == 5) { //makes sure the user is an admin
//change 5 to your admins level
if (!$_POST[update])
{
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="banned" value="levelhere">
<input size="25" type="submit" value="Submit" name="update">
</form>");
//ends the echo
}
else
{
//make it some different page
$username = htmlspecialchars($_POST[name]);
$banned = htmlspecialchars($_POST[level]);
//posts them
echo ("$username has sucessfully changed levels");
//echos it
$update = mysql_query("Update users set level = '$banned' where username = '$username'");
//inserts it all into the database please note you must have the right table name for your users.
}
//ends an function
}
//ends an function
?>
That should help you all.
Thanks for reading,
Cyrus Wu