php-general Digest 13 May 2008 07:07:15 -0000 Issue 5456

2008-05-13 Thread php-general-digest-help
php-general Digest 13 May 2008 07:07:15 - Issue 5456 Topics (messages 274204 through 274226): Re: A Little Something. 274204 by: Eric Butera 274206 by: tedd Re: Replacing accented characters by non-accented characters 274205 by: tedd creating an xls file from mysql

Re: [PHP] creating an xls file from mysql data

2008-05-13 Thread Richard Kurth
Chris wrote: Richard Kurth wrote: This script will create an xls file from the data that is sent to it When I run this it only gets one recored and it is supposet to get all the records that are past by the $_POST[selectedcontactlist] I think I have a } in the wrong place but I can not

Re: [PHP] creating an xls file from mysql data

2008-05-13 Thread Chris
This is what the $_POST['selectedcontactlist'] looks like 121,17,97,123,243,52,138,114,172,170,64,49,60,256,176,244,201,42,95,4, First question is why do you need to pass it through like that? it is not coming across as an array so the foreach is throwing an error I assume it always has a

Re: [PHP] tracking Mials Which were bounced.

2008-05-13 Thread Aschwin Wesselius
Chetan Rane wrote: Hi All I am using a PHP Mailer to send mass mails. How can I Identify how mails have bounced. Hi, I guess you have to read some RFC's to get an idea about e-mail protocols. -- Aschwin Wesselius /'What you would like to be done to you, do that to the other'/

Re: [PHP] tracking Mials Which were bounced.

2008-05-13 Thread mike
Seems like the general way is to create a mailbox (POP3 or IMAP) to accept the bounces, then check it periodically and mark the emails as invalid in your local database. I would set threshholds so you don't mark something failed that only bounced once - it could have been a mail setup error or

Re: [PHP] Re: A Little Something.

2008-05-13 Thread Peter Ford
tedd wrote: At 3:11 PM -0400 5/12/08, Eric Butera wrote: NoScript is a FireFox extension to protect users from malicious scripts. NoScript is also a tag for browsers to read and react to IF they do not accept javascript. http://www.w3schools.com/TAGS/tag_noscript.asp That's an

Re: [PHP] Good HTML parser needed

2008-05-13 Thread James Dempster
http://htmlpurifier.org/ -- /James On Tue, May 13, 2008 at 4:34 AM, Shelley [EMAIL PROTECTED] wrote: Hi all, The fact is that I have a site that allow users to post hypertext articles. However, I saw that sometimes, because of their careless input, the articles is not rendered correctly.

Re: [PHP] Re: A Little Something.

2008-05-13 Thread Stut
On 13 May 2008, at 09:04, Peter Ford wrote: I think the onus is on the coders of Urchin to document how to avoid errors when Javascript is disabled, not the site developer who uses it. Just to repeat a point I made yesterday which was clearly either misunderstood or ignored... Urchin

[PHP] calling rsync from php script

2008-05-13 Thread Jean-Christophe Roux
Hello, I have a bash script update.sh that contains: rsync -- delete -avz -e ssh ${files} [EMAIL PROTECTED]:/red when I use that script ./update.sh as root, it works like a charm as I set up the private/public key properly. When run from a php script through the apache webserver ?php

Re: [PHP] Re: A Little Something.

2008-05-13 Thread Robin Vickery
2008/5/13 Stut [EMAIL PROTECTED]: On 13 May 2008, at 09:04, Peter Ford wrote: I think the onus is on the coders of Urchin to document how to avoid errors when Javascript is disabled, not the site developer who uses it. Just to repeat a point I made yesterday which was clearly either

Re: [PHP] Re: A Little Something.

2008-05-13 Thread Stut
On 13 May 2008, at 10:32, Robin Vickery wrote: 2008/5/13 Stut [EMAIL PROTECTED]: On 13 May 2008, at 09:04, Peter Ford wrote: I think the onus is on the coders of Urchin to document how to avoid errors when Javascript is disabled, not the site developer who uses it. Just to repeat a

Re: [PHP] Scripts slowing down?

2008-05-13 Thread Per Jessen
René Leboeuf wrote: I'm running a large website. I have some mailing scripts that take days to run. I noticed these scripts slow down with time, sometimes going to an almost complete stop (no mail sent for several minutes). The source code is trivial and can't contain a loop. I monitored

Re: [PHP] Re: A Little Something.

2008-05-13 Thread Robin Vickery
2008/5/13 Stut [EMAIL PROTECTED]: On 13 May 2008, at 10:32, Robin Vickery wrote: 2008/5/13 Stut [EMAIL PROTECTED]: On 13 May 2008, at 09:04, Peter Ford wrote: I think the onus is on the coders of Urchin to document how to avoid errors when Javascript is disabled, not the

