Professional Web Applications Themes

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

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...

  1. #1

    Default 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
    miles111 Guest

  2. #2

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

    "miles111" <msu.edu> wrote in message
    news:google.com... 

    Why not use $_SERVER['SERVER_ADDR']?


    jn Guest

  3. #3

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

    Regarding this well-known quote, often attributed to miles111's famous "20
    Jan 2004 21:44:16 -0800" speech:
     

    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
    -- and.evil.ones.will.bow-down-to.us
    (put "Hey!" in the Subject line for priority processing!)
    -- http://www.pixelsaredead.com
    FLEB Guest

Similar Threads

  1. Execute PHP script automatically
    By TJ in forum PHP Development
    Replies: 4
    Last Post: December 14th, 01:43 PM
  2. Replies: 1
    Last Post: November 7th, 07:40 PM
  3. How to execute two sql statement in php script
    By xo55ox in forum PHP Development
    Replies: 0
    Last Post: November 4th, 04:17 AM
  4. VB-Script Execute function!
    By John Knoop in forum ASP.NET General
    Replies: 1
    Last Post: June 30th, 12:22 PM
  5. Execute shell script from a perl script
    By kderaedt in forum Perl / CGI
    Replies: 3
    Last Post: June 26th, 08:26 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139