Multi-Login Script - Help

Multi-Login Script - Help

I’m trying to create a ‘Multi Login System’ that connects to two different websites which as two different input field variables using a 'Dropdown Box' and once it's onChange it changes the name="" field to the respectable fields as mentioned below.

  • Website 1
  • Username Input Field: username
  • Password Input Field: password
  • Submit Input Field: login

  • Website 2
  • Username Input Field: username
  • Password Input Field: user_password
  • Submit Input Field: user_login

I know this can be accomplished using, php, javascript or jQuery, but not sure how to go about it.


After searching, I found an old code of a 'Multi Login' that the creators of one of the control panels wrote me - At the time, I had 3 'panel#' control panels of the same source as I had 3 different dedicated servers.


Now, I've merged all 3 servers into of the same source into one and the other login source would be to the billing system.


Using an onChange event on the input fields I think would suffice, but it would have to have some kind of 3-dimensional array or something to provide on all the details.



  1. <?php
  2. if (!isset($_GET['panel'])) {
  3. $_GET['panel'] = 'panel1';
  4. }
  5. ?>

  6. <script>
  7. function selectPanel()
  8. {
  9. var panel_index = document.forms['loginSelect'].panel;
  10. location.href='./login.php?panel='+ panel_index.options[panel_index.selectedIndex].value
  11. }
  12. </script>

  13. <form name="loginSelect" method="POST" action="http://<?=$_GET['panel']?>.domain.com/index.php?page=login">
  14. <input type="text" name="username">
  15. <input type="password" name="user_password">
  16. <select name="panel" onchange="selectPanel()">
  17. <option value="panel1">panel1.domain.com</option>
  18. <option value="panel2"<?php if ($_GET['panel']=='panel2'){echo ' selected';}?>>panel2.domain.com</option>
  19. <option value="panel3"<?php if ($_GET['panel']=='panel3'){echo ' selected';}?>>panel3.domain.com</option>
  20. </select>
  21. <input type="submit" name="login_submit" value="login">
  22. </form>



I'm thinking a jQuery would probably work for the solution I want. (If nobody knows how, I'm just going to end up looking into hiring a freelancer.)


Regards,
Cory