How to send moodle variable to outside site

How to send moodle variable to outside site

by Camilo Gaitán -
Number of replies: 1

Hi everyone.


First I'm sorry for my english.


I manage a Moodle 3.1.1. I need to send user information to external php site. I have used $_SESSION and $_COOKIE but it doesn´t work.

I used something like this:


1. In path-to-moodle/moodle/user/index.php I added

nombresUsuario = $USER->firstname . $USER->lastname;

setcookie('nombres', $nombresUsuario);


2. In path-to-php-file/file.php I added

echo ("<strong>" . $_COOKIE['nombres'] . "</strong>");


I don't know if it is well. The php file is in the same moodle´s server.


¿Any idea?


Thanks for yours atention.

Average of ratings: -