You are best off providing the user with installable software that you can then access on their machine. For example, provide an installer that will register a new browser protocol (call it bf2:), and associate it with a client-side command. Then offer links in the form <a href='bf2://servername.com:port'>Server Name</a>. Windows will then call your handler and pass it the URL, which the local app parses and passes on to Battlefield 2.

That's a bit of work, so there is another approach. Ask the user to download an application that can parse a one-line file containing the information needed to join a server, and uses that to launch the game and connect to that game server. Send such a file with a mime type like application/x-battlefield2-connect-script, and either (a) have your apps installer pre-register as the handler for that type, or (b) instruct the user that they will have to select your app as the default action for that MIME type (only the first time).

<-radiant.matrix->
Larry Wall is Yoda: there is no try{} (ok, except in Perl6; way to ruin a joke, Larry! ;P)
The Code that can be seen is not the true Code
"In any sufficiently large group of people, most are idiots" - Kaa's Law

In reply to Re: Running an application on a user's computer from a CGI script. by radiantmatrix
in thread Running an application on a user's computer from a CGI script. by Cap'n Steve

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.