Cory94bailly Posted May 6, 2008 Share Posted May 6, 2008 Ok well I have only a little php experience but I know alot of html.. I look up lots of tutorials and that stuff.. But I am having trouble making an Admin CP! Features wanted: Ability to ban/delete accounts securely (Ban = Just show a different web page for them) Ability to post new news... Ability to view a request, do it, upload it.. then have the uploaded file show in a php page.. I can't really think well right now but I want it to be semi-advanced and 99.99999999999999999% secure! Any help/tutorials/etc will help alot! Quote Link to comment Share on other sites More sharing options...
dezkit Posted May 6, 2008 Share Posted May 6, 2008 mysql tizag.com w3schools.com tutorialized.com google.com Quote Link to comment Share on other sites More sharing options...
Cory94bailly Posted May 6, 2008 Author Share Posted May 6, 2008 mysql tizag.com w3schools.com tutorialized.com google.com That doesn't really help me... I obviously know those.. If someone could show me a TUTORIAL on making them or something.. Like w3schools.com is great but it shows one each syntax after another.. Quote Link to comment Share on other sites More sharing options...
dezkit Posted May 6, 2008 Share Posted May 6, 2008 I have been learning mysql for about 2 months, it just uses logic and web resources... just put some stuff in a mysql then fetch array from it. <?php mysql_connect("localhost", "admin", "1admin") or die(mysql_error()); mysql_select_db("test") or die(mysql_error()); $query = "SELECT * FROM example"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "<table>"; echo "<tr><td>"; echo $row['news']; echo "<br />"; } ?> Quote Link to comment Share on other sites More sharing options...
dezkit Posted May 6, 2008 Share Posted May 6, 2008 and use this form to submit news into the table <?php if(isset($_POST['submit'])) { ?> <?php // Make a MySQL Connection mysql_connect("localhost", "admin", "1admin") or die(mysql_error()); mysql_select_db("test") or die(mysql_error()); // Insert a row of information into the table "example" mysql_query("INSERT INTO example (name, age) VALUES('$news') ") or die(mysql_error()); echo "News posted!"; ?> <?php } else { ?> <form action="<? $_SERVER['PHP_SELF']; ?>" method="post"> <textarea name="news"></textarea> <input type="submit" value="submit"> </form> <?php } ?> Quote Link to comment Share on other sites More sharing options...
dezkit Posted May 6, 2008 Share Posted May 6, 2008 well now that i made you code you can at least be a nice boy and say thanks. Quote Link to comment Share on other sites More sharing options...
Cory94bailly Posted May 6, 2008 Author Share Posted May 6, 2008 well now that i made you code you can at least be a nice boy and say thanks. Sheesh.. just read it now.. Thanks. Quote Link to comment Share on other sites More sharing options...
Cory94bailly Posted May 6, 2008 Author Share Posted May 6, 2008 Doesn't seem to work.. What sql query am I supposed to run? I created a table and a row both called news.. I ran the first one.. ran fine, no errors.. I ran the second, I put something random in the box.. hit submit.. went back to the first and it was blank.. I saw the source, the first is supposed to show the news.. right? Quote Link to comment Share on other sites More sharing options...
nafetski Posted May 6, 2008 Share Posted May 6, 2008 Search "PHP and MySQL tutorial" Do those. Come back with specific questions. Your question is just too vague for any of us to help you, unless you want us to do the work. In which case I know quite a few of us will if you put it in the freelancing forum (and cough up the $ =P) Quote Link to comment Share on other sites More sharing options...
Cory94bailly Posted May 6, 2008 Author Share Posted May 6, 2008 Ok well.. I'm going to start out and make a simple html admin panel and what functions I want it to have.. If I have problems, I'll write them here! Do those. Come back with specific questions. Well first question: How can I make an "Admin Notepad"? Like any admins that have access to the panel can write something in it.. Soo.. Just it's a big text box and you press submit and it saves what you typed in it.. But how do I get it to keep what I type and what others type? Quote Link to comment Share on other sites More sharing options...
nafetski Posted May 6, 2008 Share Posted May 6, 2008 You need to save the values to a database. Also if you're doing an admin panel (where some people will have more access than others) your'e going to need to have it permissions based. IE, you don't want a regular user to read what your "Admin Notepad" Unless you DO want everyone to read it, then it's even easier If you just want ONE big <textarea> you give it a name, then enclose it in a <form> field. When you hit Submit, it will send the variables via POST or GET...depending what you choose. From there, you make a MySQL query to your database, and input the data into a field. You will probably want to save the users name that made the post, and show it next to what they typed. Basically, while what you're asking seems like a "simple" question - it's still too open ended. I can give you a vague description of what you need to learn, but until you have a question like "Why isn't my MySQL query working?" or "There are funky little quotes all over my entries in my table!" You won't get much help from us. Do you have PHP/apache/mysql installed? Where are you at in terms of skill level? Quote Link to comment Share on other sites More sharing options...
robos99 Posted May 6, 2008 Share Posted May 6, 2008 Cory, Your questions are beyond that of a basic admin panel. The admin panel is just the interface that allows you to control all of these settings. But the tasks you want to do describe more of a user authentication system, a content management system, and I'm not sure what you were talking about for that third part "Ability to view a request, do it, upload it.. then have the uploaded file show in a php page..". In the most basic form, this is about database interaction. There may be ways to do this without using a DB, but it would be easiest to go that route. I'd read up on some more tutorials first so you can get a basic grasp of writing database driven websites. You gotta crawl before you can walk. That means learn the principles of MySQL (or whatever your DB of choice), and figure out how it all interacts first, before you decide to tackle complex projects. Creating a user authentication system and making it very secure and doing it right is no small task. At the very least, you'll want to read up on database usage, as well as sessions and cookies. It would also be wise to start learning object oriented programming, as this will make writing your entire site much easier and much more organized. Where to look? The PHP website for one, www.php.net, has excellent documentation. Other than that, find tutorials that cover this stuff. I know www.sitepoint.com (hope I'm not breaking any rules linking to a competitor...) has tutorials for OOP, database integration, and user authentication systems. Learn the basics first, then write some simply little programs to test what you've learned. If you go this route, when you finally start writing the actual program it will come much easier. Plus you'll probably spend WAY less time debugging. A few tidbits to get you started....watch out for register globals and mysql injection attacks (there was a third tidbit but I forgot it, haha)...google these terms and understand them. You need to combat these problems if you want to make a secure website. And then when you're all done post it here to see if anyone here can break in. haha. Quote Link to comment Share on other sites More sharing options...
npsari Posted May 6, 2008 Share Posted May 6, 2008 This question is so general You need to learn php and mySQL yourself Because it is only you who knows what you are after trying to get help will cost you even more time A friendly advice Quote Link to comment Share on other sites More sharing options...
Cory94bailly Posted May 6, 2008 Author Share Posted May 6, 2008 Do you have PHP/apache/mysql installed? Where are you at in terms of skill level? I have paid for hosting at godaddy so i have all that.. And my skill level... Between 1-10 I'd say I'm a 1.5... Quote Link to comment Share on other sites More sharing options...
blackcell Posted May 6, 2008 Share Posted May 6, 2008 You are going from learning to crawl to running marathons. An admin CP will take lots of playing with database interaction and figuring out sql syntax. Like dezkit said, you need to just play with putting things in and out of a database. Then wrap your logic around it. I am not sure if you know it but you have to echo or print your database values after you pull them out. They don't automatically print to the screen. Quote Link to comment Share on other sites More sharing options...
Cory94bailly Posted May 6, 2008 Author Share Posted May 6, 2008 I am not sure if you know it but you have to echo or print your database values after you pull them out. They don't automatically print to the screen. I know that much.. It's just that me and a friend are making an online service and we are going to need to basically need to update the news, and add links to a page without manually editing the file. Quote Link to comment 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.