[PHP] Scripts slowing down?

2008-05-13 Thread René Leboeuf
Hi. I'm running a large website. I have some mailing scripts that take days to run. I noticed these scripts slow down with time, sometimes going to an almost complete stop (no mail sent for several minutes). The source code is trivial and can't contain a loop. I monitored the memory usage and

Re: [PHP] Good HTML parser needed

2008-05-13 Thread Per Jessen
Shelley wrote: I want to know whether there are some good HTML parsers written in PHP. That is, the parser checks whether html tags like table, tr, td, div, dt, dl, dd, script, ul, li, span, h1, h2, etc. are nested correctly. If any tags not matched, just remove them. Except for the

[PHP] Re: Scripts slowing down?

2008-05-13 Thread Peter Ford
René Leboeuf wrote: Hi. I'm running a large website. I have some mailing scripts that take days to run. I noticed these scripts slow down with time, sometimes going to an almost complete stop (no mail sent for several minutes). The source code is trivial and can't contain a loop. I monitored

Re: [PHP] convert query result to array

2008-05-13 Thread Sanjeev N
fetchAll() works if php version is greater than 5. As Wang suggested, we should write our own function. its easy... i have done so many times for larger database. Store earch rows of the resultset in the array (multidimensional ie. 2). and then work on the array using the loops conditions

Re: [PHP] Replacing accented characters by non-accented characters

