Micro Niche Builder
+ Reply to Thread
Results 1 to 6 of 6

Thread: How do I use php code from a different domain?

  1. #1

    Default How do I use php code from a different domain?

    Here's what I'm trying to do: I have a php page I created on one domain, that stores information in a database. Next, I have another web page (This page is html NOT php) on a Different domain that I call this php page using Javascript, and would like to return a variable from the php page. How is this possible? I know it is, so don't say that it isn't! (10 points for the person that finally answers this question!)


  2. #2

    Default

    Well your first problem is there will be no way to pull that variable in to an html page it simply isn't possible. One thing you could do is make the second page a php page then connect to your other domains mysql database using the mysql_connect('domain.com', 'user', 'pass'); and in cPanel go to remote databases and add the second domain there. That's really the only way I can think of doing it unless you pass that variable via cookies...but I don't think that would be very reliable.

  3. #3

    Default

    I'm not sure that I completely understand your question, but you mention using Javascript to pull it. Would you need the data from the PHP page returned in json format?

  4. #4

    Default

    I wouldn't have gone about it like that at all. I would consider using XML and mapiulating the feed on your HTML page!

  5. #5

    Default

    Thanks feed idea really works

  6. #6

    Default

    you can use java script
    <script language="JavaScript" src="ww.domain.com/file.php"></script>

  7. The Following User Says Thank You to OneScripts For This Useful Post:

    decipher (02-24-2012)

+ Reply to Thread

Similar Threads

  1. Domain search ASP code
    By adeel in forum Domain Forum
    Replies: 1
    Last Post: 10-23-2008, 03:41 AM
  2. i'll code websites for a domain name
    By suitelifeforever in forum Webmaster Classifieds
    Replies: 2
    Last Post: 03-11-2007, 11:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts