Jump to content

grab variable value from a remote server


maxwel

Recommended Posts

i want to get value of a variable that on another server to simply log the username of the user who access a page on the server that got the variable 

(variable =  $_SESSION[username])

 

so i wanna use php script to grab value of this variable (on other server) to log it in a txt file. i got everything working except being able to grab value of variable which is username

Use curl, log in to the remote server and get the content that belongs to this particular user.

 

Another alternative is to use ssh (if the server provide it) to log into it without GUI (graphical user interface) and to get the content by php-cli. 



<?php
session_start();
$dj_name_session = $_SESSION[rp_djname];
echo $dj_name_session;
$sam = '1234';
echo $sam;
?>

i found that echo of sam do appear when i use file_get_conetent but  $name_session dont :S although it show when i acess the file through browser duh

How to get this content through the browser with log in or without it?

 

Run that code and try to get the content from my server. I'm using session_start() and $_SESSION.

<?php

$testpage = file_get_contents('http://canada.lesno.net/info.php');

echo $testpage;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.