32 lines
1.2 KiB
PHP
32 lines
1.2 KiB
PHP
|
|
<?php header('Content-type: application/json');
|
||
|
|
if ( !defined('PATHTOINCLUDES') ) define('PATHTOINCLUDES', $_SERVER["DOCUMENT_ROOT"] . '/include/analytics/');
|
||
|
|
include(PATHTOINCLUDES."base.php");
|
||
|
|
$args = array(
|
||
|
|
'quid' => FILTER_VALIDATE_INT,
|
||
|
|
'quname' =>FILTER_SANITIZE_STRING,
|
||
|
|
'qcontent' =>FILTER_SANITIZE_STRING
|
||
|
|
);
|
||
|
|
$sanitizeinputs = filter_input_array(INPUT_POST, $args);
|
||
|
|
if(!isset($_SESSION["adb_qnu"]))
|
||
|
|
{
|
||
|
|
$_SESSION["adb_qnu"]=0;
|
||
|
|
}
|
||
|
|
$theq=strip_tags($_POST["qcontent"],"<strong><em><br>");
|
||
|
|
$em="";
|
||
|
|
$theuid=$_POST['quid'];
|
||
|
|
$theq=$_POST['qcontent'];
|
||
|
|
$theuname=$_POST['quname'];
|
||
|
|
$sql=sprintf("INSERT INTO `ask_dr_question` (`ask_dr_question`.`quid`,`ask_dr_question`.`quname`,`ask_dr_question`.`ques`)
|
||
|
|
VALUES (%s, %s, %s)",
|
||
|
|
GetSQLValueString($theuid, "int"),
|
||
|
|
GetSQLValueString($theuname, "text"),
|
||
|
|
GetSQLValueString($theq, "text"));
|
||
|
|
$query=$database->database_query($sql) or $em=$em.$database->database_error();
|
||
|
|
$arr = array ('error'=>$em);
|
||
|
|
echo json_encode($arr);
|
||
|
|
$dbemail="dr.bate@bateworld.com";
|
||
|
|
$tq=stripslashes($theq);
|
||
|
|
mail("phil@b8world.com", "New Dr. Bate Question", $tq);
|
||
|
|
mail("dr.bate@bateworld.com", "New Dr. Bate Question", $tq);
|
||
|
|
$_SESSION["adb_qnu"]=$_SESSION["adb_qnu"] + 1;
|
||
|
|
?>
|