maxwel Posted May 23, 2013 Share Posted May 23, 2013 guys been since morning trying to get a way to grab value of a variable from a remote server, tried require, include, fopen, file_get_contentsand still cant make it any idea? Quote Link to comment https://forums.phpfreaks.com/topic/278327-grab-variable-value-from-a-remote-server/ Share on other sites More sharing options...
Muddy_Funster Posted May 23, 2013 Share Posted May 23, 2013 You got the new topic bit ok, but seem to have completly missed the "very informative description of your problem" part of the request. We need to know the details to provide a viable solution. Quote Link to comment https://forums.phpfreaks.com/topic/278327-grab-variable-value-from-a-remote-server/#findComment-1431865 Share on other sites More sharing options...
maxwel Posted May 23, 2013 Author Share Posted May 23, 2013 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 Quote Link to comment https://forums.phpfreaks.com/topic/278327-grab-variable-value-from-a-remote-server/#findComment-1431869 Share on other sites More sharing options...
jazzman1 Posted May 23, 2013 Share Posted May 23, 2013 (edited) 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. Edited May 23, 2013 by jazzman1 Quote Link to comment https://forums.phpfreaks.com/topic/278327-grab-variable-value-from-a-remote-server/#findComment-1431873 Share on other sites More sharing options...
maxwel Posted May 23, 2013 Author Share Posted May 23, 2013 there is no way to grab the echo value of the variable from a php page to the remote server? Quote Link to comment https://forums.phpfreaks.com/topic/278327-grab-variable-value-from-a-remote-server/#findComment-1431876 Share on other sites More sharing options...
jazzman1 Posted May 23, 2013 Share Posted May 23, 2013 there is no way to grab the echo value of the variable from a php page to the remote server? CURL works like a browser, did you try it? Quote Link to comment https://forums.phpfreaks.com/topic/278327-grab-variable-value-from-a-remote-server/#findComment-1431877 Share on other sites More sharing options...
maxwel Posted May 23, 2013 Author Share Posted May 23, 2013 nope, i don't know how to use it :S honestly Quote Link to comment https://forums.phpfreaks.com/topic/278327-grab-variable-value-from-a-remote-server/#findComment-1431880 Share on other sites More sharing options...
maxwel Posted May 23, 2013 Author Share Posted May 23, 2013 (edited) <?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 Edited May 23, 2013 by maxwel Quote Link to comment https://forums.phpfreaks.com/topic/278327-grab-variable-value-from-a-remote-server/#findComment-1431890 Share on other sites More sharing options...
jazzman1 Posted May 23, 2013 Share Posted May 23, 2013 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; Quote Link to comment https://forums.phpfreaks.com/topic/278327-grab-variable-value-from-a-remote-server/#findComment-1431902 Share on other sites More sharing options...
Solution maxwel Posted May 23, 2013 Author Solution Share Posted May 23, 2013 (edited) hello jazzman1 XD yours work but, unfortunatly when i used the same with session_start() and $_SESSION. it didnt work but for 1234 variable it worked :S with login, anyways i did it in another way thanks alot for your help Edited May 23, 2013 by maxwel Quote Link to comment https://forums.phpfreaks.com/topic/278327-grab-variable-value-from-a-remote-server/#findComment-1431947 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.