Jump to content

Recommended Posts

Hi all,

 

I am trying to call a php file currently stored on my web hosting server to a HTML code being written on a different server.. This HTML code should be able to execute this php file and then retrieve a value that is getting stored in a variable named $url within the php file.. This variable is randomly generated each time the php file is run..

 

Please assist.. Kindly ask for more info as required.

 

Cheers

Link to comment
https://forums.phpfreaks.com/topic/279054-calling-a-php-from-another-server/
Share on other sites

You're going to run in to the Same Origin Policy which basically restricts server A remote code from running on server B.  API's and SDK get around this policy by using keys and single source signon schemes.  You can load a remote page in an <iframe> tag, however that code can't make runtime instructions without some special setup (reverse proxy server).  

Can you provide any more specifics on what you're looking to do?

 

Have you considered passing the necessary information using GET variables? PHP file 1 could send a flag to file 2 which generates the variable. File 2 can then send the variable back to file 1 using a header redirect.

http://php.net/manual/en/function.header.php

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.