View Full Version : I have 3 Qs about web-service/ajax(1,2) and syntax meaning(3)

03-19-2010, 06:04 PM
I have 3 Qs about ajax(1,2) and syntax meaning(3):
I want to appear a list of urls from a db table to browser, with their newest Google PAGE RANK every time appear in the webpage, and this rank saved auto to database along with previous.... google provides any web service for this? tell me URLs? I found difficulty contact google...
Do you know any internet web service (programming) that you input a Russian word, and get (true or 1) if valid, or (false or 0) if not valid word?
what mean the
in file attached statements to html main file?

03-19-2010, 06:37 PM
Google ranker: http://www.prchecker.info/


What are you asking about with the values in the address bar, what the value after "?" is for?

03-19-2010, 06:56 PM
?x=y is not part of the filename/path, but extra information. It is sent to the server and available to serverside coding languages as variables. In PHP, you can use it as $_GET['x'] == 'y'.
The values are also (as part of the URL) available to Javascript, though that's 1) not as easy to get and 2) not the common way to do it in Javaascript (various other methods are used instead).

03-19-2010, 08:40 PM
I know xxxxxxx.yyy?x=y for web pages but for .js, .xml, .css ? is it the same use? if yes, how get this value inside the three types of file?

The links about Google PageRank, may also used in Apps involve it like:
login with "demo"

03-20-2010, 08:32 PM
There are three reasons to use ?x=y.

1) To submit variables to the server.
2) To create duplicate pages of the same page, such as for trying to trick search engines (though lately search engines have started figuring this out and will actually rank your page lower because of it). In other words, you can effectively have two URLs of the same page-- the reasons may vary.
3) Rarely it is used to add a random number (file.css?r=[randomnumber]) so that every time you load the page the file cannot be cached. This is done with CAPTCHA images frequently, for example, since the same URL is actually a new image on every load.

But, yes, with .css, .js, etc. as well.
The .php extension is set to parse with the php engine on your server. If you want you can parse other files like .htm or .js, .css with php as well, just using .htaccess.
You can also use .htaccess directly (such as with mod_rewrite) to access the "query string" (the official name for this extra bit on the URL) and do things with it there.
You could in fact make 1.css?n=2 actually load 2.css, etc.

I have no idea what it's doing in the examples you showed and it might be impossible to guess. But the point is that it can do things at several levels, but in each case it is either there to create a new 'url' for the same page or to send variable information to the server.

03-20-2010, 11:02 PM
if z.php?x=y we get inner the z.php the query string by $_GET['x'], what if z.php was z.js or z.css or z.xml? how then get it in the inner of file?

03-21-2010, 12:40 AM
The usual way to rewrite URLs to do different things is called "mod_rewrite". Look that up, though it is very confusing/advanced.
I don't really understand why you need/want this, so maybe it's just for the information.
You can make your server do anything you want, but it may get complex to do that.

03-21-2010, 05:29 AM
inside file.js and file.css how we say $_GET['x'] (php), to use it inside the file?

03-21-2010, 05:40 AM
You cannot. In css, it is not at all possible.
In Javascript, you can find the URL of the main page (on which the script is running), but I don't know about included .js files-- you could always parse the html of the page and find that url, but that's messy. It's theoretically possible, but there must be a better way.

Of course you could also set both .css and .js to be parsed like php, then they could be processed just like a .php page, or you could even use a .php page, if you sent the right headers.