» Welcome, guest.
[ Log In :: Register ]

 

[ Track this topic :: Email this topic :: Print this topic ]

Topic: Anyone good with PHP, AJAX and JS?< Next Oldest | Next Newest >
18:29 CST :: 7/13/2010

luciusxx
AnyhowStep

Profile PM 

Group: PH Administrators
Location: Singapore
Joined: July 2008
Total Posts: 1361


Umm..
I need help.

I have this website that's hosted by 000webhost.com
I've uploaded a PHP file that echos the value of a variable that's stored in a database.

I created an html webpage that I've put on my desktop so that I can just open it anytime to look at some web-stats.

However, I can't think of any way to get the returned value from the php and store it in the javascript that's in my web-document on my desktop.

How do I say this..
01) Web document is opened from desktop
02) AJAX sends request to PHP stored in 000webhost
03) PHP returns a value
04) Javascript stores that value
05) I am free to display the value anywhere I want on the web document

However, AJAX doesn't allow cross-domain requests.. Right?
Is there a way to say 'I allow anyone to access this PHP file' ? o.0

[EDIT]
Here's just something I put together real quick:
http://eztagging.netai.net/ShopName.php?User=EZTag

It echos: EZTagger =)

How do I get that echo'd string to be stored in a javascript variable?


Edited by luciusxx on 18:33 CST :: 7/13/2010

--------------
Quote (adonis_minus_20 @ 23:27 CST :: 12/18/2009)
I think those seagulls could get an S on Witch Doctor, they had good technique ?:D


Quote (Chris Lee @ 03:15 CST :: 12/17/2009)
I wanna kick his ass. I wanna have a son, so I can raise him to kick this guy's ass. Correction: I wanna have a daughter, so I can raise her to kick this guy's ass.


Quote (ShadeLRK @ 22:16 CST :: 12/20/2009)

overdeath: where are you from? do you play pump?
me: I'm from mexico
overdeath: okay you DO play pump

12:29 CST :: 7/19/2010

eXonyte
GURL HURRRRRRR

Profile PM WEB 

Group: PH Administrators
Location: Louisiana, USA
Joined: April 2005
Total Posts: 960


Your link seems to be missing now but typically you would have to use some sort of a proxy script to get around the cross-domain security. Way more trouble than it's worth for something simple like this.

Why would you want a local file anyway if you have a place to host the PHP? Since your local file would have to hit the webserver anyway, you would not gain any benefit from it being local.


--------------

20:04 CST :: 7/19/2010

luciusxx
AnyhowStep

Profile PM 

Group: PH Administrators
Location: Singapore
Joined: July 2008
Total Posts: 1361


I sort of found a workaround xD
I did this: <script type="text/javascript" src="SomeWebdocument.php?Somevariable=Somevalue">

I can't believe I didn't think of that sooner, though -____-
The stupid things I try before realizing there is a simpler solution =(


--------------
Quote (adonis_minus_20 @ 23:27 CST :: 12/18/2009)
I think those seagulls could get an S on Witch Doctor, they had good technique ?:D


Quote (Chris Lee @ 03:15 CST :: 12/17/2009)
I wanna kick his ass. I wanna have a son, so I can raise him to kick this guy's ass. Correction: I wanna have a daughter, so I can raise her to kick this guy's ass.


Quote (ShadeLRK @ 22:16 CST :: 12/20/2009)

overdeath: where are you from? do you play pump?
me: I'm from mexico
overdeath: okay you DO play pump

2 replies since 18:29 CST :: 7/13/2010 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 

Quick Reply: Anyone good with PHP, AJAX and JS?
Guest

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic

Emoticons :: iB Code
For more options such as extra emoticons and file uploads, use the "add reply" button instead of Quick Reply...