Results 1 to 3 of 3

Thread: conditional login redirect

  1. #1
    Join Date
    Oct 2009
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question conditional login redirect

    I have code for a popup login
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    
    <title>DHTML Popup Window</title>
    
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta name="description" content="" />
    <meta name="keywords"    content="" />
    
    <link rel="stylesheet" type="text/css" href="sample.css" />
    
    <script type="text/javascript" src="popup-window.js"></script>
    
    </head>
    <body>
    
    
    <!-- ***** Form ************************************************************ -->
    
    <form action="" onsubmit="return false;">
    <div>
    <input type="button" value="Standard"
           onclick="popup_show('popup', 'popup_drag', 'popup_exit', 'screen-top-left',      3,  3);" />
    <input type="button" value="Platinum"
           onclick="popup_show('popup', 'popup_drag', 'popup_exit', 'screen-center',         0,   0);" />
    </div>
    </form>
    
    <!-- ***** Popup Window **************************************************** -->
    
    <div class="sample_popup"     id="popup" style="display: none;">
    
    <div class="menu_form_header" id="popup_drag">
    <img class="menu_form_exit"   id="popup_exit" src="form_exit.png" alt="" />
    &nbsp;&nbsp;&nbsp;Login
    </div>
    
    <div class="menu_form_body">
    <form action="login.php">
    <table>
      <tr><th>Username:</th><td><input class="field" type="text"     onfocus="select();" name="username" /></td></tr>
      <tr><th>Password:</th><td><input class="field" type="password" onfocus="select();" name="password" /></td></tr>
      <tr><th>         </th><td><input class="btn"   type="submit"   value="Submit" /></td></tr>
    </table>
    </form>
    </div>
    
    </div>
    
    </body>
    </html>
    The only problem with it is that I can't figure out how to get the popup login to direct to two different login scripts based on the button pressed. You can see the code's directing script in red above; how would I go about making this dependent on button the button pressed?

    I'm a bit new to all this so any help would be greatly appreciated! Thanks in advance!

  2. #2
    Join Date
    Oct 2009
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Unhappy Anybody out there?

    Seriously, any help at all would be great.

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Here's a similar discussion. Read my reply (third in the thread):
    http://dynamicdrive.com/forums/showthread.php?t=49082

    Basically, you can't actually submit a form to two different places. There can only be one action.

    If you cannot do something serverside to fix this (receiving the form), then you must either go with javascript (somewhat unreliable), or find another solution entirely.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. The Following User Says Thank You to djr33 For This Useful Post:

    oldtimer (10-13-2009)

Bookmarks

Posting Permissions

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