plugins – Warning: Undefined variable $admin
Question
I’m running a wordpress plugin and continue to receive errors like:
Undefined variable $admin in C:\xampp\htdocs\wordpress\apps\wordpress\htdocs\wp-content\plugins\wordpress-database\vragen_plugin.php on line 791
This was my code:
// If ur an admin, you have access to the following 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'])) { $comment="Nee";} else { $comment = filter_input(INPUT_POST, 'comment', FILTER_SANITIZE_SPECIAL_CHARS); }
$uniq_name = substr(md5(uniqid(rand())),0,10);
0
2 months
2022-11-30T19:15:54-05:00
2022-11-30T19:15:54-05:00 0 Answers
0 views
0
Leave an answer