English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a screen that asks for username and password and then to submit. I would like to get around this so it is autmaticly takes me to the next page after log in. Any Ideas? But on the next page there is another link that I dont wan the user to have to click but instead be taken directly to where this link is pointing..... Sorry if this sounds like guff I am not web orientated in the slightest, I just want to know what I am talking about with regards this solution. Cheers

2007-05-09 22:11:54 · 5 answers · asked by james f 2 in Computers & Internet Programming & Design

5 answers

I’m not 100% certain as to what you’re doing with the login details that the user has typed in. I assume that you are performing some validation somehow and that may affect the answer.

However, to have a HTML form direct you to another web page you add the URL for that page to the form action attribute e.g.



The onSubmit attribute is where you would have the name of the function that is handling the authentication of the login details. If this returns false (i.e. login details are incorrect) then the redirection doesn’t happen. If you’re not checking the login details here then obviously the onSubmit attribute can be omitted.

To redirect the user from the page that the login has taken them to,
add the following:-



Between the and tags


The 1 before the “;” is supposed to be the number of seconds it waits before redirecting, but to be honest it usually happens so quick that you hardly ever see that page. You could try putting 0 (zero) in there and see if it does it instantaneously.

2007-05-10 01:23:18 · answer #1 · answered by Dark Magician 2 · 0 0

This isn't an HTML question. There must be some code running on the server, eg PHP or ASP, which takes your username and password and checks to see if they are valid. It's this code that determines where you go after a successful login. You'll need to alter it so that it redirects the user to the page you want.

Oh, and to the above poster - I wouldn't recommend putting the username/password validation code in client-side Javascript, as you imply. This makes it simple to crack - a user can just do View Source in the browser and you can see the JS code, and will quickly be able to find out what the acceptable values are. Very insecure. This code should run on the server only.

2007-05-10 09:32:08 · answer #2 · answered by Daniel R 6 · 0 0

NEVER put any usernames/passwords in HTML nor in Javascript. As said above, it is visible!
Use a form to send the data from HTML, i.e.



..

The file "checkpass.php" is written in PhP. It runs only on the server (not on user machine). It receives the data ($user and $pwd). It calls a list of users and passwords (i.e. a list or a data-base in SQL). It validates the password and returns true or false.
To jump somewhere else, you can use java:
window.location(myhtmlpage);
Do not use window.history(-1) or similar: it does not necessarely return to the right page (if the user has clicked refresh for example).

The meta "refresh" does no do what is said above! It means that the page will refresh every second!

2007-05-14 05:01:56 · answer #3 · answered by just "JR" 7 · 0 0

I sort of agree with both of you. It really depends on what you are trying to protect with your password. I have a section with family photos on my site which uses a front end java app as quite frankly, if people want to crack it and look at pics, well thats fine but it will keep out the casual browser (and in fairness thats lots of people).
For my job however, I run an ecommerce site which I dont want people to crack as it stores all sorts of user data etc etc and uses .net and SQL to validate the user who are then passed to the page I want them to arrive at. This is all done by script so its all down to how secure you want your protected section to be really.
ASP/ASPX or PHP are very good ways of doing it if you have some skill, if not then you are sure to be able to find someone who has already written the code for you to use....
Try here http://www.devshed.com/

2007-05-10 11:43:51 · answer #4 · answered by stevieperv 2 · 0 0

There are 2 kind of that

1. Built in example > http://login.yahoo.com
2. Prompt Session example > http://members.videoz.com

for your question i like to know witch one is your question. ??

for now i only have for no.2

let say you want to go automatically to www.page.com
and you have valid username and password for that.

Username=user
Password=pass

and for your automatic link should be like this !!

>> http://user:pass@www.page.com

just simple like that ....

Andi Ahdin
Indonesia

2007-05-10 12:47:16 · answer #5 · answered by Andi Ahdin 4 · 0 1

fedest.com, questions and answers