PDA

View Full Version : Remote Scripting Question...



XT-iZac
March 5th, 2008, 07:59
Well, I have a question...for e.g.

if i want to have

variable

$user= file_get_contents (another website)


is it possible?

Also, is it possible to define

$blahblah= $blahblah?

If so how?

krakjoe
March 5th, 2008, 08:02
I can't make sense of the question ...

hamster
March 5th, 2008, 08:49
Err... I think he's asking if he can set a variable as a variable but I don't see what's the point in doing that...

Stan
March 5th, 2008, 09:57
Ok, translated into english his first question is basically:
He wants to use the file_get_contents() function and wants to know if he can use it externally like file_get_contents('http://website-i-wanna-rip-from.com/index.php');

His second question is basically can he set a variable as a variable like:
$var1=something
(rest of script)
$var2=$var1

All i can say is trial and error

krakjoe
March 5th, 2008, 10:04
You can use file_get_contents( ) on any streams that PHP suports, including ftp/http streams ( addresses )...

The second question:



<?php
$var = file_get_contents( "http://www.google.co.uk" );

$next = $var ;


is perfectly valid ( although pointless ) code ...

Why are you looking to reassign the same data to two variables, you realise your script will take up twice the memory, you should avoid doing it although it will not raise any errors ...

XT-iZac
March 6th, 2008, 07:18
basically, im editing a script...but the script is such how that if i don't, it will raise tons of errors meaning having to edit over a 50-60 files which im not too keen on doing so...

Here's another question

Will it work on different servers because basically, my script requires to login to elsewhere, thus, i want to protect my user and pass by sending the user and pass and storing them on different servers...Will it work?