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

Link to a flash button in a website

Discussion in 'Other Scripting Languages' started by xgf666, Jun 15, 2011.

  1. xgf666

    xgf666 Junior Member

    Joined:
    Jan 18, 2011
    Messages:
    104
    Likes Received:
    6
    Location:
    At top of the Eiffel Tower
    Hello,
    I would like to know if it's possible to make a link to a button of a website, this way, when one of my visitor click on the link, it will transfer them automatically on the website and launch the button's action.
    Do you have a hint about what can help me here ?

    Thanks !!
     
  2. JackSparrow

    JackSparrow Supreme Member

    Joined:
    Mar 24, 2007
    Messages:
    1,469
    Likes Received:
    2,056
    Occupation:
    Semi-Employed Pirate
    Location:
    search 4 blackhatsparrow
    Home Page:
    Wouldnt it be easier to click on the flash button, make a note of the url of the page the flash button takes you to, and create link to this page on your website. Seems a funny request, unless your think of putting the flash button from the other page on your website.:confused:
     
  3. licorne101

    licorne101 Registered Member

    Joined:
    Aug 22, 2011
    Messages:
    88
    Likes Received:
    118
    Yes, you can do it with javascript (when page loads, button starts) though i think most browsers will flag it as a security flaw.
     
  4. artizhay

    artizhay BANNED BANNED

    Joined:
    Nov 21, 2010
    Messages:
    1,867
    Likes Received:
    1,335
    Can't really help with the lack of details and what your goal is, what the Flash button does, etc...

    Is the link you're referring to going to be on your web site, or do you mean you want a link that you can share externally and people will go to your site and it will launch whatever the Flash button does?

    If the link is on your site itself, you should be able to execute javascript on the link click to also execute the Flash button, but this can be seen by some browsers as a security issue (though the initial link click usually eliminates this security issue), so you'll want to test it out.

    If the link is external, there's nothing you can do and if you want your Flash button to execute automatically, perhaps it's a better idea to make it not require a click to execute...?
     
  5. Frement

    Frement Registered Member

    Joined:
    Sep 26, 2010
    Messages:
    66
    Likes Received:
    22
    Location:
    46696E6C616E64
    Home Page:
    You can have it point to a PHP file (for example, or ASP, which ever you prefer) like this:
    Code:
    redirect.php?link=1
    And let the PHP handle the logging of link clicking and then instantly redirect to the page it originally was supposed to link to, like this:
    PHP:
    <?php

    function log_action($loc) {
        
    //Database handling here (MySQL), or a simple file database.
        
    $ip $_SERVER["REMOTE_ADDR"];
    }

    $link preg_replace("[^0-9]"""$_GET["link"]);

    switch (
    $link) {
        case 
    "1"$location "hxxp://somesite.com/somepage.html"; break;
        case 
    "2"$location "hxxp://somesite.net/somepage.php"; break;
        default: 
    $location "hxxp://yoursite.com/error.php?e=404"; break;
    }

    log_action($location); //And here you have a function that writes the link to a database,
                           //and you can have extra information, like their IP with $_SERVER["REMOTE_ADDR"];

    header("Location: ".$location);

    ?>
    Hope this helps.