[PHP] Concatenation vs. Interpolation

2007-08-11 Thread AmirBehzad Eslami
Hi, FASTER CODE! This question involves Coding Style, Readability, Write-ability and Performance. Some people use the . operator to concat an string to a variable, some people use interpolation (embeding variable into string). = 1st Method (Concatenation) $str = 'My name is

[PHP] reading a word document

2007-08-11 Thread Tom Cruickshank
Hello, Would anyone know or could point me to a link which might have a way for php to read a word document? The code will run on linux, so unfortunately cannot use COM. I've done research on a third application tool which converts docs to html, but have yet to find one which keeps proper

[PHP] problem in tr

2007-08-11 Thread shivendra
hello friends, i need your ehlp,actually i have a tablbe in my php page,the format is something like this: table tr name=t1 id=t1 tdmonu/tdtd23/td /tr tr name=t2 id=t2 tdmonu/tdtd23/td /tr /table What i want,when i click a row like row t1 the values of this particuler row,i means to say the value

[PHP] php.ini of PHP 5.2.3

2007-08-11 Thread Alain Roger
Hi, I have a stupid problem. At work i installed the PHP 5.2.1 and it works fine. i uncomment extension = php_opensll and i see that extension is activated because phpinfo show me information about such extension. However, at homw i've just installed PHP 5.2.3 and i did the same as at work but

Re: [PHP] php.ini of PHP 5.2.3

2007-08-11 Thread Stut
Alain Roger wrote: I have a stupid problem. At work i installed the PHP 5.2.1 and it works fine. i uncomment extension = php_opensll and i see that extension is activated because phpinfo show me information about such extension. However, at homw i've just installed PHP 5.2.3 and i did the same

[PHP] Switch To VoIPTelco And Save!

2007-08-11 Thread VoIPTelco.net
Hi, I want to introduce you to a new phone service that I'm using. It's called VoIPTelCo and it transforms your high speed Internet connection into a regular phone line. It works just like your current telephone service except it's 40% - 60% cheaper. You get features like Call Waiting, Caller

Re: [PHP] php.ini of PHP 5.2.3

2007-08-11 Thread Alain Roger
I've discovered that when i type php -m, openssl is already loaded as module. It seems that PHP 5.2.3 was compiled with --with-openssl command. So, why modules with which ones PHP has been compiled do not appear in the phpinfo() report ? thanks a lot, Al. On 8/11/07, Stut [EMAIL PROTECTED]

Re: [PHP] magic quotes

2007-08-11 Thread Richard Heyes
I added the code to my script and I still ended up escaped quotes. if(ini_get('magic_quotes_gpc')) $_POST['data'] = stripslashes($_POST['data']); Didn't work at all. I think I read something about it not working on runtime data. Like gpc if this is correct do you have another solution? I put

Re: [PHP] Concatenation vs. Interpolation

2007-08-11 Thread Tijnema
On 8/11/07, AmirBehzad Eslami [EMAIL PROTECTED] wrote: Hi, FASTER CODE! This question involves Coding Style, Readability, Write-ability and Performance. Some people use the . operator to concat an string to a variable, some people use interpolation (embeding variable into string).

Re: [PHP] I know this is not easy and I'm not stupid but...

2007-08-11 Thread Tijnema
On 8/10/07, Zoltán Németh [EMAIL PROTECTED] wrote: 2007. 08. 10, péntek keltezéssel 02.31-kor Jan Reiter ezt írta: Hi! Thank you for your response! The only intention of my code was to investigate the (back then) unexpected behavior of the if statement. With $var['test'] set to

Re: [PHP] Forwarding $_POST[]...

2007-08-11 Thread tedd
At 7:10 PM +0100 8/9/07, Stut wrote: Rethink things. There's almost certainly a better way but without knowing why you think you need to do this it's not possible to help any further. -Stut I think I understand what the OP is asking. How about this example: 1. User selects items he wants

Re: [PHP] Friday morning brain farts....

2007-08-11 Thread tedd
At 11:00 AM -0400 8/10/07, Robert Cummings wrote: On Fri, 2007-08-10 at 10:43 -0400, Jason Pruim wrote: Hi All :) Hope you're not getting sick of my questions as of late, but I keep getting closer and closer and thank you all who have helped me in the past! The only reason I can see this

Re: [PHP] Concatenation vs. Interpolation

