I am working a wordpress plugin and proceed to obtain errors like:
Undefined variable $admin in C:xampphtdocswordpressappswordpresshtdocswp-contentpluginswordpress-databasevragen_plugin.php on line 791
This was my code:
// If ur an admin, you may have entry to the next web page
if($admin == '1'){
// When going to /Stel-vraag?createquestion=...
if (isset($_POST['createquestion'])) {
$short_question = filter_input(INPUT_POST, 'short_question', FILTER_SANITIZE_SPECIAL_CHARS);
$long_question = filter_input(INPUT_POST, 'long_question', FILTER_SANITIZE_SPECIAL_CHARS);
if (!isset($_POST['comment'])) { $remark="Nee";} else { $remark = filter_input(INPUT_POST, 'remark', FILTER_SANITIZE_SPECIAL_CHARS); }
$uniq_name = substr(md5(uniqid(rand())),0,10);