Page 1 of 1

Remote reading

Posted: Sat Jul 31, 2004 3:36 pm
by Fanstop.tk
I am developing a script that requires data to be able to be read from the local location to the remote location.

Here is what I have:

Test.php

Code: Select all

<?php
$uname = "User";
include("http://melicbot.com/fanstop/php-sec/data/login.php");
?>
login.php

Code: Select all

<?php
echo "Hello, $uname";
?>
The file will not echo the uname variable.

Posted: Sat Jul 31, 2004 4:47 pm
by John Cartwright
You have to be a bit more specific for the purpose of your script.

If you simply want to pass information you can send it through the header and the superglobal $_GET

Posted: Sat Jul 31, 2004 5:11 pm
by Fanstop.tk
More specifically, my script (explained at the site http://php-secure.tk) is designed to allow a visitor to sign up on a network and access several different websites under the same name and password to log in. The scripting, however, requires an outside variable to be read into an include file... more specifically, the outside file should be able to use the variable provided on the base page (itself) and use the external file's scripting as if it were on the same page... I want, essentually, to have the page act as if the variable and script are in the same location.

Like this:

Code: Select all

<?PHP
$name="Myname";

//External File
include("http://..../external.php");
//End File

?>
Will act the same function as this:

Code: Select all

<?PHP
$name="Myname";

//External File
echo $name;
//End File

?>
Currently, I get no variable output in the file that it's based at.

Posted: Sat Jul 31, 2004 5:20 pm
by feyd
the remote script must return php code.. the way you have it set up, it will return the final run of its code.