Link to home
Start Free TrialLog in
Avatar of HemlockPrinters
HemlockPrinters

asked on

java script to redirect to a new page

I want to write an application to book a tennis court 5 at 6pm on every Wednesday .  Using the following script  I can logon to the membership page successfully, but how can I redirect to booking page,  Wednesday booking page and book the court 5 ?
thanks


   
<!doctype html>
    <html>
    <title>Tennis Sport Club Autologin</title>
    
    <body>

<form id="loginbox" action="https://engine.gigasports.com/VerifyLogin.asp" method="post" name="Logon">
    <select name="uni_url" id="logServer" class="validate[required]">
     </select>  
           
                Username <input type="text" size="12" name="txtUserID" id="txtUserID" value="username" >
                Password <input type="password" size="12" name="txtPassword" id="txtPassword" value="passowrd">
                <br />he
 </form>

  <script>document.forms['Logon'].submit();</script>      

 <script language="javascript" type="text/javascript">
      
     window.location.href="http://engine.gigasports.com/Booking.asp";
     
 </script>
          

  </body></html>

Open in new window

booking.jpg
logon.jpg
booking.txt
logon.txt
SOLUTION
Avatar of Alexandre Simões
Alexandre Simões
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of HemlockPrinters
HemlockPrinters

ASKER

thanks. Login page redirected me to the verifylogin.asp.  How do I put java script on VerifyLogin.asp page?
As per your last comment you could put javascript on any page by using <script> tag.

 <script language="javascript" type="text/javascript">
 
    window.location.href="http://engine.gigasports.com/Booking.asp";
     
 </script>
thanks insoftservice, I put javascript after submit the login form, but it doesn't open the booking page though.

---------------------------------------



<!doctype html>
    <html>
    <title>Tennis Sport Club Autologin</title>
   
    <body>

<form id="loginbox" action="https://engine.gigasports.com/VerifyLogin.asp" method="post" name="Logon">
    <select name="uni_url" id="logServer" class="validate[required]">
     </select>  
           
                Username <input type="text" size="12" name="txtUserID" id="txtUserID" value="username" >
                Password <input type="password" size="12" name="txtPassword" id="txtPassword" value="passowrd">
                <br />he
 </form>

  <script>document.forms['Logon'].submit();</script>      

 <script language="javascript" type="text/javascript">
     
     window.location.href="http://engine.gigasports.com/Booking.asp";
     
 </script>
         

  </body></html>
"Your session has expired.
Please log in again"

Are you getting that page.If yes then please pass on the session and parameters required for these page.
Stop the page before redirecting it to  "http://engine.gigasports.com/Security_SessionExpired.asp" so that it would be clear that you page has been redirected.
And to keep it on we have to pass the required data
thanks Infoftservice, I got what you mean. but how to pass on the required session variables?
For such cases you have to take help of AJAX using some scripting language and then send such secure data using REST method like curl ,socket e.t.c
@Rob (tagit) how come my comments were not accepted . please check my all comments so as to get proper idea that client was able to redirect his page but later he got stuck in session which even i had suggested the way.