I am accessing a 3rd part API for an integration script I'm developing. It has a 3 step process in creating a userid (1. get a token 2. login as admin 3. do admin stuff)

I've scripted it via server side script that is triggered on a new user being created in our application.


$token = get_url("/api.php?action=token");




The problem that I am running into is that get_url and fopen do not appear to retain session state. As a result the 'do stuff' command fails as the admin login is not recognized. If I cut and paste the exact same commands into the browser URL everything works.

Any suggestions from the masses on how to accomplish this server side in PHP?


I've contacted the owner of the API and they have confirmed it is an issue with their code.

Nothing to see, move along ;-)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.