Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

java script to redirect to a new page

Posted on 2013-11-25
12
Medium Priority
?
650 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 30

Assisted Solution

by:Alexandre Simões
Alexandre Simões earned 1000 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 1000 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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

604 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