0

I am pretty new to php.

I have two websites: Site1 has a code that counts the characters in the domain name. So I have:

echo count($letters);

This works great. What I need is to take this variable and echo it on Site2. How can I do that? Site2 is on a different server.

4
  • 1
    take a look into curl extesion Commented Jul 11, 2013 at 10:16
  • I think we need more information here about what you're doing to understand why and how this data needs to be calculated at site 1 and outputting to site 2. Commented Jul 11, 2013 at 10:16
  • There is no direct way to allow one server to access a variable on another, you will need to code a page or service which allows them to pass information back and forth with one server sending the other the information it needs to be able to give an answer. Commented Jul 11, 2013 at 10:17
  • cURL / file_get_contents() may help u! But it's... bizarre, or i think so! Commented Jul 11, 2013 at 10:19

1 Answer 1

1

very easy and straight forward solution is

$content = file_get_contents('http://ww.google.com');
echo $content;

and replace google link with your other server link

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.