Jump to content

Run external php script on proccesswire template page


Krlos
 Share

Recommended Posts

Hi, have this php script that does a lookup in an external database.

I tryed to insert the script using an iframe , but the query is not validating the input and the script is not working.

I tried to paste de code inside a template in processwire but is not working either, I copied the script files to the root folder of the site where the processwire .htacess resides.

The script has a call to an external databe and output a pdf file.

What can I try to make this work?

Thank you in advance.

Edited by Krlos
Add more info
Link to comment
Share on other sites

1 hour ago, Krlos said:

What can I try to make this work?

Hard to tell without seeing the script. Are you sure the script is being loaded at all? Your options (some of which you have tried)

  1. Call it in a template file (include or require once). Create a page using the template and POST to that page or if it is a form on the page, POST to self
  2. Create a module based on the script. Call the module
  3. Create a module whose purpose is to call the script (include or require once)

Trying to access the script directly from protected ProcessWire folders will not work, e.g. /site/templates/myscript.php.

 

Could it be a namespace issue? Have you tried to Debug? Tracy?

Edited by kongondo
link
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...