Displaying my small php page on other SITE(S)

Discussion in 'JavaScript' started by SimThePhpCoder, Jan 10, 2011.

  1. #1
    How can I display my php page on other sites? I also need to pass a variable to my php file. The php file will access mySQL database too.
     
    SimThePhpCoder, Jan 10, 2011 IP
  2. kokulusilgi

    kokulusilgi Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    the answer is iframe ?
     
    kokulusilgi, Jan 11, 2011 IP
  3. SimThePhpCoder

    SimThePhpCoder Well-Known Member

    Messages:
    949
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #3
    I don't want to use iFrame. Here is what I came up with, but its not working..

    I place this code on external SITE to try to call my PHP file.
    my pet.php page just calls the class in pet.class.php on "somedomain.com" so I'll just post the pet.class.php file


    Any ideas. If I call pet.php by itself. It will output my template which is just an image. ;]
     
    SimThePhpCoder, Jan 11, 2011 IP
  4. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Output a javascript file that loads the contents into a div.
     
    camjohnson95, Jan 13, 2011 IP
  5. miguelf

    miguelf Member

    Messages:
    98
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    48
    #5
    You'll have to use a JavaScript file. In the JavaScript just output the HTML. You can't output PHP is has to be HTML.
     
    miguelf, Jan 13, 2011 IP