Remote reading

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Fanstop.tk
Forum Newbie
Posts: 17
Joined: Wed Jul 21, 2004 11:02 pm

Remote reading

Post 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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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
Fanstop.tk
Forum Newbie
Posts: 17
Joined: Wed Jul 21, 2004 11:02 pm

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Post Reply