473,581 Members | 2,607 Online
Bytes | Software Development & Data Engineering Community
+ 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 1725
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
2785
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 own custom domain name (pvo.no-ip.org) My ISP blocks port 80, so website runs at port 4040 The service no-ip offers "Mask / Cloaking Options": every...
8
1749
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 provides the possibility for users to log in. The loginscript and the databases are hosted at server 1. The site at server 2 contains a link to the...
3
1323
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 to act like the same user logged into a clean browser window to app A such that it has a new Session rather than sharing the same one among the 3...
2
2483
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 wondering if it was better to pass parameter from page to page as session variable instead of doing it in HREF link? Thx for the hint !
2
2107
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 launches just fine, and will postback great too. However, when the user pastes this link into a PowerPoint 2003 hyperlink, runs the slideshow, and...
17
1577
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 is expected to make requests to the server. It starts another session, but I need to use the session from browser. To the link I'm able to send any...
2
2456
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 access to the web site by typing the public ip address of the local server. I have a domain too, and this domain is redirected to the static...
4
3329
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 entering javascript:document.cookie in the URL field to get the cookies for the page). However, if I instead click on the same URL in an email link,...
3
1736
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 & displayed in a DataGrid. The DataGrid also provides pagination. Sub Page_Load(......) If Not(Page.IsPostBack) Then 'do something Else Dim strSQL...
12
3824
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 email link gets created with an encoded query string. i.e http://www.yahoo.ca?#$@%@&#%#$@&^@%# which translates into...
0
7792
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8304
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7899
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8175
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5674
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5364
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3827
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2301
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 we have to send another system
1
1403
muto222
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.