2007-08-11 Thread AmirBehzad Eslami
You're right. There is a low benefit in performance. But I think it's valuable in high-traffic websites. Of course, we should consider a lot of thing to have a better performance, but Concatenation, IMO, is the best practice. Let me explain: َActually, the programmers' preference on readability

Re: [PHP] Friday morning brain farts....

2007-08-11 Thread tedd
At 7:21 PM +0200 8/10/07, Tijnema wrote: On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: if( !isset( $argv[1] ) || !isset( $argv[2] ) || !isset( $argv[3] ) ) if(!isset($argv[1],$argv[2],$argv[3])) // Bit shorter ;) But a bit harder to recognize IMO. :-) Cheers, tedd -- ---

Re: [PHP] Friday morning brain farts....

2007-08-11 Thread Tijnema
On 8/11/07, tedd [EMAIL PROTECTED] wrote: At 7:21 PM +0200 8/10/07, Tijnema wrote: On 8/10/07, Robert Cummings [EMAIL PROTECTED] wrote: if( !isset( $argv[1] ) || !isset( $argv[2] ) || !isset( $argv[3] ) ) if(!isset($argv[1],$argv[2],$argv[3])) // Bit shorter ;) But a bit harder to

RE: [PHP] simplexml_load_file()

2007-08-11 Thread Bastien Koert
switch to an underscore comment_id instead bastien Date: Fri, 10 Aug 2007 23:03:19 +0100 From: [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] simplexml_load_file() Hello, I'm doing an script which it'll read the xml values,

Re: [PHP] multiple data to insert to database

2007-08-11 Thread brian
Richard Lynch wrote: On Fri, August 10, 2007 8:36 am, Alain Roger wrote: I would like to know what is the best way and fastest to insert into PostgreSQL around 25.000 records (extracted from CSV file). Should i use the standard pg_exec($dbconn, insert into...); for each record ? 25.000

Re: [PHP] javascript in head or in body ?

2007-08-11 Thread tedd
At 9:29 PM +0200 8/7/07, Tijnema wrote: On 8/7/07, Robert Cummings [EMAIL PROTECTED] wrote: Yeah!! This list is for public apologies and Copyright discussion. Cheers, Rob. -- Oh yeah, Tedd is only the first of thousands of people that need to apologize... :P Tijnema Ah crap, have I

Re: [PHP] reading a word document

2007-08-11 Thread brian
Tom Cruickshank wrote: Hello, Would anyone know or could point me to a link which might have a way for php to read a word document? The code will run on linux, so unfortunately cannot use COM. I've done research on a third application tool which converts docs to html, but have yet to find

Re: [PHP] manual vs. meta refresh

2007-08-11 Thread tedd
At 2:10 AM +0200 8/11/07, Tijnema wrote: On 8/11/07, Richard Lynch [EMAIL PROTECTED] wrote: On Fri, August 10, 2007 1:26 pm, Kevin Murphy wrote: I doubt this, but is there any way to determine via PHP if a browser was refreshed automatically via a META tag vs the person clicking the

Re: [PHP] javascript in head or in body ?

2007-08-11 Thread Robert Cummings
On Sat, 2007-08-11 at 12:15 -0400, tedd wrote: At 9:29 PM +0200 8/7/07, Tijnema wrote: On 8/7/07, Robert Cummings [EMAIL PROTECTED] wrote: Yeah!! This list is for public apologies and Copyright discussion. Cheers, Rob. -- Oh yeah, Tedd is only the first of thousands of people

Re: [PHP] simplexml_load_file()

2007-08-11 Thread Panquekas
But How? I tried an str_replace, and preg_replace and didn't work at all.. can you help me? Thanks in advantage. On 11/08/07, Bastien Koert [EMAIL PROTECTED] wrote: switch to an underscore comment_id instead bastien Date: Fri, 10 Aug 2007

Re: [PHP] preg_match_all to match img tags

2007-08-11 Thread tedd
At 11:45 PM + 8/9/07, Ólafur Waage wrote: I know this isn't exactly a php related question but due to the quality of answers ive seen lately ill give this a shot. (yes yes im smoothing up the crowd before the question) I have a weblog system that i am creating, the trouble is that if a user

Re: [PHP] preg_match_all to match img tags

