473,473 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Session and link

I've to create link to a new page using session variables.

I've about 20 variables already set, so this is OK. But now I've 50 links to
various articles on my page. Those links are created dynamically using a
mysql table, so I take the ArticleID.

www.mysite.com/detail.php?ID=2
www.mysite.com/detail.php?ID=4
www.mysite.com/detail.php?ID=5
www.mysite.com/detail.php?ID=7
www.mysite.com/detail.php?ID=54
....

I'd like to avoid passing the ID in the URL. It's there any way to pass it
in the SESSION variable. Javascript isn't possible, so I'd like to know if
it's the only way to create the link. Or maybe must I use a FORM for every
artivle ???? but with a link, I must use javascript....

Bob
Jul 17 '05 #1
1 1712
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.
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bart Plessers \(artabel\) | last post by:
Hello, Currently developping a site, where I use some session variables. The site is located at my home computer. Because I have a dynamic IP adress, I use no-ip (www.no-ip.org) to have my...
8
by: Marc Hoeve | last post by:
Hi everybody I'm setting up 2 websites for a friend of mine, en I'm have problems with one of the sites. The situation: I have 2 different domains (both in the .NL domain). Both domains...
3
by: Keith Patrick | last post by:
I have an app (A) that has a link to another (B) app that it spawns in a new window. The new window has a link back to app A, opening a third window (let's call it A2). The problem is, I need A2...
2
by: +The_Taco+ | last post by:
I already use session variable in my project to set a session timeout when the user doesn't do anything for 10 minutes. When I call other pages, I often use parameters in HREF link. I was...
2
by: Ivers | last post by:
My C# asp.net app (.NET 1.1) can generate an email whose body contains a link to the current page of the app. When the recipient of the email clicks the link (usually from Outlook), the app...
17
by: Jan Kucera | last post by:
Hi. How can I join session or read Session variables if I have the SessionID (or anything what I can supply)? Imagine I have a external link from my webpages, which opens an application which...
2
by: fReDiNi | last post by:
Hi, I have an strange problem with session variables. I have a site hosted in a local server. I have physic access to this server and its configuration.(apache, php,files...). I have external...
4
by: Nanker | last post by:
In our .NET 1.1 ASP.NET application, I'm noticing some behavior that I would like to change. If I open a web browser and manually copy and paste a URL, then I get a new session ID (I check it by...
3
by: rn5a | last post by:
A ASPX Form has a TextBox & a Button. Users enter their username in the TextBox & submit the Form after which records pertaining to the username get retrieved from a MS-Access database table &...
12
by: MrHelpMe | last post by:
Hello again all, I've finished my whole application and now I don't like the whole session variables that I am using. I have a form, user fills in info clicks submit and using CDOSYSMail an...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.