Results 1 to 9 of 9

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

  1. #1
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default I have 3 Qs about web-service/ajax(1,2) and syntax meaning(3)

    I have 3 Qs about ajax(1,2) and syntax meaning(3):
    1-
    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...
    2-
    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?
    3-
    what mean the
    in file attached statements to html main file?
    script.js?x=5
    or
    style.css?p=5
    or
    xmlfile.xml?x=777.

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Google ranker: http://www.prchecker.info/

    https://addons.mozilla.org/en-US/firefox/addon/321

    What are you asking about with the values in the address bar, what the value after "?" is for?
    Corrections to my coding/thoughts welcome.

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    3.
    ?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).
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    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:
    http://www.phpjunkyard.com/linkman/admin.php?1289
    login with "demo"

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    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?

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  8. #8
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    inside file.js and file.css how we say $_GET['x'] (php), to use it inside the file?

  9. #9
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    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.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •