How To Get Moodle Info To An External Page?

How To Get Moodle Info To An External Page?

by Vinícius Machado de Melo -
Number of replies: 5

Good Morning Everyone,


Here's what I'm up to: I'm doing an evaluation system, where I put the link to an external page (outside of moodle) for courses evaluation. So, every course is going to have a link, I am trying to get course info by $COURSE->id, I've already try with $PAGE, $_SESSION, and nothing seems to work.

I require login to use it, because I also need to know who the user is. I used var_dump on each of these global variables, and everyone of them is empty (I don't know why because I'm logged in while accessing it).

Did someone got through a similar situation? I appreciate your help.

Average of ratings: -
In reply to Vinícius Machado de Melo

Re: How To Get Moodle Info To An External Page?

by sas ss -

Hello, any luck in passing moodle login to another system that needs login as well?

As for the course ID, in courses, add activity, URL from there you can set the parameteres to be sent to the other website (ofcourse not the authentication)

Please if you have any updates regarding the cross platform authentication, help

In reply to Vinícius Machado de Melo

Re: How To Get Moodle Info To An External Page?

by Conn Warwicker -
Picture of Core developers Picture of Plugin developers

When you say "outside of Moodle", I assume it's still on the same web server as Moodle?

If so, make sure you have required the config file at the top of your page.

How are you trying to access the course information for a given link? Does it have the "id" of the Moodle course? If so, you can get the course record out of Moodle by using the "get_course()" function, e.g.

$course = get_course($someidhere);

Hard to say really though, without further information about what you are actually trying to do and how.


In reply to Conn Warwicker

Re: How To Get Moodle Info To An External Page?

by sas ss -

I have two platforms, Moodle (A) and another Learning System (B), located on the same server, what I want is that a student whos logged in Moodle see (click/popup/embed...) his report card that is hosted on platform B and usually needs a username and pass to be accessed.

In reply to sas ss

Re: How To Get Moodle Info To An External Page?

by Praveen Chamarthi -

Hi Sas,


We can display Moodle data in other pages....
if you want to user login with both lms you can use CAS authentication.

You can display data from Database.


In reply to Praveen Chamarthi

Re: How To Get Moodle Info To An External Page?

by sas ss -

Thank you will check it