I am developing a wordpress theme and I want to use jQuery.load() to load data from a PHP file in my theme directory called process.php to a div in a wordpress page template.

I haven't had any issues with load() in the past but Wordpress is preventing me from loading the data or even accessing the process.php file in the browser.

When I navigate to the full path of the file (eg: http://[site]/[theme]/functions/process.php) I get the following error in Chrome

Internal Server Error. The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, **@gmial.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log.`

I've read similar questions but they involve modifying the .htaccess file. Does anyone know how to do this from a theme perspective ie: using $wp_rewrite.


Linux Server error log states

    [Mon Mar 12 14:00:52 2012] [error] [client] SoftException in Application.cpp:245: File "/var/www/vhosts/****.co.nz/httpdocs/npr/wp-content/themes/_s_2/functions/process.php" is writeable by group [Mon Mar 12 14:00:52 2012] [error] [client] Premature end of script headers: process.php

and this is process.php

echo "hello from php";
  • Take a look at the questions in here: ajax. Read about localize script and admin-ajax.php. – kaiser Mar 12 '12 at 1:29

You might find this informative, not sure if it will cover what you need but it explains a lot about front end Ajax for WordPress which is not exactly intuitive and it might help you out. In particular you probably need to understand how admin-ajax.php works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.