Page 1 of 1

How to open url called by AJAX

Posted: Thu Jan 22, 2009 3:29 am
by voltmachine
Hi, I have this problem:

I need to read ajax data from: soccerway.com/
When click on leagues headers the site use ajax to display the data.

I catch ajax url with URL Snooper:
soccerway.com/ajax.php?block_id=block_home_matches_6&block_name=block_home_matches&callback_params=%7B%22date%22%3A%20%222009-01-22%22%2C%20%22now_playing%22%3A%20false%7D&action=showMatches&params=%7B%22competition_id%22%3A%20573%7D

But the problem is I can't see data when type this url in browser. I tried with php - CURL, fopen , etc...
I tried also urlencode ir urldecode the url , but can't see data. Everytime I see Page Not Found.

Here how is made url, the site use JSON:
Ajax.Request("/ajax.php",{method:"get",parameters:{block_id:j.id,block_name:j.name,callback_params:Object.toJSON(j.params),action:e,params:Object.toJSON(i||{})}

Can some help me to read data from these ajax urls ?
Is it possible to have some type of defense, based on IP or something misspell on url ?

Re: How to open url called by AJAX

Posted: Thu Jan 22, 2009 3:35 am
by mattpointblank
You need to make a file called ajax.php which does something with the $_GET['block_id'] etc values.

Re: How to open url called by AJAX

Posted: Thu Jan 22, 2009 3:46 am
by voltmachine
Can you explain in detail, please.
What will help if I made ajax.php on my pc ?

Re: How to open url called by AJAX

Posted: Thu Jan 22, 2009 4:01 am
by mattpointblank
Your code is sending data to a page called ajax.php - you need to create this page so you can do something with the data.

Re: How to open url called by AJAX

Posted: Thu Jan 22, 2009 4:27 am
by voltmachine
Maybe I not explain my first post correctly.
I not need to do anything with data.

I just need to open urls: soccerway.com/ajax.php?.... from my pc (using fopen() for example) to get soccer results.

The ajax.php is in the soccerway.com and return data when you navigate on the site, but when type these links in browser will see page not found.
So maybe have some type of defense or something other with these JSON symbols in the url.

Re: How to open url called by AJAX

Posted: Sat Jan 24, 2009 3:31 am
by voltmachine
No one can help me ? :?

Re: How to open url called by AJAX

Posted: Sat Jan 24, 2009 5:03 am
by Mark Baker
voltmachine wrote:The ajax.php is in the soccerway.com and return data when you navigate on the site, but when type these links in browser will see page not found.
So maybe have some type of defense or something other with these JSON symbols in the url.
If they do have some kind of defence, then it's there for a reason, and I'm disinclined to tell anybody how to "hack" that defence.

However, if your browser page is making an Ajax call to the external http://soccerway.com/ajax.php site, then it's a javascript/Ajax problem, not a PHP problem.
If you're trying to make the call from within PHP (usinf fopen, curl or similar), then you're not making an Ajax call.

Re: How to open url called by AJAX

Posted: Sat Jan 24, 2009 1:44 pm
by voltmachine
Thanks for all :wink: it works now, looks like was temporary problem with new version of the site.