Title: vic20's Replies | WordPress.org

---

# vic20

  [  ](https://wordpress.org/support/users/redrop/)

 *   [Profile](https://wordpress.org/support/users/redrop/)
 *   [Topics Started](https://wordpress.org/support/users/redrop/topics/)
 *   [Replies Created](https://wordpress.org/support/users/redrop/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/redrop/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/redrop/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/redrop/engagements/)
 *   [Favorites](https://wordpress.org/support/users/redrop/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 15 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[COVID19 - Coronavirus Outbreak Data] Some fields showing data with +0](https://wordpress.org/support/topic/some-fields-showing-data-with-0/)
 *  Thread Starter [vic20](https://wordpress.org/support/users/redrop/)
 * (@redrop)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/some-fields-showing-data-with-0/#post-13533139)
 * Of course if [https://worldometers.info/coronavirus](https://worldometers.info/coronavirus)
   is data source I think the reason is that for day data they wait for the next
   update.
 * I’m asking for a workaround to avoid to show data = 0 until official next daily
   update. Something like to limit plugin update frequency…
 * Thanks to everyone can help
    -  This reply was modified 5 years, 10 months ago by [vic20](https://wordpress.org/support/users/redrop/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form Submissions] Mail(2) autoresponder shouldn’t stored in the database](https://wordpress.org/support/topic/mail2-autoresponder-shouldnt-stored-in-the-database/)
 *  Thread Starter [vic20](https://wordpress.org/support/users/redrop/)
 * (@redrop)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/mail2-autoresponder-shouldnt-stored-in-the-database/#post-9145060)
 * Thank you Abhay!. it works perfectly..
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form Submissions] Mail(2) autoresponder shouldn’t stored in the database](https://wordpress.org/support/topic/mail2-autoresponder-shouldnt-stored-in-the-database/)
 *  Thread Starter [vic20](https://wordpress.org/support/users/redrop/)
 * (@redrop)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/mail2-autoresponder-shouldnt-stored-in-the-database/#post-9108356)
 * Nope.. I haven’t find any solution yet..
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Chained select with jquery](https://wordpress.org/support/topic/chained-select-with-jquery-1/)
 *  Thread Starter [vic20](https://wordpress.org/support/users/redrop/)
 * (@redrop)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/chained-select-with-jquery-1/#post-7659335)
 * Thanks a lot bcworkz,I finally decided to follow another way..
    I also figured
   out using the wordpress database for another application would be dangerous..
   I created another database (out of wordpress) I imported the tutorial tables 
   and I called it in db_config.php. Everything is working good..and so I think 
   that way is better for security and everything..Thanks again for your help!
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Chained select with jquery](https://wordpress.org/support/topic/chained-select-with-jquery-1/)
 *  Thread Starter [vic20](https://wordpress.org/support/users/redrop/)
 * (@redrop)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/chained-select-with-jquery-1/#post-7659286)
 * here the link:
    [http://chainedselect.altervista.org](http://chainedselect.altervista.org)
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Chained select with jquery](https://wordpress.org/support/topic/chained-select-with-jquery-1/)
 *  Thread Starter [vic20](https://wordpress.org/support/users/redrop/)
 * (@redrop)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/chained-select-with-jquery-1/#post-7659285)
 * Hi bcworkz,
    thanks for your reply.. I’ve followed your tips but nothing is changed.
 * jQuery was already installed so my fault trying to get jQuery from googleapis.
   Now I just added the tutorial script in the enqueued main js file.
    Here the 
   code:
 *     ```
       jQuery(document).ready(function() {
   
           var scegli = '<option value="0">Scegli...</option>';
           var attendere = '<option value="0">Attendere...</option>';
   
           jQuery("select#province").html(scegli);
           jQuery("select#province").attr("disabled", "disabled");
           jQuery("select#comuni").html(scegli);
           jQuery("select#comuni").attr("disabled", "disabled");
   
           jQuery("select#regioni").change(function(){
               var regione = jQuery("select#regioni option:selected").attr('value');
               jQuery("select#province").html(attendere);
               jQuery("select#province").attr("disabled", "disabled");
               jQuery("select#comuni").html(scegli);
               jQuery("select#comuni").attr("disabled", "disabled");
   
               jQuery.post("select.php", {id_reg:regione}, function(data){
                   jQuery("select#province").removeAttr("disabled");
                   jQuery("select#province").html(data);
               });
           }); 
   
           jQuery("select#province").change(function(){
               jQuery("select#comuni").attr("disabled", "disabled");
               jQuery("select#comuni").html(attendere);
               var provincia = jQuery("select#province option:selected").attr('value');
               jQuery.post("wp-content/select/select.class.php", {id_pro:provincia}, function(data){
                   jQuery("select#comuni").removeAttr("disabled");
                   jQuery("select#comuni").html(data);
               });
           });
       });
       ```
   
 * I think the error is here:
 *     ```
       jQuery.post("wp-content/select/select.class.php", {id_pro:provincia}, function(data){
                   jQuery("select#comuni").removeAttr("disabled");
                   jQuery("select#comuni").html(data);
               });
       ```
   
 * but anyway I get “Undefined index” errors..
 * About server side now select.class.php is:
 *     ```
       function ShowRegioni() {
       	global $wpdb;
       	$query = "SELECT * FROM {$wpdb->prefix}regioni";
       	$results_regione = $wpdb->get_results($query);
       	echo '<select id="regioni">';
       	echo '<option value="0">Scegli...</option>';
   
       	foreach($results_regione as $row) {
               $regione_id = $row->id_reg;
               $regione_name = $row->nome_regione;
               echo '<option value='.$regione_id.'>'.$regione_name.'</option>';
           }
   
           echo '</select>';
   
       }
   
       function ShowProvince() {
       	global $wpdb;
       	$query = "SELECT * FROM {$wpdb->prefix}province WHERE id_reg={$_POST['id_reg']}";
       	$results_provincia = $wpdb->get_results($query);
       	echo '<select id="province">';
       	echo '<option value="0">scegli...</option>';
   
       	foreach($results_provincia as $row) {
               $provincia_id = $row->id_pro;
               $provincia_name = $row->nome_provincia;
               echo '<option value='.$provincia_id.'>'.$provincia_name.'</option>';
           }
   
           echo '</select>';
   
       }
   
       function ShowComuni() {
       	global $wpdb;
       	$query = "SELECT * FROM {$wpdb->prefix}comuni WHERE id_pro={$_POST['id_pro']}";
       	$results_provincia = $wpdb->get_results($query);
       	echo '<select id="comuni">';
       	echo '<option value="0">scegli...</option>';
   
       	foreach($results_comune as $row) {
               $comune_id = $row->id_com;
               $comune_cap = $row->cap;
               echo '<option value='.$comune_id.'>'.$comune_cap.'</option>';
           }
   
           echo '</select>';
   
       }
       ```
   
 * I can’t get $_POST value..
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Chained select with jquery](https://wordpress.org/support/topic/chained-select-with-jquery-1/)
 *  Thread Starter [vic20](https://wordpress.org/support/users/redrop/)
 * (@redrop)
 * [10 years ago](https://wordpress.org/support/topic/chained-select-with-jquery-1/#post-7659164)
 * I’ve also found this example but if I put the new function in select.class.php
   it doesn’t works.
    [http://wptheming.com/2013/07/simple-ajax-example/](http://wptheming.com/2013/07/simple-ajax-example/)
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Chained select with jquery](https://wordpress.org/support/topic/chained-select-with-jquery-1/)
 *  Thread Starter [vic20](https://wordpress.org/support/users/redrop/)
 * (@redrop)
 * [10 years ago](https://wordpress.org/support/topic/chained-select-with-jquery-1/#post-7659152)
 * Ok, I’ve done a live demo here [http://chainedselect.altervista.org](http://chainedselect.altervista.org)
 * I’ve installed a free theme (responsive boat) and I set up the tutorial code 
   on it (of course I’ve modified some code to make it working on wordpress).
 * 2 files:
    -html code is in themes->responsiveboat->sections->big_title.php -js
   code is in themes->responsiveboat->header.php
 * I’ve imported 3 tables (regioni, province, comuni) in wordpress database.
 * I’ve created a folder “select” in wp-content where there is the file select.class.
   php.
 * Here the code:
 * sections->big_title.php
 *     ```
       <?php include_once( ABSPATH . 'wp-content/select/select.class.php' ); ?>
   
       <div id="container">
   
       	<h1>La cascata regioni - province - comuni</h1>
       	<h2>Seleziona una regione e nella select successiva compariranno le province di quella regione</h2>
       	<h3>Selezionando una provincia, nella select successiva compariranno i comuni di quella provincia</h3>
   
       	<form action="" method="POST" id="myform">
       		Seleziona una regione:<br />
   
       			<?php ShowRegioni(); ?>
   
       		<br /><br />
   
       		Seleziona una provincia:<br />
   
       			<?php ShowProvince(); ?>
   
       		<br /><br />
   
       		Seleziona un comune:<br />
   
       			<?php ShowComuni(); ?>
   
       	</form>
   
       </div><!--end container-->
       ```
   
 * header.php
 *     ```
       <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
   
           <script type="text/javascript">
       	$(document).ready(function(){
   
       		var scegli = '<option value="0">Scegli...</option>';
       		var attendere = '<option value="0">Attendere...</option>';
   
       		$("select#province").html(scegli);
       		$("select#province").attr("disabled", "disabled");
       		$("select#comuni").html(scegli);
       		$("select#comuni").attr("disabled", "disabled");
   
       		$("select#regioni").change(function(){
       			var regione = $("select#regioni option:selected").attr('value');
       			$("select#province").html(attendere);
       			$("select#province").attr("disabled", "disabled");
       			$("select#comuni").html(scegli);
       			$("select#comuni").attr("disabled", "disabled");
   
       			$.post("select.php", {id_reg:regione}, function(data){
       				$("select#province").removeAttr("disabled");
       				$("select#province").html(data);
       			});
       		});	
   
       		$("select#province").change(function(){
       			$("select#comuni").attr("disabled", "disabled");
       			$("select#comuni").html(attendere);
       			var provincia = $("select#province option:selected").attr('value');
       			$.post("select.php", {id_pro:provincia}, function(data){
       				$("select#comuni").removeAttr("disabled");
       				$("select#comuni").html(data);
       			});
       		});
       	});
   
       	</script>
       ```
   
 * wp-content/select/select.class.php
 *     ```
       <?php
   
       	function ShowRegioni() {
       		global $wpdb;
       		$query = "SELECT * FROM {$wpdb->prefix}regioni";
       		$results_regione = $wpdb->get_results($query);
       		echo '<select id="regioni">';
       		echo '<option value="0">Scegli...</option>';
   
       		foreach($results_regione as $row) {
       	        $regione_id = $row->id_reg;
       	        $regione_name = $row->nome_regione;
       	        echo '<option value='.$regione_id.'>'.$regione_name.'</option>';
       	    }
   
       	    echo '</select>';
   
       	}
   
       	function ShowProvince() {
       		global $wpdb;
       		$query = "SELECT * FROM {$wpdb->prefix}province WHERE id_reg=$_POST[id_reg]";
       		$results_provincia = $wpdb->get_results($query);
       		echo '<select id="province">';
       		echo '<option value="0">scegli...</option>';
   
       		foreach($results_provincia as $row) {
       	        $provincia_id = $row->id_pro;
       	        $provincia_name = $row->nome_provincia;
       	        echo '<option value='.$provincia_id.'>'.$provincia_name.'</option>';
       	    }
   
       	    echo '</select>';
   
       	}
   
       	function ShowComuni() {
       		global $wpdb;
       		$query = "SELECT * FROM {$wpdb->prefix}comuni WHERE id_pro=$_POST[id_pro]";
       		$results_provincia = $wpdb->get_results($query);
       		echo '<select id="comuni">';
       		echo '<option value="0">scegli...</option>';
   
       		foreach($results_comune as $row) {
       	        $comune_id = $row->id_com;
       	        $comune_cap = $row->cap;
       	        echo '<option value='.$comune_id.'>'.$comune_cap.'</option>';
       	    }
   
       	    echo '</select>';
   
       	}
   
       ?>
       ```
   
 * You can see that the first select works correctly but the others get errors.
 * second select shown errors:
 *     ```
       Notice: Undefined index: id_reg in /membri/chainedselect/wp-content/select/select.class.php on line 22
       Errore sul database di WordPress: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
       SELECT * FROM wp_province WHERE id_reg=
       ```
   
 * Third select shown errors:
 *     ```
       Notice: Undefined index: id_pro in /membri/chainedselect/wp-content/select/select.class.php on line 39
       Errore sul database di WordPress: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
       SELECT * FROM wp_comuni WHERE id_pro=
       ```
   
 * So it seems $POST doesn’t works.
 * The question is:
 * How can I get $POST selected by the user and put it in another function in wordpress?
 * Thanks to everyone can help me..
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Chained select with jquery](https://wordpress.org/support/topic/chained-select-with-jquery-1/)
 *  Thread Starter [vic20](https://wordpress.org/support/users/redrop/)
 * (@redrop)
 * [10 years ago](https://wordpress.org/support/topic/chained-select-with-jquery-1/#post-7659042)
 * Here there is the download of the working example anyway [http://www.yourinspirationweb.com/?ddownload=15305](http://www.yourinspirationweb.com/?ddownload=15305)
   but I’m not able to have the same behavior on wordpress.
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Chained select with jquery](https://wordpress.org/support/topic/chained-select-with-jquery-1/)
 *  Thread Starter [vic20](https://wordpress.org/support/users/redrop/)
 * (@redrop)
 * [10 years ago](https://wordpress.org/support/topic/chained-select-with-jquery-1/#post-7659038)
 * The tutorial is not available anymore in english but is still available in italian
   at this link [http://www.yourinspirationweb.com/2010/09/09/come-realizzare-delle-select-concatenate-con-php-e-jquery/](http://www.yourinspirationweb.com/2010/09/09/come-realizzare-delle-select-concatenate-con-php-e-jquery/).
   I can’t demonstrate you it by jsFiddle because there are database query to get
   data from wordpress database. I would like to use that chained select on wordpress.
   There was the same topic posted by [@bloke](https://wordpress.org/support/users/bloke/)
   member. Hope he can help me how can I get $POST query between selects. Thanks
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Trouble getting site URL](https://wordpress.org/support/topic/trouble-getting-site-url/)
 *  [vic20](https://wordpress.org/support/users/redrop/)
 * (@redrop)
 * [10 years ago](https://wordpress.org/support/topic/trouble-getting-site-url/#post-7569472)
 * Hi Bloke,
    I would like to reply to your topic: “Chained select with jquery” 
   but it’s closed. I’ve your same issue with the same tutorial. Please reply at
   [https://wordpress.org/support/topic/chained-select-with-jquery-1](https://wordpress.org/support/topic/chained-select-with-jquery-1)
   Sorry for the OT. Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Compliance by Hu-manity.co] Cookie Notice breaking Polylang?](https://wordpress.org/support/topic/cookie-notice-breaking-polylang-1/)
 *  [vic20](https://wordpress.org/support/users/redrop/)
 * (@redrop)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/cookie-notice-breaking-polylang-1/#post-6258687)
 * I fixed it by myself.
    There was a kind of conflict with Cookie Notice. In fact
   in Polylang string settings there were more items of Cookie Notice than the beginning
   situation. This was my first clue, so I deleted Cookie Notice and I tried to 
   go through phpMyAdmin and looking for Cookie Notice translated strings of Polylang.
   I deleted all them and when I updated, of course Cookie Notice strings were disappeared
   and Polylang finally start again to works. Good job!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Polylang] Forbidden message with strings updating](https://wordpress.org/support/topic/forbidden-message-with-strings-updating/)
 *  Thread Starter [vic20](https://wordpress.org/support/users/redrop/)
 * (@redrop)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/forbidden-message-with-strings-updating/#post-6605666)
 * I fixed it by myself.
    There was a kind of conflict with the plugin Cookie Notice.
   In fact in Polylang strings setting there were more items of Cookie Notice than
   the beginning situation. This was my first clue, so I deleted Cookie Notice and
   I tried to go through phpMyAdmin and looking for Cookie Notice translated strings
   of Polylang. I deleted all them and when I updated, of course Cookie Notice strings
   were disappeared and Polylang finally start again to works. Good job!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Compliance by Hu-manity.co] Cookie Notice breaking Polylang?](https://wordpress.org/support/topic/cookie-notice-breaking-polylang-1/)
 *  [vic20](https://wordpress.org/support/users/redrop/)
 * (@redrop)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/cookie-notice-breaking-polylang-1/#post-6258685)
 * I don’t think too. Just the weird about same issue with the same plugins.. I’m
   not solved yet the issue.. Any suggestions?
    TNX
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Compliance by Hu-manity.co] Cookie Notice breaking Polylang?](https://wordpress.org/support/topic/cookie-notice-breaking-polylang-1/)
 *  [vic20](https://wordpress.org/support/users/redrop/)
 * (@redrop)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/cookie-notice-breaking-polylang-1/#post-6258683)
 * Hey elenacone!..
    I have the same issue. I think too is a conflict between Cookie
   notice and Polylang. Did you fixed it? Help me please! TNX

Viewing 15 replies - 1 through 15 (of 15 total)