lexusgs430
asked on
java or jquery script to run a php script saved as a seperate .php file on server
Hi,
I am working with a server side scripting language that does not allow php to be used directly in conjunction with the server side templates, so to work around it, I am hoping that there is a way that I can through Java, call the PHP script which will be saved as a separate PHP file on my web server, which I believe should work around the problem. Im assuming this is possible in javascript or jquery if that would be easier. Anyways, I installed wordpress on a subdomain on my site, so basically I am trying to import blog posts from word press into my main home page template which is managed through the server side scripting form. Hopefully that makes sense.
Anyways Im including the php code from the wordpress import so basically lets assume the wordpress code im posting is saved as "wordpressNews.php" on my webserver.
I am working with a server side scripting language that does not allow php to be used directly in conjunction with the server side templates, so to work around it, I am hoping that there is a way that I can through Java, call the PHP script which will be saved as a separate PHP file on my web server, which I believe should work around the problem. Im assuming this is possible in javascript or jquery if that would be easier. Anyways, I installed wordpress on a subdomain on my site, so basically I am trying to import blog posts from word press into my main home page template which is managed through the server side scripting form. Hopefully that makes sense.
Anyways Im including the php code from the wordpress import so basically lets assume the wordpress code im posting is saved as "wordpressNews.php" on my webserver.
<?php
require('/the/path/to/your/wp-blog-header.php');
?>
<?php
$posts = get_posts('numberposts=10&order=ASC&orderby=post_title');
foreach ($posts as $post) : start_wp(); ?>
<?php the_date(); echo "<br />"; ?>
<?php the_title(); ?>
<?php the_excerpt(); ?>
<?php
endforeach;
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.