Adding data to URL for bookmarking

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • timothytoe

    #1

    Adding data to URL for bookmarking

    My URL usually looks something like this (of course with much more
    data)...

    http://www.site.com/page.php?data=AAAGX

    The data is mandatory.

    If someone comes into this page like this (without the data)...

    http://www.site.com/page.php

    ....then I check a cookie to see what the most recent data was and
    proceed. If there's no cookie, I send them back to where they enter
    the data.

    This works just fine, except without the data visible in the URL, the
    user can't copy, bookmark, email, etc. the URL (an important ability
    to have in this case).

    Can I tack the data onto the URL so it's visible in the browser
    address bar without a page reload? Or will I have to force a page
    reload?
  • David Dorward

    #2
    Re: Adding data to URL for bookmarking

    timothytoe wrote:
    Please use example.com for example URIs.
    If someone comes into this page like this (without the data)...
    http://www.site.com/page.php
    ...then I check a cookie to see what the most recent data
    This works just fine, except without the data visible in the URL, the
    user can't copy, bookmark, email, etc. the URL (an important ability
    to have in this case).
    >
    Can I tack the data onto the URL so it's visible in the browser
    address bar without a page reload?
    No.

    .... but don't load the whole page. Test to see if it is set before
    generating any content, if it isn't then redirect - and do it with the PHP
    location header, not JavaScript.

    --
    David Dorward
    David Dorward's mostly neglected blog

    David Dorward's mostly neglected blog

    Comment

    • David Dorward

      #3
      Re: Adding data to URL for bookmarking

      David Dorward wrote:
      then redirect - and do it with the PHP
      location header, not JavaScript.
      Obviously I mean the HTTP location header and the PHP header function.


      --
      David Dorward
      David Dorward's mostly neglected blog

      David Dorward's mostly neglected blog

      Comment

      • timothytoe

        #4
        Re: Adding data to URL for bookmarking

        On Apr 14, 11:39 am, David Dorward <dorw...@yahoo. comwrote:
        David Dorward wrote:
        then redirect - and do it with the PHP
        location header, not JavaScript.
        >
        Obviously I mean the HTTP location header and the PHP header function.
        >
        --
        David Dorwardhttp://dorward.me.uk/http://blog.dorward.me .uk/
        Thanks.

        Comment

        Working...