//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  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/insert.php                                          //
//  Language:     PHP 4.3                                                    //
//                                                                           //
//  Description:  Insert new words into database                             //
//                                                                           //
//  Author:       Francisco Garcia Rodriguez <*****@*****.**>      //
//                                                                           //
//  $Id$
//  ------------------------------------------------------------------------ //
include "../common.php";
include "../lib/utils.php";
include "inc/insert.inc";
$smarty = Template();
$smarty->assign("section", "Admin");
// If there are POST data, we must insert them and get status message
if (isset($_POST['word'])) {
    $smarty->assign('msg', stripslashes(InsertWord($_POST)));
}
// Now show empty FORM for new word
$smarty->assign('last_type', $_POST['type']);
$smarty->display('admin/insert.tpl');
示例#2
0
/// set the content charset to utf-8 for php
error_reporting(E_ALL);
ini_set('display_errors', '1');
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();
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  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/insert.php                                          //
//  Language:     PHP 4.3                                                    //
//                                                                           //
//  Description:  Insert new words into database                             //
//                                                                           //
//  Author:       Francisco Garcia Rodriguez <*****@*****.**>      //
//                                                                           //
//  $Id$
//  ------------------------------------------------------------------------ //
include "../common.php";
include "../lib/utils.php";
include "inc/insert.inc";
$smarty = Template();
$smarty->assign("section", "Admin");
// If there are POST data, we must insert them and get status message
if (isset($_POST['word'])) {
    $smarty->assign('msg', InsertWord($_POST));
}
// Now show empty FORM for new word
$smarty->assign('last_type', $_POST['type']);
$smarty->assign('types_list', TypesArray());
$smarty->display('admin/insert.tpl');