tracking a session without using sessions or cookies

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

    #1

    tracking a session without using sessions or cookies

    Guys,

    I have a couple of issues which I am hoping you can provide guidance
    on...

    First one:- Is there any way to retain the $_POST values when a user
    navigates between pages without using <form method = 'post'>

    I want to be able to track the user from one page to another to provide
    customised content. I could make all navigation buttons as forms but
    its a bit of a pain in the proverbials

    Second one, which is related to the first:-

    I have submitted and validated data in a form where the action is
    $PHP_SELF.

    I need to insert a record into a database.

    The user will have selected a venue which may have more than one event.
    The validation checks the database for the number of events and if
    there is only one, chooses that as the default. If there is more than
    one then it needs to display another form to select the correct event
    but I obviously need to pass all the $_POST values through this new
    form so that I can insert it into the database... Should I just
    iterate through the $_POST array with hidden fields on the form, or can
    I pass the whole array through while adding array elements to it?

  • David Haynes

    #2
    Re: tracking a session without using sessions or cookies

    frothpoker wrote:[color=blue]
    > Guys,
    >
    > I have a couple of issues which I am hoping you can provide guidance
    > on...
    >
    > First one:- Is there any way to retain the $_POST values when a user
    > navigates between pages without using <form method = 'post'>
    >
    > I want to be able to track the user from one page to another to provide
    > customised content. I could make all navigation buttons as forms but
    > its a bit of a pain in the proverbials[/color]
    Use a SESSION to store the values you want to remember.
    [color=blue]
    > Second one, which is related to the first:-
    >
    > I have submitted and validated data in a form where the action is
    > $PHP_SELF.
    >
    > I need to insert a record into a database.
    >
    > The user will have selected a venue which may have more than one event.
    > The validation checks the database for the number of events and if
    > there is only one, chooses that as the default. If there is more than
    > one then it needs to display another form to select the correct event
    > but I obviously need to pass all the $_POST values through this new
    > form so that I can insert it into the database... Should I just
    > iterate through the $_POST array with hidden fields on the form, or can
    > I pass the whole array through while adding array elements to it?[/color]

    Again SESSION would be your friend here.

    Think of it this way. The browser may pass data to the php program using
    either POST or GET methods. PHP programs may pass data using the SESSION
    to other PHP programs.

    The 'short cut' of using PHP_SELF and the browser-passed variables is
    just that - a short cut.

    -david-

    Comment

    • Krustov

      #3
      Re: tracking a session without using sessions or cookies

      <comp.lang.ph p>
      <frothpoker>
      <25 Jun 2006 07:45:21 -0700>
      <1151246721.161 660.184980@i40g 2000cwc.googleg roups.com>
      [color=blue]
      > I have a couple of issues which I am hoping you can provide guidance
      > on...
      >[/color]

      Dont know about guidance - but couldnt you use the users ip address
      coverted from 123.123.123.123 to 123_123_123_123 .txt and append the text
      to a flatfile assuming you have some sort of track.php include file at
      the top of each page .

      With perhaps 123_123_123_123 _nav.txt being used when wanted etc .


      --

      Comment

      • R. Rajesh Jeba Anbiah

        #4
        Re: tracking a session without using sessions or cookies

        frothpoker wrote:
        <snip>[color=blue]
        > First one:- Is there any way to retain the $_POST values when a user
        > navigates between pages without using <form method = 'post'>
        >
        > I want to be able to track the user from one page to another to provide
        > customised content. I could make all navigation buttons as forms but
        > its a bit of a pain in the proverbials[/color]
        <snip>

        There are couple of hacks I'm thinking like hooking onClick via
        JavaScript using event:Selectors/Prototype. But, I guess there might be
        better elegant solution when you tell us what exactly is your problem.

        --
        <?php echo 'Just another PHP saint'; ?>
        Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

        Comment

        • David Haynes

          #5
          Re: tracking a session without using sessions or cookies

          New response since I missed the desire not to use sessions or cookies.

          Generate a unique id for the session and use that as the primary key
          into a database where you store the variable values. Include the unique
          id in each browser page and pass it back with each form.

          -david-

          Comment

          • Paul Lautman

            #6
            Re: tracking a session without using sessions or cookies

            Krustov wrote:[color=blue]
            > <comp.lang.ph p>
            > <frothpoker>
            > <25 Jun 2006 07:45:21 -0700>
            > <1151246721.161 660.184980@i40g 2000cwc.googleg roups.com>
            >[color=green]
            >> I have a couple of issues which I am hoping you can provide guidance
            >> on...
            >>[/color]
            >
            > Dont know about guidance - but couldnt you use the users ip address
            > coverted from 123.123.123.123 to 123_123_123_123 .txt and append the
            > text to a flatfile assuming you have some sort of track.php include
            > file at the top of each page .
            >
            > With perhaps 123_123_123_123 _nav.txt being used when wanted etc .[/color]

            But the user's ip address may not be unique.


            Comment

            Working...