preg_match help

From: Date: Fri, 11 Apr 2003 08:35:45 +0000
Subject: preg_match help
Groups: php.general 
Request: Send a blank email to php-general+get-143462@lists.php.net to get a copy of this message
Hi I am trying to do the following: From the machine at work connected via ADSL running through a proxy, I'd like to "send" the gateway Linux machine IP to my webserver. I used to simply make the gateway access a hidden page on the webserver and then got the IP from the $_SERVER['REMOTE_ADDR'], but since the ISP forced the connection through a proxy, that doesn't work anymore. So I'm trying to do the following now: use a system() fnuction in a Php page on the gateway to run ifconfig. Then I want to retrieve the IP for the pppx interface and then use something like: lynx -dump myserver/page_to_capture_ip.php?ip=my_ip BUT, I'm battling to get the preg_match to work... Firstly, we have two dial-ups that are used regularly, ppp0 and ppp1 , so I can't do a system('ifconfig ppp0'); I must do an ifconfig and then just match 'ppp' and the first inet addr: after that will indicate the ISP assigned IP. Can someone help me with the correct expression, or maybe an easier way to do this? Thanks

« previous php.general (#143462) next »