Re: [PHP] Reading files in PHP 5.3.0
At 12:32 AM -0400 9/13/09, Paul M Foster wrote: On Sat, Sep 12, 2009 at 10:22:10AM -0400, tedd wrote: At 6:02 PM -0400 9/11/09, Paul M Foster wrote: I typically use us2.php.net, which is hosted by Hurricane Electric. Paul Paul: I wouldn't use Hurricane Electric if their accounts were provided for free! The following is an experience I had with Hurricane Electric and support for my opinion as to their service. You see, many years ago Hurricane Electric hosted (IMO with complicity) a porn site that sent out over 2000 porn spams to AOL using MY email address as the person to contact. That incident caused me a great deal of trouble. In an attempt to understand and resolve the problem, I sent several emails to Hurricane Electric; I called them numerous times via telephone; and I even sent them letters via the US mail. But unfortunately they refused to answer ANY of my correspondence. Their lack of communication provided support for my opinion of their complicity with what had happened. A few years back they contacted me (again more spam) soliciting my interest in hosting with them. Normally, I would have just reported such spam to spamcop, but because of the incident I replied and told them what had happened. Later I was contacted by one of their technicians who looked thorough their records and confirmed/admitted the incident. However, he told me that they could not be held responsible for they clients they host. Furthermore, they have no intention of screening their clients. He said that they will provide hosting to whomever they want, including porn and spam sites. If their clients do anything wrong per their standards, then they will deal with it internally. Otherwise they don't care about any harm done to anyone by them hosting such sites. In short, they want the money but not the responsibility. Now, maybe Hurricane Electric has changed its ways, but they can't change their past. In my opinion, there are more than enough hosting companies who care about the damage they might cause and take steps to reduce the about spam and porn on the net. My advice, seek hosts other than Hurricane Electric. I don't know much about HE, other than the fact that they run ads in Linux Journal. But they're a real hosting company, like Rackspace or 1and1. Yahoo (who hosts www.php.net) isn't a company I think of as a hosting company. And they're an internet behemoth, like Godaddy or Microsoft. So I'd personally steer away from them. Just my bias. It sounds like HE's real problem is their TOS. I've hosted with a lot of companies who will drop accounts where they find porn, spam and warez; it's part of their TOS. The other problem I can see is that they are apparently unwilling to even mediate a problem between two of their accounts. We just host 'em. Other than that, we don't care. Typical. I expect the porn company paid them a *lot* more money than you did, so they simply looked the other way. A shame. The lesson, I suppose, is to look at the terms of service before you sign up with a hosting company. You may still end up being a victim, but at least you know what you're getting yourself into. If they don't specifically disavow porn, spam and warez, then they allow (and in effect, condone) it. Paul Paul: Good advice, but you assumed that I was one of their clients -- I wasn't. I was just an innocent bystander who found his email address being used as a return address for porn spam. It wasn't until after I started receiving hate email that I discovered who/what Hurricane Electric was. Imagine that suddenly out of the blue you started receiving hate mail from hundreds of AOL users telling you what a low-life you are because you sent porn to their children -- what would you do? I imagine you would: a) find out who was behind it; b) contact them and ask for an explanation; c) and try to restore your good name. One might think that suing them would be a good idea, but the last suit I was in cost me over $20k and I won! I didn't have that spare change laying around at the time to go after a company in another state. I just wanted an explanation, but Hurricane Electric wouldn't do anything. In my opinion, they are an example of what a hosting company should not be. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading files in PHP 5.3.0
At 6:02 PM -0400 9/11/09, Paul M Foster wrote: I typically use us2.php.net, which is hosted by Hurricane Electric. Paul Paul: I wouldn't use Hurricane Electric if their accounts were provided for free! The following is an experience I had with Hurricane Electric and support for my opinion as to their service. You see, many years ago Hurricane Electric hosted (IMO with complicity) a porn site that sent out over 2000 porn spams to AOL using MY email address as the person to contact. That incident caused me a great deal of trouble. In an attempt to understand and resolve the problem, I sent several emails to Hurricane Electric; I called them numerous times via telephone; and I even sent them letters via the US mail. But unfortunately they refused to answer ANY of my correspondence. Their lack of communication provided support for my opinion of their complicity with what had happened. A few years back they contacted me (again more spam) soliciting my interest in hosting with them. Normally, I would have just reported such spam to spamcop, but because of the incident I replied and told them what had happened. Later I was contacted by one of their technicians who looked thorough their records and confirmed/admitted the incident. However, he told me that they could not be held responsible for they clients they host. Furthermore, they have no intention of screening their clients. He said that they will provide hosting to whomever they want, including porn and spam sites. If their clients do anything wrong per their standards, then they will deal with it internally. Otherwise they don't care about any harm done to anyone by them hosting such sites. In short, they want the money but not the responsibility. Now, maybe Hurricane Electric has changed its ways, but they can't change their past. In my opinion, there are more than enough hosting companies who care about the damage they might cause and take steps to reduce the about spam and porn on the net. My advice, seek hosts other than Hurricane Electric. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading files in PHP 5.3.0
On Sat, Sep 12, 2009 at 10:22:10AM -0400, tedd wrote: At 6:02 PM -0400 9/11/09, Paul M Foster wrote: I typically use us2.php.net, which is hosted by Hurricane Electric. Paul Paul: I wouldn't use Hurricane Electric if their accounts were provided for free! The following is an experience I had with Hurricane Electric and support for my opinion as to their service. You see, many years ago Hurricane Electric hosted (IMO with complicity) a porn site that sent out over 2000 porn spams to AOL using MY email address as the person to contact. That incident caused me a great deal of trouble. In an attempt to understand and resolve the problem, I sent several emails to Hurricane Electric; I called them numerous times via telephone; and I even sent them letters via the US mail. But unfortunately they refused to answer ANY of my correspondence. Their lack of communication provided support for my opinion of their complicity with what had happened. A few years back they contacted me (again more spam) soliciting my interest in hosting with them. Normally, I would have just reported such spam to spamcop, but because of the incident I replied and told them what had happened. Later I was contacted by one of their technicians who looked thorough their records and confirmed/admitted the incident. However, he told me that they could not be held responsible for they clients they host. Furthermore, they have no intention of screening their clients. He said that they will provide hosting to whomever they want, including porn and spam sites. If their clients do anything wrong per their standards, then they will deal with it internally. Otherwise they don't care about any harm done to anyone by them hosting such sites. In short, they want the money but not the responsibility. Now, maybe Hurricane Electric has changed its ways, but they can't change their past. In my opinion, there are more than enough hosting companies who care about the damage they might cause and take steps to reduce the about spam and porn on the net. My advice, seek hosts other than Hurricane Electric. I don't know much about HE, other than the fact that they run ads in Linux Journal. But they're a real hosting company, like Rackspace or 1and1. Yahoo (who hosts www.php.net) isn't a company I think of as a hosting company. And they're an internet behemoth, like Godaddy or Microsoft. So I'd personally steer away from them. Just my bias. It sounds like HE's real problem is their TOS. I've hosted with a lot of companies who will drop accounts where they find porn, spam and warez; it's part of their TOS. The other problem I can see is that they are apparently unwilling to even mediate a problem between two of their accounts. We just host 'em. Other than that, we don't care. Typical. I expect the porn company paid them a *lot* more money than you did, so they simply looked the other way. A shame. The lesson, I suppose, is to look at the terms of service before you sign up with a hosting company. You may still end up being a victim, but at least you know what you're getting yourself into. If they don't specifically disavow porn, spam and warez, then they allow (and in effect, condone) it. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading files in PHP 5.3.0
At 5:06 PM -0700 9/10/09, Tommy Pham wrote: So did anything change in PHP5.3.0 that would preclude the code below from working? Am I going crazy? Or did Apple f...@# something up in this release? Thanks, Steve BEGIN CODE -snip- Does anyone else see every line above ending with a square? If so, what causes that. I only see them from Tommy post. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading files in PHP 5.3.0
On Fri, 2009-09-11 at 08:04 -0400, tedd wrote: At 5:06 PM -0700 9/10/09, Tommy Pham wrote: So did anything change in PHP5.3.0 that would preclude the code below from working? Am I going crazy? Or did Apple f...@# something up in this release? Thanks, Steve BEGIN CODE -snip- Does anyone else see every line above ending with a square? If so, what causes that. I only see them from Tommy post. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com No, but his post inside of yours is looking messed up a bit. Maybe he's not sending the posts as plain text or maybe it's something peculiar between Gmail and Yahoo? Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading files in PHP 5.3.0
At 1:15 PM +0100 9/11/09, Ashley Sheridan wrote: On Fri, 2009-09-11 at 08:04 -0400, tedd wrote: At 5:06 PM -0700 9/10/09, Tommy Pham wrote: So did anything change in PHP5.3.0 that would preclude the code below from working? Am I going crazy? Or did Apple f...@# something up in this release? Thanks, Steve BEGIN CODE -snip- Does anyone else see every line above ending with a square? If so, what causes that. I only see them from Tommy post. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com No, but his post inside of yours is looking messed up a bit. Maybe he's not sending the posts as plain text or maybe it's something peculiar between Gmail and Yahoo? Thanks, Ash Ash: Yeah, what I sent out wasn't organized the way you reported. I suspect that it's one of those end of line problems regarding some combination of LF, CR, and/or NL characters. http://en.wikipedia.org/wiki/Newline Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading files in PHP 5.3.0
--- On Fri, 9/11/09, Ashley Sheridan a...@ashleysheridan.co.uk wrote: From: Ashley Sheridan a...@ashleysheridan.co.uk Subject: Re: [PHP] Reading files in PHP 5.3.0 To: tedd tedd.sperl...@gmail.com Cc: Tommy Pham tommy...@yahoo.com, php-general@lists.php.net Date: Friday, September 11, 2009, 7:15 AM On Fri, 2009-09-11 at 08:04 -0400, tedd wrote: At 5:06 PM -0700 9/10/09, Tommy Pham wrote: So did anything change in PHP5.3.0 that would preclude the code below from working? Am I going crazy? Or did Apple f...@# something up in this release? Thanks, Steve BEGIN CODE -snip- Does anyone else see every line above ending with a square? If so, what causes that. I only see them from Tommy post. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com No, but his post inside of yours is looking messed up a bit. Maybe he's not sending the posts as plain text or maybe it's something peculiar between Gmail and Yahoo? Thanks, Ash http://www.ashleysheridan.co.uk I just checked my 'Mail Options' again. It's always been 'compose as text'. But I can't guaranteed that Yahoo actually does it. Been having problems with Yahoo lately (both mail and Yahoo hosting of www.php.net). Maybe I should switch to gmail... Thanks, Tommy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading files in PHP 5.3.0
On Fri, Sep 11, 2009 at 05:48:42AM -0700, Tommy Pham wrote: I just checked my 'Mail Options' again. It's always been 'compose as text'. But I can't guaranteed that Yahoo actually does it. Been having problems with Yahoo lately (both mail and Yahoo hosting of www.php.net). Maybe I should switch to gmail... I think I'm reading this wrong. Are you saying that php.net is hosted with *Yahoo*? WTF? Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading files in PHP 5.3.0
On Fri, Sep 11, 2009 at 8:15 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Fri, 2009-09-11 at 08:04 -0400, tedd wrote: At 5:06 PM -0700 9/10/09, Tommy Pham wrote: So did anything change in PHP5.3.0 that would preclude the code below from working? Am I going crazy? Or did Apple f...@# something up in this release? Thanks, Steve BEGIN CODE -snip- Does anyone else see every line above ending with a square? If so, what causes that. I only see them from Tommy post. Cheers, tedd No, but his post inside of yours is looking messed up a bit. Maybe he's not sending the posts as plain text or maybe it's something peculiar between Gmail and Yahoo? Thanks, Ash http://www.ashleysheridan.co.uk It looks fine to me using Gmail. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading files in PHP 5.3.0
function parseResponseHeaders($header_file) { $http_found = $error_found = false; $http_reponse = $error_message = NULL; $response = array(); $response['ResponseCode'] = NULL; $response['ErrorMessage'] = NULL; if (!is_file($header_file) || !is_readable($header_file)) { return $response; } $fin = fopen($header_file, 'r'); while ($line = fgets($fin)) { var_dump($line); What does var_dump($line); tell you? Nothing, not even an empty variable. Which is why I think something is completely screwed up here. BTW, squares at the end of lines are your platform not interpreting EOL characters correctly from another platform. Generally, its the sending client thats not being friendly, not the receiving client. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading files in PHP 5.3.0
--- On Fri, 9/11/09, Paul M Foster pa...@quillandmouse.com wrote: From: Paul M Foster pa...@quillandmouse.com Subject: Re: [PHP] Reading files in PHP 5.3.0 To: php-general@lists.php.net Date: Friday, September 11, 2009, 8:57 AM On Fri, Sep 11, 2009 at 05:48:42AM -0700, Tommy Pham wrote: I just checked my 'Mail Options' again. It's always been 'compose as text'. But I can't guaranteed that Yahoo actually does it. Been having problems with Yahoo lately (both mail and Yahoo hosting of www.php.net). Maybe I should switch to gmail... I think I'm reading this wrong. Are you saying that php.net is hosted with *Yahoo*? WTF? Paul go to www.php.net. scroll all way down to the bottom. This mirror generously provided by: Yahoo! Inc. Last updated: Fri Sep 11 14:51:27 2009 UTC -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading files in PHP 5.3.0
On Fri, Sep 11, 2009 at 08:38:13AM -0700, Tommy Pham wrote: --- On Fri, 9/11/09, Paul M Foster pa...@quillandmouse.com wrote: From: Paul M Foster pa...@quillandmouse.com Subject: Re: [PHP] Reading files in PHP 5.3.0 To: php-general@lists.php.net Date: Friday, September 11, 2009, 8:57 AM On Fri, Sep 11, 2009 at 05:48:42AM -0700, Tommy Pham wrote: I just checked my 'Mail Options' again. It's always been 'compose as text'. But I can't guaranteed that Yahoo actually does it. Been having problems with Yahoo lately (both mail and Yahoo hosting of www.php.net). Maybe I should switch to gmail... I think I'm reading this wrong. Are you saying that php.net is hosted with *Yahoo*? WTF? Paul go to www.php.net. scroll all way down to the bottom. This mirror generously provided by: Yahoo! Inc. Last updated: Fri Sep 11 14:51:27 2009 UTC I typically use us2.php.net, which is hosted by Hurricane Electric. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Reading files in PHP 5.3.0
I've been beating my head against a wall all day and can't figure this one out. The code below worked perfectly in PHP5.2.4. However, I recently upgraded to PHP5.3.0 and this code no longer works. The function below accepts the path to a text file containing headers from a cUrl session (example attached). Basically this function opens to log file, looks for certain headers and captures some information from that line. When called on the attached file (or any log file for that matter), the following is output: array(2) { [ResponseCode]= NULL [ErrorMessage]= NULL } Which means that nothing is getting read from the file. Now, I'm going to qualify all of this by saying I'm running OSX Snow Leopard, so I'm fully prepared to believe that Apple fucked something up in it, as they have done to third party packages on other occasions in the past. Well... to be fair, they don't usually fuck up third party packages, rather they introduce enhancements to the OS that prevents certain packages from working correctly and could care less that they broke it. So did anything change in PHP5.3.0 that would preclude the code below from working? Am I going crazy? Or did Apple f...@# something up in this release? Thanks, Steve BEGIN CODE == function parseResponseHeaders($header_file) { $http_found = $error_found = false; $http_reponse = $error_message = NULL; $response = array(); $response['ResponseCode'] = NULL; $response['ErrorMessage'] = NULL; if (!is_file($header_file) || !is_readable($header_file)) { return $response; } $fin = fopen($header_file, 'r'); while ($line = fgets($fin)) { var_dump($line); if (substr($line, 0, 4) == 'HTTP') { $line_explode = explode(' ', $line); $response['ResponseCode'] = preg_replace('/\D/', '', $line_explode[1]); if ($response['ResponseCode'] != 100) { $http_found = true; } } if (substr($line, 0, 16) == 'X-Error-Message:') { $line_explode = explode(' ', $line); array_shift($line_explode); $response['ErrorMessage'] = join(' ', $line_explode); $error_found = true; } } fclose($fin); var_dump($response); return $response; } HTTP/1.1 100 Continue HTTP/1.1 200 OK Date: Thu, 10 Sep 2009 20:57:43 GMT Server: Apache/2.2.6 (Unix) mod_ssl/2.2.6 PHP/5.2.8 X-Powered-By: PHP/5.2.8 Vary: Accept-Encoding Content-Length: 1630 Content-Type: text/html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading files in PHP 5.3.0
--- On Thu, 9/10/09, Steve Brown sbrow...@gmail.com wrote: From: Steve Brown sbrow...@gmail.com Subject: [PHP] Reading files in PHP 5.3.0 To: php-general@lists.php.net Date: Thursday, September 10, 2009, 4:13 PM I've been beating my head against a wall all day and can't figure this one out. The code below worked perfectly in PHP5.2.4. However, I recently upgraded to PHP5.3.0 and this code no longer works. The function below accepts the path to a text file containing headers from a cUrl session (example attached). Basically this function opens to log file, looks for certain headers and captures some information from that line. When called on the attached file (or any log file for that matter), the following is output: array(2) { [ResponseCode]= NULL [ErrorMessage]= NULL } Which means that nothing is getting read from the file. Now, I'm going to qualify all of this by saying I'm running OSX Snow Leopard, so I'm fully prepared to believe that Apple fucked something up in it, as they have done to third party packages on other occasions in the past. Well... to be fair, they don't usually fuck up third party packages, rather they introduce enhancements to the OS that prevents certain packages from working correctly and could care less that they broke it. So did anything change in PHP5.3.0 that would preclude the code below from working? Am I going crazy? Or did Apple f...@# something up in this release? Thanks, Steve BEGIN CODE == function parseResponseHeaders($header_file) { $http_found = $error_found = false; $http_reponse = $error_message = NULL; $response = array(); $response['ResponseCode'] = NULL; $response['ErrorMessage'] = NULL; if (!is_file($header_file) || !is_readable($header_file)) { return $response; } $fin = fopen($header_file, 'r'); while ($line = fgets($fin)) { var_dump($line); What does var_dump($line); tell you? Regards, Tommy if (substr($line, 0, 4) == 'HTTP') { $line_explode = explode(' ', $line); $response['ResponseCode'] = preg_replace('/\D/', '', $line_explode[1]); if ($response['ResponseCode'] != 100) { $http_found = true; } } if (substr($line, 0, 16) == 'X-Error-Message:') { $line_explode = explode(' ', $line); array_shift($line_explode); $response['ErrorMessage'] = join(' ', $line_explode); $error_found = true; } } fclose($fin); var_dump($response); return $response; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Reading files from Win 2003 Server
Hi, I have a script located on an Ubuntu box and I am trying to read files located on a Win 2003 Server. I have 'mounted', if that's the right term to use, a connection from Ubuntu to Server 2003 and can read the files fine via the desktop, etc. If the Win Server name is say 'WinServer' and the shared directory I want to read from on it is called say 'SharedDirectory' and the user name is 'User', I notice the reference to that folder on the Ubuntu desktop is as follows: smb://[EMAIL PROTECTED]/SharedDirectory But I am at a loss as to how I should refer to the path for this connection within my PHP script. Any help would be most appreciated. If it's any additional help, I would be using the connection to read files only, and not add/edit/delete them. Thanks Alexis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reading files through ssl protocal
Hi Trying to read a file via ssl. It seems to read the file ok. The content is correct. But I get this when using the https protocol. Warning: fgets(): SSL: fatal protocol error or Warning: fread(): SSL: fatal protocol error When I use regular http, I do not get the warning. Anyone observed this behaviour and fixed it? Thanks. -- Chris Edwards Web Application Developer Outer Banks Internet, Inc. 252-441-6698 [EMAIL PROTECTED] http://www.OuterBanksInternet.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Reading files question
I have a file that has the 130 lines which follows the example below. Option Value=146Barnaby What I need to do is read this file, remove one line, add another line, and then resave it. I have tried the different fget functions etc. to read the file, but all I get is the name part and nothing else. I am assuming it has to do with the ,, or = in the line, so how would I read in the entire line. TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading files question
Beauford.2005 [EMAIL PROTECTED] wrote: I have a file that has the 130 lines which follows the example below. Option Value=146Barnaby What I need to do is read this file, remove one line, add another line, and then resave it. I have tried the different fget functions etc. to read the file, but all I get is the name part and nothing else. I am assuming it has to do with the ,, or = in the line, so how would I read in the entire line. hmm, are you printing the results of fgets to the browser? If you are check the source, the browswer wont display the stuff between or use htmlentities on the string before printing it. Curt -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Reading files over SSL using fopen or fsockopen
Hi, I am trying to read the contents of a file using fopen or fsockopen over a secure SSL connection. I have a script working fine over a non-SSL connection, but it just won't work over SSL. I have tried using fsockopen with the port set to 443, (I have checked this and the file I am trying to read is on a server where the secure port is set to 443). I am using PHP 4.3.0 on a Linux machine with OpenSSL installed. Has anyone got any ideas how I might be able to get this working? If it's not possible to read files over SSL using PHP, I will need to come up with another solution pretty quickly, so any help is much appreciated. Thanks, Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading files over SSL using fopen or fsockopen
At 14:35 11.03.2003, Dan Mullen said: [snip] I am trying to read the contents of a file using fopen or fsockopen over a secure SSL connection. I have a script working fine over a non-SSL connection, but it just won't work over SSL. I have tried using fsockopen with the port set to 443, (I have checked this and the file I am trying to read is on a server where the secure port is set to 443). I am using PHP 4.3.0 on a Linux machine with OpenSSL installed. Has anyone got any ideas how I might be able to get this working? If it's not possible to read files over SSL using PHP, I will need to come up with another solution pretty quickly, so any help is much appreciated. [snip] You can't simply do a read on port 443, you need to make an SSL connection - there's a lot more to it that just changing ports. Have a look at cURL - this will get you the task done, without effort. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Reading files
Greetings... When the following runs.. === ?php $handle = fopen (fopen.txt, r); $date = date(l dS of F Y h:i:s: A); while (!feof ($handle)) ; { $buffer = fgets($handle, 4096); echo 'textarea'. $buffer. '/textarea'; } fclose($handle); ? .it gives out Fatal error: Maximum execution time of 30 seconds exceeded in /home/data/ClientWebs/chrisplay/Things/fopen.php on line 16 I used the example from php.net/fget() and have tried a few changes based on other stuff I read, but to no avail. Line 16 is =while (!feof ($handle)) ; Suggestions ? -- Chris Blake Office : (011) 782-0840 Cell : 083 985 0379 It is reported that somewhere in the world, every 15 seconds, a woman gives birth to a child. She must be found and stopped. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading files
Hi Chris, You should delete the ; after the while statement because it causes an infinite loop. - Original Message - From: Chris Blake [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 27, 2003 16:29 Subject: [PHP] Reading files Greetings... When the following runs.. === ?php $handle = fopen (fopen.txt, r); $date = date(l dS of F Y h:i:s: A); while (!feof ($handle)) ; { $buffer = fgets($handle, 4096); echo 'textarea'. $buffer. '/textarea'; } fclose($handle); ? .it gives out Fatal error: Maximum execution time of 30 seconds exceeded in /home/data/ClientWebs/chrisplay/Things/fopen.php on line 16 I used the example from php.net/fget() and have tried a few changes based on other stuff I read, but to no avail. Line 16 is =while (!feof ($handle)) ; Suggestions ? -- Chris Blake Office : (011) 782-0840 Cell : 083 985 0379 It is reported that somewhere in the world, every 15 seconds, a woman gives birth to a child. She must be found and stopped. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading files
while (!feof ($handle)) ; Take that semi-colon away. You're running this loop continously. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Reading files from a directory
I have problem with reading files from directory. This is the code: ? $Handle = opendir('/www/publico2/docs/map'); while ($file = readdir($Handle)) { print $filebr\n; }; ? That is ALL code on a script file. These are the file in directory: . .. array_maker.php4 map.php4 renamer.php4 border_bl.gif border_bm.gif border_br.gif border_ml.gif border_mr.gif border_ul.gif border_um.gif border_ur.gif grid.gif map_config.php4 map_dot.php4 handle.php4 map_dot.gif core md_998634933_071758800998634933.gif md_998634937_060465500998634937.gif md_998634941_025996400998634941.gif If I have more than five of the files named like md_123456789_12345.gif page returns Internal Server Error (500). What can cause this? Is there a solution? Niklas