Page 4 of 4 FirstFirst ... 234
Results 31 to 37 of 37

Thread: URLS like: index.php?page=page1 ???

  1. #31
    Join Date
    Feb 2006
    Posts
    236
    Thanks
    8
    Thanked 3 Times in 3 Posts

    Default

    Ah! But there is another method (the one that I like the best.) Use Ajax to take the 'page1' from either a .txt or .html file and dump it in the index.html (or index.php) page. That way, you can use the menu inside index.html to load additional pages and whatever page you want can be called from anyother page, displaying the content inside index.html. index.html can have a default content as well. There was a previous post where this was all worked out. I use it occasionally on several websites where 'non-coders' can change their content often without messing the website up, and where email content can be displayed on a page, directory listings, image galleries, etc.

  2. #32
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Ugh, no. The PHP response was a far better idea. It neither messes up browser functionality nor requires Javascript to view the page.

    Also, if using AJAX, one would presumably be dumping XML to the page, not HTML. This could result in some odd goings-on.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #33
    Join Date
    Feb 2006
    Posts
    236
    Thanks
    8
    Thanked 3 Times in 3 Posts

    Default

    Ok, whatever suits your particular needs.

    Ajax is simpler and doesn't require server mods, all the folders, easier to test, change and faster to implement, format to page, etc. And I got the basic routines from DynamicDrive scripts. BTW, both .html and .txt files work perfectly because the server dishes them up as html.

  4. #34
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    .txt files work perfectly because the server dishes them up as html.
    Then that server is misconfigured (or at least, configured in an unconventional way), and this shouldn't be expected to be the case on all servers. Plain-text files (which is what the extension .txt usually signifies) should be served as text/plain, and they shouldn't be parsable by an XML parser whether text/plain or text/html.
    Ajax is simpler and doesn't require server mods
    AJAX is far from simple (in terms of the amount of code required to achieve the same effect). Relying on a server-side technology is considered greatly preferable to relying on a client-side one, since the server can be guaranteed to have the technology installed, whereas what the client supports will vary from client to client (and occasionally, even request to request).
    faster to implement
    In this case, it would be much more difficult: assuming no server-side technologies, one would have to use Javascript to render the XML into HTML which can be dumped to the page.
    I got the basic routines from DynamicDrive scripts.
    There are (as far as I know) no AJAX (Asynchronous Javascript And XML) scripts on DynamicDrive except the RSS feeds, which rely upon a server-side technology.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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

    Default

    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. #36
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Oh, there is one I didn't see that.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #37
    Join Date
    Oct 2006
    Posts
    183
    Thanks
    0
    Thanked 11 Times in 11 Posts

    Default

    okay you can use ajax but just a warning... if you want to use the one I posted previously then you need to save it as a .php file, make sure its php and not .htm or .html or anyhting else.

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
  •