473,410 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

Why does referrer disappear on drop down?

When I use this code:

<select name="status" onChange =
"location.href=this.options[this.selectedIndex].value">
<option value="mypage.htm">Select View</option>
</select>

I don't have a referrer. When I click an anchor tag link, the
resulting page does have a referrer. How can I get a referrer using
the above JS?

Thanks,
Brett

Jul 23 '05 #1
1 1713
"brett" <ac*****@cygen.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
When I use this code:

<select name="status" onChange =
"location.href=this.options[this.selectedIndex].value">
<option value="mypage.htm">Select View</option>
</select>

I don't have a referrer. When I click an anchor tag link, the
resulting page does have a referrer. How can I get a referrer using
the above JS?
Setting location.href in some user agents does not send the HTTP_REFERER
header. But since the referrer information is unreliable anyway <url:
http://www.datatrendsoftware.com/spoof.html />, it isn't really that big
a deal.

If you absolutely must pass it, and you are relying on JavaScript
anyway, then you could do:

<select
name="status"
onchange="
location.href =
this.options[this.selectedIndex].value +
'?referer=' + location.href;
"


(split across multiple lines for readability only)

Note that you'll need special handling on the next page (in either
client- or server-side code) to retrieve the referrer. The standard ways
of getting the value ( $_SERVER['http_referer'] in PHP for example)
won't work.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2

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

Similar topics

2
by: ehm | last post by:
I am working on creating an editable grid (for use in adding, deleting, and editing rows back to an Oracle database). I have a JSP that posts back to a servlet, which in turns posts to a WebLogic...
1
by: MarkCFC | last post by:
My project consists of one form and one standard microsoft datagrid. In code and not by binding, I create a sqlconnection, sqlAdapter and dataset. When the form is displayed I have to click on the...
1
by: rewf | last post by:
Hi, I fave this problem with a drop down list: I have a drop down list that work with a database. In the database I have some word with some spaces before like that "Example Example" My problem...
17
by: Aussie Rules | last post by:
Hi, I want to have a single line combo box dropdown, but where i can selected multiple items in the drop down via a check box... I can see one in the standard tool box... is there one ? If...
3
by: rsteph | last post by:
I have a javascript drop down menu that I borrowed from a website. It utilizes a little .css to help with formatting. The menu works great, and on all 3 of the browsers I'm concerned about; but I am...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
1
by: deerick | last post by:
Hi there I want to know how to add a drop down list based on value from a table in an asp form. Then I want the user to be able to submit the form, and the drop down list value that they have...
1
by: grego9 | last post by:
I have two option buttons - Diplayed as Option Button 76 and Option Button 77 in the name box on a tab called "AMEND" . When Option button 76 is slected I want a drop down box called Drop Down 43...
0
by: Ash Mar | last post by:
Hi Every one :) My Issue is the sub menu level 2 Not working in Internet Explore but it's working perfect in all other browsers. I Spend more than 6 hours and could not find the solution guys if...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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
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...
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...

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.