[PHP] PHP HTTP Forwarding / Port Translation
Hi People ! (Diagram below in text) I'm interested in thoughts on how to effect the equivalent of Router Network Address Translation for a PHP page. The feature that are important are: o Can process forms o Can pass images o Can manage relative HREFs o Least invasive to the end user I've tried PHP Proxy and it works fine for basic pages but Scott thinks that it needs work to do forms. Along with this I'm just wondering if we can intercept the header at a low level and just simply rewrite the port -- or is this dumb thinking? I'd be very grateful for any thoughts or references. There's a piccie of what I have in mind below -- needs monospaced fonts before it will make any sense Thanks in advance Mike Please view in a fixed-width font such as Courier. ++ || | PHP Referrer | | (Proxy)| || 80| Passes distant | Firewall / | pages back to | +-+/ | requestor | |-| /|| |-| / | Passes form| |-| / | processes forward |-|/ ++ --Normal HTTP Ports / | |-| | |-| ++ Distant URL |-| | |-| |http://distant.com/Dir |-| | +---+ |-| | |Target Page| +-+ | |Images / forms | | | | +-3000-- | | | | | | | | | | +| | | / | | / +--+/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Relaying variables to distant site
Hi People! Can anyone help with this: Want to pick up variables passed from form in PHP page and pass to distant site. Can use long get, but would like to access ALL variables in the PHP page and pass them forward, without coding each individual one if possible Port 80 Port 3000 +-WebForm-+ +-PHP Page++-DistantSite-+ | | | || | | | | || | |Form Variables--- || | | | | || | | | | readfile() - | | | | | ^ | | | | | | | | | | | | | | | | | | | | | | | | +--- | +--- | | +--- | | / | | / | | | / | |/ | |/| | |/ +---+--- | +--- | | Need to on forward all variables passed from form -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Thanks !!!
Well thanks heaps everyone for some very good ideas ! I'm taking bits and pieces and coming together with a very fine understanding ! Much appreciated ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Relaying variables to distant site
[EMAIL PROTECTED] (Ernest E Vogelsinger) wrote in news:5.1.1.6.2.20021115015548.028ef858;mail.vogelsinger.at: [EMAIL PROTECTED] Ernest ! I just tried out your solution and it formats up the get string out of the box! We're really close because although the page still errors, if I print the composite URL out to the page, and paste it into the browser it works fine. If I run the script as below then it doesn't. This version uses the 'snoopy' php class, but I get the same result when I just use readfile() $post = null; foreach($_REQUEST as $var = $val) { if ($post) $post .= ''; $post .= htmlentities($var).'='.htmlentities($val); } //echo $post; $post=trim($post); $CompositeURL=http://202.20.65.2:3000/sportzHUB/Fletchers/BookingResults ?$post; echo $CompositeURL; // Pull in Snoopy include ProxyInc.html; $snoopy = new Snoopy; $snoopy-fetch($CompositeURL); print $snoopy-results; The error is the ioctl error that one gets if the page is not there. However the page is there -- I can prove it by pasting the printed URL into the browser. We're very nearly there !! Thanks very much for your help and all the others who have contributed !! Kind regards Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Relaying variables to distant site
Hi people ! Just a few words of thanks. This site is now up and going with the help of all of you Your guidance pointed us towards new learning and discovery. In the end we needed to use a number of the suggestions made -- the destination app is somewhat brittle! and the client firewall political !!! This is what we did: o Used readlines() to pull back the pages from the target app site on port 3000 and echo back on port 80 o Used redirected the form handler output back to php facade pages (pages involving a readlines() call) Finished 2 hours before target, with all of you helping. Thanks heaps. Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php