[PHP] problem with download script on safari and ie 7

2007-10-08 Thread Hulf
The problem I am getting is safari just downloads the .php file. IE7 corrupts the binary file. It opens fine on FF and IE6. Is this a headers problem? Thanks, R. ?php if(isset($_GET['id'])) { $id= $_GET['id']; $query = SELECT file_name, type, size, content FROM results WHERE id =

Re: [PHP] problem with download script on safari and ie 7

2007-10-08 Thread Robert Cummings
On Mon, 2007-10-08 at 14:59 +0100, Hulf wrote: The problem I am getting is safari just downloads the .php file. IE7 corrupts the binary file. It opens fine on FF and IE6. Is this a headers problem? What's the value of $type? Cheers, Rob. Thanks, R. ?php

[PHP] Re: problem with download script on safari and ie 7

2007-10-08 Thread Hulf
I changes it now so it is... header('Content-Type: application/octet-stream'); header(Content-Disposition: attachment; filename=$file_name); echo $content; exit; Which works on ie7 but safari still downloads the .php R. Hulf [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] The

Re: [PHP] Please recommend blog script

2007-10-08 Thread Richard S. Crawford
On Sunday 07 October 2007 03:41:40 Paul Scott wrote: On Sun, 2007-10-07 at 09:35 +0200, Niels wrote: Basically I want to integrate articles into existing pages, something like ?php blog::getArticlesHTML($rule); ? ?php blog::getUserCommentEditHTML($article); ? What you want is a blog that

Re: [PHP] Moodle: Add field to user listing

2007-10-08 Thread Richard S. Crawford
On Sunday 07 October 2007 08:10:16 RalfGesellensetter wrote: Dear list, is there any approach to patch any PHP files within moodle in order to gain further columns for the user list? Reference: http://docs.moodle.org/en/Browse_list_of_users Objective: I wish to add a (sortable) user field

Re: [PHP] problem with download script on safari and ie 7

2007-10-08 Thread Jim Lucas
Hulf wrote: header(Content-Length: .filesize($file)); Ok, for the third time, I am going to ask, why are you running filesize() on a variable that doesn't exist. You are pulling a variable out of the DB called $size. From the scripts that you posted a few weeks ago, the upload handling

RE: [PHP] Something you can do with AJAX + PHP as well

2007-10-08 Thread Jay Blanchard
[snip] I've made a nice video where you see ajax in combination with php. and it works really well although really is misspelled realy. Here is the video: http://magedb.mageprojects.com/videos/MageDB%202nd%20WIP%20demonstration %20with%20AJAX.mpeg Cool huh? [/snip] It is too bad that the video

Re: [PHP] Something you can do with AJAX + PHP as well

2007-10-08 Thread Jim Lucas
Mark wrote: Hey, I've made a nice video where you see ajax in combination with php. and it works really well although really is misspelled realy. Here is the video: http://magedb.mageprojects.com/videos/MageDB%202nd%20WIP%20demonstration%20with%20AJAX.mpeg Cool huh? Mark. Same as Jay here,

Re: [PHP] Something you can do with AJAX + PHP as well

2007-10-08 Thread Tom Friedhof
I had to download the video and open it up in VLC to play. I'm on Mac OS X, not sure what windows program will open it. Tom Friedhof On 10/8/07, Jim Lucas [EMAIL PROTECTED] wrote: Mark wrote: Hey, I've made a nice video where you see ajax in combination with php. and it works really

Re: [PHP] Something you can do with AJAX + PHP as well

2007-10-08 Thread Stut
Tom Friedhof wrote: I had to download the video and open it up in VLC to play. I'm on Mac OS X, not sure what windows program will open it. I'm thinking VLC might. Is it worth it? -Stut On 10/8/07, Jim Lucas [EMAIL PROTECTED] wrote: Mark wrote: Hey, I've made a nice video where you see

RE: [PHP] Something you can do with AJAX + PHP as well

2007-10-08 Thread Jay Blanchard
[snip] I saved it and it played in Winamp, but no audio [/snip] So, is it worth going to all of the trouble to see? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Something you can do with AJAX + PHP as well

2007-10-08 Thread Jim Lucas
Stut wrote: Tom Friedhof wrote: I had to download the video and open it up in VLC to play. I'm on Mac OS X, not sure what windows program will open it. I'm thinking VLC might. Is it worth it? -Stut On 10/8/07, Jim Lucas [EMAIL PROTECTED] wrote: Mark wrote: Hey, I've made a nice video

[PHP] Socket how to die if connection broken

2007-10-08 Thread chris
Hi I have a socket connection like so.. $sourceip = '84.234.18.16'; // ip you want to bind to $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); socket_bind($sock, $sourceip); socket_connect($sock, 'dac.nic.uk', 2043); if ($socket === false) { $errorcode = socket_last_error();

Re: [PHP] Socket how to die if connection broken

2007-10-08 Thread Stut
[EMAIL PROTECTED] wrote: Hi I have a socket connection like so.. $sourceip = '84.234.18.16'; // ip you want to bind to $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); socket_bind($sock, $sourceip); socket_connect($sock, 'dac.nic.uk', 2043); if ($socket === false) { $errorcode =

RE: [PHP] Socket how to die if connection broken

2007-10-08 Thread Instruct ICC
But if the socket connection gets broken it creates an error msg Warning: socket_write(): unable to write to socket [32]: Broken pipe in Warning: socket_write(): unable to write to socket [32]: Broken pipe in Warning: socket_write(): unable to write to socket [32]: Broken pipe in That

Re: [PHP] Socket how to die if connection broken

2007-10-08 Thread chris
Yes its a valid socket. The destination only allows a max of 2 two connections at any one time. The most likely reason for lossing a connection is I exceed the 2 connection rule and then it breaks and spills out that error. - Original Message - From: Instruct ICC [EMAIL PROTECTED]

[PHP] PHP5 under IIS6

2007-10-08 Thread Alberto García Gómez
Hi fellows: I'm trying to mount PHP5 ( the last stable version from php.net) under a IIS6 (win2k3 SP2), and when I run the .msi and it finish it said that is not possible the configure httpd.conf, which is a very big mistake 'cause I'm specify that I use IIS6. After that I try making a

Re: [PHP] Socket how to die if connection broken

2007-10-08 Thread chris
Hi Stut Ive tried your example but still cant get it to work. - Original Message - From: Stut [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Monday, October 08, 2007 5:26 PM Subject: Re: [PHP] Socket how to die if connection broken [EMAIL PROTECTED]

Re: [PHP] PHP5 under IIS6

2007-10-08 Thread Carlton Whitehead
Hi Alberto, Try using the php5isapi.dll instead of CGI. Make sure you have an entry for PHP5 in your Web Service Extensions list, and that it is marked as Allowed. Also, open the properties of your Web Sites folder in IIS Manager, go to the Home Directory Tab, click Configuration, and make

[PHP] Structure of maintainable websites

2007-10-08 Thread Matheus Degiovani
Hello, I'm currently maintaining a website (I developed myself) for the Intranet of a public school. Among the usual things (news, login system, online grading) the web interface is also used for controlling the server it resides on (which includes a few simple tasks such as verifying the

[PHP] triggering another php script whilst parent continues

2007-10-08 Thread chris
Hi how would I trigger another script whilst the parent continues without waiting for the second script to finish. ie in the example below if db empty, start second script but also continue closing connections and exiting. if(sqlite_num_rows($result) == 0) { // trigger another php script

RE: [PHP] Socket how to die if connection broken

2007-10-08 Thread Instruct ICC
Remove the @ and see if you get any useful message. From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: php-general@lists.php.net Date: Mon, 8 Oct 2007 19:04:45 +0100 Subject: Re: [PHP] Socket how to die if connection broken Hi Stut Ive tried your example but still cant get it to work.

[PHP] count vs mysql_num_rows

2007-10-08 Thread Kevin Murphy
I've got a little function that just checks to see if something is in a mysql db. There are several ways to do this and was curious as to the best way. The following are 2 (simplified) versions that work just fine. If these are the best ways, which of the following is better from a

Re: [PHP] Socket how to die if connection broken

2007-10-08 Thread chris
Hi I got this error Warning: socket_write() expects parameter 1 to be resource, null given in /path/script.php on line 34 Thanks - Original Message - From: Instruct ICC [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Monday, October 08, 2007 7:43 PM Subject: RE: [PHP] Socket

Re: [PHP] Socket how to die if connection broken

2007-10-08 Thread chris
Sorry if I change it to.. if (false === socket_write($sock, $buffer)) rather then $s if (false === socket_write($s, $buffer)) ie if (false === socket_write($sock, $buffer)) { echo connection broken; socket_close($sock); exit; } I dont get that error Warning: socket_write() expects

Re: [PHP] count vs mysql_num_rows

2007-10-08 Thread mike
On 10/8/07, Kevin Murphy [EMAIL PROTECTED] wrote: I've got a little function that just checks to see if something is in a mysql db. There are several ways to do this and was curious as to the best way. The following are 2 (simplified) versions that work just fine. If these are the best ways,

RE: [PHP] Socket how to die if connection broken

2007-10-08 Thread Instruct ICC
It looks like you didn't pass in a socket resource as the first parameter to socket_write. http://php.he.net/manual/en/function.socket-write.php From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; php-general@lists.php.net Date: Mon, 8 Oct 2007 19:51:15 +0100 Subject: Re: [PHP] Socket how to die

[PHP] CURL - how to get URL of returned page?

2007-10-08 Thread Marianne Mason
Is there a way to get the URL of the page that is returned when using Curl? If I look at CURLINFO_EFFECTIVE_URL value from the return of curlget_info(), all I see is the URL I requested, not the one that is returned. I am trying to write an URL checking script against a site that may return a

RE: [PHP] Socket how to die if connection broken

2007-10-08 Thread Instruct ICC
I dont get that error Warning: socket_write() expects parameter 1 to be resource, null given in /path/script.php on line 34 but just the original error msg Warning: socket_write(): unable to write to socket [32]: Broken pipe in Multiple times still? Or just the one time? Use

RE: [PHP] Something you can do with AJAX + PHP as well

2007-10-08 Thread tedd
At 9:53 AM -0500 10/8/07, Jay Blanchard wrote: [snip] I've made a nice video where you see ajax in combination with php. and it works really well although really is misspelled realy. Here is the video: http://magedb.mageprojects.com/videos/MageDB%202nd%20WIP%20demonstration %20with%20AJAX.mpeg

Re: [PHP] count vs mysql_num_rows

2007-10-08 Thread Jim Lucas
Kevin Murphy wrote: I've got a little function that just checks to see if something is in a mysql db. There are several ways to do this and was curious as to the best way. The following are 2 (simplified) versions that work just fine. If these are the best ways, which of the following is

Re: [PHP] count vs mysql_num_rows

2007-10-08 Thread Kevin Murphy
Is this a joke? You are using a LIMIT 1, so your count is always going to be 1. No, its not a joke. The answer is not going to always 1, its going to be 1 (the value exists in the DB at least once) or 0 (the value doesn't exist in the DB), that's what I am trying to test for. I don't

RE: [PHP] count vs mysql_num_rows

2007-10-08 Thread Jay Blanchard
[snip] Is this a joke? You are using a LIMIT 1, so your count is always going to be 1. No, its not a joke. The answer is not going to always 1, its going to be 1 (the value exists in the DB at least once) or 0 (the value doesn't exist in the DB), that's what I am trying to test for. I

[PHP] PHP loop control

2007-10-08 Thread David Peters
I'm looking for some ideas on the best way to perform the following. 1. Give the user a webpage that allows him/her to start/stop a loop. 2. Open a socket to a device. 3. Issue commands to the device a read the results. 4. Process the results. 5. If the user selected 'Stop', exit the loop or

Re: [PHP] PHP loop control

2007-10-08 Thread Nathan Nobbe
On 10/8/07, David Peters [EMAIL PROTECTED] wrote: I'm looking for some ideas on the best way to perform the following. 1. Give the user a webpage that allows him/her to start/stop a loop. 2. Open a socket to a device. 3. Issue commands to the device a read the results. 4. Process the

Re: [PHP] PHP loop control

2007-10-08 Thread Nathan Nobbe
actually, now that i think about it, the real problem is how to keep the loop alive after the script terminates. hmm; that is a problem. you could have a cli script run in the background. the only way youll be able to get data to it from the scripts that send output to the browser is through

[PHP] php5 - possible bug discovered

2007-10-08 Thread David Restall - System Administrator
Hi, I think I have discovered a bug in php5. If I haven't, I've discovered a bug in the documentation or a bug in my brain. php -v :- PHP 5.2.3 (cli) (built: Jun 26 2007 15:38:48) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies I've

[PHP] Re: Something you can do with AJAX + PHP as well

2007-10-08 Thread Colin Guthrie
Jay Blanchard wrote: [snip] I saved it and it played in Winamp, but no audio [/snip] So, is it worth going to all of the trouble to see? In a word, no. I watched it fine in Firefox on Linux with mplayer pluing. It just worked(tm) for me! But overall I have to say I was somewhat

Re: [PHP] php5 - possible bug discovered

2007-10-08 Thread Robert Cummings
In PHP5 objects are no longer copied when assigned. Instead the object's handle is assigned (similar to a reference but not quite). So the behaviour is as expected. Cheers, Rob. On Mon, 2007-10-08 at 21:42 +0100, David Restall - System Administrator wrote: Hi, I think I have discovered a

Re: [PHP] php5 - possible bug discovered

2007-10-08 Thread Stut
David Restall - System Administrator wrote: I think I have discovered a bug in php5. If I haven't, I've discovered a bug in the documentation or a bug in my brain. Start here: http://php.net/language.oop5.cloning -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/)

[PHP] How to format CLI tabular data?

2007-10-08 Thread Daevid Vincent
I write many CLI scripts in PHP to clean up DB records, etc via crontab scripts. Often though, I implement command line switches to 'debug' or see various data as a precaution before actually purging. Perl has some neat tools built in to format tabular data:

Re: [PHP] count vs mysql_num_rows

2007-10-08 Thread tedd
At 12:47 PM -0700 10/8/07, Kevin Murphy wrote: Is this a joke? You are using a LIMIT 1, so your count is always going to be 1. No, its not a joke. The answer is not going to always 1, its going to be 1 (the value exists in the DB at least once) or 0 (the value doesn't exist in the DB),

Re: [PHP] MySQL and SESSIONs

2007-10-08 Thread Philip Thompson
On 10/5/07, Stut [EMAIL PROTECTED] wrote: Vo, Lance wrote: What's good for multiple webservers? thanks * DO NOT USE PERSISTANT CONNECTIONS * Minimise the amount of time you keep a database connection open during a request. Good logic/presentation separation helps a lot here. * Cache the

Re: [PHP] Sending lots of emails - 2 choices - choose the best one

2007-10-08 Thread Philip Thompson
On 10/7/07, Stut [EMAIL PROTECTED] wrote: Martin Zvarík wrote: Hello-- I want to send email to 100+ recipients. Two choices I thought of: 1) once call mail() and use BCC, but the negative of this method is that every recipient in BCC has header To same (so I used to put my email

Re: [PHP] MySQL and SESSIONs

2007-10-08 Thread mike
On 10/8/07, Philip Thompson [EMAIL PROTECTED] wrote: Hi. This may not be best practice, but I think it's great to use - especially since I can use multiple functions with the same database connection w/o having to send the db link/resource. Store the connection in the GLOBALS variable - this

Re: [PHP] How to format CLI tabular data?

2007-10-08 Thread Robert Cummings
On Mon, 2007-10-08 at 15:59 -0700, Daevid Vincent wrote: I write many CLI scripts in PHP to clean up DB records, etc via crontab scripts. Often though, I implement command line switches to 'debug' or see various data as a precaution before actually purging. Perl has some neat tools built in

Re: [PHP] How to format CLI tabular data?

2007-10-08 Thread Larry Garfield
Look into sprintf(). I believe it has whitespace formatting codes that are wonderfully suited to this case. (They're derived from C, where the printf() routine is used quite frequently for that sort of screen output.) On Monday 08 October 2007, Robert Cummings wrote: On Mon, 2007-10-08 at