Quantcast
Channel: Calling PHP Scripts in Ajax that are in PHP Snippets - WordPress Development Stack Exchange
Viewing all articles
Browse latest Browse all 2

Calling PHP Scripts in Ajax that are in PHP Snippets

$
0
0

So i'll preface this with the fact that I am trying to learn Ajax and I've spent considerable time trying to get a single example to work but to no avail. In the long run it'll replace a lot of my MySQL website calls that are done via a submit button requiring a page refresh.

After a lot of frustration I've come to realise that there is likely an issue with the calling of the php script in the xmlhttp.open("GET","example.php?q="+str,true); call.

I use a php snippet (wordpress plug-in which allows the user to include a short code on a page instead of embedding php code). The snippet doesn't require you to add the <?php / ?> bookends and doesn't have the option to name the php script, is there a simple way to name the script within the php script itself?

Alternatively, where is the best place to store php scripts to be able to call them up, I'm assuming the functions.php file of which I have no experience with to this point.

Note I'd rather be able to continue using my current snippet plug-in if possible (PHP code snippets (Insert PHP)).


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images