Bman900 Posted April 30, 2009 Share Posted April 30, 2009 Alright so my script is as follows: User inputs a question which is then checked for keywords and redirected to pages specified. Here is what I want to do: 1. I want to store all the question entered into a database. 2. Create and admin panel where all the question can be retrieved. 3. create some kind of system where I can see how many times a keyword has been hit and redirected to a page 4. Modify some variables in my script from a secure admin panel. Example: if (strstr($question, $keyword)) { echo "<meta http-equiv=\"refresh\" content=\"0;URL=page1.php\">"; } What I want is to be able to change the value of the $keyword variable. I am fairly new to PHP but I can learn what I need but I have no clue where to start or what to look at. Quote Link to comment https://forums.phpfreaks.com/topic/156316-create-admin-panel/ Share on other sites More sharing options...
Zhadus Posted April 30, 2009 Share Posted April 30, 2009 1. Learn how to connect to a MySQL database. Running queries are a breeze after that from PHP. 2. Use what you learned in step 1 as well as google to have a secure login system. You can have it public or private registration as well. 3. Again using MySQL DB queries. 4. Nothing is really ever 100% secure. The majority of this can still be done if you load the variables from the database, then you can just use more queries to modify the database values. If you're talking about rewriting PHP pages with this sytem, I wouldn't recommend it. A great tutorial for using a MySQL database: http://www.tizag.com/mysqlTutorial/ The rest is very easily learned by browsing this forum. Quote Link to comment https://forums.phpfreaks.com/topic/156316-create-admin-panel/#findComment-823021 Share on other sites More sharing options...
Bman900 Posted April 30, 2009 Author Share Posted April 30, 2009 So for the last one I can make it so what ever I put in the admin panel will go to the database and then the varibale will look in the database for the value? so it works like Admin input to database > $keyword = databsevalue Like that? Quote Link to comment https://forums.phpfreaks.com/topic/156316-create-admin-panel/#findComment-823031 Share on other sites More sharing options...
revraz Posted April 30, 2009 Share Posted April 30, 2009 That is the concept, yes. Quote Link to comment https://forums.phpfreaks.com/topic/156316-create-admin-panel/#findComment-823035 Share on other sites More sharing options...
Bman900 Posted April 30, 2009 Author Share Posted April 30, 2009 So how would I insert my question into the database. Assuming that I have my table created and everything what code would I use. This is what I came up with: mysql_query("INSERT INTO example (question) VALUES('$_POST['question']' ) ") or die(mysql_error()); Would that work? Quote Link to comment https://forums.phpfreaks.com/topic/156316-create-admin-panel/#findComment-823063 Share on other sites More sharing options...
Bman900 Posted April 30, 2009 Author Share Posted April 30, 2009 Any one? Quote Link to comment https://forums.phpfreaks.com/topic/156316-create-admin-panel/#findComment-823120 Share on other sites More sharing options...
mikesta707 Posted May 1, 2009 Share Posted May 1, 2009 yeah that would work, but you need to wrap array values with { }. Dont ask me why. so something like mysql_query("INSERT INTO example (question) VALUES('{$_POST['question']}' ) ") or die(mysql_error()); [/php[ should work for you. hope that helps! Quote Link to comment https://forums.phpfreaks.com/topic/156316-create-admin-panel/#findComment-823154 Share on other sites More sharing options...
Bman900 Posted May 1, 2009 Author Share Posted May 1, 2009 Yep that worked! Man this is addicting, I keep going but I can't stop.... Quote Link to comment https://forums.phpfreaks.com/topic/156316-create-admin-panel/#findComment-823163 Share on other sites More sharing options...
Bman900 Posted May 1, 2009 Author Share Posted May 1, 2009 Now how would I spit out the result from that table in a nice HTML table? Quote Link to comment https://forums.phpfreaks.com/topic/156316-create-admin-panel/#findComment-823164 Share on other sites More sharing options...
Zhadus Posted May 4, 2009 Share Posted May 4, 2009 $query = "SELECT * FROM example"; $results = mysql_query($query) or die(); echo '<table>'; while ($tval = mysql_fetch_array($results)) { echo '<tr><td>' . $tval['varName'] . '</td><td>' . $tval['varValue'] . '</td></tr>'; } echo '</table>'; There is a basic example. Quote Link to comment https://forums.phpfreaks.com/topic/156316-create-admin-panel/#findComment-825725 Share on other sites More sharing options...
Jagmeet Posted May 4, 2009 Share Posted May 4, 2009 I also want to learn admin panel ......... is there any online tutorials available !! Quote Link to comment https://forums.phpfreaks.com/topic/156316-create-admin-panel/#findComment-825863 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.