Re: [PHP] php generated javascript
On 8/30/06, Shu Hung (Koala) [EMAIL PROTECTED] wrote: On 8/31/06, Peter Lauri [EMAIL PROTECTED] wrote: Koala, There is no difference with the php generated javascript and javascript on a static html page. Take a look at the source code of the page that has been generated in the browser, and if that one looks as it should, it is probably your javascript that is not doing what it should :) And if that is the case you can join the [EMAIL PROTECTED] list for that purpose. /Peter Petar, Thanks for your reply. I've used some server side cache for that javascript generation now. It works a lot better. Seems to me that it takes too long to generate the javascript. Sometimes browsers decided to ignores the javascript and just run. You might want to be more elaborate than that... What is considered longer, What do you mean it ignores the javascript? I used document.write in that javascript. When it isn't loaded completely, nothing shows. I wonder if there is any better way. This i dont understand, perhaps an example of what you are doing? Curt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Free Shopping Carts
On 8/30/06, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] Are there free shopping carts that would work with PHP 5.0.X + and MySQL 4.1.X + and /or PostgresQL 8.1+ ? [/snip] Yes. Just in case: Try google: 'php mysql shopping' cart or 'php pgsql shopping cart' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RSS Creator
Has anyone created an RSS feed creator in PHP? I could make one fast enough, but ... John -- John Taylor-Johnston - If it's not Open Source, it's Murphy's Law. '''Cégep de Sherbrooke: ô¿ôhttp://www.cegepsherbrooke.qc.ca/languesmodernes/ - 819-569-2064 °v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures /(_)\ Université de Sherbrooke ^ ^ http://compcanlit.ca/ T: 819.569.2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange situation when saving a file
Please remove your 'this message is for the sole use of the person...' thing or simply use a different account to ask questions.. On 8/29/06, Miguel Guirao [EMAIL PROTECTED] wrote: Hi all, I'm using ob_start() in order to save the content of a web page into a variable string and then save it into a file in the file system. Every thing is done OK. The only workaround I'm doing is adding a .doc file extension when saving the file, in order to open the file in Word. So you are adding a .doc extension so word can render the html file as a wor doccument? Once the file has been created and saved as I doc file (not a doc format!), I e-mail it! When the client gets the e-mail, he/she should open the file either by saving the file to the local system or openning the file directly from the e-mail attachment. Either way, I got a blank page in Word. If I open the document directly from the web server, without having it sent by e-mail, it opens correctly in Word. The only problem is when the file is been emailed!!! what you want to do is send the file you saved to a file as an attatchment, if you are already doing so the problem is with how you are composing the email that is sent to the client. You are dealing with many issues, where the problem exists depends on a lot of issues. [snip] Este mensaje es exclusivamente para el uso de la persona o entidad a quien esta dirigido; [/snip] again, do avoid using accounts that use this Curt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] send a file or stream
On 8/29/06, Rafael Mora [EMAIL PROTECTED] wrote: Hi! i want to send a file or output stream in a .php, but first compress it, I tryed the example to compress files but how do i do to send as answer to the http request?? Unlike my recent posts, this could be a candidate for using ob_* There is no need to compress it first, just use ob_start('ob_gzhandler'); if the client supports a compression method, no special things are needed and the content sent is compressed otherwise it is sent without compression. see http://php.net/ob-gzhandler for more info. HTH, Curt. Curt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Not using cached version
On 8/30/06, Stut [EMAIL PROTECTED] wrote: Peter Lauri wrote: I have some images stored in a database (only file name and other relevant information, rest stored in file system). I use the following html to access them: img src='image.php?imageid=123' / At some pages I have the same image, so that tag will be seen on multiple places on the same page. So what I am curious is why all of the different images are loaded separately, instead of just recognizing that they are the same and use a cache version? This is the code that do all the work: Header (Content-type: $image_type); readfile(files/$image); I am a little bit lost here; kick me in the right direction if you can :) Probably because the browser sees the ? in the URL, thinks dynamic and doesn't cache the result. You can set caching headers to get around this You also have to remember that php by default sends the headers to prevent caching, take a look at the headers responded via a static .jpg file and a php page tha sends an image; You'll notice all those extra no-cache type headers that enforce any browser to not reload a (local) cached version of the file. To get best performance support a HEAD request: send last-modified: and content-length: with the orignal sending of the file and within your php script if the client requests a IF_MODIFIED_SINCE header check the header against the value, if it matches respond with something like: header('HTTP/1.0 304 Not modified'); exit; support partial requests: check for the http header for partial content requests (I forget the name, perhaps someone can remind me of it) and respond according to the http specs. HTH, Curt. (Google for it), or if you want *all* browsers to do it right, even the poorly implemented ones, you could modify the URL so it doesn't have the ?. I do this using the Apache MultiViews option and a URL similar to /image/123.gif. That actually runs /image.php which pulls the REQUEST_URI server variable apart to get the required image. Do both and you should be good for all browsers. -Stut -- 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] image manipulation with php
On 8/29/06, Ross [EMAIL PROTECTED] wrote: I have an saved images I output with this... img src=includes/viewphoto.php?id=?=$photo? I want to use getimagesize() to get the height and width of the image and if it is above a certain size then scale/ reduce it. The problems are (i) using getimage() without a url just my viewphoto.php script I'm not sure what you mean here. (ii) comparing and reducing the file reducing a file tends to follow the logic of some sort: $size = GetImageSize ($image); $ratio = $size[0]/$size[1]; if ($ratio 1) { $width = $max_size; $height = ($max_size/$size[0]) * $size[1]; } else { $width = ($max_size/$size[1]) * $size[0]; $height = $max_size; } where $max_size is the largest you want your image to be in width, then just copy it it into a new image create at that size There are a lot of samples of this on google as jochem suggested. Curt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file type and recode
On 8/29/06, Martin Marques martin@bugs.unl.edu.ar wrote: Simple question: Is there a built-in function in PHP to get the charset of a file, so that I can pass the right parameters to recode_file()? It depends. If it is a .txt file (nope) a .doc file (mabey, pending the .doc format) a .xml file (most likely, unless it is a poorly formatted xml file) It all depends how the document is stored and if it keeps the charset within the document. Curt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help - outputting a jpeg
On 8/29/06, Ross [EMAIL PROTECTED] wrote: I just get all the binary data output ? include(includes/config.php); $link = mysql_connect($host, $user, $password) or die ('somethng went wrong:' .mysql_error() ); mysql_select_db($dbname, $link) or die ('somethng went wrong, DB error:' .mysql_error() ); $query = SELECT DISTINCT gallery FROM thumbnails; $result = @mysql_query( $query,$link ); and also dont use @ to suppress errors it will cause your more problems, turn off display_errors and keep error_reportlng at minimum E_WARNING, and log the errors to a file. Curt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problems with UTF
:: top posted to be consistant:: I would go as far as configuring your default php.ini to send utf-8 as the default charset. Curt. On 8/28/06, Peter Lauri [EMAIL PROTECTED] wrote: Hi, Have you set header('Content-Type: text/html; charset=utf-8'); in your php script that you call via AJAX? -Original Message- From: mbneto [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 29, 2006 2:57 AM To: php-general@lists.php.net Subject: [PHP] Problems with UTF Hi, I have a php based script that is called from a html page via ajax. Everything runs fine except when I use characters such as á that ends up like A! After searching and testing I found that if I remove the encodeURIComponentfrom the javascript and replace with escape everything works fine. So the question is what can I do from PHP side to make it play nice with those UTF encoded chars generated from encodeURIComponent? Since escape is deprecated I'd like to find out before I have tons of files to change tks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: image manipulation with php
On 8/29/06, zerof [EMAIL PROTECTED] wrote: http://www.educar.pro.br/abc/gdlib/index.php?pageNum_rsNVER=22totalRows_rsNVER=67 zerof speako englisho, solo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Email with pregmatch
On 8/27/06, Dave Goodchild [EMAIL PROTECTED] wrote: Try this: preg_match(/^([a-zA-Z0-9.])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/, $_POST['email']); So: [EMAIL PROTECTED] is valid? Curt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Email with pregmatch
On 8/27/06, Peter Lauri [EMAIL PROTECTED] wrote: I found this on google, does this LONG function do anything more then your preg_match? i think a combo of what the function does and a few regex's will work. The issue is more on how idoes it pass all the rfc's on each part of the address, for a quick reference of rfc's: http://en.wikipedia.org/wiki/E-mail_address An address consists of: [EMAIL PROTECTED] so the question is does it pass local tests, which should be rather simple, the domain part gets rather complcated since you cant predict at what domain level we are talking about: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] There is a pcre expression out there somewhere in perl land that is considered to validate all the rfc requirements of the address and is about 50 lines worth of regular expressions with a lot of backward matching and forward matching conditions. So the only simple logic you can really apply is split on the @; is local ok? are each part of the domains valid according to the rfc's. typically it is safe to say if they put at least two periods in a name and the characters between those periods are valid chars then it is a valid input ( of course it doesn't mean it is a valid email) I suppose the least you want to do is limit addresses people can use so: local ~~ assumed invalid (no @), unless you only want local addresses [EMAIL PROTECTED] ~~ assumed invalid since there is no tld (unless you want a local address) everything else is valid (as long as it passes all the tests) So with that you want an expression that allows for: (valid_local){1}@(valid_domain.)+(valid_tld){1} where: valid_local = a valid local addres valid_domain = a valid domain name valid_tld = a valid tld . = period (dot) {1} = must match once + = must have 1, can have more Making a pcre expression can get complicated, breaking it apart and validating each section will probably make it easier to deal with. Curt. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strip slashes from beginning and end of string in one expression
PHP list. This is another regular expression type of question. The very handy PHP function trim() takes excess white space off the beginning and end of a string. I'd like to be able to do the same thing, except instead of white spaces, trim excess slashes: / So for example, all of these: /this/that/ /this/that this/that/ this/that ... become: this/that There is also the chance of more than one slash occurring inside the desired text: /this/that/this/that/ So that would also need to be accounted for. The above example should become: this/that/this/that I think I need to use preg_replace() for this, but, as ever, regular expressions completely throw me. If I'm not mistaken, #^/*# should get me the first slash of the string, and more if there are more. And #*/$# should get me the last slash of the string, and more if there are more. Can I test for the first and last slash in the same expression? I think I either need something between the two that says ignore what's in the middle, or and and/or statement to say replace if this occurs at the end, or at the beginning, or both. I've looked around and can't seem to find a way of connecting these in the same search. However, I'm sure that is because I'm not familiar enough with regular expressions to know what I'm looking at. How would I connect #^/*# and #*/$# into one regular expression? Thank you for your time and advice. -- Dave M G Ubuntu 6.06 LTS Kernel 2.6.17.7 Pentium D Dual Core Processor PHP 5, MySQL 5, Apache 2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strip slashes from beginning and end of string in one expression
Dave M G wrote: This is another regular expression type of question. The very handy PHP function trim() takes excess white space off the beginning and end of a string. I'd like to be able to do the same thing, except instead of white spaces, trim excess slashes: / So for example, all of these: /this/that/ /this/that this/that/ this/that ... become: this/that Why do people insist on over-complicating things with regexes? They're not the best tool for every job! Read the manual page for the trim function (http://php.net/trim) and try using the second parameter. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file type and recode
On Wed, 30 Aug 2006, Curt Zirzow wrote: On 8/29/06, Martin Marques martin@bugs.unl.edu.ar wrote: Simple question: Is there a built-in function in PHP to get the charset of a file, so that I can pass the right parameters to recode_file()? It depends. If it is a .txt file (nope) a .doc file (mabey, pending the .doc format) a .xml file (most likely, unless it is a poorly formatted xml file) It all depends how the document is stored and if it keeps the charset within the document. I want something more like the output of the unix command file -i (without running a system call). And yes, they are text files. -- 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18 - Lic. Martín Marqués | SELECT 'mmarques' || Centro de Telemática| '@' || 'unl.edu.ar'; Universidad Nacional| DBA, Programador, del Litoral | Administrador - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: strip slashes from beginning and end of string in one expression
Dave M G wrote: PHP list. This is another regular expression type of question. The very handy PHP function trim() takes excess white space off the beginning and end of a string. I'd like to be able to do the same thing, except instead of white spaces, trim excess slashes: / So for example, all of these: /this/that/ /this/that this/that/ this/that ... become: this/that There is also the chance of more than one slash occurring inside the desired text: /this/that/this/that/ So that would also need to be accounted for. The above example should become: this/that/this/that I think I need to use preg_replace() for this, but, as ever, regular expressions completely throw me. If I'm not mistaken, #^/*# should get me the first slash of the string, and more if there are more. And #*/$# should get me the last slash of the string, and more if there are more. Can I test for the first and last slash in the same expression? I think I either need something between the two that says ignore what's in the middle, or and and/or statement to say replace if this occurs at the end, or at the beginning, or both. I've looked around and can't seem to find a way of connecting these in the same search. However, I'm sure that is because I'm not familiar enough with regular expressions to know what I'm looking at. How would I connect #^/*# and #*/$# into one regular expression? Thank you for your time and advice. -- Dave M G Ubuntu 6.06 LTS Kernel 2.6.17.7 Pentium D Dual Core Processor PHP 5, MySQL 5, Apache 2 something like $trimmed = preg_replace('#^/*(.+)/*$#m', '$1', $string) should work -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] send a file or stream
Thank you very much Curt!, I'm tests right now with this. The client is not a web browser, it is an application that calls the .php file with $_GET params, and the app waits to receive the file compressed, this is the way I want it to work! I'll let u know about this. But anyway thank you Rafa PS: what is that ob_start though? On 8/31/06, Curt Zirzow [EMAIL PROTECTED] wrote: On 8/29/06, Rafael Mora [EMAIL PROTECTED] wrote: Hi! i want to send a file or output stream in a .php, but first compress it, I tryed the example to compress files but how do i do to send as answer to the http request?? Unlike my recent posts, this could be a candidate for using ob_* There is no need to compress it first, just use ob_start('ob_gzhandler'); if the client supports a compression method, no special things are needed and the content sent is compressed otherwise it is sent without compression. see http://php.net/ob-gzhandler for more info. HTH, Curt. Curt.
Re: [PHP] Free Shopping Carts
On Thu, Aug 31, 2006 at 09:56:44AM +0200, Jose Leon wrote: Hello, On 8/31/06, The Doctor [EMAIL PROTECTED] wrote: Are there free shopping carts that would work with PHP 5.0.X + and MySQL 4.1.X + and /or PostgresQL 8.1+ ? I think it's not so hard to tell you an url, right? ;-) http://www.oscommerce.com Actually we , customer and myself as admin, ran into: New Installation Please customize the new installation with the following options: Import Catalog Database: Fatal error: Call to undefined function osc_draw_checkbox_field() in /path/to/shop/install/templates/pages/install.php on line 24 MYSQL used as DB. Why did the above take place? Regards -- qstudio :: PHP Visual RAD development environment http://www.qadram.com/products.php -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- Member - Liberal International This is [EMAIL PROTECTED] Ici [EMAIL PROTECTED] God Queen and country! Beware Anti-Christ rising! New Brunswick kick out the Harper Puppet and VOTE LIBERAL on 18 Sept 2006 -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Free Shopping Carts
[snip] Actually we , customer and myself as admin, ran into: New Installation Please customize the new installation with the following options: Import Catalog Database: Fatal error: Call to undefined function osc_draw_checkbox_field() in /path/to/shop/install/templates/pages/install.php on line 24 MYSQL used as DB. Why did the above take place? [/snip] Because the function osc_draw_checkbox_field() was called from /path/to/shop/install/templates/pages/install.php on line 24 and does not appear to exist. Look at install.php on line 24 and then follow the trail back to where the function should exist. There are probably some include files above line 24. Oscommerce has forums at http://forums.oscommerce.com/ I searched for osc_draw_checkbox_field() in the form and came up with http://forums.oscommerce.com/index.php?act=SearchCODE=simpleresultssid =910579afc7e9c2d09ea1c8d7e3b250f2highlite=osc_draw_checkbox_field%28%29 which appears to be a pretty in depth discussion of the error at hand. I have decided not to post that discussion here because this e-mail would become unnecessarily long and is pretty much an osCommerce issue rather than a PHP issue. Can we do anything else for you today? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] remove SimpleXML nodes
Hi all, Is there any way to remove a non-unique* *node using SimpleXML? For example, let's say I have: $myXML = ENDXML database ... table name='one' ... /table table name='two' ... /table table name='three' ... /table /database ENDXML; So I want to do... $xmlDatabase = new SimpleXMLElement($myXML); foreach ($xmlDatabase as $oneTable) { if ($oneTable['name'] == 'two') { /// HERE I WANT TO DELETE THE $oneTable NODE unset($oneTable); // -- and this doesn't work... } } any ideas?
[PHP] Re: strip slashes from beginning and end of string in one expression
M. Sokolewiczz, Stut, Thank you for your answers. Both are very helpful. I will use the trim() method, although it's helpful to know the regular expression for learning purposes. Unless I can find a way to make things much more complicated. Your time and advice is much appreciated. -- Dave M G Ubuntu 6.06 LTS Kernel 2.6.17.7 Pentium D Dual Core Processor PHP 5, MySQL 5, Apache 2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] remove SimpleXML nodes
On Thu, 2006-08-31 at 14:38 +0200, Javier Ruiz wrote: So I want to do... $xmlDatabase = new SimpleXMLElement($myXML); foreach ($xmlDatabase as $oneTable) { if ($oneTable['name'] == 'two') { /// HERE I WANT TO DELETE THE $oneTable NODE unset($oneTable); // -- and this doesn't work... } } I tried to do the same a while back and could not figure it out. I think that SimpleXML is just that - simple. You should rather try using DOMXML functions, or as I did, roll an XML parser and do it like that. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Texture and wrap
Hi I would like to output an image from php where an input image is textured and wrapped around a frame. Like when you assemble a canvas on a frame (on, not under). So I get a sort of canvas looking texture on the image and that the edges of the image are wrapped around the sides of the frame in a 3d-ish look. Do you understand what I mean? Is this somehow possible? I guess I would use gd and maybe a transparent png to get the texture, or am I way off? The wrapping thing I have no clue how to make. Thanks for your time! Regards Emil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php and Cygwin SVN
Hello list, I'm developing an application that fetches some files from a local svn repository, and shows them on request (using svn cat, svn list and such). Originally, it was deployed in Linux (Apache, PHP5.0) and worked perfectly well. I tried to port it to Windows (specifically, WinXP Pro SP2, PHP5, IIS5), and because it depends on many command line utilities, i decided to install cygwin. After struggling a bit, i got it working. The thing is that, when executing any cygwin svn command (via shell_exec), many command windows pops up appears on the windows desktop, making the sistem quite slow during the process. I realized that, this happens because of shell_exec opening a new shell on every command call, i tried the other exec functions, but the same happened. I wonder if it is posible to launch those commands in a silent manner. Thanks, Mariano.- -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.11.7/434 - Release Date: 30/08/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Texture and wrap
Hi Thanks, but what I meant with wrapping around a frame was this: http://www.proformat.se/gfx/pic_006_kilram.jpg Not just a normal frame around the image. Emil Emil: Yes, that can be done by simply merging images (i.e., watermark). For example: http://xn--ovg.com/watermark The texture image should be to some degree transparent and the frame simply larger OR be added via css. hth's tedd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Texture and wrap
At 4:08 PM +0200 8/31/06, Emil Edeholt wrote: Hi I would like to output an image from php where an input image is textured and wrapped around a frame. Like when you assemble a canvas on a frame (on, not under). So I get a sort of canvas looking texture on the image and that the edges of the image are wrapped around the sides of the frame in a 3d-ish look. Do you understand what I mean? Is this somehow possible? I guess I would use gd and maybe a transparent png to get the texture, or am I way off? The wrapping thing I have no clue how to make. Thanks for your time! Regards Emil Emil: Yes, that can be done by simply merging images (i.e., watermark). For example: http://xn--ovg.com/watermark The texture image should be to some degree transparent and the frame simply larger OR be added via css. hth's 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] Email with pregmatch
At 1:11 AM -0700 8/31/06, Curt Zirzow wrote: so the question is does it pass local tests, which should be rather simple, the domain part gets rather complcated since you cant predict at what domain level we are talking about: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] The last email address is not valid because it has no TLD (top level domain) -- that's probably just an omission error. One thing to add to this topic is multilingual domains, which use PUNYCODE. This is a technique that uses ASCII characters to represent Unicode code points -- a mapping and look-up function. For IE browsers and many email programs (in fear of homographic attacks) do not translate multilingual domains properly. Instead, multilingual domains will be shown with a xn-- prefix, such as: [EMAIL PROTECTED]whatever.TLD Like: http://xn--ovg.com This prefix is probably the last one to be used, but it was not the first. PUNYCODE was never meant to be seen by the end user, but M$ had other ideas -- if your native language is other than English, apparently M$ doesn't care. IMO, that's a giant step backwards for true global access to the Internet, but I digress. So, in any evaluation to determine valid email addresses, one should also consider xn-- appearing at the start of the domain name, such as: [EMAIL PROTECTED] hth's tedd PS: So Curt, what's your solution? -- --- 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] Re: Php and Cygwin SVN
Mariano Guadagnini wrote: Hello list, I'm developing an application that fetches some files from a local svn repository, and shows them on request (using svn cat, svn list and such). Originally, it was deployed in Linux (Apache, PHP5.0) and worked perfectly well. I tried to port it to Windows (specifically, WinXP Pro SP2, PHP5, IIS5), and because it depends on many command line utilities, i decided to install cygwin. After struggling a bit, i got it working. The thing is that, when executing any cygwin svn command (via shell_exec), many command windows pops up appears on the windows desktop, making the sistem quite slow during the process. I realized that, this happens because of shell_exec opening a new shell on every command call, i tried the other exec functions, but the same happened. I wonder if it is posible to launch those commands in a silent manner. Thanks, Mariano.- There is a windows port of Subversion, and the GNU utilities you're referring to have mostly been ported to Windows without the use of cygwin (see gnuwin32). Do you really need to rely on cygwin? Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error Handling Library?
I've been doing some research and was wondering if anyone out there has written a library for error handling? I haven't found anything as of yet but would love to hear suggestions! Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error Handling Library?
Hi!, u can extend the exception class and handle ur own errors, If u need help let me know! Rafa On 8/31/06, Jay Paulson [EMAIL PROTECTED] wrote: I've been doing some research and was wondering if anyone out there has written a library for error handling? I haven't found anything as of yet but would love to hear suggestions! Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error Handling Library?
On Thu, 2006-08-31 at 11:12 -0500, Jay Paulson wrote: I've been doing some research and was wondering if anyone out there has written a library for error handling? I haven't found anything as of yet but would love to hear suggestions! PEAR Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Texture and wrap
Emil: To continue top posting. Dude, an image is an image. You're not wrapping anything -- you're just producing an image that looks a certain way. My first example did not just put a frame around an image, it merged two images. If I had wanted to put a frame around your image, I would have done this: http://xn--ovg.com/pframes Incidentally, styles #4 and #2 put a shadow around it, which could be expanded to mimic what I think you want. I suggest that you back up and re-read what I said. tedd At 5:05 PM +0200 8/31/06, Emil Edeholt wrote: Hi Thanks, but what I meant with wrapping around a frame was this: http://www.proformat.se/gfx/pic_006_kilram.jpg Not just a normal frame around the image. Emil Emil: Yes, that can be done by simply merging images (i.e., watermark). For example: http://xn--ovg.com/watermark The texture image should be to some degree transparent and the frame simply larger OR be added via css. hth's 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] remove SimpleXML nodes
So I want to do... $xmlDatabase = new SimpleXMLElement($myXML); foreach ($xmlDatabase as $oneTable) { if ($oneTable['name'] == 'two') { /// HERE I WANT TO DELETE THE $oneTable NODE unset($oneTable); // -- and this doesn't work... } } I tried to do the same a while back and could not figure it out. I think that SimpleXML is just that - simple. You should rather try using DOMXML functions, or as I did, roll an XML parser and do it like that. Why can't you just recreate the XML and skip the node you don't want to include? So something like below: foreach ($xmlDatabase as $oneTable) { // skip node you don't want in your final xml output if ($oneTable['name'] != 'two') { } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] remove SimpleXML nodes
Yes, I agree. SimpleXML is limited. Do not expect to find advanced features in SimpleXML. Regards. On 8/31/06, Jay Paulson [EMAIL PROTECTED] wrote: So I want to do... $xmlDatabase = new SimpleXMLElement($myXML); foreach ($xmlDatabase as $oneTable) { if ($oneTable['name'] == 'two') { /// HERE I WANT TO DELETE THE $oneTable NODE unset($oneTable); // -- and this doesn't work... } } I tried to do the same a while back and could not figure it out. I think that SimpleXML is just that - simple. You should rather try using DOMXML functions, or as I did, roll an XML parser and do it like that. Why can't you just recreate the XML and skip the node you don't want to include? So something like below: foreach ($xmlDatabase as $oneTable) { // skip node you don't want in your final xml output if ($oneTable['name'] != 'two') { } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Anas Mughal
[PHP] Eaccelerator
All, I have just had some very pleasing success with Eaccelerator on windows. Has anyone else been trying this on windows. Has anyone had production experience with this? Thanks for any feedback. I have written up the work I have done so far at http://nerds-central.blogspot.com/2006/08/eaccelerator-rocks.html Cheers AJ -- www.deployview.com www.nerds-central.com www.project-network.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] remove SimpleXML nodes
I found sample code. Hope this helps. $doc = new DOMDocument; if (!is_dir($source_dir)) { $logger-fatal(Source directory IN is not found. Terminating...); die(Source directory IN is not found. Terminating...); } $doc-Load($source_dir . / . $xmlfilename); $xpath = new DomXPath($doc); // Find parent node $parent = $xpath-query($parent_path); // new node will be inserted before this node $next = $xpath-query($next_path); // Create the new element $contentidelement = $doc-createElement('source_id', $contentid); $element = $doc-createElement('fallback', 'true'); $secondelement = $doc-createElement('fallback_locale', $originatingLocale); // Insert the new element $parent-item(0)-insertBefore($contentidelement, $next-item(0)); $parent-item(0)-insertBefore($element, $next-item(0)); $parent-item(0)-insertBefore($secondelement, $next-item(0)); //remove the language_code node. $parent-item(0)-removeChild($next-item(0)); // append new node $newNode = $doc-createElement(language_code, $currentfallbacklocale); $parent-item(0)-appendChild($newNode); -- Anas Mughal On 8/31/06, Anas Mughal [EMAIL PROTECTED] wrote: Yes, I agree. SimpleXML is limited. Do not expect to find advanced features in SimpleXML. Regards. On 8/31/06, Jay Paulson [EMAIL PROTECTED] wrote: So I want to do... $xmlDatabase = new SimpleXMLElement($myXML); foreach ($xmlDatabase as $oneTable) { if ($oneTable['name'] == 'two') { /// HERE I WANT TO DELETE THE $oneTable NODE unset($oneTable); // -- and this doesn't work... } } I tried to do the same a while back and could not figure it out. I think that SimpleXML is just that - simple. You should rather try using DOMXML functions, or as I did, roll an XML parser and do it like that. Why can't you just recreate the XML and skip the node you don't want to include? So something like below: foreach ($xmlDatabase as $oneTable) { // skip node you don't want in your final xml output if ($oneTable['name'] != 'two') { } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Anas Mughal -- Anas Mughal
Re: [PHP] Texture and wrap
Emil Edeholt wrote: I would like to output an image from php where an input image is textured and wrapped around a frame. Like when you assemble a canvas on a frame (on, not under). So I get a sort of canvas looking texture on the image and that the edges of the image are wrapped around the sides of the frame in a 3d-ish look. Your description is pretty ambiguous, so I'm going to take a guess... I think what you're talking about is essentially doing 3D rendering. Taking an abitrary shape made of polygons (the frame) and wrapping a texture around it to form a 3d-ish looking object...? I'm not familiar with any way of doing it, but: - http://pear.php.net/package/Image_3D might be a start - http://www.icarusindie.com/DoItYourSelf/rtsr/php3d/ has a pretty neat little writeup on how to do software 3D rendering in PHP. You could use the same principles to do 3D. jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Texture and wrap
Hi again Sorry if I was unclear what I wanted was of course what Jon Anderson said. I wanted what was pictured in the image I posted (the look of wrapping a canvas over a frame) with some kind of fake or simple 3d rendering. The pear libs for doing it seems like what I was looking for, I hope it will look good and that it's fast/easy enough for me to implement. Thanks both of you. tedd wrote: Emil: To continue top posting. Dude, an image is an image. You're not wrapping anything -- you're just producing an image that looks a certain way. My first example did not just put a frame around an image, it merged two images. If I had wanted to put a frame around your image, I would have done this: http://xn--ovg.com/pframes Incidentally, styles #4 and #2 put a shadow around it, which could be expanded to mimic what I think you want. I suggest that you back up and re-read what I said. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Php and Cygwin SVN
Thanks for your reply. I checked those ports and seem nice. Actually, i use cygwin mainly because it was already installed on the Windows server. But the same problem arises with any command I execute trough shell_exec, no matter if it's a cygwin executable or a windows native app, the command shell pop ups always. There should be some way to execute something without the cmd windows opening again and again, i guess. Any ideas? Adam Zey wrote: Mariano Guadagnini wrote: Hello list, I'm developing an application that fetches some files from a local svn repository, and shows them on request (using svn cat, svn list and such). Originally, it was deployed in Linux (Apache, PHP5.0) and worked perfectly well. I tried to port it to Windows (specifically, WinXP Pro SP2, PHP5, IIS5), and because it depends on many command line utilities, i decided to install cygwin. After struggling a bit, i got it working. The thing is that, when executing any cygwin svn command (via shell_exec), many command windows pops up appears on the windows desktop, making the sistem quite slow during the process. I realized that, this happens because of shell_exec opening a new shell on every command call, i tried the other exec functions, but the same happened. I wonder if it is posible to launch those commands in a silent manner. Thanks, Mariano.- There is a windows port of Subversion, and the GNU utilities you're referring to have mostly been ported to Windows without the use of cygwin (see gnuwin32). Do you really need to rely on cygwin? Regards, Adam Zey. -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.11.7/434 - Release Date: 30/08/2006 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Php and Cygwin SVN
Look into the syntax of the Windows command start (open a console and type start /?). It's purpose is to start other processes, and it provides some flexibility as to how they're launched. One of the options is to hide the console windows. Regards, Adam Zey. Mariano Guadagnini wrote: Thanks for your reply. I checked those ports and seem nice. Actually, i use cygwin mainly because it was already installed on the Windows server. But the same problem arises with any command I execute trough shell_exec, no matter if it's a cygwin executable or a windows native app, the command shell pop ups always. There should be some way to execute something without the cmd windows opening again and again, i guess. Any ideas? Adam Zey wrote: Mariano Guadagnini wrote: Hello list, I'm developing an application that fetches some files from a local svn repository, and shows them on request (using svn cat, svn list and such). Originally, it was deployed in Linux (Apache, PHP5.0) and worked perfectly well. I tried to port it to Windows (specifically, WinXP Pro SP2, PHP5, IIS5), and because it depends on many command line utilities, i decided to install cygwin. After struggling a bit, i got it working. The thing is that, when executing any cygwin svn command (via shell_exec), many command windows pops up appears on the windows desktop, making the sistem quite slow during the process. I realized that, this happens because of shell_exec opening a new shell on every command call, i tried the other exec functions, but the same happened. I wonder if it is posible to launch those commands in a silent manner. Thanks, Mariano.- There is a windows port of Subversion, and the GNU utilities you're referring to have mostly been ported to Windows without the use of cygwin (see gnuwin32). Do you really need to rely on cygwin? Regards, Adam Zey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: character set when sending emails with PHP
Hello, on 08/30/2006 06:48 AM Angelo Zanetti said the following: I have various PHP CRONTAB scripts that run and send automated emails to people, the subject often contains the TM character: ™, in most of the email clients the character shows correctly but in some webmail applications the character is replaced with a square, it obviously doesnt recognise the character. Now if I forward one the mails from the email client to the webmail account it then recognises and shows the character correctly? Very weird as it is the same mail just forwarded, is the problem that the mail forwarded from the email client uses a different content type when sent? The one specified in the PHP script is as follows: $mail-setHeader(Content-type, text/plain; charset=iso-8859-1); Or is there something wrong with the charset that I'm specifying above? The content-type header only applies to that message body part. The character set of the headers is defined in a different way using q-encoding. Take a look at this class that lets you define headers with whatever encoding and character set you need to use: http://www.phpclasses.org/mimemessage thanks for the reply, I've got the classes now how do I know which character set to use for the TM to be shown correctly? I think chr(153). I can see it with iso-8859-1 but I am not sure if it is a legal character for this character set. You can always specify windows-1252 as character set to make sure it works. -- Regards, Manuel Lemos Metastorage - Data object relational mapping layer generator http://www.metastorage.net/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Free Shopping Carts
Curt Zirzow wrote: On 8/30/06, Jay Blanchard [EMAIL PROTECTED] wrote: [snip] Are there free shopping carts that would work with PHP 5.0.X + and MySQL 4.1.X + and /or PostgresQL 8.1+ ? [/snip] Yes. Just in case: Try google: 'php mysql shopping' cart or 'php pgsql shopping cart' Freaking goody, goody. ;) -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Free Shopping Carts
Jay Blanchard wrote: Can we do anything else for you today? I'm a php programmer and I have a valve knocking in the engine of my car. Can you fix it? -- John C. Nichel IV Programmer/System Admin (ÜberGeek) Dot Com Holdings of Buffalo 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: remove SimpleXML nodes
Javier Ruiz wrote: Hi all, So I want to do... $xmlDatabase = new SimpleXMLElement($myXML); foreach ($xmlDatabase as $oneTable) { if ($oneTable['name'] == 'two') { /// HERE I WANT TO DELETE THE $oneTable NODE unset($oneTable); // -- and this doesn't work... } } any ideas? The answer is simple, everybody else seems to have missed it. foreach() makes a copy of the array before working on it. Changes made to $oneTable would obviously never affect the original. You're just unsetting a temporary variable that's going to be overwritten next time through the loop anyhow. You should have better luck with this code: $xmlDatabase = new SimpleXMLElement($myXML); foreach ($xmlDatabase as $key = $oneTable) { if ($oneTable['name'] == 'two') { /// HERE I WANT TO DELETE THE $oneTable NODE unset($xmlDatabase[$key]); } } What that is doing is having foreach also get the key of the array element that $oneTable represents. It then does the unset() on the original table instead of the copy. Remember that all array elements have keys, even if you didn't set one or it doesn't look like they should. In this case, you don't know what the key is internally, and you don't care either. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: remove SimpleXML nodes
On 8/31/06, Adam Zey [EMAIL PROTECTED] wrote: Javier Ruiz wrote: Hi all, So I want to do... $xmlDatabase = new SimpleXMLElement($myXML); foreach ($xmlDatabase as $oneTable) { if ($oneTable['name'] == 'two') { /// HERE I WANT TO DELETE THE $oneTable NODE unset($oneTable); // -- and this doesn't work... } } any ideas? The answer is simple, everybody else seems to have missed it. foreach() makes a copy of the array before working on it. Changes made to $oneTable would obviously never affect the original. You're just unsetting a temporary variable that's going to be overwritten next time through the loop anyhow. You should have better luck with this code: $xmlDatabase = new SimpleXMLElement($myXML); foreach ($xmlDatabase as $key = $oneTable) fwiw, In php5 you can do something like: foreach ($xmlDatabase as $key = $oneTable) //note the -- unset($oneTable); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Texture and wrap
tedd wrote: http://xn--ovg.com/pframes Whoa, nice work Tedd! :) Very cool. Gives me some fun ideas... thanks for sharing. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Texture and wrap
On Thu, 2006-08-31 at 16:23 -0700, Micky Hulse wrote: tedd wrote: http://xn--ovg.com/pframes Whoa, nice work Tedd! :) Very cool. Gives me some fun ideas... thanks for sharing. Tedd, I'm very disappointed that it doesn't render properly in Opera 9. What is with the lockout Opera users vibe I'm feeling?? :B Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Texture and wrap
At 7:31 PM -0400 8/31/06, Robert Cummings wrote: On Thu, 2006-08-31 at 16:23 -0700, Micky Hulse wrote: tedd wrote: http://xn--ovg.com/pframes Whoa, nice work Tedd! :) Very cool. Gives me some fun ideas... thanks for sharing. Tedd, I'm very disappointed that it doesn't render properly in Opera 9. What is with the lockout Opera users vibe I'm feeling?? :B Cheers, Rob. Not intentional Opera lockout -- it should be easily fixed. I was working with this a few months ago, just never got around to finishing. 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] Working with an existing PDF doc
Hi gang: I can create a pdf document on-the-fly pretty easily, as shown here: http://xn--ovg.com/pdf However, what I need is to find out how to open an existing pdf document and insert data into it -- does anyone have any experience in doing this, or references they can point me to? As always, mondo thanks for those who reply. 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] Free Shopping Carts
At 5:12 PM -0400 8/31/06, John Nichel wrote: Jay Blanchard wrote: Can we do anything else for you today? I'm a php programmer and I have a valve knocking in the engine of my car. Can you fix it? RTFOM O= Owner's :-) Valves don't knock -- they click. What commonly knocks are the connecting-rod bearings. This reminds me of a joke -- where a man tells a mechanic My water-pump don't pump, my spark-plugs don't spark and my pistons... well, they don't work either. 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] Extream OT
HI, This is very Off Topic, but I have no clue where to go to find out this information fast enough. I have a client that just changed their mind and want me to host their web services. However, they have their current hosting setup on a Windows NT server. Now the question comes: How the heck can I move the mail boxes from the Windows NT server to my Plesk Linux server? Basically I just want to know if it is possible, because then I can give them a go, find out the information after that is easy maybe, or I will hire someone :-) Thanks if someone have a clue about this. /Peter
Re: [PHP] Error Handling Library?
I'm curious, what features are you looking for in an error handling library? 2006/8/31, Jay Paulson [EMAIL PROTECTED]: I've been doing some research and was wondering if anyone out there has written a library for error handling? I haven't found anything as of yet but would love to hear suggestions! Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extream OT
Peter Lauri wrote: HI, This is very Off Topic, but I have no clue where to go to find out this information fast enough. I have a client that just changed their mind and want me to host their web services. However, they have their current hosting setup on a Windows NT server. Now the question comes: How the heck can I move the mail boxes from the Windows NT server to my Plesk Linux server? Basically I just want to know if it is possible, because then I can give them a go, find out the information after that is easy maybe, or I will hire someone :-) Of course it's possible. Linux mail servers allow mailboxes, depending on which mta you are using it's different. No idea what plesk uses. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extream OT
On Fri, 2006-09-01 at 13:05 +1000, Chris wrote: Of course it's possible. Linux mail servers allow mailboxes, depending on which mta you are using it's different. No idea what plesk uses. A pretty safe bet is to export your mail as MBOX, this can be done via a PHP or perl script, and then move them across. Almost every known MTA can use MBOX format, even the crummy ones. If it is on a production linux box, the MTA is probably going to be either Exim, Postfix or Sendmail (maybe) and all of them can work with mbox without issues. If you do get a PHP anyMail2mbox script going, please let me know, as I was actually thinking about doing something similar the other day, as I was thinking of dumping both Mbox and mailman tgz archives into our forum and writing an import for that as well as being able to export archives and forum posts as Mbox for new developers to look at offline, without downloading the mail archives. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php