How to get external PHP code with HTML/JavaScript

Discussion in 'PHP' started by mihaidamianov, Feb 8, 2006.

  1. #1
    To explain it better:

    Let's suppose I have a moron hosting service which allows me to put to put only .html files. How do I call a remote .php file to output something on my page?

    the remote php file could look like this:

    <?
    $r=rand(1,2);
    $s=$r+$p;   //where $p was issued by my html/javascript script somehow
    echo ($s);
    ?>
    Code (markup):
    and my file should look like what? to display the result of that php file? A javascript call I suppose would do. But I don't have that good knowledge of javascript. Can anyone give me any suggestions?

    <html>
    <body>
    The result of today's number is
    //// I WOULD NEED THE RESULT ISSUED BY THE PHP FILE HERE ////
    </body>
    </html>
    Code (markup):
    Random numbers was just an example. It's much more complicated what I have to do, involving server side processing, it won't be possible to do it in javascript only
    Thanks
     
    mihaidamianov, Feb 8, 2006 IP
  2. onlyican.com

    onlyican.com Peon

    Messages:
    206
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    simple answer.

    Change hosting company
     
    onlyican.com, Feb 8, 2006 IP
  3. mihaidamianov

    mihaidamianov Well-Known Member

    Messages:
    1,434
    Likes Received:
    111
    Best Answers:
    0
    Trophy Points:
    190
    #3
    Darn, of course someone got smart enough to say that. I have a good hosting company and I have php and everything else I need. What I want to do is to develop a script on my server that can be accessed by everyone from their browsers.

    Something like me using some affiliate network script to access their clients' banners in their databases. I hope that settles the questions.

    "simple answer." Doh!..
     
    mihaidamianov, Feb 8, 2006 IP
  4. onlyican.com

    onlyican.com Peon

    Messages:
    206
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    sorry, I thought you where on about your hosting company

    XML FEED ro database driven stuff
     
    onlyican.com, Feb 8, 2006 IP
  5. mihaidamianov

    mihaidamianov Well-Known Member

    Messages:
    1,434
    Likes Received:
    111
    Best Answers:
    0
    Trophy Points:
    190
    #5
    I need something easier, just like the adsense script, or whatever.. What I want to do is to set up a service which will provide content to the user (a webmaster wanting to add on his pages something I offer) just like any common ad services provides you with specific code to place where you want the banners to appear.
     
    mihaidamianov, Feb 8, 2006 IP