473,566 Members | 3,307 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

display things by the name they enter

Dear,

I want to create an page where they have to enter ther name in an prompt.
by the name they entered i want to open different html page's

example:

<SCRIPT LANGUAGE="JAVAS CRIPT" TYPE="TEXT/JAVASCRIPT">

var name;

name = prompt('Give your name please:');
if (name != "myname")
{
1.html;
}
else
{
2.html;
}
</SCRIPT>
my question is: how can i load these file's automaticly?

greetz Dirk
Jul 20 '05 #1
5 1301
On Tue, 13 Jan 2004 11:55:07 GMT, trpplayer <di********@pan dora.be> wrote:
I want to create an page where they have to enter ther name in an prompt.
by the name they entered i want to open different html page's


Try:

<!--
The language attribute is not
required and it's use is discouraged
-->
<SCRIPT type="text/javascript">
function loadPage() {
switch( window.prompt(' Please enter your name').toLowerC ase()) {
case 'fred':
window.location = 'fred/index.html';
break;
case 'jill':
window.location = 'jill/index.html';
break;
case 'bob':
window.location = 'bob/index.html';
break;
case 'amy':
window.location = 'amy/index.html';
break;
default: // Loaded when no match for the entered name is
// found
window.location = 'no_such_name.h tml';
break;
}
}
</SCRIPT>

I assume that the names will be case-insensitive (hence the call to
toLowerCase()).

You could then call this function on a button press. For example,

<BUTTON type="button" onclick="loadPa ge()">Load user page</BUTTON>

You could also use an INPUT element instead of a prompt window.

Mike

--
Michael Winter
M.******@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #2
In article <v0************ *********@hesti a.telenet-ops.be>,
di********@pand ora.be enlightened us with...
Dear,

I want to create an page where they have to enter ther name in an prompt.
by the name they entered i want to open different html page's

Not sure why...
example:

<SCRIPT LANGUAGE="JAVAS CRIPT" TYPE="TEXT/JAVASCRIPT">
Lower case, I believe, is standard.

var name;

name = prompt('Give your name please:');
if (name != "myname")
{
1.html; Change to
top.location="1 .html";
}
else
{
2.html;

Change to
top.location="2 .html";
--
--
~kaeli~
No one is listening until you make a mistake.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #3
Thank you, this work's fine

By using this, only the persone for who is has been created can read it and
the rest get an blank page whith "NO ACCESS" or something like that
"kaeli" <ti******@NOSPA M.comcast.net> schreef in bericht
news:MP******** *************** *@nntp.lucent.c om...
In article <v0************ *********@hesti a.telenet-ops.be>,
di********@pand ora.be enlightened us with...
Dear,

I want to create an page where they have to enter ther name in an prompt. by the name they entered i want to open different html page's


Not sure why...
example:

<SCRIPT LANGUAGE="JAVAS CRIPT" TYPE="TEXT/JAVASCRIPT">


Lower case, I believe, is standard.

var name;

name = prompt('Give your name please:');
if (name != "myname")
{
1.html;

Change to
top.location="1 .html";
}
else
{
2.html;

Change to
top.location="2 .html";
--
--
~kaeli~
No one is listening until you make a mistake.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #4
trpplayer wrote:
"kaeli" <ti******@NOSPA M.comcast.net> schreef in bericht
news:MP******** *************** *@nntp.lucent.c om...
In article <v0************ *********@hesti a.telenet-ops.be>,
di********@pa ndora.be enlightened us with...
Dear,

I want to create an page where they have to enter ther name in an prompt.
by the name they entered i want to open different html page's

Not sure why...
example:

<SCRIPT LANGUAGE="JAVAS CRIPT" TYPE="TEXT/JAVASCRIPT">


Lower case, I believe, is standard.
var name;

name = prompt('Give your name please:');
if (name != "myname")
{
1.html;


Change to
top.location= "1.html";

}
else
{
2.html;


Change to
top.location= "2.html";


Thank you, this work's fine

By using this, only the persone for who is has been created can read it and
the rest get an blank page whith "NO ACCESS" or something like that


So I just disable javascript goto this page and look at the source (or
get the source via one of a multitude of ways that don't evaluate the
javascript). I see "myname". I enable javascript, reload the page, use
the 'secret' "myname" and get to 1.html. Or having seen the source I
just go directly to 1.html

You cannot secure your site with client-side scripting, it needs to be
done server-side. Well, I cannot see a way you could anyway but I bet
someone here will say otherwise.

Robin

Jul 20 '05 #5
In article <bu**********@p egasus.csx.cam. ac.uk>, an**@somewhere. com
enlightened us with...

You cannot secure your site with client-side scripting, it needs to be
done server-side. Well, I cannot see a way you could anyway but I bet
someone here will say otherwise.


Nope, can't be done.
Any idiot can view a source.
Anyone with enough free time can figure out a way around client-side
"protection ", no matter how obfuscated it is. This has been discussed to
death here.

Best you can do is Flash. That's pretty hard to crack. A person needs to
get the Flash, decompile it, etc.
But it CAN be done.

--
--
~kaeli~
Is it true that cannibals don't eat clowns because they
taste funny?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #6

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

Similar topics

4
10026
by: James | last post by:
Hello, I have a RequiredFieldValidator for several textbox controls on a form. Here's an example with the RequiredFieldValidator. EnableClientScript, Enabled, and Visible are set to true for the RequiredFieldValidator. <asp:textbox id="FirstName" MaxLength="25" runat="server"></asp:textbox>
4
1820
by: singh79 | last post by:
Hi Pls Any One Solve My Problem. One Text box for Enter user Name.My Requirement is if web application is Run then, In Textbox Display "Pls Enter User name" If Click By Mouse the text Is Gone.If Enter Usename, If In Case Do Not Enter User Name, Again Come And Display "Pls Enter User Name" Thanks & Regards Atul Singh
14
4345
by: confusedfusion | last post by:
Not sure how many form submissions that have been lost over the years before I started but the company has a contact form that the required fields when validation fails the error message is going into the URL string on a refresh of the form page. I am very green on CF and CFM files and have this code below; I need to help for the error messages...
1
1916
by: spynx | last post by:
import javax.swing.JOptionPane; import java.io.*; import java.util.Arrays; public class election5 { public static void main( String args ) {
0
7673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
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
8109
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
7645
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
7953
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
5485
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
3643
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
926
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.