Problem with shortcode and php script
-
Dear All,
let me explain my little work with WordPress 4.4.10 and my problem.I’d like to add to my web site a page to show some information about races
reading values from custom tables inside wp instance. To do that I’ve prepared
a shortcode adding these statements to functions.php file:function race_func() { ob_start(); include('/var/www/html/wp-content/themes/twentyeleven/race.php'); $var = ob_get_clean(); return $var; } add_shortcode( 'race', 'race_func' );
I’ve made some test sith simple php code and I see that this short works fine
but doesn’t work my final php script.Inside “race.php” I’ve also two others php programms that I’ve to execute:
<html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <style type="text/css"> </style> <script> function testoEvento(valore) { document.getElementById("testo_evento").innerHTML = ''; $.ajax ({ type: "POST", url: "test9369c.php", data: {id: valore}, dataType: "html", success: function(dati_testo){ $("#testo_evento").html(dati_testo); return; }, error:function(msg){ alert('Errore : '+msg); } }); return;
….omissis
but test9369c don’t run. I’ve already tried with some path without any improvements.
Does Anybody know how can run php script that are inside this program ?Thanks a Lot !!!
Best Regards.
Willy
- The topic ‘Problem with shortcode and php script’ is closed to new replies.