• 0
Votes
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /var/www/html/cnasolution/site/application/views/question.php
Line: 191
Function: _error_handler

File: /var/www/html/cnasolution/site/application/controllers/Questions.php
Line: 419
Function: view

File: /var/www/html/cnasolution/site/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Ajax not working on Chrome and other browsers but works on firefox

I have this code where I am trying to fetch information from my database and display to the user using ajax but the code only works on firefox. I have tried it on chrome and other browsers, it does not work. See the code I have here:

JQuery

$('.product-category > option').on("click", function(){         var product_category=$(this).text();         $.ajax({             type:'POST',             url:'http://localhost/free/loadskill.php',             data:{                 product_cat:product_category,             },             success:function(output){                 var refOutput=JSON.parse(output);                 $("#tags").empty();                 $("#tags").append('');                 var arr_count=-1                 $.each(refOutput, function(){                 arr_count++;                 $("#tags").append('');              })         },     });     }) 

HTML

In loadskill.php I have

query("SELECT * FROM product WHERE category='$product_category'");         while($row=$product_search->fetch_assoc()){             $product=$row['name'];             array_push($products, $product);         }         $output=json_encode($products);         echo $output;     }  ?> 
Download script demo [LINK] [Origin]
Download script demo [LINK 2] [Onedrive] Download script demo [LINK 2] [Google drive]