Recent Widgets


Register for DashboardWidgets

Recent Forums Posts

Partners


iCompositions

MacDesktops.net

RSS Showcase
RSS Comments
RSS Forums

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. Posted in: Widget Central

php help

Author Message
puscifier



Joined: 14 Jun 2005
Posts: 2

Posted: Tue Jun 14, 2005 - 3:29 pm    Post subject: php help Reply with quote

so i'm making a widget to update according to an external website. couldn't use xmlhttprequest directly due to "same origin policy." i ended up making a .php that fetches the data and prints it in the appropriate format. the main .html then makes an xmlhttprequest of the .php in the same directory. problem is, while the test works just fine on my personal website, the widget isn't working. seems a problem with the php? the widget prints the php code verbatim instead of the data.

ideas? is this a dashboard server thing? if so, how do i get around it? if not, what should i do?

thanks.
View user's profile Send private message Send e-mail Widgets
mdc



Joined: 24 May 2005
Posts: 5
Location: florida.usa

Posted: Tue Jun 14, 2005 - 4:26 pm    Post subject: Reply with quote

i was thinking about this before. i am not sure if php can be in a widget, since if you put a .php file into safari it just displays the raw code. i read that if you turn on your local webserver, then install php locally, safari will load php files.

this does not help with dashboard since the widgets are run locally and thus not everyone has php.

would be cool if it worked, or if there is a work-around since php would be neat.
View user's profile Send private message Send e-mail Visit poster's website AIM Address Widgets
sean



Joined: 22 Apr 2005
Posts: 67
Location: Duluth, MN

Posted: Tue Jun 14, 2005 - 9:34 pm    Post subject: Reply with quote

The "same origin policy" doesn't apply to dashboard widgets, or any local javascript it seems (at least in Safari). You can use xmlhttprequest to grab data from anywhere: external servers or local files. If you want to use the php, you'll have to put the file on your web server and have the widget access it with xmlhttprequest.
View user's profile Send private message Send e-mail Visit poster's website Widgets
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

 
Powered by phpBB © 2001, 2002 phpBB Group