1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

code a simple script to open two URLs from one link

Discussion in 'Hire a Freelancer' started by intence, Feb 18, 2012.

  1. intence

    intence Regular Member

    Joined:
    Nov 21, 2008
    Messages:
    435
    Likes Received:
    77
    I want to have one link open two URLs.

    The first URL would be: http://www.sample1.com (for example) and opens in the same browser/window. The first URL will be different every time so you can use a place holder like cnn.com or google.com.

    The second URL has to execute this and open in a background browser/window (for cookie purposes). It has a built in image but you can remove that:

    <form method="GET" action="http://www.sample.com/gp/aws/cart/add.html">
    <input type="hidden" name="Tag" value="xxxxxxxxxxxx"/>
    <input type="hidden" name="SId" value="0EMJ6TWAXGX6JF1NP202"/>
    <input type="hidden" name="ASIN.1" value="B003VNKNF0"/>
    <input type="hidden" name="Quantity.1" value="1"/>
    <input type="image" name="add" value="Buy from sample2.com" border="0" alt="Buy from sample2.com" src="http://images.sample2.com/images/G/01/associates/add-to-cart.gif">
    </form>

    This is the code provided to me by the second site but essentially I want the first URL to open in front and then the second URL open in the background and execute the script so a product is added to cart in the background.

    I'll be using this on wordpress sites if that makes a difference.

    PM me for more specific details and clarification.

    thanks
     
  2. dario111cro

    dario111cro Junior Member

    Joined:
    Feb 5, 2012
    Messages:
    180
    Likes Received:
    203
    Location:
    cloud
    Please add me on skype: dario111cro
     
  3. dra$tic

    dra$tic BANNED BANNED

    Joined:
    Dec 20, 2010
    Messages:
    393
    Likes Received:
    108
    Code:
    <a href=http://www.sample1.com onclick="window.open('http://www.sample2.com', 'newtab');">a link</a>
    
     
  4. intence

    intence Regular Member

    Joined:
    Nov 21, 2008
    Messages:
    435
    Likes Received:
    77
    haha i wish this would work but i need the second URL to execute that code for cookie reasons..