By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,946 Members | 697 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,946 IT Pros & Developers. It's quick & easy.

tracking a session without using sessions or cookies

P: n/a
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?

Jun 25 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
frothpoker wrote:
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 Use a SESSION to store the values you want to remember.
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?


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-

Jun 25 '06 #2

P: n/a
<comp.lang.php>
<frothpoker>
<25 Jun 2006 07:45:21 -0700>
<11**********************@i40g2000cwc.googlegroups .com>
I have a couple of issues which I am hoping you can provide guidance
on...


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 .
--
www.emailuser.co.uk/?name=KRUSTOV
Jun 25 '06 #3

P: n/a
frothpoker wrote:
<snip>
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

<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/

Jun 25 '06 #4

P: n/a
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-

Jun 25 '06 #5

P: n/a
Krustov wrote:
<comp.lang.php>
<frothpoker>
<25 Jun 2006 07:45:21 -0700>
<11**********************@i40g2000cwc.googlegroups .com>
I have a couple of issues which I am hoping you can provide guidance
on...


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 .


But the user's ip address may not be unique.
Jun 25 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.