...

View Full Version : HTML double link (help plz)



J.Ivory@HotMail
08-02-2007, 01:12 AM
Ok I am wondering if there is away to have a double link?

Heres my problem I am building a site that has multiple layers but ures have to log out of Page 1 in order to access Page 2 so I have the link that will automaticlly log users out of Page 1 but I need that same link to take them to Page 2 is there a way?


I hope this makes sense and Thank You for any help.
J.Ivory

ahallicks
08-02-2007, 10:20 AM
Where does the link go that automatically logs user out? How are you logging people in and out? Do you have any code to show how you are doing it at the moment, or a link to your page?

I'm thinking that javascript is the option to use here, but without seeing anything (and not having that great a knowledge of javascript) I can't help you very much.

BWiz
08-02-2007, 04:53 PM
Yes, javascript could be a solution here. However, with a login system, I'm guessing you're using (or will evetually use) a server side language. Use the server side language to set it up; it'll be much simpliar than using JavaScript - and if the user has javascript disabled, the entire thing falls apart.

J.Ivory@HotMail
08-02-2007, 05:03 PM
Im at work right now so I dont have any of the links but it takes you back to the home page. If you know of a script and could post it that would be awsome

Thanks agian.

ahallicks
08-02-2007, 05:09 PM
If you were using php to submit the form couldn't you just add the header location to the end that will process the information, do what it has to do and then take you to the homepage? Do you need the page to reload and then take you to the homepage?

BWiz
08-02-2007, 05:18 PM
Not that I know of. Every time I try to add a header("location: blah.php") after some processed code, it errors up because the "headers have already been sent".

I wouls suggest that if you had a logout link, then use it like such: <a href="index.php?do=logout">Logout</a>

When the PHP script recognizes that it's supposed to log out, it changes the link:




if ( isset ( $_GET['do'] ) )
{
if ( $_GET['do'] == 'logout' )
{
print "<a href='ndex.php?id=11'>Home</a>\n";
}
}
else
{
print "<a href='index.php?do=logout'>Logout</a>\n";
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum