Example #1
0
session_start();
$temp = $_POST["param"];
$temp = str_replace("[", "", $temp);
$temp = str_replace("]", "", $temp);
//echo $temp;
$param = json_decode($temp);
$ordr = (int) $param->order;
switch ($ordr) {
    case 1:
        GetWords();
        break;
    case 2:
        InsertWord($param);
        break;
    case 3:
        UpdateWord($param);
        break;
    case 4:
        GetWordInfo($param);
        break;
    case 5:
        DelWord($param);
        break;
}
function GetWords()
{
    $sql = "SELECT `the_word` FROM `oneword`";
    $rr = array();
    include "db_config.php";
    $result = mysqli_query($con, $sql);
    $i = 0;
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
//                                                                           //
//  File:         /admin/edit.php                                            //
//  Language:     PHP 4.3                                                    //
//                                                                           //
//  Description:  Edit, update and remove words from user's dictionary       //
//                                                                           //
//  Author:       Francisco Garcia Rodriguez <*****@*****.**>      //
//                                                                           //
//  $Id$
//  ------------------------------------------------------------------------ //
include 'inc/edit.inc';
if (isset($_GET['editingword'])) {
    EditWord($_GET['editingword']);
} else {
    if ($_POST['action'] == "Update") {
        UpdateWord($_POST);
    } else {
        if ($_POST['action'] == "Remove") {
            RemoveWord($_POST['new_word']);
        } else {
            Error("Requested link not available");
        }
    }
}