dcsimg
www.webdeveloper.com
Results 1 to 11 of 11

Thread: How to find a hotlink between Hong Kong and Kuala Lumpur?

  1. #1
    Join Date
    Jun 2012
    Posts
    19

    How to find a hotlink between Hong Kong and Kuala Lumpur?

    Referrng to following link, I would like to find a hotlink between Hong Kong and Kuala Lumpur in Ecomony class, does anyone have any suggestions based on the source coding?

    Thanks in advance for any suggestions

    http://www.malaysiaairlines.com/hk/e...f-the-day.html

  2. #2
    Join Date
    Jun 2012
    Posts
    19
    Does anyone have any suggestions?

    Thanks in advance for any suggestions

  3. #3
    Join Date
    Mar 2012
    Posts
    1,813
    What is a "hotlink" in the context of travelling from HK to KL? And what does source code have to do with it?

  4. #4
    Join Date
    Jun 2012
    Posts
    19
    I would like to check price between Hong Kong and Kuala Lumpur in Ecomony class everyday, but it requires to input locations for input selections. After I select locations and class and click search, it used method="post" instead of get, I would like to know whether it is possible to replicate this action using a single URL or not, so I don't need to select the locations and class everyday for checking price. If the web page used method="get", then it would be easy to replicate this action, since all locations and class will be add to the parameter of URL.

    Do you have any suggestions?

    Thanks in advance for any suggestions

  5. #5
    Join Date
    Mar 2012
    Posts
    1,813
    It is possible to dump the post parameters, using PHP or JavaScript. That would allow you to inspect the parameter names and content. Then you could write your own front-end pre-setting the locations. So, yes, it is possible.

    On reflection you might not even need to dump the parameters. If you save the web page locally (all major browsers have this facility) you could inspect the web page for the location input, and pre-set it. That might be easier. However, there could be a problem with retaining control. Such a web site is most likely to have extensive server functionality that is not apparent from the web page delivered to the client. But you can try...

    A further thought... If the web site initially takes GET parameters then POST, it may be possible to pass the GET parameters anyway. It depends on how the arbitration between GET and POST parameters has been written. So you could try setting up an icon to launch the web page with the locations set in the GET parameters, and see what happens...

    Good luck!
    Last edited by jedaisoul; 03-29-2013 at 07:36 AM.

  6. #6
    Join Date
    Jun 2012
    Posts
    19
    "It is possible to dump the post parameters, using PHP or JavaScript. That would allow you to inspect the parameter names and content. Then you could write your own front-end pre-setting the locations. So, yes, it is possible. "
    It is too difficult to achieve without understanding PHP or JavaScript, furthermore, it may require to install server to perform this task.

    ... If you save the web page locally (all major browsers have this facility) you could inspect the web page for the location input, and pre-set it. That might be easier. However, there could be a problem with retaining control. Such a web site is most likely to have extensive server functionality that is not apparent from the web page delivered to the client. But you can try...
    I try that it does not work, because the parameter cannot be saved using this approach.

    ... If the web site initially takes GET parameters then POST, it may be possible to pass the GET parameters anyway. It depends on how the arbitration between GET and POST parameters has been written. So you could try setting up an icon to launch the web page with the locations set in the GET parameters, and see what happens...
    It seems impossible to guess parameters for GET.

    Does anyone have any suggestions?

    Thanks you very much for any suggestions

  7. #7
    Join Date
    Mar 2012
    Posts
    1,813
    Quote Originally Posted by oem7110 View Post
    It is too difficult to achieve without understanding PHP or JavaScript, furthermore, it may require to install server to perform this task.
    But you asked if it were possible, not if it were easy.

    Quote Originally Posted by oem7110 View Post
    I try that it does not work, because the parameter cannot be saved using this approach.
    I meant that the parameter name and content should be apparent from the form control. I.e. There should be SELECT tags in the HTML that take the flight departure and destination airports. I'll have a look at it.

    Quote Originally Posted by oem7110 View Post
    It seems impossible to guess parameters for GET.
    You indicated that the site switched to POST parameters AFTER the source and destination were input. If so the parameters should be visible in the URL.

  8. #8
    Join Date
    Mar 2012
    Posts
    1,813
    I've had a look at the source code and the parameters you want are:

    ddlOrigin=HKG
    ddlDestination=KUL
    ddlCabinClass=1

    However, I've tried passing these to the page as GET parameters, with no joy. So it seems that the only way to pre set them is to download and amend the source code:

    - Open the web page and save it using the browser's facility to save the source code.

    - Open the downloads folder and find "dealoftheday.htm" (the source code), and open it with a text editor (NOT a word processor). Then:

    - Find:
    <label>I'm leaving from</label>
    <select tabindex="1" name="ddlOrigin" id="ddlOrigin">
    <option value="">Please select a Departure City</option>

    - Scroll down to:
    <option value="HKG ">Hong Kong</option>

    amend to:
    <option selected="selected" value="HKG ">Hong Kong</option>

    - Find:
    <p><label>I'm going to</label>
    <select tabindex="2" name="ddlDestination" id="ddlDestination">
    <option value="">Please select an Arrival City</option>

    - Scroll down to:
    <option value="KUL ">Kuala Lumpur</option>

    amend to:
    <option selected="selected" value="KUL ">Kuala Lumpur</option>

    - Find:
    <p><label>Cabin</label>
    <select tabindex="5" name="ddlCabinClass" id="ddlCabinClass">
    <option selected="selected" value="">Please select</option>
    <option value="1">Economy Class</option>
    <option value="2">Business Class</option>
    <option value="3">First Class</option>
    </select>

    amend:
    <option selected="selected" value="">Please select</option>
    <option value="1">Economy Class</option>

    to:
    <option value="">Please select</option>
    <option selected="selected" value="1">Economy Class</option>

    - Save the amended file, then click on the HTML file, and it will launch with the Origin, Destination and Cabin Class pre set. Voila!

  9. #9
    Join Date
    Jun 2012
    Posts
    19
    I have amended the file as you described, but when I click search, it does not connection to server.

    Do you have any suggestions?

    Thanks you very much for any suggestions

    Amended html file
    http://sdrv.ms/1774wjQ

  10. #10
    Join Date
    Mar 2012
    Posts
    1,813
    Sorry, that's my ideas exhausted. At least I tried.

  11. #11
    Join Date
    Jun 2012
    Posts
    19
    I am very appreciated your efforts.

    Thanks you very much for any suggestions

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles