Page 1 of 1

Is it possible to include a PHP file to the MYSPACE ?

Posted: Fri Jun 27, 2008 12:18 pm
by albertforns
Hi, I want to make an include to my myspace. I have a code that works fine on other own page I have.

The include statement is:

<?PHP include ('http://www.albertforns.com/easycounter_myspace.php'); ?>

which I have inserted on a style script inside a profile code in my own myspace...

It does'nt work, as if the include is (as it might be) into a .htm file instead of a .php and cannot be executed.

I had this problem with other pages since I discovered that you have to include php files in files which have .php extension, but as you can imagine, in myspace you cannot to know which extension are the parent files and the php execution control and so on....

can you help me?

THANKS

Re: Is it possible to include a PHP file to the MYSPACE ?

Posted: Fri Jun 27, 2008 12:22 pm
by kingen
With include(), you can only include local files. You have to use file_get_contents().

Re: Is it possible to include a PHP file to the MYSPACE ?

Posted: Fri Jun 27, 2008 12:26 pm
by albertforns
mmm interesting! thanks

are you telling me that file_get_contents() would work exactly as if I include? my 'included' script has a coutner and file I/O operation and a kind of "echo $count"... does it all will run?

thanks

Re: Is it possible to include a PHP file to the MYSPACE ?

Posted: Fri Jun 27, 2008 12:29 pm
by John Cartwright
myspace will not allow the execution of php code on their website, nor would any site with sensible security. I would suggest creating an iframe and loading your page from there.