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

Home Posts Topics Members FAQ

Redirect based on cookie value

I'm trying to either redirect users to a new page or giving them an
alert message depending on the value of a cookie. I'm very new to
Javascript and would appreciate any advice on making the following
statement work (this is more a wish list of what I would like it to do
than workable code!)

function CookieRedirect () {

var favorite = GetCookie('number');

if (favorite <= "300") {
alert('incorrect');
else
("<a href="page2.htm>")
}

Thanks for any help.

Laura
Jul 23 '05 #1
1 1696
ld*******@yahoo.co.uk schrieb:
I'm trying to either redirect users to a new page or giving them an
alert message depending on the value of a cookie. I'm very new to
Javascript and would appreciate any advice on making the following
statement work (this is more a wish list of what I would like it to do
than workable code!)


<http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/document.html#1193577>
<http://devedge.netscape.com/library/manuals/2000/javascript/1.5/reference/string.html#1194452>
<http://devedge.netscape.com/library/manuals/2000/javascript/1.5/reference/toplev.html#1064173>
<http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/location.html>
HTH

PointedEars
Jul 23 '05 #2

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

Similar topics

9
28640
by: deko | last post by:
I have a page that I don't want anyone to be able to link directly to. The page should only be accessed from gatepage.php. I tried this code, but keep getting errors - "header info already sent",...
2
9155
by: bagsmode | last post by:
Hi, I'm trying to set a session cookie and then redirect, however I get the error: Status: 302 Moved Location: /index.cgi I thought I recall getting an error like this when I first tried...
3
7846
by: Peter Row | last post by:
Hi, I better get the background stuff out the way first, so here goes: - Porting a VB6 webclass app to VB.NET using HttpHandlers and FormsAuthentication - When someone visits my site...
11
1164
by: Mark | last post by:
We use cookies to maintain some state information about a users session. They are not file based due to the fact that we don't specify a expiration date. They go away when the session ends. I...
6
2883
by: Keith Patrick | last post by:
I have to do some programmatic redirects (in several pages) based on URLs I am given from an external source. The URLs have querystrings at the end, but one in particular is about 240 chars long,...
6
5785
by: Coleen | last post by:
Hi all :-) I need to redirect to multiple pages on click of a transmit button, without redisplaying each page. This redirection is to capture session variables that are created on each page and...
4
11382
by: mike.biang | last post by:
I have an ASP page that is using an XMLHTTP object to request various pages from my server. I keep a single session throughout the XMLHTTP requests by bassing the ASPSESSIONID cookie through the...
11
2848
by: Nospam | last post by:
I don't know what it is I am doing wrong, I am trying to get the menus to either expand or contract based on their previous states, i.e if already expanded if clicked again contract, and if...
0
1929
by: daonho | last post by:
Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal e As System.EventArgs) Dim strPath As String = HttpContext.Current.Request.Path() Dim cookie As...
0
7049
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
7092
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
6744
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
5348
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4790
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
4488
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
3000
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1304
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
188
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.