2008-05-13 Thread Per Jessen
Yannick Warnier wrote: That would probably work out if it wasn't too dependent on the locales to work. I'm developing an open-source product which could end up on a server without the locales for French but be used by some French people, which would make (as far as I can get out of one

Re: [PHP] Permissions set on php script question

2008-05-13 Thread Bojan Tesanovic
If your web-server is setup to read files with .php extension through PHP engine (it is I guess) than no body from outside (using HTTP) can't read content of original PHP file only the output of that particular script. The only concern you may have is that somebody else on that server

RES: [PHP] Re: Scripts slowing down?

2008-05-13 Thread Thiago Pojda
I don't know... this looks like some mail server is greylisting¹ your connections and you have to wait to deliver this message and make more connections to it. As Peter said, probably your mail server is looking like a spam engine. 1 - Greylisting puts your email in a queue and tells you have

Re: [PHP] tracking Mials Which were bounced.

2008-05-13 Thread Per Jessen
Chetan Rane wrote: Hi All I am using a PHP Mailer to send mass mails. How can I Identify how mails have bounced. You send them with a bounce-address that uniquely identifies the recipient - when the email bounces, you know exactly which recipient it was. I typically have my mailserver do

Re: [PHP] using variable in php form before the form is POSTed

2008-05-13 Thread tedd
At 2:44 PM -0700 5/12/08, milt wrote: I have a form that will be filled in by the user, I want to have access to the content of one of the fields in that form, in order to fill in an another variable that is not part of the form. this variable is used by a routine when the form is posted.

Re: [PHP] Re: A Little Something.

2008-05-13 Thread tedd
At 9:04 AM +0100 5/13/08, Peter Ford wrote: I don't expect anyone to second-guess pet peeves :) Why not? That's the way things change. I still haven't had anyone address the concerns I posted. Instead, I feel like a kid watching two others play a game of keep-a-way with me in the middle.

Re: [PHP] calling rsync from php script

2008-05-13 Thread Daniel Brown
On Tue, May 13, 2008 at 4:32 AM, Jean-Christophe Roux [EMAIL PROTECTED] wrote: Hello, I have a bash script update.sh that contains: rsync -- delete -avz -e ssh ${files} [EMAIL PROTECTED]:/red when I use that script ./update.sh as root, it works like a charm as I set up the private/public

[PHP] validating textarea using php

2008-05-13 Thread Sudhakar
hi i need to validate textarea of a html form using php textarea name=comments cols=26 rows=3 id=comments?php echo($comments);?/textarea presently my php code to validate the text area is if($comments == ) { $error.=brPlease enter your comments; } with this code if a user hits the space bar

Re: [PHP] validating textarea using php

2008-05-13 Thread Thijs Lensselink
Quoting Sudhakar [EMAIL PROTECTED]: hi i need to validate textarea of a html form using php textarea name=comments cols=26 rows=3 id=comments?php echo($comments);?/textarea presently my php code to validate the text area is if($comments == ) { $error.=brPlease enter your comments; } with

RE: [PHP] validating textarea using php

2008-05-13 Thread Warren Vail
with this code if a user hits the space bar once or couple of times as a matter of fact there are no characters entered by the user i do not want this to happen, if a user simply hits the spacebar and does not type anything i should be able to display an alert message. One

RES: [PHP] validating textarea using php

2008-05-13 Thread Thiago Pojda
You really should use htmlspecialchars before showing any user stipulated HTML to help prevent security holes. Also you can use short tags (popular...) to make the HTML more readable. Eg: snip ?=htmlspecialchars($comments)? Just to add, short tags are not recommended for conflicts with

Re: [PHP] validating textarea using php

2008-05-13 Thread Richard Heyes
i need to validate textarea of a html form using php textarea name=comments cols=26 rows=3 id=comments?php echo($comments);?/textarea You really should use htmlspecialchars before showing any user stipulated HTML to help prevent security holes. Also you can use short tags (popular...) to

Re: [PHP] Re: A Little Something.

2008-05-13 Thread Shawn McKenzie
Stut wrote: On 12 May 2008, at 09:39, Peter Ford wrote: tedd wrote: Hi gang: This is what I did this morning: http://webbytedd.com/bb/tribute/ It speaks for itself. Cheers, tedd tedd, Nothing to do with the subject matter, but I noticed because it is one of your more simple pages: I get a

[PHP] Can Safari 3 be forced to cache a large jpeg with PHP headers?

2008-05-13 Thread Rob Gould
I am creating a touch-screen kiosk application, using a full-screen version of Safari 3.1, and was wondering if there's a way I can force Safari to cache a large background image JPEG. What I'm finding is that Safari 3 will sometimes cache my large 1.1 MB background image (1680x1050), and

Re: [PHP] Re: A Little Something.

2008-05-13 Thread Daniel Brown
On Tue, May 13, 2008 at 10:55 AM, Shawn McKenzie [EMAIL PROTECTED] wrote: My main pet peeve is when my wife leaves empty clothes hangers on door knobs throughout the house. Mine is when the pre-wife leaves her clothes on. So we're pretty similar. -- /Daniel P. Brown Dedicated Servers

Re: [PHP] validating textarea using php

2008-05-13 Thread Hiep Nguyen
On Tue, 13 May 2008, Sudhakar wrote: hi i need to validate textarea of a html form using php textarea name=comments cols=26 rows=3 id=comments?php echo($comments);?/textarea presently my php code to validate the text area is if($comments == ) { $error.=brPlease enter your comments; } with

Re: [PHP] Why doesn't working with array's ever stick in my thick head?

2008-05-13 Thread Jason Pruim
Hi Everyone, I am taking another stab at this problem, complete with code and an example... Here is the issue: I need to be able to display pounds and ounces of a given number of pieces, the code I have does this just fine for a single route... But what I can't seem to get through my

Re: [PHP] validating textarea using php

2008-05-13 Thread Usamah al-Amin
if(chop($comments) == ) { ... } //hope that helps. Well, chop() is an alias of rtrim(), so it won't work here for, say, trimming control characters at the end of the string like line feeds. trim() is actually the best bit here. Regards, Usamah -- PHP General Mailing List

Re: [PHP] validating textarea using php

2008-05-13 Thread Dan Joseph
On Tue, May 13, 2008 at 12:02 PM, Usamah al-Amin [EMAIL PROTECTED] wrote: if(chop($comments) == ) { ... } //hope that helps. Well, chop() is an alias of rtrim(), so it won't work here for, say, trimming control characters at the end of the string like line feeds. trim() is actually the

Re: [PHP] validating textarea using php

2008-05-13 Thread Jim Lucas
Richard Heyes wrote: Also you can use short tags (popular...) to make the HTML more readable. Eg: textarea name=comments cols=26 rows=3 id=comments ?=htmlspecialchars($comments)? /textarea It also makes the code less portable. -- Jim Lucas Some men are born to greatness, some

Re: [PHP] validating textarea using php

2008-05-13 Thread Robert Cummings
On Tue, 2008-05-13 at 19:02 +0300, Usamah al-Amin wrote: if(chop($comments) == ) { ... } //hope that helps. Well, chop() is an alias of rtrim(), so it won't work here for, say, trimming control characters at the end of the string like line feeds. trim() is actually the best bit here.

Re: [PHP] Re: A Little Something.

2008-05-13 Thread tedd
At 11:01 AM -0400 5/13/08, Daniel Brown wrote: On Tue, May 13, 2008 at 10:55 AM, Shawn McKenzie [EMAIL PROTECTED] wrote: My main pet peeve is when my wife leaves empty clothes hangers on door knobs throughout the house. Mine is when the pre-wife leaves her clothes on. So we're

RES: [PHP] Re: A Little Something.

2008-05-13 Thread Thiago Pojda
Our neighbors all thought I had lost my mind If they only knew you lost it long ago... ;) Atenciosamente, www.softpartech.com.br Thiago Henrique Pojda Desenvolvimento Web +55 41 3033-7676 [EMAIL PROTECTED] Excelência em Softwares Financeiros -Mensagem original- De: tedd

