Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 30th, 2004, 09:23 AM
Authorized User
 
Join Date: May 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sockets and Mac OS Remote address

Hello,

I am writing a script that uses sockets to attach to a local computer and read a mysql dump file. Now I've successfully achieved this on a windows machine w/ no problem using this simple method:

#---- create connection to local machine -----------

$remote_address = getenv( "REMOTE_ADDR" );

$fp = fsockopen( $remote_address, 80);
if( $fp ){ echo "<br>CONNECTED"; }else{ echo "<br>NOT CONNECTED"; }

fputs($fp,"GET http://$remote_address/admin/upload_download/mysql_dumps/download_dump_file HTTP/1.0\n\n");

#---- now read the contents -------
while(!feof($fp))
{
$value = fgets($fp,1024);
}
#--------------------------------------

When I try this same concept on a Mac OS X w/ php/mysql running, it won't connect. Is there a problem w/ the port I'm connecting to?

Thanks for your concern,
Clem C.






Similar Threads
Thread Thread Starter Forum Replies Last Post
text editor for mac os 9.2 starfrog CSS Cascading Style Sheets 4 February 1st, 2018 06:47 AM
include problems on Mac OS clem_c_rock Beginning PHP 4 May 19th, 2004 11:04 AM
JRun4 for Mac OS + Mac OS X's Java 1.4.1 elbicho J2EE 0 June 27th, 2003 12:18 PM
Connect from Mac OS to Windows yarith Forum and Wrox.com Feedback 1 June 4th, 2003 08:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.