473,418 Members | 2,052 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,418 software developers and data experts.

automatic redirection.....

I am setting up a web page to collect some data via a questionnaire.
The questionnaire part is working fine, but I need some help with one
part. I have two different versions of the questionnaire (basically
just different orders of questions) and would like the users to be
redirected to one of the two versions. The idea I had was to have a
redirection page that simply had a web page counter on it (like so many
pages have now days) and based on this counter, people would
automatically be redirected to one of the two versions of my
questionnaire. Basically, if the counter was odd, the person would be
routed to version 1 and if even, they would be routed to version 2. I
thought this would be similar to redirecting people based on the type of
browser they are using or their language settings. However, I was
recently told there is not a way to do what I proposed above. So, this
leaves me with two questions:

1. Was the advice that I received accurate in stating that having a
simple script to redirect the user based on a web page counter is not
possible?

2. If so, does anyone have some advice as to how I could go about
automatically redirecting people to one of two web pages?

Thanks in advance for your time and any help you can provide.
-Andrew
Jul 23 '05 #1
1 1446
Lee
Andrew said:

I am setting up a web page to collect some data via a questionnaire.
The questionnaire part is working fine, but I need some help with one
part. I have two different versions of the questionnaire (basically
just different orders of questions) and would like the users to be
redirected to one of the two versions. The idea I had was to have a
redirection page that simply had a web page counter on it (like so many
pages have now days) and based on this counter, people would
automatically be redirected to one of the two versions of my
questionnaire. Basically, if the counter was odd, the person would be
routed to version 1 and if even, they would be routed to version 2. I
thought this would be similar to redirecting people based on the type of
browser they are using or their language settings. However, I was
recently told there is not a way to do what I proposed above. So, this
leaves me with two questions:

1. Was the advice that I received accurate in stating that having a
simple script to redirect the user based on a web page counter is not
possible?
That depends on the nature of the counter you're trying to use.
It's certainly not the simplest way to do what you want.
2. If so, does anyone have some advice as to how I could go about
automatically redirecting people to one of two web pages?


This should best be done on the server, so you don't have to rely
on the visitor having Javascript enabled, but if you must do it in
client-side script, simply redirect randomly.

<script type="text/javascript">
if(Math.round(Math.random())) location="theOtherVersion.html";
</script>
</head>
<body>
<!-- Begin This Version -->

Jul 23 '05 #2

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

Similar topics

52
by: Gerard M Foley | last post by:
Can one write a webpage which is not displayed but which simply redirects the user to another page without any action by the user? Sorry if this is simple, but I am sometimes simple myself. ...
1
by: JoanneC | last post by:
How can I incorporate the following javascript code in an ASP.NET application (using VB.NET) Like the following If textbox1.text = "" then <SCRIPT LANGUAGE="JavaScript" runat="server">...
2
by: Fabiano | last post by:
Please, I need refresh automatically my asp.net page into an interval of 30 seconds. But i need that this refresh fires a postback event so i could manage it. Any idea? tks in adv. ...
3
by: Victor | last post by:
Dear Members I'm new here. Please permit me to ask some newbie question I'm from a non-profit organization, working for gender equality. We wish to get a small message across to sister blogs...
8
by: Luciano A. Ferrer | last post by:
Hi! I was following the http://www.seomoz.org/articles/301-redirects.php article, trying to do that with one of my test sites I added this to the .htaccess file: RewriteEngine On RewriteCond...
13
by: souissipro | last post by:
Hi, I have written a C program that does some of the functionalities mentionned in my previous topic posted some days ago. This shell should: 1- execute input commands from standard input,...
1
by: Siva | last post by:
Hi, Can somebody help me in getting me a code for automatic redirection. I have a message box in my project. If somebody post a message, after clicking the submit button a thankyou.aspx page...
2
by: Gregor Horvath | last post by:
Hi, As I am no expert web programmer I thought I'd better ask the experts if there is a simpler or better solution to my problem than the one I am thinking of. (using TurboGears) The problem...
1
by: comp.lang.php | last post by:
require_once("/users/ppowell/web/php_global_vars.php"); if ($_GET) { // INITIALIZE VARS $fileID = @fopen("$userPath/xml/redirect.xml", 'r'); $stuff = @fread($fileID,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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,...
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...

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.