Hello.
Is it possible to execute an external page programmatically in Drupal?
What I'm trying to do is trying to do a form post for a login page in order to get the session id.
Thanks.
Pol

Comments

trailerparkopera’s picture

that does what you want externally, then enter into a node in drupal. Tell drupal the node is PHP code, then whenever you open the node, your code will execute.

If it's simply executing an HTML form, code it in HTML, tell Drupal that the node is HTML, and you're good to go.

palabat’s picture

Hello.

Thanks for your response.

The way I plan to do it is this way.

I have the external URL Login page and the login credentials. I want Drupal to execute this external login page without even showing it.

ex.. https://example.com/logon.do?username=[name]&password=[pass]

And then I'll try to open the rest of the external pages hoping that I got the session id from the previous step. Just a note the url is using secure http.

ex..https://example.com/index.htm

Thanks.
Pol

panis’s picture

lookup the php curl library to do what you want to do.

You can follow the instructions above to put it in a node as a PHP page or write your own module - which may be better if you intend to keep track of the session over multiple calls.