473,395 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

use a local php script to execute a remote php script and return results?

Basically, can I execute a php script from within a php script? Heres
some details:

I'm using a remote script to get my local ip address using
$HTTP_SERVER_VARS['REMOTE_ADDR'];

This works. Now I want to run a local php script to call the remote
script and return my ip address. Any Ideas? Thanks! -bp
Jul 17 '05 #1
2 10155
jn
"miles111" <pl******@pilot.msu.edu> wrote in message
news:e7**************************@posting.google.c om...
Basically, can I execute a php script from within a php script? Heres
some details:

I'm using a remote script to get my local ip address using
$HTTP_SERVER_VARS['REMOTE_ADDR'];

This works. Now I want to run a local php script to call the remote
script and return my ip address. Any Ideas? Thanks! -bp


Why not use $_SERVER['SERVER_ADDR']?
Jul 17 '05 #2
Regarding this well-known quote, often attributed to miles111's famous "20
Jan 2004 21:44:16 -0800" speech:
Basically, can I execute a php script from within a php script? Heres
some details:

I'm using a remote script to get my local ip address using
$HTTP_SERVER_VARS['REMOTE_ADDR'];

This works. Now I want to run a local php script to call the remote
script and return my ip address. Any Ideas? Thanks! -bp


Just use a GET redirect (Assuming you're running Apache+php on your local
system):

To get an IP from local to remote (in a script running locally):
header("Location: http://remoteserver.com/ip.php?local=$myIPAddress")

To get an IP from remote to local (in a script running remotely):
header("Location: http://127.0.0.1/ip.php?remote=$theirIPAddress")

--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: steve | last post by:
Hi, I finally figured out the best way to synch local and remote script folders, containing many php script files. What I used to do before was try to ftp all the changed files, etc. which was...
3
by: melih.onvural | last post by:
Group, I want to get into a remote server, tail a file, and see if the last line is an error or not. I think that I've figured out how to shell over and tail the file. I have the specific server...
4
by: hokieghal99 | last post by:
This may not be possible, but I thought I'd ask anyway. Could I get the below code to run on a Python server where other machines would connect to it (say thru the Web) and get details of *their*...
3
by: JonBoy | last post by:
As some of you may know from my previous posts I am trying to set up an internet page on our intranet that contains logoff/shutdown and restart buttons. This needs to work in a remote desktop...
0
by: David Walker | last post by:
I have access to a Microsoft SQL server, but can only access it from the same local webserver. I need ideally to be able to access it, for both reading and writing, from a different webserver /...
2
by: News East | last post by:
Currently I must manually complete the following commands to set a new value for the "open objects" and "open indexes". I need a way script this process in a batch file. COMMANDS RAN: This is...
11
by: cj | last post by:
Perhaps someone knows how to do this. When I open a new ASP.NET web service application in VS 2008, it opens with a simple Hello World web service already written. I want to see this work. ...
0
by: srinivasan srinivas | last post by:
This is ok. Is there any other way to find it out? Thanks, Srini ----- Original Message ---- From: Gerhard Häring <gh@ghaering.de> To: python-list@python.org Sent: Friday, 20 June, 2008...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.