php-general Digest 26 Aug 2008 06:24:46 -0000 Issue 5645

2008-08-26 Thread php-general-digest-help
php-general Digest 26 Aug 2008 06:24:46 - Issue 5645 Topics (messages 278680 through 278709): Re: concatenating with . or , 278680 by: Yeti 278682 by: Robert Cummings 278687 by: tedd 278697 by: Bernhard Kohl Re: alphabetical filenames with readdir

[PHP] render html

2008-08-26 Thread VamVan
hello, i have html tags in the bod of text like: $body = hellobr/ulier/ulhellohello; print $body; Some how it does not render html properly in a html page , what might be going wrong? br still get displayed as br instead of line breaks. How can I render my HTML properly. Please note that it

Re: [PHP] render html

2008-08-26 Thread Björn Bartels
Hi, are you propably using a wysiwyg-editor to edit this html? my guess is ,your cms doesn't recognize br / as a valid tag and transforms and to lt; and gt; you should check your cms (or in case your wysiwyg-editor) docs for xhtml compatiblity ;) cheers, bb Am 26.08.2008 um 08:24

[PHP] Large/unreliable file uploading over HTTP

2008-08-26 Thread mike
Let's face it - HTTP is not very good for file uploads. It's stateless nature, slow connections, inability to resume (technically), etc, etc. What I've been thinking about is a way to skip all the normal annoyances with file uploading - multipart form encodings, file upload tools with specific

[PHP] Mysqli::prepare + select ... where ... in + array

2008-08-26 Thread Hans Henrik Petersen
Hey there I have been toying around with the following code for a few days: ?php //Gets the tokens defined in the array $tokensToGet, with the language defined by $languageId public static function GetTokens($tokensToGet, $languageId) { $query = @SELECT Name,

[PHP] Mysqli::prepare + select ... where ... in + array

2008-08-26 Thread hanshenp
Hey there I have been toying around with the following code for a few days: ?php //Gets the tokens defined in the array $tokensToGet, with the language defined by $languageId public static function GetTokens($tokensToGet, $languageId) { $query = @SELECT Name, Value FROM

[PHP] multiple question form creation

2008-08-26 Thread Alain R.
Hi, i have a web application in which some people should be able to create form adding questions and possible answers. basically user should: 1. type the question (which will be displayed to customer) 2. select type of answers (closed, open, list, multiple answer, and so on...) 3. add

Re: [PHP] PHP editor for linux

2008-08-26 Thread Thodoris
O/H It flance ??: Hi, What do you think is the best php editor for linux. I'm using the Debian distribution. Thanks I surprisingly use PSPad editor which is quite neat solution and support some basic regexps. http://www.pspad.com/ I think I'll probably move to vim

Re: [PHP] multiple question form creation

2008-08-26 Thread Dan Shirah
Hi, i have a web application in which some people should be able to create form adding questions and possible answers. basically user should: 1. type the question (which will be displayed to customer) 2. select type of answers (closed, open, list, multiple answer, and so on...) 3. add

[PHP] Search Suggestions

2008-08-26 Thread Dan Shirah
Hello, I'm hoping to get a few good ideas on the best way to perform a search of PHP results. Currently I have a page that returns a list of collapsed customer data: Example + John Smith + Jane Doe + Robert Jones + Dale Bennett If the user clicks on a customer name it will expand the

[PHP] Assign things to users

2008-08-26 Thread Dan Joseph
Hi, This is more of a logic question than a PHP question. I wanted to get some opinions on how some of you are doing things like this. I have a set of employees in our quote management system. We get thousands of quotes per hour, and every 15 minutes I have a cron that goes out and grabs the

[PHP] DNL by value

2008-08-26 Thread Luke
Hi everyone, I was wondering if there is a way to create a dnl (or an array?) with all the entries in an XML with a certain value in a certain tag in PHP DOM? Thanks a lot. Luke

Re: [PHP] comments function being spammed, how do I stop it?

