remote server returns empty

Discussion in 'Customization & add-ons' started by handwriting, Dec 20, 2015.

  1. handwriting

    handwriting New Member

    Joined:
    Dec 1, 2010
    Messages:
    8
    Hi,

    We are getting username after user logs in,
    username.php (is on local server where aMember is installed)
    $username = Am_Lite::getInstance()->getUsername();
    username is displayed fine on local server,

    but when we read username from remote server,
    username is empty

    remote.php (is on remote server)
    $page = file_get_contents('http://mydomain.com/username.php');
    echo($page);

    Does aMember allow reading Am_Lite details from remote server?
    Is there option to add IP address to allow it?

    Thanks,
    Nurbek
  2. handwriting

    handwriting New Member

    Joined:
    Dec 1, 2010
    Messages:
    8
    Does Am_Lite return as cookie?
  3. thehpmc

    thehpmc Member

    Joined:
    Aug 24, 2006
    Messages:
    901
    No as a variable.

    Thinking you could use session variables such as:
    PHP:
    <?php
    session_start
    ();   // first line of script
    $_SESSION['username']= Am_Lite::getInstance()->getUsername();
    ....
    ....
    Then in your script get the usename from
    PHP:
    session_start(); // first line of script
    $username=$_SESSION['username']

Share This Page