Solved

java script to redirect to a new page

Posted on 2013-11-25
12
637 Views
Last Modified: 2014-01-02
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
0
Comment
Question by:HemlockPrinters
12 Comments
 
LVL 30

Assisted Solution

by:Alexandre Simões
Alexandre Simões earned 250 total points
ID: 39676878
This is best done with a browser automation tool like Selenium

Selenium also support to be launched from command line so you can set it as a windows task to be run everyday at a certain hour...
0
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 250 total points
ID: 39676941
As per my understanding login page redirectling you to the VerifyLogin.asp
then you need to put javascript on VerifyLogin.asp page to redirect to boooking page

     
     window.location.href="http://engine.gigasports.com/Booking.asp";
0
 

Author Comment

by:HemlockPrinters
ID: 39685857
thanks. Login page redirected me to the verifylogin.asp.  How do I put java script on VerifyLogin.asp page?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 15

Expert Comment

by:Insoftservice
ID: 39686457
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>
0
 

Author Comment

by:HemlockPrinters
ID: 39690481
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>
0
 
LVL 15

Expert Comment

by:Insoftservice
ID: 39692386
"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
0
 

Author Comment

by:HemlockPrinters
ID: 39696936
thanks Infoftservice, I got what you mean. but how to pass on the required session variables?
0
 
LVL 15

Expert Comment

by:Insoftservice
ID: 39697483
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
0
 
LVL 15

Expert Comment

by:Insoftservice
ID: 39751026
@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.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
best counters for cpu high usage 3 33
sql query to calculate avaerage 21 40
Button and js nou working 3 8
Jquery 2 13
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question