danlew Posted May 25, 2007 Share Posted May 25, 2007 I am trying to create an admin.. I have already my tables and backend working but i need to make a php admin like apanel so i can easily add and edit text without going to phpmyadmin to do it everytime. Can anyone help me? Wil i need to show some code here of how my tables are in MYSQL or PHP Docs? Quote Link to comment https://forums.phpfreaks.com/topic/52929-help-with-admin-phpmysql/ Share on other sites More sharing options...
MasterACE14 Posted May 25, 2007 Share Posted May 25, 2007 certainly set yourself an interesting task go here http://wiz.homelinux.net/php.php and download Wiz MySQL Admin , and have a look at the coding of it, its similar to PHPmyAdmin but with less files, and I personally think it is better. you could do alot of copy and pasting from it for your admin control panel. That should be a nice head start for you. Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/52929-help-with-admin-phpmysql/#findComment-261402 Share on other sites More sharing options...
danlew Posted May 25, 2007 Author Share Posted May 25, 2007 No, I want to stick with phpadmin, but what i want is to design or code an admin so the client can log in and add and edit as they wish.. What will I need to add to this code to have 3 categories which sit as tables in phpadmin? At the monet the code i have created only displays the edit option. 1. News (contain : date, title and description) 2. Events (contain : date, title , description and images) 3. Information (contain : date, title and description) <?php session_start(); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>News System - Edit News</title> <style type="text/css"> <!-- select, textarea, input { border: #808080 1px solid; color: #000000; font-size: 11px; font-family: Verdana; BACKGROUND-COLOR: #ffffff } input[type=submit]:hover, input[type=button]:hover{ background-color:#EBEBEB !important; } a:active,a:visited,a:link {color: #446488; text-decoration: none; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt;} a:hover {color: #00004F; text-decoration: none; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; } a.nav { padding-top:10px; padding-bottom:10px; padding:9px;} a.nav:active, a.nav:visited, a.nav:link { color: #000000; font-size : 10px; font-weight: bold; font-family: verdana; text-decoration: none;} a.nav:hover { font-size : 10px; font-weight: bold; color: black; font-family: verdana; text-decoration: underline; } .header { font-size : 16px; font-weight: bold; color: #808080; font-family: verdana; text-decoration: none; } .bborder { background-color: #FFFFFF; border: 1px #A7A6B4 solid; } .panel {-moz-border-radius: .3em .3em .3em .3em; border: 1px solid silver; background-color: #F7F6F4;} BODY, TD, TR {text-decoration: none; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; cursor: default;} --> </style> </head> <body> <?php $admin_username = "admin"; $admin_password = "password"; $act = $_GET['act']; if ($act == "logout") { session_destroy(); echo "You have successfully logout"; exit(); } if ($_SESSION['login'] != "" || $_SESSION['loginpass'] != "") { $already_login = "TRUE"; } if ($already_login == "TRUE") { } else { if (!isset($_POST['login_box'])) { ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <div> Username: <input type="text" name="username" value="" style="width:120px; height:18px; font-family:Tahoma; font-size:11px "><br> Password: <input type="password" name="password" value="" style="width:120px; height:18px; font-family:Tahoma; font-size:11px "><br> <input type="submit" name="login_box" value="Submit"> </div> </form> <?php } else { $username = $_POST['username']; $password = $_POST['password']; if ($username == "" || $password == "") { echo "Please fill up the blank."; } elseif ($username != $admin_username || md5($password) != md5($admin_password)) { echo "Sorry, you don't have the privileges to access."; } else { // Save them in session $_SESSION['loginid'] = $username; $_SESSION['loginpass'] = md5($password); echo "Permission granted."; echo "<META HTTP-EQUIV='Refresh' CONTENT='1'>"; } } } ?> <?php if ($already_login != "TRUE") { exit(); } require_once('config.php'); if ($_GET['id'] != "") { $id = $_GET['id']; $query = "SELECT * FROM news WHERE id ='$id'"; $result = mysql_query($query) or die("There's some problem editing the news, please report it to $support_email"); $row = mysql_fetch_assoc($result); if (!$row) { echo "The news doesn't exists."; exit(); } if (!isset($_POST['submit'])) { ?> <form action="<?php echo $_SERVER['PHP_SELF'] . "?id=$id"; ?>" method="post"> <table border=0 cellpading=0 cellspacing=0 width="654" > <tr> <td width="75"> Title <td width="575" colspan="2"> <input type=text size="55" name="title" value="<?php echo $row['title']; ?>"> </tr> <tr> <tr> <td width="75"> Date <td width="575" colspan="2"> <input type=text size="55" name="date" value="<?php echo $row['date']; ?>"> </tr> <tr> <td width="75" valign="top"> <br />Content <td> <textarea rows="12" cols="74" id="content" name="content"><?php echo $row['content']; ?></textarea> <td width="108" valign="top"> <p align="center"><br /> <a href="add.php?act=help" target="_blank">[README]</a><br> <a href="?act=logout">[Logout]</a> </tr> </table> <table border=0 cellpading=0 cellspacing=0 width="654" > <tr> <td width="75"> <td> <table border=0 cellspacing=0 cellpadding=0 width=100%> <tr> <td width=50%> <input type=submit style='font-weight:bold' title="Edit the New Article" value="Edit News" name="submit"> </td> <td width=50% align=right> </td> </tr> </table> </tr> </table> </form> <?php } else { $title = $_POST['title']; $content = $_POST['content']; $date = $_POST['date']; if ($title == "" || $content == "") { echo "Please fill up all the blanks."; } else { mysql_query("UPDATE `news` SET title='$title', date='$date', content='$content' WHERE id='$id'") or die ("There's some problem editing this news, please report it to $support_name."); echo "You have successfully edited your news."; } } } ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/52929-help-with-admin-phpmysql/#findComment-261410 Share on other sites More sharing options...
nuttycoder Posted May 25, 2007 Share Posted May 25, 2007 have a loot at this tutorial http://www.php-mysql-tutorial.com/cms-php-mysql.php Easy to follow and with a little modification should do what your after Quote Link to comment https://forums.phpfreaks.com/topic/52929-help-with-admin-phpmysql/#findComment-261415 Share on other sites More sharing options...
danlew Posted May 25, 2007 Author Share Posted May 25, 2007 I am not after links, I want you to help me with my code which is what this forum is meant to be about. Quote Link to comment https://forums.phpfreaks.com/topic/52929-help-with-admin-phpmysql/#findComment-261416 Share on other sites More sharing options...
danlew Posted May 25, 2007 Author Share Posted May 25, 2007 I apologise nutycoder, that link ended up being very useful!, Thankyou Quote Link to comment https://forums.phpfreaks.com/topic/52929-help-with-admin-phpmysql/#findComment-261502 Share on other sites More sharing options...
unidox Posted May 25, 2007 Share Posted May 25, 2007 Are you looking for something like www.team-unidox.com/admin/ I have coded that, and if you need help I can help. Quote Link to comment https://forums.phpfreaks.com/topic/52929-help-with-admin-phpmysql/#findComment-261550 Share on other sites More sharing options...
unidox Posted May 25, 2007 Share Posted May 25, 2007 BUMP Quote Link to comment https://forums.phpfreaks.com/topic/52929-help-with-admin-phpmysql/#findComment-261635 Share on other sites More sharing options...
danlew Posted May 26, 2007 Author Share Posted May 26, 2007 Oh yeah something like that would be great... Quote Link to comment https://forums.phpfreaks.com/topic/52929-help-with-admin-phpmysql/#findComment-261919 Share on other sites More sharing options...
unidox Posted May 26, 2007 Share Posted May 26, 2007 email design@unidoxhosting.com with any questions. We will be more than heppy to help! Quote Link to comment https://forums.phpfreaks.com/topic/52929-help-with-admin-phpmysql/#findComment-262302 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.