2007-08-11 Thread Richard Heyes
How can i match an image tag correctly so it does not cause any issues with how the user adds the image. preg_match_all('/img[^]*/Ui'); Off the top of my head. This wouldn't allow for using the right angle bracket in the img tag, but that's almost never going to happen in reailty. --

Re: [PHP] preg_match_all to match img tags

2007-08-11 Thread Richard Heyes
Richard Heyes wrote: How can i match an image tag correctly so it does not cause any issues with how the user adds the image. preg_match_all('/img[^]*/Ui'); Off the top of my head. This wouldn't allow for using the right angle bracket in the img tag, but that's almost never going to happen

Re: [PHP] preg_match_all to match img tags

2007-08-11 Thread Tijnema
On 8/11/07, Richard Heyes [EMAIL PROTECTED] wrote: Richard Heyes wrote: How can i match an image tag correctly so it does not cause any issues with how the user adds the image. preg_match_all('/img[^]*/Ui'); Off the top of my head. This wouldn't allow for using the right angle

Re: [PHP] preg_match_all to match img tags

2007-08-11 Thread Richard Heyes
img src=image.jpg Your script doesn't catch above ;) So don't write HTML like that. -- Richard Heyes +44 (0)844 801 1072 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] preg_match_all to match img tags

2007-08-11 Thread Tijnema
On 8/11/07, Richard Heyes [EMAIL PROTECTED] wrote: img src=image.jpg Your script doesn't catch above ;) So don't write HTML like that. Depends where the HTML is coming from, it might be user input Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP

Re: [PHP] preg_match_all to match img tags

2007-08-11 Thread Richard Heyes
img src=image.jpg Your script doesn't catch above ;) So don't write HTML like that. Depends where the HTML is coming from, it might be user input Ok, add \s* after the initial angle bracket. -- Richard Heyes +44 (0)844 801 1072 http://www.websupportsolutions.co.uk Knowledge Base

Re: [PHP] preg_match_all to match img tags

2007-08-11 Thread Stut
Tijnema wrote: On 8/11/07, Richard Heyes [EMAIL PROTECTED] wrote: Richard Heyes wrote: How can i match an image tag correctly so it does not cause any issues with how the user adds the image. preg_match_all('/img[^]*/Ui'); Off the top of my head. This wouldn't allow for using the right angle

Re: [PHP] reading a word document

2007-08-11 Thread brian
Tom Cruickshank wrote: Hello, What I would like to preserve in the sense of formatting is bold, italics, spacing, pictures (if any). That kind of thing. I'm aware that Word isn't the best type of document to read from, unfortunately some folks will be using that file format to upload

Re: [PHP] preg_match_all to match img tags

2007-08-11 Thread Tijnema
On 8/11/07, Stut [EMAIL PROTECTED] wrote: Tijnema wrote: On 8/11/07, Richard Heyes [EMAIL PROTECTED] wrote: Richard Heyes wrote: How can i match an image tag correctly so it does not cause any issues with how the user adds the image. preg_match_all('/img[^]*/Ui'); Off the top of my

[PHP] question about note on php.net

2007-08-11 Thread Michael Cooper
Hello, I have a question--is the note from equazcion here correct? It is left unchallenged on the page but I can't see how it is correct since I am under the impression that the environment is refreshed each page load and the function or method definitions (including those for

Re: [PHP] question about note on php.net

2007-08-11 Thread Stut
Michael Cooper wrote: Hello, I have a question--is the note from equazcion here correct? It is left unchallenged on the page but I can't see how it is correct since I am under the impression that the environment is refreshed each page load and the function or method definitions (including

[PHP] convert (windows-1250) to (utf-8)

2007-08-11 Thread Alain Roger
Hi, I import a csv file (which includes characters from windows-1250 charset) to postgreSQL database which is in UTF-8. How can i convert windows-1250 to utf-8 charset ? thanks a lot, -- Alain Windows XP SP2 PostgreSQL 8.2.3 Apache 2.2.4 PHP 5.2.3

Re: [PHP] preg_match_all to match img tags

2007-08-11 Thread Ólafur Waage
Ive already finished the code and pasted it to this mailing list :) Just an fyi. Ólafur Waage 2007/8/11, Tijnema [EMAIL PROTECTED]: On 8/11/07, Stut [EMAIL PROTECTED] wrote: Tijnema wrote: On 8/11/07, Richard Heyes [EMAIL PROTECTED] wrote: Richard Heyes wrote: How can i match

[PHP] results to html table

