php-general Digest 21 Nov 2007 12:39:37 -0000 Issue 5140
php-general Digest 21 Nov 2007 12:39:37 - Issue 5140 Topics (messages 264887 through 264901): Should I put pictures into a database? 264887 by: Ronald Wiplinger 264888 by: Bastien Koert 264893 by: Børge Holen 264894 by: Jonas Geiregat Basic question - PHP usage of SVG files 264889 by: Dave M G 264890 by: Casey Re: __sleep() strange behavior with file writting and SESSION using 264891 by: Julien Pauli 264892 by: chetan rane 264896 by: Zoltán Németh 264899 by: Jochem Maas Re: Basic question - PHP usage of SVG filesã[SOLVED] 264895 by: Dave M G Re: Sending Pictures to Cell Phones 264897 by: Jeffrey uploading files... necessary Ajax? 264898 by: pere roca 264900 by: Christian Hänsel PHP + Amazon to retrieve book data 264901 by: Scott Wilcox Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- I have an application, where I use pictures. The size of the picture is about 90kB and to speed up the preview, I made a thumbnail of each picture which is about 2.5 to 5kB. I use now a directory structure of ../$a/$b/$c/pictures I wonder if it would be good to put the thumbnails into the current table, in a different table or leave it like it is now. Same for the pictures. What is your opinion and why? bye Ronald ---End Message--- ---BeginMessage--- Well, this was just hashed out last week, again. Its a personal thing. I am against it, having seen the slowdown and database bloat caused when this is done. I prefer a pointer to the image to be stored in the table and use that. I have found that after about 12Gb of binary data gets into the table, it really starts to affect perfomance (in mysql). The arguments for storing the image: - automatically backed up with the db (you do back up, right?) - stored with the relevant backing data Against: - more complex to show image - db bloat (size of db balloons, may affect cost of storage) - performance slowdowns as image data grows regards, bastien Date: Wed, 21 Nov 2007 10:14:43 +0800 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] Should I put pictures into a database? I have an application, where I use pictures. The size of the picture is about 90kB and to speed up the preview, I made a thumbnail of each picture which is about 2.5 to 5kB. I use now a directory structure of ../$a/$b/$c/pictures I wonder if it would be good to put the thumbnails into the current table, in a different table or leave it like it is now. Same for the pictures. What is your opinion and why? bye Ronald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Send a smile, make someone laugh, have some fun! Start now! http://www.freemessengeremoticons.ca/?icid=EMENCA122---End Message--- ---BeginMessage--- On Wednesday 21 November 2007 03:14:43 Ronald Wiplinger wrote: I have an application, where I use pictures. The size of the picture is about 90kB and to speed up the preview, I made a thumbnail of each picture which is about 2.5 to 5kB. I use now a directory structure of ../$a/$b/$c/pictures I wonder if it would be good to put the thumbnails into the current table, in a different table or leave it like it is now. Same for the pictures. What is your opinion and why? Ouch this particular piece of topic is a all time champion of things to discuss... Richard Lynch is pretty good at beating that old horse ;D (you there?) I would say it's up to you and the project... I've made a couple of pedigrees and membership lists where I've chosen to put images in the database for the reason of simplicity. 10.000 small images really gets me depressed when viewed as files. _I_ feel that a list of ... lets say 250 employees is far more compact and corrrect in a blob; small program and everything piled in one place. The previous mailer talked about huge blob data, mine will never come close 12gb of blob data. I've made a couple of forums where multiple image uploading and expanding possibilities made it awkward to use blobs. As I said, if youre comfortable with using files in a blob rather than remote filesystem, and the project works OK with it, why not. On the other hand, none've my tables passed 1gb yet. bye Ronald -- --- Børge Holen http://www.arivene.net ---End Message--- ---BeginMessage--- Op 21-nov-07, om 03:45 heeft Bastien Koert het volgende geschreven: Well, this was just hashed out last week, again. Its a personal thing. I am against it, having seen the slowdown and database bloat caused when this is done. I prefer a pointer to the image to be
Re: [PHP] __sleep() strange behavior with file writting and SESSION using
Okay, I understand that, thanks all for your help. I'am used to always using an absolute path, I don't know why this time I didn't use one. By the way, that was interesting to understand the underground php behavior. 2007/11/21, Jochem Maas [EMAIL PROTECTED]: Andrés Robinet wrote: -Original Message- ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Just wanted to add, I found a log.txt at D:\xampp\apache which happens to be the root of the apache installation on my system... so, moral of the story, the current dir is not always the script's dir. dirname(__FILE__)./log.txt will do the trick. I was stumped when originally reading your question. I guess I glossed over the fact that you weren't using an absolute path for the log file. the problem makes sense - the CWD is the directory of the script that was called, but during the startup/shutdown phases of php there is no script, the CWD is then whatever the CWD is of the process that started php - apache in this case. additionally some code may change the CWD and there maybe countless of other factors that could effect it. I suggest always using absolute paths - of only to avoid little mind-benders like this. :-) Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] __sleep() strange behavior with file writting and SESSION using
Sorry Buddie But Session dose not serialize the Object Please Have a look at the Code Again I have tried it with PHP 5.2 IT dose not call __sleep function. only when you have serialize it calls it. On Nov 21, 2007 3:23 AM, Julien Pauli [EMAIL PROTECTED] wrote: Sorry but it goes throught __sleep() as session serializes objects before storing them Proof is that done! is echoed. Step by step debugging also prove that , the only thing is that file_put_contents, doesn't execute, but returns a value... 2007/11/20, chetan rane [EMAIL PROTECTED]: This aint a bug because __sleep is called only when you serialize an object and not when you assign it to a session Variable; On Nov 21, 2007 12:21 AM, Julien Pauli [EMAIL PROTECTED] wrote: Consider that very simple code, that runs on PHP 5.2.5 onto a Windows machine : ?php class a { public $b; public function __sleep() { file_put_contents(log.txt,ok . PHP_EOL,FILE_APPEND); echo done!; return array(); } } $a = new a; serialize($a); ? No problem here, log.txt is writtable, when it passes on the serialize() instruction, it goes to __sleep and works well. OK\r\n is appended to the log file , and done! is displayed. Now consider this : ?php session_start(); class a { public $b; public function __sleep() { file_put_contents(log.txt,ok . PHP_EOL,FILE_APPEND); echo done!; return array(); } } $a = new a; $_SESSION['obj'] = $a; ? In this case, when the object is going in the session, it naturally passes throught __sleep(). The problem is that file_put_contents() doesn't work - the file is not appended OK\r\n as it should be. done! is displayed , and if you look at the return value of file_put_contents ( number of bytes that have been written ) : it's all right ! It simply doesn not write to the file. Anyone has an idea ? Is this a bug ? Thx :) -- Have A plesant Day Chetan. D. Rane Location: India Contact: +91-9844922489 otherID: [EMAIL PROTECTED] [EMAIL PROTECTED] -- Have A plesant Day Chetan. D. Rane Location: India Contact: +91-9844922489 otherID: [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [PHP] Should I put pictures into a database?
On Wednesday 21 November 2007 03:14:43 Ronald Wiplinger wrote: I have an application, where I use pictures. The size of the picture is about 90kB and to speed up the preview, I made a thumbnail of each picture which is about 2.5 to 5kB. I use now a directory structure of ../$a/$b/$c/pictures I wonder if it would be good to put the thumbnails into the current table, in a different table or leave it like it is now. Same for the pictures. What is your opinion and why? Ouch this particular piece of topic is a all time champion of things to discuss... Richard Lynch is pretty good at beating that old horse ;D (you there?) I would say it's up to you and the project... I've made a couple of pedigrees and membership lists where I've chosen to put images in the database for the reason of simplicity. 10.000 small images really gets me depressed when viewed as files. _I_ feel that a list of ... lets say 250 employees is far more compact and corrrect in a blob; small program and everything piled in one place. The previous mailer talked about huge blob data, mine will never come close 12gb of blob data. I've made a couple of forums where multiple image uploading and expanding possibilities made it awkward to use blobs. As I said, if youre comfortable with using files in a blob rather than remote filesystem, and the project works OK with it, why not. On the other hand, none've my tables passed 1gb yet. bye Ronald -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Should I put pictures into a database?
Op 21-nov-07, om 03:45 heeft Bastien Koert het volgende geschreven: Well, this was just hashed out last week, again. Its a personal thing. I am against it, having seen the slowdown and database bloat caused when this is done. I prefer a pointer to the image to be stored in the table and use that. I have found that after about 12Gb of binary data gets into the table, it really starts to affect perfomance (in mysql). Using a pointer just makes more sense to me. The arguments for storing the image: - automatically backed up with the db (you do back up, right?) - stored with the relevant backing data Against: - more complex to show image - db bloat (size of db balloons, may affect cost of storage) - performance slowdowns as image data grows regards, bastien Date: Wed, 21 Nov 2007 10:14:43 +0800 From: [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] Should I put pictures into a database? I have an application, where I use pictures. The size of the picture is about 90kB and to speed up the preview, I made a thumbnail of each picture which is about 2.5 to 5kB. I use now a directory structure of ../$a/$b/$c/ pictures I wonder if it would be good to put the thumbnails into the current table, in a different table or leave it like it is now. Same for the pictures. What is your opinion and why? bye Ronald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Send a smile, make someone laugh, have some fun! Start now! http://www.freemessengeremoticons.ca/?icid=EMENCA122 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Basic question - PHP usage of SVG files [SOLVED]
Casey, There is no SVG support in PHP, as far as I know. Thank you. That clears things up. I'll just go with PNGs then. -- Dave M G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] __sleep() strange behavior with file writting and SESSION using
2007. 11. 21, szerda keltezéssel 14.12-kor chetan rane ezt írta: Sorry Buddie But Session dose not serialize the Object Please Have a look at the Code Again I have tried it with PHP 5.2 IT dose not call __sleep function. only when you have serialize it calls it. AFAIK session does serialize the objects. and calls the __sleep method as well. http://hu.php.net/manual/en/language.oop.serialization.php greets Zoltán Németh On Nov 21, 2007 3:23 AM, Julien Pauli [EMAIL PROTECTED] wrote: Sorry but it goes throught __sleep() as session serializes objects before storing them Proof is that done! is echoed. Step by step debugging also prove that , the only thing is that file_put_contents, doesn't execute, but returns a value... 2007/11/20, chetan rane [EMAIL PROTECTED]: This aint a bug because __sleep is called only when you serialize an object and not when you assign it to a session Variable; On Nov 21, 2007 12:21 AM, Julien Pauli [EMAIL PROTECTED] wrote: Consider that very simple code, that runs on PHP 5.2.5 onto a Windows machine : ?php class a { public $b; public function __sleep() { file_put_contents(log.txt,ok . PHP_EOL,FILE_APPEND); echo done!; return array(); } } $a = new a; serialize($a); ? No problem here, log.txt is writtable, when it passes on the serialize() instruction, it goes to __sleep and works well. OK\r\n is appended to the log file , and done! is displayed. Now consider this : ?php session_start(); class a { public $b; public function __sleep() { file_put_contents(log.txt,ok . PHP_EOL,FILE_APPEND); echo done!; return array(); } } $a = new a; $_SESSION['obj'] = $a; ? In this case, when the object is going in the session, it naturally passes throught __sleep(). The problem is that file_put_contents() doesn't work - the file is not appended OK\r\n as it should be. done! is displayed , and if you look at the return value of file_put_contents ( number of bytes that have been written ) : it's all right ! It simply doesn not write to the file. Anyone has an idea ? Is this a bug ? Thx :) -- Have A plesant Day Chetan. D. Rane Location: India Contact: +91-9844922489 otherID: [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sending Pictures to Cell Phones
Maybe too late. Here are some simple starting points. If you want to send pictures as MMS messages, you will need to use an SMS gateway. How different the protocols are for SMS and MMS, I don't know. But I've used www.clickatel.com's SMS gateway happily. So, you might want to start there. They are responsive - so you could probably get advice. They even have some PHP scripts for interacting with their gateway. If you want to make pictures available as images on web enabled telephones, I suggest you download Opera web browser. It has a function that allows you to preview small screen pages, which can be useful for developing if you want to use this route. Good luck! Jeffrey [EMAIL PROTECTED] wrote: Hey list, I'm doing some RD for a project at my job and my boss wants the ability to send pictures to cell phones. I was wondering if anyone had any experience with this or could point me in the right direction to get started. Thanks, Jeremy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] uploading files... necessary Ajax?
Hi, a basic question: I want to send a CSV file and some other parameters. In my FORM I have method=POST input type=file and action=http://php;; It sends it to the php file but I don't want the php to be visualized (in fact it just works with the data and inserts in database). I want to keep the original HTML and the php working in the background. Is for that absolutely necessary Ajax? thanks, Pere -- View this message in context: http://www.nabble.com/uploading-files...-necessary-Ajax--tf4849678.html#a13875829 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] __sleep() strange behavior with file writting and SESSION using
chetan rane wrote: Sorry Buddie But Session dose not serialize the Object Please Have a look at the Code Again I have tried it with PHP 5.2 IT dose not call __sleep function. only when you have serialize it calls it. this is completely untrue. during the shutdown phase objects in the $_SESSION superglobal are serialized and __sleep() is called if defined. On Nov 21, 2007 3:23 AM, Julien Pauli [EMAIL PROTECTED] wrote: Sorry but it goes throught __sleep() as session serializes objects before storing them Proof is that done! is echoed. Step by step debugging also prove that , the only thing is that file_put_contents, doesn't execute, but returns a value... 2007/11/20, chetan rane [EMAIL PROTECTED]: This aint a bug because __sleep is called only when you serialize an object and not when you assign it to a session Variable; On Nov 21, 2007 12:21 AM, Julien Pauli [EMAIL PROTECTED] wrote: Consider that very simple code, that runs on PHP 5.2.5 onto a Windows machine : ?php class a { public $b; public function __sleep() { file_put_contents(log.txt,ok . PHP_EOL,FILE_APPEND); echo done!; return array(); } } $a = new a; serialize($a); ? No problem here, log.txt is writtable, when it passes on the serialize() instruction, it goes to __sleep and works well. OK\r\n is appended to the log file , and done! is displayed. Now consider this : ?php session_start(); class a { public $b; public function __sleep() { file_put_contents(log.txt,ok . PHP_EOL,FILE_APPEND); echo done!; return array(); } } $a = new a; $_SESSION['obj'] = $a; ? In this case, when the object is going in the session, it naturally passes throught __sleep(). The problem is that file_put_contents() doesn't work - the file is not appended OK\r\n as it should be. done! is displayed , and if you look at the return value of file_put_contents ( number of bytes that have been written ) : it's all right ! It simply doesn not write to the file. Anyone has an idea ? Is this a bug ? Thx :) -- Have A plesant Day Chetan. D. Rane Location: India Contact: +91-9844922489 otherID: [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading files... necessary Ajax?
pere roca [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] Hi, a basic question: I want to send a CSV file and some other parameters. In my FORM I have method=POST input type=file and action=http://php;; It sends it to the php file but I don't want the php to be visualized (in fact it just works with the data and inserts in database). I want to keep the original HTML and the php working in the background. Is for that absolutely necessary Ajax? thanks, Pere -- View this message in context: http://www.nabble.com/uploading-files...-necessary-Ajax--tf4849678.html#a13875829 Sent from the PHP - General mailing list archive at Nabble.com. Hi Why don'tr you upload the file and have a cronjob running in the background, executing the PHP file on command line? That way, the work will get done and the user won't see anything. Just an idea :o) Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP + Amazon to retrieve book data
Hey folks, Does anyone have any resources or links to resources concerning obtaining book data via Amazons web services? Any help/pointers appreciated. Scott. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading files... necessary Ajax?
pere roca wrote: Hi, a basic question: I want to send a CSV file and some other parameters. In my FORM I have method=POST input type=file and action=http://php;; It sends it to the php file but I don't want the php to be visualized (in fact it just works with the data and inserts in database). I want to keep the original HTML and the php working in the background. Is for that absolutely necessary Ajax? no. have a look at the various HTTP status codes you can return to the browser: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html one of the following should do it, although a little further discussion as to which is the best choice (and/or the correct choice) might be worthwhile: 204 No Content 202 Accepted one of the following probably will do it too, although I don't think that their use in the described context is as correct as 204 or 202. 304 Not Modified 201 Created thanks, Pere -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Basic question - PHP usage of SVG files [SOLVED]
On Wednesday 21 November 2007, Dave M G wrote: Casey, There is no SVG support in PHP, as far as I know. Thank you. That clears things up. I'll just go with PNGs then. I think you missed the point. SVG is just text. It's XML. You can manipulate it with SimpleXML or the DOM API functions just as you would any other XML file. It's been a while since I worked with SVG, but I believe you can resize an image just by changing an attribute or two. There's no need for SVG support per se, as SimpleXML provides all you need anyway. That's the advantage of XML. :-) -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it. -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading files... necessary Ajax?
On Wed, 21 Nov 2007 14:06:17 +0100, Jochem Maas [EMAIL PROTECTED] wrote: pere roca wrote: Hi, a basic question: I want to send a CSV file and some other parameters. In my FORM I have method=POST input type=file and action=http://php;; It sends it to the php file but I don't want the php to be visualized (in fact it just works with the data and inserts in database). I want to keep the original HTML and the php working in the background. Is for that absolutely necessary Ajax? no. have a look at the various HTTP status codes you can return to the browser: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html one of the following should do it, although a little further discussion as to which is the best choice (and/or the correct choice) might be worthwhile: 204 No Content 202 Accepted one of the following probably will do it too, although I don't think that their use in the described context is as correct as 204 or 202. 304 Not Modified 201 Created Jochem, Just out of interest! How would the upload be performed in the background by sending an HTTP status code? It would still require the page to reload. Wich will not keep the current HTML displayed in the browser. Seems to me Pere want's to do an upload without reloading the whole page. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] uploading files... necessary Ajax?
[snip] Seems to me Pere want's to do an upload without reloading the whole page. [/snip] The problem is that you cannot upload files using Ajax alone. But you can do it without a reload, requires an invisible IFRAME and a little technique. Search Google for several different articles on this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] uploading files... necessary Ajax?
On Wed, 21 Nov 2007 08:38:18 -0600, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] Seems to me Pere want's to do an upload without reloading the whole page. [/snip] The problem is that you cannot upload files using Ajax alone. But you can do it without a reload, requires an invisible IFRAME and a little technique. Search Google for several different articles on this. Indeed uploading with only Ajax is not possible. The already named iframe technique was the only thing i could think of. I was just curious if Jochem knew some other way of tackling this problem. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Concurrency in a multi-user environment
Hi, I'm been googling to see if I can find information on how programmers handle concurrency in a multi-user PHP/MySQL environment. Here's a snippet of my app. I have a form where users can maintain client information such as Name, Address, telephone, email, etc I've been wondering how to handle a situation where two users are editing the same record. One idea is to lock the record when User A enters but this may make it inaccessible for a long period if User A decided to get up and leave for a three hour lunch. Also, does locking a record prevent file locks (when new records need to be added)? Finally, locking a record means I have to convert from MyISAM to InnoDB but this is probably necessary for concurrency. Another idea is to use a semaphore where User A enters and retrieves a numeric field in the table. Upon leaving, the user locks and checks if the field is the same value. If yes, save, increment the numeric field and leave. If not, it indicates another user entered has edited, saved and left. I'm not crazy about this as it would mean User A could spend 15 minutes updating a record only to get a message that User B already edited it. Does anyone have any user friendly suggestions or can give me some URLs where I can read up on this? Thanks, Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] uploading files... necessary Ajax?
Thanks for the answer, you are right, Jay, I don't want nor reload the page nor a new .php page (the one that works with the data I post) appears. It's difficult to believe that a so dummy thing is not working in php (without Ajax)! I found this URL explaining ajax/php for uploading files. http://www.anyexample.com/programming/php/php_ajax_example__asynchronous_file_upload.xml Pere 2007/11/21, Jay Blanchard [EMAIL PROTECTED]: [snip] Seems to me Pere want's to do an upload without reloading the whole page. [/snip] The problem is that you cannot upload files using Ajax alone. But you can do it without a reload, requires an invisible IFRAME and a little technique. Search Google for several different articles on this.
RE: [PHP] uploading files... necessary Ajax?
You can try this one http://swfupload.mammon.se/ (I didn't try that yet... but planning to do so shortly) Rob -Original Message- From: pere roca ristol [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 21, 2007 12:04 PM To: Jay Blanchard Cc: T.Lensselink; Jochem Maas; php-general@lists.php.net Subject: Re: [PHP] uploading files... necessary Ajax? Thanks for the answer, you are right, Jay, I don't want nor reload the page nor a new .php page (the one that works with the data I post) appears. It's difficult to believe that a so dummy thing is not working in php (without Ajax)! I found this URL explaining ajax/php for uploading files. http://www.anyexample.com/programming/php/php_ajax_example__asynchronou s_file_upload.xml Pere 2007/11/21, Jay Blanchard [EMAIL PROTECTED]: [snip] Seems to me Pere want's to do an upload without reloading the whole page. [/snip] The problem is that you cannot upload files using Ajax alone. But you can do it without a reload, requires an invisible IFRAME and a little technique. Search Google for several different articles on this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: uploading files... necessary Ajax?
T.Lensselink wrote: On Wed, 21 Nov 2007 08:38:18 -0600, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] Seems to me Pere want's to do an upload without reloading the whole page. [/snip] The problem is that you cannot upload files using Ajax alone. But you can do it without a reload, requires an invisible IFRAME and a little technique. Search Google for several different articles on this. Indeed uploading with only Ajax is not possible. The already named iframe technique was the only thing i could think of. I was just curious if Jochem knew some other way of tackling this problem. I've not tried but I thought the point of returning a status code as Jochem mentioned would cause the browser to not need to download the content again? e.g. it gets a status code of e.g. 304 Not Changed and no data will the browser need to reload the page from it's cache or will it just keep the current page as it is. I would have thought this was a client-side implementation issue rather than anything else. Of course with these codes you can't inform someone that something has gone wrong, but I guess you only issue the codes on success. That said it will be a little odd exerpience for the user without some form of positive feedback. Just a click a small wait with mouse cursor whirring then it stops and that's it bit odd. Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] manipulating XML via php DOM
I don't think it is valid to have an opening tag and a closing tag with nothing in between. So an initial or and a final /or, as you recall it, should become or/. Second, I'm not sure I understand what you want to accomplish. From the example document you added is this the result you expect: And PropertyIsEqualTo PropertyNamegenus/PropertyName Literalontophaugs332/Literal /PropertyIsEqualTo Or/ Or/ /And Regards Jonas On Tue, 2007-11-20 at 10:27 -0800, pere roca wrote: please, I need some help with php DOM, for me it's becoming a hell! After trying other methods (check message from 19th november, called php DOM question), I'm getting a little more success to manipulate XML. From the code you can see below you generate this xml. Now I just want to keep only the initial Or and the final /Or. How can I access and delete the other (the between tags)? I suppose there is no way to create an initial Or without the associated /Or. Thanks a lot, Pere This is the WRONG XML generated from code. ... And PropertyIsEqualTo PropertyNamegenus/PropertyName Literalontophaugs332/Literal /PropertyIsEqualTo Or PropertyIsEqualTo PropertyNamegenus/PropertyName Literalcopris/Literal /PropertyIsEqualTo /Or Or PropertyIsEqualTo PropertyNamegenus/PropertyName Literalcopris2/Literal /PropertyIsEqualTo /Or /And ?php $species=array('ontophaugs332','copris','copris2'); $dom = new DOMDocument; //XML we will insert the data to $dom - load('edit_iberia3.xml'); $count=count($species); foreach ($species as $sp=$value) { //we pass parameters of the array $where_to_insert= $dom-getElementsByTagName('And')-item(0); $child = $dom-createElement('Or'); $or=$where_to_insert-appendChild($child); $child = $dom-createElement('PropertyIsEqualTo'); $first=$or-appendChild($child); $child2 = $dom-createElement('PropertyName'); $first-appendChild($child2); $child3 = $dom-createElement('Literal'); $first-appendChild($child3); //inserting the array data $values = $dom-createTextNode($value); $values = $child3-appendChild($values); } echo $dom-save(nou_iberia); ? -- View this message in context: http://www.nabble.com/manipulating-XML-via-php-DOM-tf4845510.html#a13862945 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] manipulating XML via php DOM
Jonas, that's what I want to get (and is valid). Thanks, ... And PropertyIsEqualTo PropertyNamegenus/PropertyName Literalontophaugs332/Literal /PropertyIsEqualTo Or PropertyIsEqualTo PropertyNamegenus/PropertyName Literalontophaugs332/Literal /PropertyIsEqualTo PropertyIsEqualTo PropertyNamegenus/PropertyName Literalontophaugs/Literal /PropertyIsEqualTo /Or /And ... 2007/11/21, Jonas Geiregat [EMAIL PROTECTED]: I don't think it is valid to have an opening tag and a closing tag with nothing in between. So an initial or and a final /or, as you recall it, should become or/. Second, I'm not sure I understand what you want to accomplish. From the example document you added is this the result you expect: And PropertyIsEqualTo PropertyNamegenus/PropertyName Literalontophaugs332/Literal /PropertyIsEqualTo Or/ Or/ /And Regards Jonas On Tue, 2007-11-20 at 10:27 -0800, pere roca wrote: please, I need some help with php DOM, for me it's becoming a hell! After trying other methods (check message from 19th november, called php DOM question), I'm getting a little more success to manipulate XML. From the code you can see below you generate this xml. Now I just want to keep only the initial Or and the final /Or. How can I access and delete the other (the between tags)? I suppose there is no way to create an initial Or without the associated /Or. Thanks a lot, Pere This is the WRONG XML generated from code. ... And PropertyIsEqualTo PropertyNamegenus/PropertyName Literalontophaugs332/Literal /PropertyIsEqualTo Or PropertyIsEqualTo PropertyNamegenus/PropertyName Literalcopris/Literal /PropertyIsEqualTo /Or Or PropertyIsEqualTo PropertyNamegenus/PropertyName Literalcopris2/Literal /PropertyIsEqualTo /Or /And ?php $species=array('ontophaugs332','copris','copris2'); $dom = new DOMDocument; //XML we will insert the data to $dom - load('edit_iberia3.xml'); $count=count($species); foreach ($species as $sp=$value) { //we pass parameters of the array $where_to_insert= $dom-getElementsByTagName('And')-item(0); $child = $dom-createElement('Or'); $or=$where_to_insert-appendChild($child); $child = $dom-createElement('PropertyIsEqualTo'); $first=$or-appendChild($child); $child2 = $dom-createElement('PropertyName'); $first-appendChild($child2); $child3 = $dom-createElement('Literal'); $first-appendChild($child3); //inserting the array data $values = $dom-createTextNode($value); $values = $child3-appendChild($values); } echo $dom-save(nou_iberia); ? -- View this message in context: http://www.nabble.com/manipulating-XML-via-php-DOM-tf4845510.html#a13862945 Sent from the PHP - General mailing list archive at Nabble.com.
Re: [PHP] Concurrency in a multi-user environment
Don Proshetsky wrote: I'm been googling to see if I can find information on how programmers handle concurrency in a multi-user PHP/MySQL environment. Here's a snippet of my app. I have a form where users can maintain client information such as Name, Address, telephone, email, etc I've been wondering how to handle a situation where two users are editing the same record. One idea is to lock the record when User A enters but this may make it inaccessible for a long period if User A decided to get up and leave for a three hour lunch. Also, does locking a record prevent file locks (when new records need to be added)? Finally, locking a record means I have to convert from MyISAM to InnoDB but this is probably necessary for concurrency. Another idea is to use a semaphore where User A enters and retrieves a numeric field in the table. Upon leaving, the user locks and checks if the field is the same value. If yes, save, increment the numeric field and leave. If not, it indicates another user entered has edited, saved and left. I'm not crazy about this as it would mean User A could spend 15 minutes updating a record only to get a message that User B already edited it. Does anyone have any user friendly suggestions or can give me some URLs where I can read up on this? Personally I would approach this from a non-locking perspective. Store a last updated timestamp with each row. Keep a copy of the data you presented to the user when they started editing. When a modification request comes in you... 1) Lock the row 2) Get the row 3) Compare it to the incoming data and your stored copy - You can work out which fields the user has changed by comparing the incoming data with the stored copy - You can work out which fields have been changed since the user started editing by comparing the stored copy with the latest you got in step 2 - You can use the intersection of these two to see if there are any conflicts 4) If there are conflicts, show the user and let them make a decision 5) Update and unlock the row Note that step 4 actually contains a copy of all the steps again, but before you start you update the stored copy with the latest data you fetched in step 2. Locking is bad, m'kay! Hope that makes sense. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Concurrency in a multi-user environment
Stut wrote: Don Proshetsky wrote: I'm been googling to see if I can find information on how programmers handle concurrency in a multi-user PHP/MySQL environment. Here's a snippet of my app. I have a form where users can maintain client information such as Name, Address, telephone, email, etc I've been wondering how to handle a situation where two users are editing the same record. One idea is to lock the record when User A enters but this may make it inaccessible for a long period if User A decided to get up and leave for a three hour lunch. Also, does locking a record prevent file locks (when new records need to be added)? Finally, locking a record means I have to convert from MyISAM to InnoDB but this is probably necessary for concurrency. Another idea is to use a semaphore where User A enters and retrieves a numeric field in the table. Upon leaving, the user locks and checks if the field is the same value. If yes, save, increment the numeric field and leave. If not, it indicates another user entered has edited, saved and left. I'm not crazy about this as it would mean User A could spend 15 minutes updating a record only to get a message that User B already edited it. Does anyone have any user friendly suggestions or can give me some URLs where I can read up on this? Personally I would approach this from a non-locking perspective. Store a last updated timestamp with each row. Keep a copy of the data you presented to the user when they started editing. When a modification request comes in you... 1) Lock the row 2) Get the row 3) Compare it to the incoming data and your stored copy - You can work out which fields the user has changed by comparing the incoming data with the stored copy - You can work out which fields have been changed since the user started editing by comparing the stored copy with the latest you got in step 2 - You can use the intersection of these two to see if there are any conflicts 4) If there are conflicts, show the user and let them make a decision 5) Update and unlock the row Note that step 4 actually contains a copy of all the steps again, but before you start you update the stored copy with the latest data you fetched in step 2. Reading that back to myself I realised the last updated timestamp is fairly redundant. It might be worth having it if the dataset is large as you can use it to avoid the comparison if it hasn't been updated. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: uploading files... necessary Ajax?
Colin Guthrie wrote: T.Lensselink wrote: On Wed, 21 Nov 2007 08:38:18 -0600, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] Seems to me Pere want's to do an upload without reloading the whole page. [/snip] The problem is that you cannot upload files using Ajax alone. But you can do it without a reload, requires an invisible IFRAME and a little technique. Search Google for several different articles on this. Indeed uploading with only Ajax is not possible. The already named iframe technique was the only thing i could think of. I was just curious if Jochem knew some other way of tackling this problem. I've not tried but I thought the point of returning a status code as Jochem mentioned would cause the browser to not need to download the content again? e.g. it gets a status code of e.g. 304 Not Changed and no data will the browser need to reload the page from it's cache or will it just keep the current page as it is. I would have thought this was a client-side implementation issue rather than anything else. correct. you send a request to the server, which includes the file being uploaded - at the stage of sending a request there is nothing to reload, all the way through the upload the page just sits there. when the server completes handling the request it will send a status header and optionally some content. inb the case of return a 304 to the browser, your telling the browser to use whatever it's already displaying - actually I feel the 204 status is more appropriate. in both cases no content is returned, and no page is refreshed/reloaded/whatever :-) Of course with these codes you can't inform someone that something has gone wrong, but I guess you only issue the codes on success. That said it will be a little odd exerpience for the user without some form of positive feedback. Just a click a small wait with mouse cursor whirring then it stops and that's it bit odd. I agree. Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Should I put pictures into a database?
At 10:14 AM +0800 11/21/07, Ronald Wiplinger wrote: I have an application, where I use pictures. The size of the picture is about 90kB and to speed up the preview, I made a thumbnail of each picture which is about 2.5 to 5kB. I use now a directory structure of ../$a/$b/$c/pictures I wonder if it would be good to put the thumbnails into the current table, in a different table or leave it like it is now. Same for the pictures. What is your opinion and why? I use both depending on need. One fact that is seldom addressed is that computational speed is increasing while storage costs are decreasing. As such, I suspect in a very short while, it won't make much difference regardless. Even now, while there is much debate over what to do, it isn't until you reach the maximums that degrades in service becomes significant when comparing the two methods. I don't know specifically how MySQL stores BLOB data, but databases typically use pointers to files (binary-tree nodes) and not the files themselves. So, the arguments of: pictures shouldn't be stored in a dB because there is nothing there to search; and I would rather use a pointer instead; are kind of moot. After all is said and done, no matter what you do with a picture (file system or dB) it is stored on a hard drive. So in a sense, a dB is not much more than a file system with more options. I am sure sometime in the future. programmers will look back on our debates and ask What hell was all that about? Didn't these guys realize that a filing system is just another database? 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] two small issues with php mail OT
2007. 11. 21, szerda keltezéssel 18.38-kor Dimiter Ivanov ezt írta: On Nov 21, 2007 2:29 AM, Børge Holen [EMAIL PROTECTED] wrote: On Wednesday 21 November 2007 00:53:14 Jochem Maas wrote: Stephen Johnson wrote: Who says you can't please them all... ;) Erin Brokovich. nah you sure? why cant i remember that. must be that early altzheimers syndrome or something -- Stephen Johnson c | eh The Lone Coder http://www.thelonecoder.com continuing the struggle against bad code http://www.thumbnailresume.com -- From: Jay Blanchard [EMAIL PROTECTED] Date: Tue, 20 Nov 2007 14:25:21 -0600 To: Stephen Johnson [EMAIL PROTECTED], php-general@lists.php.net Conversation: [PHP] two small issues with php mail OT Subject: RE: [PHP] two small issues with php mail OT [snip] I wrote about this a long time ago ... In a galaxy far far away... http://www.thelonecoder.com/Blog/?p=7 Be good lemmings and do as you're told... [/snip] Sitting squarely on the fence he is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Since it's the OT thread, i can mention some of Brad's most memorable postings (for me) in this list. I played around with the gmail search function, i dug this one : http://marc.info/?l=php-generalm=117921190509410w=2 OMG I didn't even realize that this Brad with the homework stuff thread was the same as that Brad who bragged about being engineer for military and stuff... comparing the things he said in a couple of his mails shows that he is at least 3 different people... that must be hard ;) greets, Zoltán Németh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] two small issues with php mail OT
Daniel Brown [EMAIL PROTECTED] wrote: On Nov 21, 2007 11:38 AM, Dimiter Ivanov [EMAIL PROTECTED] wrote: On Nov 21, 2007 2:29 AM, Børge Holen [EMAIL PROTECTED] wrote: On Wednesday 21 November 2007 00:53:14 Jochem Maas wrote: Stephen Johnson wrote: Who says you can't please them all... ;) Erin Brokovich. nah you sure? why cant i remember that. must be that early altzheimers syndrome or something -- Stephen Johnson c | eh The Lone Coder http://www.thelonecoder.com continuing the struggle against bad code http://www.thumbnailresume.com -- From: Jay Blanchard [EMAIL PROTECTED] Date: Tue, 20 Nov 2007 14:25:21 -0600 To: Stephen Johnson [EMAIL PROTECTED], php-general@lists.php.net Conversation: [PHP] two small issues with php mail OT Subject: RE: [PHP] two small issues with php mail OT [snip] I wrote about this a long time ago ... In a galaxy far far away... http://www.thelonecoder.com/Blog/?p=7 Be good lemmings and do as you're told... [/snip] Sitting squarely on the fence he is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Since it's the OT thread, i can mention some of Brad's most memorable postings (for me) in this list. I played around with the gmail search function, i dug this one : http://marc.info/?l=php-generalm=117921190509410w=2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I nearly forgot all about that! HA! -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Anyone else besides me laughing their @$$ off at the fact that brad is one of 2 people who are Federal Technologies Networks sole contacts? And that their website has a flashy front page but drops to nothingness after that? I did make sure to email the lady mentioned in all of those previous emails of his code about the probable increase of spam as well as the probably server attacks. For any who aren't aware, sites such as this are culled for email/server information. So don't post stuff out here unless you're prepared for it. Course I use Thunderbird's filtering/learning and it gets 99% of it. :) Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] two small issues with php mail OT
On Nov 21, 2007 11:38 AM, Dimiter Ivanov [EMAIL PROTECTED] wrote: On Nov 21, 2007 2:29 AM, Børge Holen [EMAIL PROTECTED] wrote: On Wednesday 21 November 2007 00:53:14 Jochem Maas wrote: Stephen Johnson wrote: Who says you can't please them all... ;) Erin Brokovich. nah you sure? why cant i remember that. must be that early altzheimers syndrome or something -- Stephen Johnson c | eh The Lone Coder http://www.thelonecoder.com continuing the struggle against bad code http://www.thumbnailresume.com -- From: Jay Blanchard [EMAIL PROTECTED] Date: Tue, 20 Nov 2007 14:25:21 -0600 To: Stephen Johnson [EMAIL PROTECTED], php-general@lists.php.net Conversation: [PHP] two small issues with php mail OT Subject: RE: [PHP] two small issues with php mail OT [snip] I wrote about this a long time ago ... In a galaxy far far away... http://www.thelonecoder.com/Blog/?p=7 Be good lemmings and do as you're told... [/snip] Sitting squarely on the fence he is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Since it's the OT thread, i can mention some of Brad's most memorable postings (for me) in this list. I played around with the gmail search function, i dug this one : http://marc.info/?l=php-generalm=117921190509410w=2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I nearly forgot all about that! HA! -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 If at first you don't succeed, stick to what you know best so that you can make enough money to pay someone else to do it for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session problem
I got a strange problem here, here are the setup details first as this seems to be a server problem more than a php problem but it is still related to php configuration: Server: Win2003 (latest) WebServer: IIS6 (latest) PHP: php5.2.2.1 MySQL: mysql.5 Sites installed in server that may have influence: www.palliscience.com dev.palliscience.com maj.palliscience.com dev2.palliscience.com (All sites are installed using php5_ISAPI.dll) Problem: When i try to start a session in maj.palliscience.com (Same code as everywhere else except the content may differ), the server hangs. I tried for two days to find and make sure where this server hang was coming from and eventually came to the solid conclusion that my server hang on session_start. I tried to add different commands such as session_write_close at end of my scripts and checked that my sessions where not already open by using session_id. The only way i was able to make my sessions work in maj.palliscience.com is using the CGI version of PHP, but hell this is causing me problems i never thought it would. I'm having problems with headers, and also the $_SERVER variable is deadly different. So my question is simple, what could cause this problem. Could it be a clash in the filenames for the session files? I tried reading a bit the php.ini and saw there is a way to split the session files in different folders but i don't have the expertise nor the famous script the php.ini is talking about in the session section to fix or alter this info correctly. (I can't start tweaking this, there are other sites on the machine that are in production mode so i need a final configuration that will work on the first try) Keep in mind: 1) I got 3 other sites that sport the same code, only slightly different content 2) All the sessions in the other sites work marvelously in ISAPI 3) Only maj is affected, i tried copying the code to dev2.palliscience.com, problem doesn't show. 4) I can definitely say my sessions are problematic, i comment out any session_start, and the problem nevers shows Thanks Mathieu Dumoulin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: uploading files... necessary Ajax?
Hi gang: So that I can get my head around this, are all of you saying there is no Ajax equivalent of: form action=index.php enctype=multipart/form-data method=post input type=hidden name=MAX_FILE_SIZE value=2048000 input name=userfile type=file input type=hidden name=stage value=1 input type=submit value=submit We can't in some way use the ajax post method to send the file in the background without a refresh (other than using iframe) is that correct? Or am I completely missing something here? 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] two small issues with php mail OT
On Nov 21, 2007 2:29 AM, Børge Holen [EMAIL PROTECTED] wrote: On Wednesday 21 November 2007 00:53:14 Jochem Maas wrote: Stephen Johnson wrote: Who says you can't please them all... ;) Erin Brokovich. nah you sure? why cant i remember that. must be that early altzheimers syndrome or something -- Stephen Johnson c | eh The Lone Coder http://www.thelonecoder.com continuing the struggle against bad code http://www.thumbnailresume.com -- From: Jay Blanchard [EMAIL PROTECTED] Date: Tue, 20 Nov 2007 14:25:21 -0600 To: Stephen Johnson [EMAIL PROTECTED], php-general@lists.php.net Conversation: [PHP] two small issues with php mail OT Subject: RE: [PHP] two small issues with php mail OT [snip] I wrote about this a long time ago ... In a galaxy far far away... http://www.thelonecoder.com/Blog/?p=7 Be good lemmings and do as you're told... [/snip] Sitting squarely on the fence he is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Since it's the OT thread, i can mention some of Brad's most memorable postings (for me) in this list. I played around with the gmail search function, i dug this one : http://marc.info/?l=php-generalm=117921190509410w=2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Should I put pictures into a database?
I use a custom file system that caches large amounts of data in RAM. That way it's really fast and as easy to use as normal file system calls. -- Michael McGlothlin Southwest Plumbing Supply -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] two small issues with php mail OT
Zoltán Németh [EMAIL PROTECTED] wrote: 2007. 11. 21, szerda keltezéssel 18.38-kor Dimiter Ivanov ezt írta: On Nov 21, 2007 2:29 AM, Børge Holen [EMAIL PROTECTED] wrote: On Wednesday 21 November 2007 00:53:14 Jochem Maas wrote: Stephen Johnson wrote: Who says you can't please them all... ;) Erin Brokovich. nah you sure? why cant i remember that. must be that early altzheimers syndrome or something -- Stephen Johnson c | eh The Lone Coder http://www.thelonecoder.com continuing the struggle against bad code http://www.thumbnailresume.com -- From: Jay Blanchard [EMAIL PROTECTED] Date: Tue, 20 Nov 2007 14:25:21 -0600 To: Stephen Johnson [EMAIL PROTECTED], php-general@lists.php.net Conversation: [PHP] two small issues with php mail OT Subject: RE: [PHP] two small issues with php mail OT [snip] I wrote about this a long time ago ... In a galaxy far far away... http://www.thelonecoder.com/Blog/?p=7 Be good lemmings and do as you're told... [/snip] Sitting squarely on the fence he is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Since it's the OT thread, i can mention some of Brad's most memorable postings (for me) in this list. I played around with the gmail search function, i dug this one : http://marc.info/?l=php-generalm=117921190509410w=2 OMG I didn't even realize that this Brad with the homework stuff thread was the same as that Brad who bragged about being engineer for military and stuff... comparing the things he said in a couple of his mails shows that he is at least 3 different people... that must be hard ;) greets, Zoltán Németh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Yeah, same guy... and from looking at the previous thread, it looks like the website he was working on was done by someone else. It really looks like he has a shell company he is trying to get out there and failing on. Kinda sad really, since his aced English and Grammar courses didn't teach him the difference between hear and here... Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: uploading files... necessary Ajax?
That's correct as far as I know... Ajax would require javascript had access to the data stream of the file you are trying to upload... and that would be a security issue for browsers (or was it because the multipart/form-data encoding? Don't kill me if I'm totally wrong). All in all, the only way to do a file upload I know of is with an iframe or with a SWF technique (which provides a bit more control on the progress of the upload). But any of those techniques will be transaparent to the end user if implemented well (meaning they will not know you are actually using an iframe or a SWF). Hope not to be far from thruth Rob (sorry, top posting, we've all read the rest of it :D) -Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 21, 2007 2:13 PM To: Jochem Maas; Colin Guthrie Cc: php-general@lists.php.net Subject: Re: [PHP] Re: uploading files... necessary Ajax? Hi gang: So that I can get my head around this, are all of you saying there is no Ajax equivalent of: form action=index.php enctype=multipart/form-data method=post input type=hidden name=MAX_FILE_SIZE value=2048000 input name=userfile type=file input type=hidden name=stage value=1 input type=submit value=submit We can't in some way use the ajax post method to send the file in the background without a refresh (other than using iframe) is that correct? Or am I completely missing something here? 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: uploading files... necessary Ajax?
[snip] That is correct. Without an IFRAME you cannot upload a file without a refresh. [/snip] Take Two. You could also open another window, but that kinda defeats the purpose. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: uploading files... necessary Ajax?
Jay Blanchard wrote: [snip] So that I can get my head around this, are all of you saying there is no Ajax equivalent of: form action=index.php enctype=multipart/form-data method=post input type=hidden name=MAX_FILE_SIZE value=2048000 input name=userfile type=file input type=hidden name=stage value=1 input type=submit value=submit We can't in some way use the ajax post method to send the file in the background without a refresh (other than using iframe) is that correct? Or am I completely missing something here? [/snip] That is correct. Without an IFRAME you cannot upload a file without a refresh. huh? if I post a file to a script that returns a 204 status and nothing else then the page should not change in the browser. of course as Colin pointed out this leaves much to be desired in terms of usability so for practical purposes you'll want to use an Iframe hack or upload widget built with java or flash. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sending Pictures to Cell Phones
have a look at www.helkvist.org he has some php classes for MMS bastien Date: Wed, 21 Nov 2007 11:38:37 +0100 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: php-general@lists.php.net Subject: Re: [PHP] Sending Pictures to Cell Phones Maybe too late. Here are some simple starting points. If you want to send pictures as MMS messages, you will need to use an SMS gateway. How different the protocols are for SMS and MMS, I don't know. But I've used www.clickatel.com's SMS gateway happily. So, you might want to start there. They are responsive - so you could probably get advice. They even have some PHP scripts for interacting with their gateway. If you want to make pictures available as images on web enabled telephones, I suggest you download Opera web browser. It has a function that allows you to preview small screen pages, which can be useful for developing if you want to use this route. Good luck! Jeffrey [EMAIL PROTECTED] wrote: Hey list,I'm doing some RD for a project at my job and my boss wants the ability to send pictures to cell phones. I was wondering if anyone had any experience with this or could point me in the right direction to get started.Thanks, Jeremy-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Are you ready for Windows Live Messenger Beta 8.5 ? Get the latest for free today! http://entertainment.sympatico.msn.ca/WindowsLiveMessenger
RE: [PHP] Re: uploading files... necessary Ajax?
[snip] So that I can get my head around this, are all of you saying there is no Ajax equivalent of: form action=index.php enctype=multipart/form-data method=post input type=hidden name=MAX_FILE_SIZE value=2048000 input name=userfile type=file input type=hidden name=stage value=1 input type=submit value=submit We can't in some way use the ajax post method to send the file in the background without a refresh (other than using iframe) is that correct? Or am I completely missing something here? [/snip] That is correct. Without an IFRAME you cannot upload a file without a refresh. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] two small issues with php mail OT
-Original Message- From: Wolf [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 21, 2007 2:05 PM To: Zoltán Németh Cc: Børge Holen; php-general@lists.php.net; Dimiter Ivanov Subject: Re: [PHP] two small issues with php mail OT Zoltán Németh [EMAIL PROTECTED] wrote: 2007. 11. 21, szerda keltezéssel 18.38-kor Dimiter Ivanov ezt írta: On Nov 21, 2007 2:29 AM, Børge Holen [EMAIL PROTECTED] wrote: On Wednesday 21 November 2007 00:53:14 Jochem Maas wrote: Stephen Johnson wrote: Who says you can't please them all... ;) Erin Brokovich. nah you sure? why cant i remember that. must be that early altzheimers syndrome or something -- Stephen Johnson c | eh The Lone Coder http://www.thelonecoder.com continuing the struggle against bad code http://www.thumbnailresume.com -- From: Jay Blanchard [EMAIL PROTECTED] Date: Tue, 20 Nov 2007 14:25:21 -0600 To: Stephen Johnson [EMAIL PROTECTED], php-general@lists.php.net Conversation: [PHP] two small issues with php mail OT Subject: RE: [PHP] two small issues with php mail OT [snip] I wrote about this a long time ago ... In a galaxy far far away... http://www.thelonecoder.com/Blog/?p=7 Be good lemmings and do as you're told... [/snip] Sitting squarely on the fence he is -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- --- Børge Holen http://www.arivene.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Since it's the OT thread, i can mention some of Brad's most memorable postings (for me) in this list. I played around with the gmail search function, i dug this one : http://marc.info/?l=php-generalm=117921190509410w=2 OMG I didn't even realize that this Brad with the homework stuff thread was the same as that Brad who bragged about being engineer for military and stuff... comparing the things he said in a couple of his mails shows that he is at least 3 different people... that must be hard ;) greets, Zoltán Németh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Yeah, same guy... and from looking at the previous thread, it looks like the website he was working on was done by someone else. It really looks like he has a shell company he is trying to get out there and failing on. Kinda sad really, since his aced English and Grammar courses didn't teach him the difference between hear and here... Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php OMG! I've got an email from the NSA! It says Rob you're behavior is being watched by one of our agents (Mr B_d, we cannot disclose the second letter of his name for security reasons). If you and your friends insist in the tough behavior you are having, you will all have no cookies for breakfast and your coffee will taste like shit while you are coding in the night. Please watch out and take care! Lol -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: uploading files... necessary Ajax?
At 11:32 AM -0600 11/21/07, Jay Blanchard wrote: [snip] huh? if I post a file to a script that returns a 204 status and nothing else then the page should not change in the browser. [/snip] True, the missing piece is that the post cannot move the file up to the server. Ahhh, so that's it. My twitchy little brain was thinking if I can send arguments to the server via ajax, then why can't I send multipart/form-data? After all, data is data right? It might be too cpu intensive, but I can imagine js breaking down an image file in packets and then sending those to a server via post arguments to be assembled on the server. Is that not feasible, or am I blowing wind out my shorts again? 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] Re: uploading files... necessary Ajax?
[snip] huh? if I post a file to a script that returns a 204 status and nothing else then the page should not change in the browser. [/snip] True, the missing piece is that the post cannot move the file up to the server. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sending Pictures to Cell Phones
[snip] have a look at www.helkvist.org he has some php classes for MMS [/snip] Site cannot be found -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: uploading files... necessary Ajax?
[snip] Ahhh, so that's it. My twitchy little brain was thinking if I can send arguments to the server via ajax, then why can't I send multipart/form-data? After all, data is data right? It might be too cpu intensive, but I can imagine js breaking down an image file in packets and then sending those to a server via post arguments to be assembled on the server. Is that not feasible, or am I blowing wind out my shorts again? [/snip] The wind does blow JS does not have permissions to do such file handling. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Should I put pictures into a database?
Michael McGlothlin wrote: I use a custom file system that caches large amounts of data in RAM. That way it's really fast and as easy to use as normal file system calls. It's called a relational database ;) Seriously. Databases like MySQL do not handle BLOB's with any sensible control hence the againsts quoted. A decent database working in cooperation with the operating system should be as fast at returning a block of raw data as searching the file system to find the same block and hand that data to the following process transparently. Firebird has always handled BLOB's reasonably well, and with the incremental backup facilities now available, ALL of the data can be safely managed and replicated to secondary machines. Managing 100s of thousands of images in a directory structure may not be the best way of managing a large volume of data, requiring searching through a tree of directories to get to a file, while storing the same in a flat file system WITHIN a database SHOULD be a more efficient alternative. Should I put pictures into a database? - depends on both the data base and the file system/OS :) -- Lester Caine - G8HFL - Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact L.S.Caine Electronic Services - http://home.lsces.co.uk MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/ Firebird - http://www.firebirdsql.org/index.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: uploading files... necessary Ajax?
tedd wrote: At 12:23 PM -0600 11/21/07, Jay Blanchard wrote: [snip] But, take a look at this: http://www.captain.at/ajax-file-upload.php They look like their blowing the same wind. [/snip] Yep, look at all of the gotchas. Well, I wasn't able to get it to work -- I couldn't find where to change the FF settings (Mac). type 'about:config' into the address bar :-) Cheers, tedd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: uploading files... necessary Ajax?
Jay Blanchard wrote: [snip] huh? if I post a file to a script that returns a 204 status and nothing else then the page should not change in the browser. [/snip] True, the missing piece is that the post cannot move the file up to the server. I was referring to a standard POST not using AJAX. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: uploading files... necessary Ajax?
At 12:23 PM -0600 11/21/07, Jay Blanchard wrote: [snip] But, take a look at this: http://www.captain.at/ajax-file-upload.php They look like their blowing the same wind. [/snip] Yep, look at all of the gotchas. Well, I wasn't able to get it to work -- I couldn't find where to change the FF settings (Mac). 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
[PHP] Code Critique Please :)
Hello, I am trying to increase my knowledge and understanding of OO and OO Design Patterns. I'd like to request a critique of a program that extracts MySQL table information and translates it into XML. In the program, I tried to accomplish a few things: 1. Correct use of ADOdb 2. Closely match the PEAR coding standards - I encode my scripts in UTF-8 - Not all indents are 4 spaces, but I have switched my IDE to treat tabs as four spaces - My phpDoc comments could probably use some tweaking 3. Object Oriented principles 4. Strategy Design Pattern - Interface used for column attribute parsing My overall goal is to use these xml files as a starting point to write a DAO with the Data Mapper Pattern. Here are the related files to peruse: http://simeons.net/code/datamapper/sql/photo_portfolio.sql - SQL dump http://simeons.net/code/datamapper/mysql_to_xml_oo.phps - Calling script http://simeons.net/code/datamapper/helpers/autoload.phps - Auto load classes http://simeons.net/code/datamapper/classes/DB.phps - ADOdb connection http://simeons.net/code/datamapper/classes/MySQLToXML.phps - MySQL extraction and parsing - XML writing Here are the outputted xml files: http://simeons.net/code/datamapper/xmldatamaps/album.xml http://simeons.net/code/datamapper/xmldatamaps/photo.xml http://simeons.net/code/datamapper/xmldatamaps/comment.xml Any comments are appreciated. Thanks, Simeon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: uploading files... necessary Ajax?
At 11:49 AM -0600 11/21/07, Jay Blanchard wrote: [snip] Ahhh, so that's it. My twitchy little brain was thinking if I can send arguments to the server via ajax, then why can't I send multipart/form-data? After all, data is data right? It might be too cpu intensive, but I can imagine js breaking down an image file in packets and then sending those to a server via post arguments to be assembled on the server. Is that not feasible, or am I blowing wind out my shorts again? [/snip] The wind does blow JS does not have permissions to do such file handling. Yeah, the permission thing again. But, take a look at this: http://www.captain.at/ajax-file-upload.php They look like their blowing the same wind. 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] Re: uploading files... necessary Ajax?
[snip] But, take a look at this: http://www.captain.at/ajax-file-upload.php They look like their blowing the same wind. [/snip] Yep, look at all of the gotchas. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sending Pictures to Cell Phones
my bad http://hellkvist.org/software/ bastien Subject: RE: [PHP] Sending Pictures to Cell Phones Date: Wed, 21 Nov 2007 11:36:58 -0600 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] CC: php-general@lists.php.net [snip] have a look at www.helkvist.org he has some php classes for MMS [/snip] Site cannot be found _ Are you ready for Windows Live Messenger Beta 8.5 ? Get the latest for free today! http://entertainment.sympatico.msn.ca/WindowsLiveMessenger
RE: [PHP] Re: uploading files... necessary Ajax?
-Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 21, 2007 3:24 PM To: tedd; Jochem Maas Cc: Colin Guthrie; php-general@lists.php.net Subject: RE: [PHP] Re: uploading files... necessary Ajax? [snip] But, take a look at this: http://www.captain.at/ajax-file-upload.php They look like their blowing the same wind. [/snip] Yep, look at all of the gotchas. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php So, I was not that wrong at all... So, one point more in favor of swfupload, despite being beta, it's more suitable than the about:config stuff. I will surely try swfupload in the next CMS I get involved with. Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code Critique Please :)
Simeon F. Willbanks wrote: Hello, I am trying to increase my knowledge and understanding of OO and OO Design Patterns. I'd like to request a critique of a program that extracts MySQL table information and translates it into XML. In the program, I tried to accomplish a few things: 1. Correct use of ADOdb 2. Closely match the PEAR coding standards - I encode my scripts in UTF-8 - Not all indents are 4 spaces, but I have switched my IDE to treat tabs as four spaces - My phpDoc comments could probably use some tweaking 3. Object Oriented principles 4. Strategy Design Pattern - Interface used for column attribute parsing My overall goal is to use these xml files as a starting point to write a DAO with the Data Mapper Pattern. Here are the related files to peruse: http://simeons.net/code/datamapper/sql/photo_portfolio.sql - SQL dump http://simeons.net/code/datamapper/mysql_to_xml_oo.phps - Calling script http://simeons.net/code/datamapper/helpers/autoload.phps - Auto load classes does the preg_replace() need to be run for every call to __autoload(), I think it would speed it up a little if you stored the class path in a static variable so that you only have to determine it once. http://simeons.net/code/datamapper/classes/DB.phps - ADOdb connection http://simeons.net/code/datamapper/classes/MySQLToXML.phps - MySQL extraction and parsing - XML writing I'd drop the trailing '?' in all your files - it's not required and it will save you hunting through stacks of files trying to find errant blank lines (which are output to the browser and will break subsequent calls to header()) Here are the outputted xml files: http://simeons.net/code/datamapper/xmldatamaps/album.xml http://simeons.net/code/datamapper/xmldatamaps/photo.xml http://simeons.net/code/datamapper/xmldatamaps/comment.xml Any comments are appreciated. Thanks, Simeon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: uploading files... necessary Ajax?
At 8:03 PM +0100 11/21/07, Jochem Maas wrote: tedd wrote: Well, I wasn't able to get it to work -- I couldn't find where to change the FF settings (Mac). type 'about:config' into the address bar :-) I know I'll get a big argument from all of you about this, but sometimes I can be pretty dumb. :-) Thanks, 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] Session problem
On Nov 21, 2007 11:08 AM, Mathieu Dumoulin [EMAIL PROTECTED] wrote: I got a strange problem here, here are the setup details first as this seems to be a server problem more than a php problem but it is still related to php configuration: Server: Win2003 (latest) WebServer: IIS6 (latest) PHP: php5.2.2.1 MySQL: mysql.5 Sites installed in server that may have influence: www.palliscience.com dev.palliscience.com maj.palliscience.com dev2.palliscience.com (All sites are installed using php5_ISAPI.dll) Problem: When i try to start a session in maj.palliscience.com (Same code as everywhere else except the content may differ), the server hangs. I tried for two days to find and make sure where this server hang was coming from and eventually came to the solid conclusion that my server hang on session_start. I tried to add different commands such as session_write_close at end of my scripts and checked that my sessions where not already open by using session_id. The only way i was able to make my sessions work in maj.palliscience.comis using the CGI version of PHP, but hell this is causing me problems i never thought it would. I'm having problems with headers, and also the $_SERVER variable is deadly different. So my question is simple, what could cause this problem. Windoze and IIS. =/ Could it be a clash in the filenames for the session files? Yes, AFAIK, the session names will clash. Meaning, for each DNS (subdomain, whatever it is), use a different prefix to avoid clashes: $_SESSION['www'][...] $_SESSION['dev'][...] $_SESSION['maj']...] etc. Obviously if some are in production, this is not a trivial change. I tried reading a bit the php.ini and saw there is a way to split the session files in different folders but i don't have the expertise nor the famous script the php.ini is talking about in the session section to fix or alter this info correctly. (I can't start tweaking this, there are other sites on the machine that are in production mode so i need a final configuration that will work on the first try) Keep in mind: 1) I got 3 other sites that sport the same code, only slightly different content 2) All the sessions in the other sites work marvelously in ISAPI 3) Only maj is affected, i tried copying the code to dev2.palliscience.com , problem doesn't show. 4) I can definitely say my sessions are problematic, i comment out any session_start, and the problem nevers shows This is a stab in the dark, but maybe the problem is not with session_start. Maybe session_start uses/calls something else which has a negative impact on your system. So you may be addressing the issue, but from the wrong angle?? Thanks Mathieu Dumoulin Well, I gave you a lot of useless information, but hopefully it sparks a fire! =D Good Luck. ~Philip
Re: [PHP] Code Critique Please :)
Simeon F. Willbanks wrote: Jochem, Thanks for the tips. no worries, for the rest you stuff looks tidy and making use of phpDoc comments and using CS consistently are both recommended! with regard to OO I didn't really see enough [complexity] to be able to offer any worthwhile feedback - but then again I didn't see any faux pas' either. you might consider checking out other implementations of similar functionality to compare your own idea/implementation against. oh and we prefer to keep all communications on list :-) Simeon On Nov 21, 2007, at 2:23 PM, Jochem Maas wrote: Simeon F. Willbanks wrote: Hello, I am trying to increase my knowledge and understanding of OO and OO Design Patterns. I'd like to request a critique of a program that extracts MySQL table information and translates it into XML. In the program, I tried to accomplish a few things: 1. Correct use of ADOdb 2. Closely match the PEAR coding standards - I encode my scripts in UTF-8 - Not all indents are 4 spaces, but I have switched my IDE to treat tabs as four spaces - My phpDoc comments could probably use some tweaking 3. Object Oriented principles 4. Strategy Design Pattern - Interface used for column attribute parsing My overall goal is to use these xml files as a starting point to write a DAO with the Data Mapper Pattern. Here are the related files to peruse: http://simeons.net/code/datamapper/sql/photo_portfolio.sql - SQL dump http://simeons.net/code/datamapper/mysql_to_xml_oo.phps - Calling script http://simeons.net/code/datamapper/helpers/autoload.phps - Auto load classes does the preg_replace() need to be run for every call to __autoload(), I think it would speed it up a little if you stored the class path in a static variable so that you only have to determine it once. http://simeons.net/code/datamapper/classes/DB.phps - ADOdb connection http://simeons.net/code/datamapper/classes/MySQLToXML.phps - MySQL extraction and parsing - XML writing I'd drop the trailing '?' in all your files - it's not required and it will save you hunting through stacks of files trying to find errant blank lines (which are output to the browser and will break subsequent calls to header()) Here are the outputted xml files: http://simeons.net/code/datamapper/xmldatamaps/album.xml http://simeons.net/code/datamapper/xmldatamaps/photo.xml http://simeons.net/code/datamapper/xmldatamaps/comment.xml Any comments are appreciated. Thanks, Simeon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Session problem
-Original Message- From: Philip Thompson [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 21, 2007 4:43 PM To: php-general@lists.php.net Subject: Re: [PHP] Session problem On Nov 21, 2007 11:08 AM, Mathieu Dumoulin [EMAIL PROTECTED] wrote: I got a strange problem here, here are the setup details first as this seems to be a server problem more than a php problem but it is still related to php configuration: Server: Win2003 (latest) WebServer: IIS6 (latest) PHP: php5.2.2.1 MySQL: mysql.5 Sites installed in server that may have influence: www.palliscience.com dev.palliscience.com maj.palliscience.com dev2.palliscience.com (All sites are installed using php5_ISAPI.dll) Problem: When i try to start a session in maj.palliscience.com (Same code as everywhere else except the content may differ), the server hangs. I tried for two days to find and make sure where this server hang was coming from and eventually came to the solid conclusion that my server hang on session_start. I tried to add different commands such as session_write_close at end of my scripts and checked that my sessions where not already open by using session_id. The only way i was able to make my sessions work in maj.palliscience.comis using the CGI version of PHP, but hell this is causing me problems i never thought it would. I'm having problems with headers, and also the $_SERVER variable is deadly different. So my question is simple, what could cause this problem. Windoze and IIS. =/ Could it be a clash in the filenames for the session files? Yes, AFAIK, the session names will clash. Meaning, for each DNS (subdomain, whatever it is), use a different prefix to avoid clashes: $_SESSION['www'][...] $_SESSION['dev'][...] $_SESSION['maj']...] etc. Obviously if some are in production, this is not a trivial change. I tried reading a bit the php.ini and saw there is a way to split the session files in different folders but i don't have the expertise nor the famous script the php.ini is talking about in the session section to fix or alter this info correctly. (I can't start tweaking this, there are other sites on the machine that are in production mode so i need a final configuration that will work on the first try) Keep in mind: 1) I got 3 other sites that sport the same code, only slightly different content 2) All the sessions in the other sites work marvelously in ISAPI 3) Only maj is affected, i tried copying the code to dev2.palliscience.com , problem doesn't show. 4) I can definitely say my sessions are problematic, i comment out any session_start, and the problem nevers shows This is a stab in the dark, but maybe the problem is not with session_start. Maybe session_start uses/calls something else which has a negative impact on your system. So you may be addressing the issue, but from the wrong angle?? Thanks Mathieu Dumoulin Well, I gave you a lot of useless information, but hopefully it sparks a fire! =D Good Luck. ~Philip I don't think there's a name clash in session file names... session identification is based on a browser cookie if I remember well PHPSESSIONID, and so are file names which (again, if my memory is right) are called sess_session_id where session_id is the aforementioned cookie. Cookies are different for different (sub)domains... so, the browser won't send the session cookie for www.domain.com to dev.domain.com... meaning both subdomains should get different session ids and session files (which cannot clash because the session id is generated randomly using an MD5 hash, right?). I would say the problem is at some point in the IIS-PHP communication. Maybe the browser is sending the session ID to the server, the server gets the session id, and when you use session_start it tries to grab the file which is locked (for some extrange and unknown windows reason as usual) and then it hangs waiting for the file to be available. I don't know if this will be of any help for you, but I'd locate the session files directory (the location can be found in PHP.INI) and delete every file in there, and if possible restart the webserver. Also, there's a debugging tool in the IIS 6.0 resource kit that can be used to log and/or point out problems in the IIS worker processes (can't remember its name, I had to deal with that about two years ago). That will at least give you some use(ful|less) information about which process is faulting, what's the exception and which is the code causing the fault. If there's any fault of course... if it's only a deadlock, it might provide no useful information, because the IIS process would simply be waiting for the session file to be available for read(write). Ok... this was just another bit of probably useless information... but someone will help us out, I know. Rob -- PHP General Mailing List
[PHP] PHP6 - MySQL 4.1.20
Hello, So I've been trying to compile PHP6 with MySQL 4.1.20 and it seems, I keep getting compile errors. It complains for MYSQL_TYPE_VARCHAR. I don't want to use the MySQLND, because we use MySQL 4.1.20 with old_password = 1 ... so any suggestions on how to compile PHP 6 CVS with MySQL 4.1? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Session problem
By the way... I remember there were to ways of installing PHP over IIS. One was adding it for ALL websites and the other way was adding it on a site by site basis. I'd recommend doing the second method. Notice that this has nothing to do with ISAPI vs CGI, it is just an option in IIS settings (again, I've not seen a Windows 2003 Server since about two years ago, so I don't remember where or how this was accomplished). Rob (excuse me for top posting, but this is just a side note) -Original Message- From: Andrés Robinet [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 21, 2007 5:51 PM To: php-general@lists.php.net Subject: RE: [PHP] Session problem -Original Message- From: Philip Thompson [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 21, 2007 4:43 PM To: php-general@lists.php.net Subject: Re: [PHP] Session problem On Nov 21, 2007 11:08 AM, Mathieu Dumoulin [EMAIL PROTECTED] cdgi.com wrote: I got a strange problem here, here are the setup details first as this seems to be a server problem more than a php problem but it is still related to php configuration: Server: Win2003 (latest) WebServer: IIS6 (latest) PHP: php5.2.2.1 MySQL: mysql.5 Sites installed in server that may have influence: www.palliscience.com dev.palliscience.com maj.palliscience.com dev2.palliscience.com (All sites are installed using php5_ISAPI.dll) Problem: When i try to start a session in maj.palliscience.com (Same code as everywhere else except the content may differ), the server hangs. I tried for two days to find and make sure where this server hang was coming from and eventually came to the solid conclusion that my server hang on session_start. I tried to add different commands such as session_write_close at end of my scripts and checked that my sessions where not already open by using session_id. The only way i was able to make my sessions work in maj.palliscience.comis using the CGI version of PHP, but hell this is causing me problems i never thought it would. I'm having problems with headers, and also the $_SERVER variable is deadly different. So my question is simple, what could cause this problem. Windoze and IIS. =/ Could it be a clash in the filenames for the session files? Yes, AFAIK, the session names will clash. Meaning, for each DNS (subdomain, whatever it is), use a different prefix to avoid clashes: $_SESSION['www'][...] $_SESSION['dev'][...] $_SESSION['maj']...] etc. Obviously if some are in production, this is not a trivial change. I tried reading a bit the php.ini and saw there is a way to split the session files in different folders but i don't have the expertise nor the famous script the php.ini is talking about in the session section to fix or alter this info correctly. (I can't start tweaking this, there are other sites on the machine that are in production mode so i need a final configuration that will work on the first try) Keep in mind: 1) I got 3 other sites that sport the same code, only slightly different content 2) All the sessions in the other sites work marvelously in ISAPI 3) Only maj is affected, i tried copying the code to dev2.palliscience.com , problem doesn't show. 4) I can definitely say my sessions are problematic, i comment out any session_start, and the problem nevers shows This is a stab in the dark, but maybe the problem is not with session_start. Maybe session_start uses/calls something else which has a negative impact on your system. So you may be addressing the issue, but from the wrong angle?? Thanks Mathieu Dumoulin Well, I gave you a lot of useless information, but hopefully it sparks a fire! =D Good Luck. ~Philip I don't think there's a name clash in session file names... session identification is based on a browser cookie if I remember well PHPSESSIONID, and so are file names which (again, if my memory is right) are called sess_session_id where session_id is the aforementioned cookie. Cookies are different for different (sub)domains... so, the browser won't send the session cookie for www.domain.com to dev.domain.com... meaning both subdomains should get different session ids and session files (which cannot clash because the session id is generated randomly using an MD5 hash, right?). I would say the problem is at some point in the IIS-PHP communication. Maybe the browser is sending the session ID to the server, the server gets the session id, and when you use session_start it tries to grab the file which is locked (for some extrange and unknown windows reason as usual) and then it hangs waiting for the file to be available. I don't know if this will be of any help for you, but I'd locate the session files
Re: [PHP] PHP6 - MySQL 4.1.20
Hayden Livingston wrote: Hello, So I've been trying to compile PHP6 with MySQL 4.1.20 and it seems, I keep getting compile errors. It complains for MYSQL_TYPE_VARCHAR. Since php6 is alpha code, ask the -internals list. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ZVAL reference counter code execution
Hi all, Do I have to worry about the ZVAL overflow vulnerability if I don't use unserialize() in my code? Or is it used behind the scenes whether I call it directly or not? I have a web server running PHP 4.4.4 with only one custom application running on it. The server is dedicated to this one application. Thanks, Bill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Basic question - PHP usage of SVG files
Larry, Thank you for responding. I think you missed the point. SVG is just text. ... There's no need for SVG support per se, as SimpleXML provides all you need anyway. I did miss the point - thanks for setting me straight. However, I'm still unsure about using SVGs. On the one hand, what I'm using as source files are originally in SVG format and I want to be able to dynamically resize and scale them without loss of clarity. But, after they have been resized and scaled, then I think I need to send the resulting image to the browser in some raster image format. Indications are that SVG support on browsers is still not as uniform as PNG or other raster graphics formats. At that last step, assuming that I have manipulated the images to my satisfaction with SimpleXML, can I then output the result in PNG or JPG with PHP? I'm not so sure this can be done. The tricky part is that I am building PHP scripts that could be deployed on servers with different PHP settings, so I'm not confident that I can rely on PEAR or ImageMagick functions being present. Are they standard on PHP 5? Forgive me if my questions are clueless to the point of making the questions unclear. -- Dave M G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] image galleries
Does anyone know of an image gallery I can use on multiple pages of a website. I'd like to be able to click on the thumbnails and see a larger image. Hopefully something simple and easy to install. thanks, Lisa A -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Basic question - PHP usage of SVG files
On Wednesday 21 November 2007, Dave M G wrote: Larry, Thank you for responding. I think you missed the point. SVG is just text. ... There's no need for SVG support per se, as SimpleXML provides all you need anyway. I did miss the point - thanks for setting me straight. However, I'm still unsure about using SVGs. On the one hand, what I'm using as source files are originally in SVG format and I want to be able to dynamically resize and scale them without loss of clarity. That sounds like an excellent reason to use SVG for your image manipulation. But, after they have been resized and scaled, then I think I need to send the resulting image to the browser in some raster image format. Indications are that SVG support on browsers is still not as uniform as PNG or other raster graphics formats. Yeah, Firefox is the only browser I know of with native SVG support worth a damn. Konqueror keeps talking about it but I don't know if it's any good yet. Not sure about Opera or Safari. IE requires a plugin from Adobe, which the last time I was playing with it (which has been a while, but there were no signs of plans to improve it at the time) was OK, but not great and embedded a la flash in a fixed, immutable box. At that last step, assuming that I have manipulated the images to my satisfaction with SimpleXML, can I then output the result in PNG or JPG with PHP? With native PHP, I don't believe so. However, I know that there are assorted command line tools and Java tools to do so. I naturally can't think of them off the top of my head, but I know they exist. You could exec() out to them to cache the rasterized combined image to disk and then serve that. I don't know off hand if there's a PECL module or some user-space PHP code to do that. It's worth spending 10 min Googling it, though. I'm not so sure this can be done. The tricky part is that I am building PHP scripts that could be deployed on servers with different PHP settings, so I'm not confident that I can rely on PEAR or ImageMagick functions being present. Are they standard on PHP 5? Now that could be a problem. You'd have to find either some PHP user-space library or a CLI C library that you could bundle with the app. I'm fairly certain nothing like that is in stock PHP 5. As for finding a good such library, as I said Google would know better than I. (Or maybe I should say Yahoo, since they use PHP. g) Forgive me if my questions are clueless to the point of making the questions unclear. They make a lot more sense now, actually. :-) -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it. -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Should I put pictures into a database?
Michael McGlothlin wrote: I use a custom file system that caches large amounts of data in RAM. That way it's really fast and as easy to use as normal file system calls. It's called a relational database ;) Seriously. Databases like MySQL do not handle BLOB's with any sensible control hence the againsts quoted. A decent database working in cooperation with the operating system should be as fast at returning a block of raw data as searching the file system to find the same block and hand that data to the following process transparently. Firebird has always handled BLOB's reasonably well, and with the incremental backup facilities now available, ALL of the data can be safely managed and replicated to secondary machines. Managing 100s of thousands of images in a directory structure may not be the best way of managing a large volume of data, requiring searching through a tree of directories to get to a file, while storing the same in a flat file system WITHIN a database SHOULD be a more efficient alternative. Should I put pictures into a database? - depends on both the data base and the file system/OS :) -- Lester Caine - G8HFL - Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact L.S.Caine Electronic Services - http://home.lsces.co.uk MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/ Firebird - http://www.firebirdsql.org/index.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Should I put pictures into a database?
On Thu, 2007-11-22 at 06:22 +, Lester Caine wrote: Michael McGlothlin wrote: I use a custom file system that caches large amounts of data in RAM. That way it's really fast and as easy to use as normal file system calls. It's called a relational database ;) Seriously. Databases like MySQL do not handle BLOB's with any sensible control hence the againsts quoted. A decent database working in cooperation with the operating system should be as fast at returning a block of raw data as searching the file system to find the same block and hand that data to the following process transparently. Firebird has always handled BLOB's reasonably well, and with the incremental backup facilities now available, ALL of the data can be safely managed and replicated to secondary machines. Managing 100s of thousands of images in a directory structure may not be the best way of managing a large volume of data, requiring searching through a tree of directories to get to a file, while storing the same in a flat file system WITHIN a database SHOULD be a more efficient alternative. Should I put pictures into a database? - depends on both the data base and the file system/OS :) There's lots of reasons to do either. For one project I keep images in a database. When the browser makes a request for the image via a specially crafted URL it either gets a direct hit or invokes PHP's 404 handler. Using the 404 handler I can then pull the image out of the database, scale it's dimensions according to the URL and save to filesystem and then set the header to status 200 and flush the image. using this technique subsequent requests come from the file system while internally I have the convenience of the database. Once a day I have a cron job traverse the image version directory and purge any older than X days. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php