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

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
albertforns
Forum Newbie
Posts: 2
Joined: Fri Jun 27, 2008 12:11 pm

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

Post 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
kingen
Forum Newbie
Posts: 3
Joined: Fri Jun 27, 2008 12:11 pm

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

Post by kingen »

With include(), you can only include local files. You have to use file_get_contents().
albertforns
Forum Newbie
Posts: 2
Joined: Fri Jun 27, 2008 12:11 pm

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

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

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

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