Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question HTML double link (help plz)

    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

  • #2
    Senior Coder ahallicks's Avatar
    Join Date
    May 2006
    Location
    Lancaster, UK
    Posts
    1,134
    Thanks
    1
    Thanked 57 Times in 55 Posts
    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.
    "write it for FireFox then hack it for IE."
    Quote Originally Posted by Mhtml View Post
    Domains are like women - all the good ones are taken unless you want one from some foreign country.
    Reputation is your friend

    Development & SEO Tools

  • #3
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    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.
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #4
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #5
    Senior Coder ahallicks's Avatar
    Join Date
    May 2006
    Location
    Lancaster, UK
    Posts
    1,134
    Thanks
    1
    Thanked 57 Times in 55 Posts
    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?
    "write it for FireFox then hack it for IE."
    Quote Originally Posted by Mhtml View Post
    Domains are like women - all the good ones are taken unless you want one from some foreign country.
    Reputation is your friend

    Development & SEO Tools

  • #6
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    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:

    PHP Code:

    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";

    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •