Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/156316-create-admin-panel/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/156316-create-admin-panel/#findComment-823021
Share on other sites

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?

 

Link to comment
https://forums.phpfreaks.com/topic/156316-create-admin-panel/#findComment-823063
Share on other sites

$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.

Link to comment
https://forums.phpfreaks.com/topic/156316-create-admin-panel/#findComment-825725
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.