Include a PHP file in a Server Connect action file

Is it possible to include a PHP file within a Server Connect action file?

To give some context. I have a PHP file which generates a PDF using FPDF. I want to run that as part of a Server Connect script. The idea is to generate a PDF which is saved on the server and then the rest of the action file does the sending of an email with the PDF attached.

I just call the custom php files I use, using an api action. Only downside is that sessions are not shared, but you can just pass what you need using variables.

1 Like

Thanks @mebeingken, I hadn’t thought of that. The actions in a Server Connect file run in sequence and each completes before moving to the next, doesn’t it?

Correct

1 Like

Thanks again, @mebeingken. It’s working perfectly.

1 Like

You might also like this:

1 Like

Using the HTTP_HOST server variable is something I hadn’t thought of. I just wrote the full URL in.

It would be lovely if a similar SC action could be created which can take a local path instead of a URL as that would increase security. I may submit that as a feature request.