2008-08-26 Thread tedd
At 3:14 PM -0700 8/25/08, Jim Lucas wrote: Here is the function that I added to a generic guest book script. It works great for me. I have a predefined list of sexual, pharmaceutical, rude, vulgar, etc... words that I have in the spamwords.dat file. function is_spam($str) { $data =

Re: [PHP] PHP editor for linux

2008-08-26 Thread Carlos Medina
Thodoris schrieb: O/H It flance ??: Hi, What do you think is the best php editor for linux. I'm using the Debian distribution. Thanks I surprisingly use PSPad editor which is quite neat solution and support some basic regexps. http://www.pspad.com/ I think I'll probably

Re: [PHP] comments function being spammed, how do I stop it?

2008-08-26 Thread Stut
On 26 Aug 2008, at 15:23, tedd wrote: At 3:14 PM -0700 8/25/08, Jim Lucas wrote: Here is the function that I added to a generic guest book script. It works great for me. I have a predefined list of sexual, pharmaceutical, rude, vulgar, etc... words that I have in the spamwords.dat file.

Re: [PHP] PHP editor for linux

2008-08-26 Thread Björn Bartels
hello... i am using kde's 'quanta+' (os-x opensuse). it comes with most linux/kde distributions and has an acceptable set of code-editing features (IMO ;) ) cheers bb Am 14.08.2008 um 19:05 schrieb It flance: Hi, What do you think is the best php editor for linux. I'm using the Debian

Re: [PHP] Assign things to users

2008-08-26 Thread Dan Shirah
Hi, This is more of a logic question than a PHP question. I wanted to get some opinions on how some of you are doing things like this. I have a set of employees in our quote management system. We get thousands of quotes per hour, and every 15 minutes I have a cron that goes out and

Re: [PHP] Assign things to users

2008-08-26 Thread Wolf
Dan Joseph [EMAIL PROTECTED] wrote: Hi, This is more of a logic question than a PHP question. I wanted to get some opinions on how some of you are doing things like this. I have a set of employees in our quote management system. We get thousands of quotes per hour, and every 15

RE: [PHP] Search Suggestions

2008-08-26 Thread Simcha Younger
You could have (and I assume you already have) an id for each customer_name-DIV . This id should correspond to the customer id in your DB. You can then send out an AJAX request with the search term and have it return a list of the ids of the customer-DIV's to expand. A similar solution is to send

Re: [PHP] Assign things to users

2008-08-26 Thread Dan Joseph
Hey Dan, Wolf, Thanks for the input. I do not have any checks in there for balancing out the number of quotes per user. That's actually a great idea and something I am going definitely add to it. I also do not have anything to handle vacations or out of office time, although I don't know if we

RE: [PHP] Large/unreliable file uploading over HTTP

2008-08-26 Thread Simcha Younger
Is this what you are looking for -- It's a java applet that has most of the features you mentioned. I have used it for very large files with no problem. http://www.javazoom.net/applets/jclientupload/jclientupload.html (Sorry, its not free software.) -Original Message- From: mike

RE: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-26 Thread Ford, Mike
On 25 August 2008 00:54, Govinda advised: if (stripos(strrev($file), gpj.) === 0) { echo $file; } note the ===, 3 equals signs here is very important! check the docs for why. == means 'equals', and === means 'is identical to'. Seems like they would do the same thing when

Re: [PHP] multiple question form creation

2008-08-26 Thread Alain R.
thanks a lot Dan, i already know this possibility with textarea but it is not so nice. i would like to do something like under windows/linux. to have a button and when user click on it it add a new field for a new answer... however i do not know if it is so nice step for customer... any other

Re: [PHP] concatenating with . or ,

2008-08-26 Thread tedd
At 10:37 PM +0200 8/25/08, Bernhard Kohl wrote: # Ok tedd, if you insist .. Bernhard: I wasn't insisting, but it's nice you picked up the Gauntlet. Good work and it validates (but of course, you didn't think I would check?). Your results: Comma took: 0.0191585 milliseconds on average.

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-26 Thread James Ausmus
On Tue, Aug 26, 2008 at 8:57 AM, Ford, Mike [EMAIL PROTECTED] wrote: On 25 August 2008 00:54, Govinda advised: snip Personally, I might be tempted to do something like this: if (($pos = strrchr($file, '.'))!==FALSE): switch (strtolower(substr($file, $pos))): case '.gif':

Re: [PHP] Assign things to users

2008-08-26 Thread Jason Pruim
On Aug 26, 2008, at 11:16 AM, Dan Joseph wrote: Hey Dan, Wolf, Thanks for the input. I do not have any checks in there for balancing out the number of quotes per user. That's actually a great idea and something I am going definitely add to it. I also do not have anything to handle

[PHP] Closing a website (mod_redirect)

2008-08-26 Thread Alex Chamberlain
Hi, From time to time, I will need to update my website. During this time, I would like to forward all traffic to a ‘closed for site maintenance’ page. This page will have an image. I’ve had a go using mod_redirect: RewriteEngine on RewriteRule ^.*/splash.png$

Re: [PHP] Assign things to users

2008-08-26 Thread Dan Joseph
On Tue, Aug 26, 2008 at 12:31 PM, Jason Pruim [EMAIL PROTECTED] wrote: On Aug 26, 2008, at 11:16 AM, Dan Joseph wrote: Hey Dan, Wolf, Thanks for the input. I do not have any checks in there for balancing out the number of quotes per user. That's actually a great idea and something I

RE: [PHP] Closing a website (mod_redirect) SOLVED

2008-08-26 Thread Alex Chamberlain
Why do you always solve a problem you have been working on for a day as soon as you email a mail list!?! THE SOLUTION, should anybody want it. RewriteEngine on RewriteCond %{REQUEST_URI} !^.*/closed/closed.png.*$ RewriteCond %{REQUEST_URI} !^.*/closed/closed.htm.*$ RewriteRule ^.*$

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-26 Thread Lupus Michaelis
Ford, Mike a écrit : case '.gif': case '.png': case '.jpg': case '.jpeg': echo $file; Be carefull. The « extension » is just a clue to know what filled the file. See http://fr3.php.net/manual/en/book.fileinfo.php. -- Mickaël Wolff aka Lupus

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-26 Thread Lupus Michaelis
Ford, Mike a écrit : case '.gif': case '.png': case '.jpg': case '.jpeg': Be careful. The end of the filename is just a clue on what is filled the file. See http://fr3.php.net/manual/en/book.fileinfo.php for more acurate result. -- Mickaël Wolff aka

RE: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-26 Thread Ford, Mike
On 26 August 2008 17:15, James Ausmus advised: On Tue, Aug 26, 2008 at 8:57 AM, Ford, Mike [EMAIL PROTECTED] wrote: On 25 August 2008 00:54, Govinda advised: snip Personally, I might be tempted to do something like this: if (($pos = strrchr($file, '.'))!==FALSE): switch

Re: [PHP] comments function being spammed, how do I stop it?

2008-08-26 Thread Jim Lucas
Stut wrote: On 26 Aug 2008, at 15:23, tedd wrote: At 3:14 PM -0700 8/25/08, Jim Lucas wrote: Here is the function that I added to a generic guest book script. It works great for me. I have a predefined list of sexual, pharmaceutical, rude, vulgar, etc... words that I have in the

Re: [PHP] concatenating with . or ,

2008-08-26 Thread Lupus Michaelis
tedd a écrit : The cycle of programming continues. And the algorithm era crunch down ;) The test isn't accurate because it focuses on two strings of the same length. And all programmers know that some algorithms depends on the size of the data handled, and the number of it.

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-26 Thread James Ausmus
On Tue, Aug 26, 2008 at 10:08 AM, Ford, Mike [EMAIL PROTECTED] wrote: On 26 August 2008 17:15, James Ausmus advised: On Tue, Aug 26, 2008 at 8:57 AM, Ford, Mike [EMAIL PROTECTED] wrote: On 25 August 2008 00:54, Govinda advised: snip Personally, I might be tempted to do something like

