Newbie question: Include external files

Discussion in 'Java' started by Marsel, Oct 12, 2007.

  1. Marsel

    Marsel Guest

    OK, first off I admit I don't have clue about JAVA. I am a newbie noknow :)

    I want to launch an affiliate program, where publishers can include configurable feed from my site.

    Generation of the code in PHP is done, so publishers could simply ad

    <?php
    include "http://mysite.com/ad.php?n=5&o=h&w=460&bgc=white&bc=lightgray&afid=4584& etc.etc...";
    ?>

    to their code. Of course this only works for PHP publishers. ASP cannot handle external includes (so I am told), and I
    would also hate to rule out HTML pages.

    So, is there a (simple) way to solve this with JAVA? I would appreciate any help to point me in the right direction.

    Thanks,
    Marsel
    Marsel, Oct 12, 2007
    #1
    1. Advertising

  2. Marsel

    Roedy Green Guest

    On Fri, 12 Oct 2007 12:55:49 -0400, Marsel <> wrote, quoted or
    indirectly quoted someone who said :

    ><?php
    >include "http://mysite.com/ad.php?n=5&o=h&w=460&bgc=white&bc=lightgray&afid=4584& etc.etc...";
    >?>
    >
    >to their code. Of course this only works for PHP publishers. ASP cannot handle external includes (so I am told), and I
    >would also hate to rule out HTML pages.
    >
    >So, is there a (simple) way to solve this with JAVA? I would appreciate any help to point me in the right direction.


    You can embed links in HTML, or Java Applets or Servlets. However,
    bald PHP code itself is not going to be any use inside a Java
    program.

    To make it useful, you would need to create a C++ wrapper around your
    code, and JNI glue so that you could use your PHP api from Java.

    See http://mindprod.com/jgloss/jni.html

    That is fairly tricky. You need someone who understands PHP, C++,
    Java and JNI.
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, Oct 13, 2007
    #2
    1. Advertising

  3. Marsel

    Marsel Guest

    On Sat, 13 Oct 2007 07:08:32 GMT, Roedy Green <> wrote:

    >On Fri, 12 Oct 2007 12:55:49 -0400, Marsel <> wrote, quoted or
    >indirectly quoted someone who said :
    >
    >><?php
    >>include "http://mysite.com/ad.php?n=5&o=h&w=460&bgc=white&bc=lightgray&afid=4584& etc.etc...";
    >>?>
    >>
    >>to their code. Of course this only works for PHP publishers. ASP cannot handle external includes (so I am told), and I
    >>would also hate to rule out HTML pages.
    >>
    >>So, is there a (simple) way to solve this with JAVA? I would appreciate any help to point me in the right direction.

    >
    >You can embed links in HTML, or Java Applets or Servlets. However,
    >bald PHP code itself is not going to be any use inside a Java
    >program.
    >
    >To make it useful, you would need to create a C++ wrapper around your
    >code, and JNI glue so that you could use your PHP api from Java.
    >
    >See http://mindprod.com/jgloss/jni.html
    >
    >That is fairly tricky. You need someone who understands PHP, C++,
    >Java and JNI.


    Thanks.

    Maybe I was not clear. I just want the file http://mysite.com/ad.php to be called with certain arguments and included on
    the affiliate's site.

    I am currently doing it with IFRAME. Do I really need C++, Java, and JNI? If yes, do you know who might do the
    programming?
    Marsel, Oct 15, 2007
    #3
  4. Marsel

    Guest

    On Oct 15, 12:28 pm, Marsel <> wrote:
    > I just want the filehttp://mysite.com/ad.phpto be called with certain arguments and included on
    > the affiliate's site.


    Ugh!!

    Well, in THAT case, I have new advice for you: go to hell. Go directly
    to hell, do not pass Go, do not collect 200 click-thrus, you miserable
    spammer.

    > I am currently doing it with IFRAME. Do I really need C++, Java, and JNI? If yes, do you know who might do the
    > programming?


    No, all you need is your head soaking, preferably in something less
    harmless than water.

    Not only do you mean to bombard innocent web surfers with nasty popups
    or other evil, intrusive, obnoxious advertising (else you'd be
    satisfied with a plain 460x60 .jpg file on the other site rather than
    a php file), but you actually want to run arbitrary code on other
    peoples' sites, which will constitute a security hazard for these
    sites and everyone who surfs to any of them.

    There's no good reason for an advertiser to want to run custom code on
    someone else's site. The only point in doing so is to do something
    nefarious, such as make the ad scribble outside of its html element
    and cover up the content nearby, or dance and play annoying sounds, or
    load synchronously so if your ad server is slow surfers have to wait
    for the stupid ad to load before reading on, rather than if your ad
    server is slow then *you* end up with ineffective ads because people
    will have scrolled past before they managed to load, or ...

    Go away, buzzard. Nobody wants evil spammers around here.
    , Oct 15, 2007
    #4
  5. Marsel wrote:
    > <?php
    > include "http://mysite.com/ad.php?n=5&o=h&w=460&bgc=white&bc=lightgray&afid=4584& etc.etc...";
    > ?>


    WOW !!
    Do you think you can get people to do that ??
    They will have to trust you an awful lot.
    Robert Larsen, Oct 17, 2007
    #5
  6. Marsel

    Randy Webb Guest

    Robert Larsen said the following on 10/17/2007 3:38 AM:
    > Marsel wrote:
    >> <?php
    >> include "http://mysite.com/ad.php?n=5&o=h&w=460&bgc=white&bc=lightgray&afid=4584& etc.etc...";
    >> ?>

    >
    > WOW !!
    > Do you think you can get people to do that ??
    > They will have to trust you an awful lot.


    Only if you equate stupid and trust :)

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Randy Webb, Oct 17, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tobias Merler
    Replies:
    16
    Views:
    1,268
    Yakov
    Oct 3, 2004
  2. Scott Allen
    Replies:
    8
    Views:
    10,936
    Scott Allen
    May 2, 2004
  3. Andreas Bogenberger
    Replies:
    3
    Views:
    904
    Andreas Bogenberger
    Feb 22, 2008
  4. Mellow Crow
    Replies:
    6
    Views:
    418
    Richard Cornford
    Nov 4, 2005
  5. Marsel
    Replies:
    11
    Views:
    170
    Robert Larsen
    Oct 17, 2007
Loading...

Share This Page