$row = $db->queryManyObject("select * from $subjects_tablename");

        if($row){
            $result = $row;
            $data = array('resultStatus'=>100,'data'=>$result);
            return json_encode($data);
        }else{
            $data = array('resultStatus'=>101);
            return json_encode($data);
        }
    }

    switch($_GET['action']){
        case 'submit_topic':
            echo submitTopic();
            break;
        case 'query_topic':
            echo queryTopics();
            break;
        case 'submit_subject':
            echo submitSubject();
            break;
        case 'query_subjects':
            echo querySubjects();
            break;
        default:
            break;
    }
}
?>
Beispiel #2
0
     if (isset($_REQUEST['site_name'])) {
         $site_name = $_REQUEST['site_name'];
     }
     if (isset($_REQUEST['description'])) {
         $description = $_REQUEST['description'];
     }
     if (isset($_REQUEST['text'])) {
         $text = $_REQUEST['text'];
     }
     if (isset($_REQUEST['locale'])) {
         $locale = $_REQUEST['locale'];
     }
     if (isset($_REQUEST['forum'])) {
         $forum = $_REQUEST['forum'];
     }
     submitTopic($threadid, $title, $image, $site_name, $description, $text, $locale, $author, $forum);
     //submitTopic($tags,$link,$title,$image,$site_name,$description,$text,$locale);
     break;
 case "load_link":
     $link = 0;
     if (isset($_REQUEST['link'])) {
         $link = $_REQUEST['link'];
     }
     loadLink($link);
     break;
 case "load_categories":
     $node = 'Root';
     if (isset($_REQUEST['node'])) {
         $node = $_REQUEST['node'];
     }
     loadCategories($node);