2007-08-11 Thread Kevin Waterson
I wish to get a result set into a html table. normally this is not a problem. But I wish to use one of the results as a heading. Here is the data... ASCII art warning ++--+-+---+ | forum_group_id | forum_group_name | forum_type_name |

Re: [PHP] results to html table

2007-08-11 Thread Robert Cummings
On Sun, 2007-08-12 at 08:07 +1000, Kevin Waterson wrote: I wish to get a result set into a html table. normally this is not a problem. But I wish to use one of the results as a heading. Here is the data... ASCII art warning

Re: [PHP] convert (windows-1250) to (utf-8)

2007-08-11 Thread Tijnema
On 8/11/07, Alain Roger [EMAIL PROTECTED] wrote: Hi, I import a csv file (which includes characters from windows-1250 charset) to postgreSQL database which is in UTF-8. How can i convert windows-1250 to utf-8 charset ? thanks a lot, -- I personally never worked with different charsets,

Re: [PHP] manual vs. meta refresh

2007-08-11 Thread Richard Lynch
On Fri, August 10, 2007 6:51 pm, Geoff Nicol wrote: That was my first thought as well but you will still have to use a session variable or cookie for the page following redirect to know it was a meta-refresh. No. For the page following, you can use some other GET parameter, such as

Re: [PHP] question about note on php.net

2007-08-11 Thread brian
Michael Cooper wrote: Hello, I have a question--is the note from equazcion here correct? It is left unchallenged on the page but I can't see how it is correct since I am under the impression that the environment is refreshed each page load and the function or method definitions (including

Re: [PHP] convert (windows-1250) to (utf-8)

2007-08-11 Thread brian
Alain Roger wrote: Hi, I import a csv file (which includes characters from windows-1250 charset) to postgreSQL database which is in UTF-8. How can i convert windows-1250 to utf-8 charset ? Try the iconv functions: http://www.php.net/manual/en/function.iconv.php $out = iconv('ISO-8859-2',

RE: [PHP] Running a server process

2007-08-11 Thread Nathan Wallis
Thanks for the info guys. Sockets sound interesting. Will check the out more. I have played with sockets and flash before, but I will read up more. From what you are saying I gather that 500 people with an open socket to the program is a lot different to 500 people spawning their own process.

Re: [PHP] manual vs. meta refresh

2007-08-11 Thread Geoff Nicol
And if they do a manual refresh on the page you re-directed to, the was_meta_refresh_before flag will be set. How will you tell it from a meta-refresh redirect? You need to use a cookie or session id. Regardless, by reading the whole thread and 'cheating off the other students' this has been

Re: [PHP] manual vs. meta refresh

2007-08-11 Thread Robert Cummings
On Sat, 2007-08-11 at 18:26 -0700, Geoff Nicol wrote: And if they do a manual refresh on the page you re-directed to, the was_meta_refresh_before flag will be set. How will you tell it from a meta-refresh redirect? I already explained this in previous email. Go read the history of this thread.

Re: [PHP] manual vs. meta refresh

2007-08-11 Thread Geoff Nicol
Rob, What you suggested, which matches the theory of what I and others suggested, would certainly work as an ID that changes is involved. If you read the specific posting by Richard Lynch, which is what I was replying to, you will note he suggest refreshing to a static 'was_meta_refresh_before'

Re: [PHP] manual vs. meta refresh

2007-08-11 Thread Robert Cummings
On Sat, 2007-08-11 at 19:36 -0700, Geoff Nicol wrote: Rob, What you suggested, which matches the theory of what I and others suggested, would certainly work as an ID that changes is involved. If you read the specific posting by Richard Lynch, which is what I was replying to, you will note

Re: [PHP] manual vs. meta refresh

2007-08-11 Thread Richard Lynch
You don't do it there. You do whatever it is you have to do in the URL before you re-direct. Though I guess if you want different output on that page, you would need to set something somewhere, be it session, database, or a cookie. On Sat, August 11, 2007 8:25 pm, Geoff Nicol wrote: And if

Re: [PHP] manual vs. meta refresh

2007-08-11 Thread Robert Cummings
On Sat, 2007-08-11 at 22:11 -0500, Richard Lynch wrote: You don't do it there. You do whatever it is you have to do in the URL before you re-direct. Though I guess if you want different output on that page, you would need to set something somewhere, be it session, database, or a cookie. I