Publishing System Settings Logout Login Register
Change Your User Levels- Usersystem Required
TutorialCommentsThe AuthorReport Tutorial
Tutorial Avatar
Rating
Add to Favorites
Posted on May 15th, 2007
788 views
PHP Coding
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
Dig this tutorial?
Thank the author by sending him a few P2L credits!

Send
CyrusWu

I'm an coder at 12. I'm still learning lot's of codings and hope to learn them all before i get to high school or univeristy.
View Full Profile Add as Friend Send PM
Pixel2Life Home Advanced Search Search Tutorial Index Publish Tutorials Community Forums Web Hosting P2L On Facebook P2L On Twitter P2L Feeds Tutorial Index Publish Tutorials Community Forums Web Hosting P2L On Facebook P2L On Twitter P2L Feeds Pixel2life Homepage Submit a Tutorial Publish a Tutorial Join our Forums P2L Marketplace Advertise on P2L P2L Website Hosting Help and FAQ Topsites Link Exchange P2L RSS Feeds P2L Sitemap Contact Us Privacy Statement Legal P2L Facebook Fanpage Follow us on Twitter P2L Studios Portal P2L Website Hosting Back to Top