[PHP] $_SESSION NOT WORKING

2008-05-13 Thread Balpo
Hi everyone, I'm having a problem moving my code to a linux computer. I won't post the whole code here, but an accurate example that reproduces exactly the error. // 1.php ?php session_register('tree'); $_SESSION['tree'] = This is tree number one; header(Location:

Re: RES: [PHP] Re: A Little Something.

2008-05-13 Thread Robert Cummings
On Tue, 2008-05-13 at 15:22 -0300, Thiago Pojda wrote: Our neighbors all thought I had lost my mind If they only knew you lost it long ago... ;) Atenciosamente, www.softpartech.com.br I tried to hear your website... my screen reader had a lot of trouble :| ;) Cheers, Rob. --

Re: [PHP] $_SESSION NOT WORKING

2008-05-13 Thread Dmitri
Try adding session_start() at top of the script Balpo wrote: Hi everyone, I'm having a problem moving my code to a linux computer. I won't post the whole code here, but an accurate example that reproduces exactly the error. // 1.php ?php session_register('tree');

Re: [PHP] validating textarea using php

2008-05-13 Thread Iv Ray
Sudhakar wrote: i do not want this to happen, if a user simply hits the spacebar and does not type anything i should be able to display an alert message. From usability point of view such check will, in many cases, generate annoyance, and bring nothing. If I do not want to enter anything,

RES: RES: [PHP] Re: A Little Something.