Re: [PHP] concatenating with . or ,

2008-08-26 Thread Robert Cummings
On Tue, 2008-08-26 at 12:07 -0400, tedd wrote: At 10:37 PM +0200 8/25/08, Bernhard Kohl wrote: # Ok tedd, if you insist .. Bernhard: I wasn't insisting, but it's nice you picked up the Gauntlet. Good work and it validates (but of course, you didn't think I would check?). Your

Re: [PHP] Large/unreliable file uploading over HTTP

2008-08-26 Thread mike
Thanks - there's a lot of uploaders out there... I'll look at it more, but I'd really like a solution which allows for us to use any applet language we want. We'd prefer not to use java too :) I don't see anything specific right off the bat that says how it uploads (POST vs PUT) or splitting up

Re: [PHP] concatenating with . or ,

2008-08-26 Thread Yeti
Bernhard wrote: echo $test_string, $array_value; It seems like they echoed them -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Bug in array_key_exist?

2008-08-26 Thread Korgan
Hi, I have a problem with array_key_exists in if statement. I have a class with this function class XXX { private items = array(); ... ... ... public function addXXX($id, $count) { $count = (int)$cout; if (!array_key_exists($id, $this-items))

[PHP] Re: Bug in array_key_exist?

2008-08-26 Thread Lupus Michaelis
Korgan a écrit : public function addXXX($id, $count) { $count = (int)$cout; Try to work with error_reporting set to E_ALL ;) session_start(); var_dump($_SESSION['XX']); /** A **/ If XX is a right value for a variable name, they are no problem. -- Mickaël Wolff aka Lupus

Re: [PHP] Quick question regarding getcwd() and directory location.

2008-08-26 Thread Micah Gersten
I said AFAIK. I was under the impression the DirectoryIndex did a redirect. I just tested it and it does not, so you are correct Jochem. He has everything he needs. He'll need the document root and $_SERVER['REQUEST_URI'] to do this. Thank you, Micah Gersten onShore Networks Internal

[PHP] Re: Bug in array_key_exist?

2008-08-26 Thread Korgan
Error reporting is set on E_ALL notice: it change value if I add the item which isnt in array Lupus Michaelis wrote: Korgan a écrit : public function addXXX($id, $count) { $count = (int)$cout; Try to work with error_reporting set to E_ALL ;) session_start();

Re: [PHP] Bug in array_key_exist?

2008-08-26 Thread Jim Lucas
Korgan wrote: Hi, I have a problem with array_key_exists in if statement. I have a class with this function class XXX { private items = array(); ... ... ... public function addXXX($id, $count) { $count = (int)$cout; Let me point at it Check your spelling If

Re: [PHP] Bug in array_key_exist?

2008-08-26 Thread Korgan
Jim Lucas napsal(a): Korgan wrote: Hi, I have a problem with array_key_exists in if statement. I have a class with this function class XXX { private items = array(); ... ... ... public function addXXX($id, $count) { $count = (int)$cout; Let me point at it Check

Re: [PHP] concatenating with . or ,

2008-08-26 Thread Govinda
I never thanked all the people who answered my Q in so many helpful ways and on so many levels.I see that this list if chock full of really quality people with loads of expertise and many other fine qualities (tedd sperling's broad perspective, for one) ... I would be tempted to

Re: [PHP] concatenating with . or ,

2008-08-26 Thread Robert Cummings
On Tue, 2008-08-26 at 19:56 -0600, Govinda wrote: I never thanked all the people who answered my Q in so many helpful ways and on so many levels.I see that this list if chock full of really quality people with loads of expertise and many other fine qualities (tedd sperling's broad

[PHP] PHP IDE needed

2008-08-26 Thread Sascha Braun
Hi people, I have a webproject which is round about 3 GB in size. I was usually using eclipse to work with the software but over time eclipse became very instable regarding that project. As soon as I open classes with 2000 or more lines of code in it, an out of memory error occours. So I need

Re: [PHP] PHP IDE needed

2008-08-26 Thread Micah Gersten
How much RAM do you have? Eclipse is a great IDE. Have you upgraded to 3.4? Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Sascha Braun wrote: Hi people, I have a webproject which is round about 3 GB in size. I was usually using eclipse to work with