Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Programming Help

    Hi I am new to programming and looking for some help. I want to create a program to automatically choose a size and add a pair of shoes to the cart on nike.com. I am willing to do it myself; I just need to know if I would use Java or what type of program I need to learn how to learn.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,200
    Thanks
    75
    Thanked 4,342 Times in 4,308 Posts
    First of all, if you want to use Java, you are in the wrong forum. This is the JavaSCRIPT forum. About the only thing Java and JavaScript have in common are the first 4 letters of their names.

    Assuming you meant JavaScript:

    You probably can't do it.

    You can't use JavaScript from your own pages/site to affect *ANYTHING* on some other site.

    What you *MIGHT* be able to do is to clone the <form> on the Nike site to your own site, making sure that the action= of the <form> still points to the Nike site. Then you could use your own JS code on your own site to fill in the <form> and submit it to the Nike site. More than likely, that won't work. And that's because, of course, to Nike you look like somebody trying to hack their site and submit bogus orders. So, like most modern sites, they will have all sorts of code in place to detect attempts to do this very thing. Just for example, and the most obvious thing to check and the easiest for even a beginner in server-side programming to implement: Whan any <form> is submitted (or any page is linked to another, for that matter), the receiving site can check something called the HTTP_REFERER, which tells it what site *AND PAGE* the <form> or other link came from. And if the REFERER is not what the site is expecting, it rejects the attempt.

    Now, HTTP_REFERER isn't too terribly hard to spoof. Though you won't do it with just JavaScript code. You would need some server-side knowledge to do that, albeit not too much. But that's just the very first line of defense that a *GOOD* eCommerce site will erect against people like you who want to hack them.

    SO... If you are truly a newbie, I'd say you are very very unlikely to succeed at this. And if you aren't a newbie, your changes of success are still pretty darned small.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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