Line 21: if($_GET['func'] == "drop_1" && isset($_GET['func'])) { drop_1($_GET['drop_var']); } Line 61: if($_GET['func'] == "drop_2" && isset($_GET['func'])) { drop_2($_GET['drop_var']); } They are chained drop downs and they work but I still get notices from these lines. I attached the full func.php file too if anyone would like to view it. I'm just a beginner with php so I'm pretty clueless. Thanks!
The file doesn't have the HTML in it, so there's no way to tell, but there has to be an element named drop_var or func in the HTML, and there most likely isn't. $_GET[''] refers to an element name in your HTML code.
Rukbat here is the link to the script. Everything is posted online. Somone in the comments even says that are having a problems with the undefined index too. http://www.blueicestudios.com/chained-select-boxes-using-php-mysql-ajax/
Line 21:if(isset($_GET['func'])){if($_GET['func'] == "drop_1") { drop_1($_GET['drop_var']); } } Line 61:if(isset($_GET['func'])){if($_GET['func'] == "drop_2") { drop_2($_GET['drop_var']); }} this should work
Sloppy... multiple IF statements doing the job of one. if ( isset($_GET['func']) && ($_GET['func'] == "drop_1") ) { drop_1($_GET['drop_var']); } if ( isset($_GET['func']) && ($_GET['func'] == "drop_2") ) { drop_2($_GET['drop_var']); } Code (markup): Much better. I'd also add some form of internal warning or error handling for if those values are not set.