Running a php script from another web page

by 1 replies
2
Is there a way to run a php script from another web page in another directory though the same domain besides an iframe? Iframe seems a little hokey to me though I did use it in a search and create script I wrote. Get file contents would be a bit complicated due to includes etc..

Rick
#programming #page #php #running #script #web
  • There are a few ways. You could make an ajax request to the second page using javascript. The reply from the second page can then be used however you see fit.

    One example of this that I made was onsite recommendations. A person would visit a product page, the javascript would then id the product and send a request to a php script which would generate the recommendations and reply with the html for those recommendations. At that point the javascript would insert the html into a specific element on the page.
    • [ 1 ] Thanks

Next Topics on Trending Feed

  • 2

    Is there a way to run a php script from another web page in another directory though the same domain besides an iframe? Iframe seems a little hokey to me though I did use it in a search and create script I wrote. Get file contents would be a bit complicated due to includes etc.. Rick