2008-05-13 Thread Thiago Pojda
Too bad I do not run that ;) BTW it's in aspx... I'm not that insane. Atenciosamente, www.softpartech.com.br Thiago Henrique Pojda Desenvolvimento Web +55 41 3033-7676 [EMAIL PROTECTED] Excelência em Softwares Financeiros -Mensagem original- De: Robert Cummings [mailto:[EMAIL

Re: [PHP] $_SESSION NOT WORKING

2008-05-13 Thread Daniel Brown
On Tue, May 13, 2008 at 2:38 PM, Balpo [EMAIL PROTECTED] wrote: Hi everyone, I'm having a problem moving my code to a linux computer. I won't post the whole code here, but an accurate example that reproduces exactly the error. [snip!] Modify 2.php as follows: ?php session_start();

[PHP] fsockopen on ssl://

2008-05-13 Thread bob pilly
Hi all I have tried researching this issue but havent come up with any solution so im hoping someone has seen it before and can help. I have the following test script that uses fsockopen to connect to a https site, get the contents and outputs it. ?php $host = www.microsoft.com; $path = /;

RES: [PHP] $_SESSION NOT WORKING

2008-05-13 Thread Thiago Pojda
Actually his question was about why session.auto_start is not working on Linux, I almost answered what you both did :) Atenciosamente, www.softpartech.com.br Thiago Henrique Pojda Desenvolvimento Web +55 41 3033-7676 [EMAIL PROTECTED] Excelência em Softwares Financeiros -Mensagem

Re: [PHP] $_SESSION NOT WORKING

2008-05-13 Thread Balpo
Yes, that way it works. Thanx. But the Windows version of the same code and the same php.ini ***does not *** need the session_start() because it has the session.auto_start = 1 inside php.ini. The thing is, I think session.auto_start = 1 does not work on Linux. Is this a bug? Daniel Brown

Re: [PHP] $_SESSION NOT WORKING

2008-05-13 Thread Jens Himmelrath
Balpo schrieb: Hi everyone, I'm having a problem moving my code to a linux computer. I won't post the whole code here, but an accurate example that reproduces exactly the error. // 1.php ?php session_register('tree'); $_SESSION['tree'] = This is tree number one;

[PHP] fsockopen on ssl://

2008-05-13 Thread bob pilly
Hi all I have tried researching this issue but havent come up with any solution so im hoping someone has seen it before and can help. I have the following test script that uses fsockopen to connect to a https site, get the contents and outputs it. ?php $host = www.microsoft.com; $path = /;

Re: [PHP] validating textarea using php

2008-05-13 Thread Shawn McKenzie
Dan Joseph wrote: On Tue, May 13, 2008 at 12:02 PM, Usamah al-Amin [EMAIL PROTECTED] wrote: if(chop($comments) == ) { ... } //hope that helps. Well, chop() is an alias of rtrim(), so it won't work here for, say, trimming control characters at the end of the string like line feeds. trim()

Re: [PHP] validating textarea using php

2008-05-13 Thread Richard Heyes
Jim Lucas wrote: Richard Heyes wrote: Also you can use short tags (popular...) to make the HTML more readable. Eg: textarea name=comments cols=26 rows=3 id=comments ?=htmlspecialchars($comments)? /textarea It also makes the code less portable. If that's even a concern. A lot of the

Re: [PHP] validating textarea using php

2008-05-13 Thread Dotan Cohen
2008/5/14 Richard Heyes [EMAIL PROTECTED]: It also makes the code less portable. If that's even a concern. A lot of the time, it's not. A lot of people think that, until their host upgrades php. Have you seen how many things are being removed for php6? Dotan Cohen http://what-is-what.com

Re: [PHP] tracking Mials Which were bounced.

2008-05-13 Thread Chris
mike wrote: Seems like the general way is to create a mailbox (POP3 or IMAP) to accept the bounces, then check it periodically and mark the emails as invalid in your local database. I would set threshholds so you don't mark something failed that only bounced once - it could have been a mail

Re: [PHP] tracking Mials Which were bounced.

2008-05-13 Thread mike
On 5/13/08, Chris [EMAIL PROTECTED] wrote: I use this method and it works reasonably well. The hard part is the last sentence - there are so many ways to say mailbox full - half don't include smtp error codes, the rest tell you the same thing in thousands of different ways. exactly. that's

Re: [PHP] Good XML Parser

2008-05-13 Thread Waynn Lue
Ok, thanks so much for the help. I went with DOM-parsing to begin with, I'll explore XPath + SimpleXML later. Thanks, Waynn On Mon, May 12, 2008 at 5:23 AM, David Otton [EMAIL PROTECTED] wrote: 2008/5/12 Waynn Lue [EMAIL PROTECTED]: So if I'm looking to parse certain attributes out of an XML

Re: [PHP] validating textarea using php

2008-05-13 Thread Robert Cummings
On Wed, 2008-05-14 at 00:32 +0300, Dotan Cohen wrote: 2008/5/14 Richard Heyes [EMAIL PROTECTED]: It also makes the code less portable. If that's even a concern. A lot of the time, it's not. A lot of people think that, until their host upgrades php. Have you seen how many things are

[PHP] Re: $_SESSION NOT WORKING --SOLVED

2008-05-13 Thread Balpo
After an all-evening debugging I found out what the problem is. Why? Please don't ask. I have no idea. The problem was php's extension php-colorer How I got to the problem. Eliminating every extension until I got the *bad* one. Thank you: Daniel, Thiago, Jens, Verny Dmitri for your

Re: [PHP] Can Safari 3 be forced to cache a large jpeg with PHP headers?

2008-05-13 Thread Chris
Rob Gould wrote: I am creating a touch-screen kiosk application, using a full-screen version of Safari 3.1, and was wondering if there's a way I can force Safari to cache a large background image JPEG. What I'm finding is that Safari 3 will sometimes cache my large 1.1 MB background

Re: [PHP] Good XML Parser

2008-05-13 Thread Nathan Nobbe
On Tue, May 13, 2008 at 7:29 PM, Waynn Lue [EMAIL PROTECTED] wrote: Ok, thanks so much for the help. I went with DOM-parsing to begin with, I'll explore XPath + SimpleXML later. just fyi, youre likely to get more bang for your buck starting off w/ SimpleXML. DOM is a successor to DOMXML

[PHP] Re: fsockopen on ssl://

2008-05-13 Thread Manuel Lemos
Hello, on 05/13/2008 04:37 PM bob pilly said the following: Hi all I have tried researching this issue but havent come up with any solution so im hoping someone has seen it before and can help. I have the following test script that uses fsockopen to connect to a https site, get the

Re: [PHP] validating textarea using php

2008-05-13 Thread Chris W
Dotan Cohen wrote: 2008/5/14 Richard Heyes [EMAIL PROTECTED]: It also makes the code less portable. If that's even a concern. A lot of the time, it's not. A lot of people think that, until their host upgrades php. Have you seen how many things are being removed for php6? From the article

[PHP] validating using php

2008-05-13 Thread Sudhakar
thanks to everyone for providing the solution for validating textarea using php i have used the following and it worked $add = trim($_POST[add]); if(strlen(trim($add)) == 0 ) { $error.=brPlease enter your address ; } as part of the form the user has to fill in their name, assuming if the user