Bob Bedford wrote:
I'd like to avoid passing the ID in the URL. It's there any way to pass it
in the SESSION variable.
To be able to store a value in the SESSION array, it has to be passed
somehow from the browser to the server. Otherwise, you will not know what
link the user clicked. There are 2 ways to do this - with HTTP get and post
requests. So yes, you can store that variable in the session array, but it
has to be passed to the server do so.
Now, I don't know what your issue is:
1. you don't want to send that particular ID parameter; or
2. you don't want to send any parameters; or
3. you don't want to display any parameters in the browser location bar
So, some ideas, respectively (if you don't want to use post or javascript):
1. Then send something else - title, some other temporary session-based
reference, etc.
2. You can't not send anything because then you will not know what the user
clicked;
3a. What you can do is send the ID to article-redirect.php that will set a
session variable and then redirect to details.php. details.php will read
that session variable and display the article without displaying the ID in
the browser location bar.
3b. You can also send the article ID in the URL itself
http://bogussite.com/1234/
where 1234 is the ID, and then use Apache's mod_rewrite (or a similar tool
for other web servers) to translate to
http://bogussite.com/details.php?ID=1234
So, the browser will see only the original URL, while the content will come
from details.php.
Anyway, I don't understand what you are trying to accomplish with this. You
have to remember that (except in 3b) it will be harder for your users to
bookmark your articles, send links to friends, etc.