|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
what could i use instead because in NN document.referrer works, in IE it doesnt, it returns UNDEFINED, can someone help me??
colton22 |
|
#2
|
||||
|
||||
|
referer
Referer can not be relied on. Some browsers, like Opera, let the user choose whether or not to send referer headers. And I guess some browsers just don't send them. Maybe you have your IE settings to "no referer header"? Or maybe you are accessing the page directly? If you make a page linking to the referer script page, does it work in IE then?
|
|
#3
|
||||
|
||||
|
every time i try to access and save the document.referrer above into a variable, every time it comes up undefined in an alert therefore telling me that anywhere i go it still does that, ive tried, what im trying to do is see if there is any other operator to give me the same information that the above code would,
why i need this is i have a javascript "secure" login page and in order to access the restricted page you need to go though the page "login.html" in which it will check and if it isnt the same referrer it will link to a different page before any information was even compiled therefore not letting anyone see any of the urls with the information and then being persistant in closing a window with a setTimeout around a function and all the function does is parent.close() colton22 sorry i didnt reply sooner just i live in chicago, and right now im in erie pa, so i may not have reliable internet connection, if you can will you let other people know so people dont get mad if i dont reply, lol, thanks again |
|
#4
|
||||
|
||||
|
javascript "secure" login page?? *shudders*
Have you considered server side scripting at all?
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter! DevArticles Forum Moderator "The net is a waste of time, and that's exactly what's right about it." -- William Gibson |
|
#5
|
||||
|
||||
|
referring page
If you want to make sure a page is accessed from one of you other pages the best way would be for the caller page to set a variable that the called page could test for. With PHP you can set a SESSION var and then
if isset && == val else location |
|
#6
|
||||
|
||||
|
well i have a problem, i only know html, javascript and not very much java, i guess i could do a window.open() to open the new browser and then check to see if the locations are correct by changing a variable in the opened window but better yet, checking to make sure opener.location== what i want it.
thanks, ps is there any good site for learning php or serverside? also i found anoter tag element for <script> all my script tags look like this: <SCRIPT TYPE="text/javascript" LANGUAGE="javascript" RUNAT="server"> does the runat let the javascript be complied on the server or by the user? the only reason i didnt post a new thread is because i am currently on dial-up and dont have that long to waste, i wont be on for a while after this, im not sure anyway thanks, i try the above, colton22 |
|
#7
|
||||
|
||||
|
runat
I hadn't heard of the runat attribute. After a little searching I know why now. It's an IE only attribute. The only way that I can think of to do this using only HTML and javascript would work for non-tech savvy users and honest tech savvy users. But anyone that knows javascript and wanted to get at the page without logging in could do it. I guess if the pages' security isn't critical you could add a variable to be passed from the login page to the "secure" pages to deter some. But anyone could just request eg. www.yourdomain.com/securepage?login=true (or whatever you use) and they would get the page. Javascript is great for enhancing a site visitors experience, but it's no good at giving your site security as it's client side.
I don't know if the runat=server is different, but since it's only IE it still wouldn't be a fool-proof solution. Last edited by Mittineague : July 23rd, 2006 at 12:00 PM. |
|
#8
|
||||
|
||||
|
yea, the only way i could do this "securly" is to go and using the username of the client (which isnt listed ANYWHERE on my entire site) creating a number off of it by having a...
var alphabet=" abcdefghijklmnopqrstuvwxyz0123456789"; then, do this... var numarray=new Array(); var usernameval=((location.search).toString()).substri ng(1,eval((location.search).length)); for (var x=0;x<usernameval.length;x++) { numarray[numarray.length]=alphabet.indexOf([the substirng of the username] } exc. and then create an object or something like that with that name, then check to see if on the opener, that object is in a position it should be, if it is, then good and it will go, otherwise it wont, (the objects name will be the coded number toString()'ed) its crazy coding but the safest i have found! lol colton22 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Document.referrer in IE |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|