Re: [PHP] Re: how to detect type of image

2007-04-28 Thread Tijnema !
On 4/28/07, Tim <[EMAIL PROTECTED]> wrote: On 21.04.2007 12:45, Alain Roger wrote: > Hi, > > In my web application, end user is able to load images (png, jpeg, > gif,..) into database. I would like to know how can i detect > automatically the type of image (pnd, jpeg,...) ? i do not want to > che

Re: [PHP] Script feedback: insert string into another string

2007-04-28 Thread Tijnema !
On 4/28/07, Micky Hulse <[EMAIL PROTECTED]> wrote: Hi, I pieced-together a script that will insert a string into another string at a set interval of words... See here: [Click the "view source" link to view source.] :D Basically, I need

Re: [PHP] Script feedback: insert string into another string

2007-04-28 Thread Micky Hulse
Tijnema! Thanks for the quick reply! I really really really appreciate the help. :D Tijnema ! wrote: Nice idea, but it seems that it isn't working correctly. I did this example: With your break_up function. It results this: .. While i expected this: .. Ahh! Great way to test thi

Re: [PHP] Script feedback: insert string into another string

2007-04-28 Thread Micky Hulse
Just FYI, I did some slight upgrades/updates to the code... Seems to be working pretty good now. :) Thanks again Tijnema! Cheers, Micky -- Wishlists: Switch: BCC?:

Re: [PHP] Script feedback: insert string into another string

2007-04-28 Thread Tijnema !
On 4/28/07, Micky Hulse <[EMAIL PROTECTED]> wrote: Just FYI, I did some slight upgrades/updates to the code... Seems to be working pretty good now. :) Thanks again Tijnema! Cheers, Micky I think i found another problem in your script, whe

[PHP] Re: how to detect type of image

2007-04-28 Thread tedd
At 2:10 AM +0200 4/28/07, Tim wrote: On 21.04.2007 12:45, Alain Roger wrote: Hi, In my web application, end user is able to load images (png, jpeg, gif,..) into database. I would like to know how can i detect automatically the type of image (pnd, jpeg,...) ? i do not want to check the extension

Re: [PHP] Re: how to detect type of image

2007-04-28 Thread Tijnema !
On 4/28/07, tedd <[EMAIL PROTECTED]> wrote: At 2:10 AM +0200 4/28/07, Tim wrote: >On 21.04.2007 12:45, Alain Roger wrote: >>Hi, >> >>In my web application, end user is able to load images (png, jpeg, >>gif,..) into database. I would like to know how can i detect >>automatically the type of image

Re: [PHP] Script feedback: insert string into another string

2007-04-28 Thread Micky Hulse
Tijnema! You rock! Another great catch. :) Tijnema ! wrote: .. the eregi function. So like this: if(eregi('[0-9A-Za-zÀ-ÖØ-öø-ÿ]', $array[$i])) { becomes: if(eregi('[0-9A-Za-zÀ-ÖØ-öø-ÿ]', strip_tags($array[$i]))) { That would fix it :) Just updated the code. (Hehe, tis hard to catch those z

Re: [PHP] Re: how to detect type of image

2007-04-28 Thread Edward Vermillion
On Apr 28, 2007, at 6:54 AM, tedd wrote: At 2:10 AM +0200 4/28/07, Tim wrote: On 21.04.2007 12:45, Alain Roger wrote: Hi, In my web application, end user is able to load images (png, jpeg, gif,..) into database. I would like to know how can i detect automatically the type of image (pnd, jpeg

Re: [PHP] [ANNOUNCE] TODO parser

2007-04-28 Thread Edward Vermillion
On Apr 27, 2007, at 8:24 PM, Daevid Vincent wrote: For a long time I've wanted a tool that would traverse my source code to find all those little forgotten "TODO" entries. [snip] Doesn't phpDocumentor (http://phpdocu.sourceforge.net/) do that already? Ed -- PHP General Mailing List (htt

Re: [PHP] Script feedback: insert string into another string

2007-04-28 Thread Tijnema !
On 4/28/07, Micky Hulse <[EMAIL PROTECTED]> wrote: Tijnema! You rock! Another great catch. :) Tijnema ! wrote: > .. > the eregi function. So like this: > if(eregi('[0-9A-Za-zÀ-ÖØ-öø-ÿ]', $array[$i])) { > becomes: > if(eregi('[0-9A-Za-zÀ-ÖØ-öø-ÿ]', strip_tags($array[$i]))) { > That would fix

Re: [PHP] Re: how to detect type of image

2007-04-28 Thread Tijnema !
On 4/28/07, Edward Vermillion <[EMAIL PROTECTED]> wrote: On Apr 28, 2007, at 6:54 AM, tedd wrote: > At 2:10 AM +0200 4/28/07, Tim wrote: >> On 21.04.2007 12:45, Alain Roger wrote: >>> Hi, >>> >>> In my web application, end user is able to load images (png, jpeg, >>> gif,..) into database. I wou

Re: [PHP] phpbb / sessionid nightmare

2007-04-28 Thread Tijnema !
On 4/28/07, Brad Sumrall <[EMAIL PROTECTED]> wrote: Users log into web site in a sudo phpbb login which works fine. Users are able to browse around phpbb and a sudo phpbb program called photopost. But when the goto a differen't part of the site which is not phpbb related, the sessionid does n

Re: [PHP] Re: how to detect type of image

2007-04-28 Thread tedd
At 9:22 AM -0500 4/28/07, Edward Vermillion wrote: It should, but instead try this: $image_size = getimagesize($filename); echo $image_size['mime']; $image_size['mime'] ? Where did that come from? I duno, maybe the manual. http://us2.php.net/getimagesize <-- 5th or 6th example down. Als

[PHP] Re: [ANNOUNCE] TODO parser

2007-04-28 Thread Alexander Elder
Daevid Vincent wrote: For a long time I've wanted a tool that would traverse my source code to find all those little forgotten "TODO" entries. It should handle most all kinds (as you'll see if you look at the example files). The only one I didn't bother with was: $foo = 1; //Todo: [dv] I mea

Re: [PHP] Re: how to detect type of image

2007-04-28 Thread Tim
On 28.04.2007 10:39, Tijnema ! wrote: First of all, i don't see any reason why this works better then other functions, as it also relies on the magic bytes. Second, for your switch, you should use the constants (IMAGETYPE_GIF,IMAGETYPE_JPEG,...) instead of just using decimal values. Tijnema Y

RE: [PHP] phpbb / sessionid nightmare

2007-04-28 Thread Brad Sumrall
Hi there my friend, Thank you so much for answering me. The reason for me posting all of the code is because I am clueless as to which sessionid call on that crazy page is kicking out the original sessionid and asking for a new one. Sessionid is normally easy, that page is blowing my mind with a

[PHP] Object-oriented $_REQUEST?

2007-04-28 Thread js
Hi. I'm looking for implementation of request object that represent a request that works like this. $r = new request(); if ($r->method == 'GET') $name = $r->GET->get('name'); $age = $r->GET->get('age'); else if (request.method == 'POST') $name = $r->POST->get('name'); $age = $r->POST

RE: [PHP] Object-oriented $_REQUEST?

2007-04-28 Thread Buesching, Logan J
I feel that a 'request' class wouldn't be appropriate for the $_REQUEST array. The reason being, is that there isn't to that class other than the $_REQUEST array, and a bunch of 'get' methods. If this were to be expanded upon by adding filtering user input, then it *could* be more useful. IMO an

Re: [PHP] phpbb / sessionid nightmare

2007-04-28 Thread Richard Lynch
On Sat, April 28, 2007 11:03 am, Brad Sumrall wrote: > Users log into web site in a sudo phpbb login which works fine. > > Users are able to browse around phpbb and a sudo phpbb program called > photopost. > > > > But when the goto a differen't part of the site which is not phpbb > related, > the s

RE: [PHP] phpbb / sessionid nightmare

2007-04-28 Thread Richard Lynch
On Sat, April 28, 2007 12:47 pm, Brad Sumrall wrote: > which sessionid call on that crazy page is kicking out the original > sessionid and asking for a new one. That's when an experienced programmer KNOWS that it's time to re-factor and re-write the page. :-) > I am lost in the sauce on this one

Re: [PHP] Script feedback: insert string into another string

2007-04-28 Thread Richard Lynch
Without reading source, it sounds like you've just re-invented this: http://php.net/wordwrap :-) On Sat, April 28, 2007 12:32 am, Micky Hulse wrote: > Hi, > > I pieced-together a script that will insert a string into another > string > at a set interval of words... See here: > >

Re: [PHP] [ANNOUNCE] TODO parser

2007-04-28 Thread Richard Lynch
Personally, I always spell it 'todo' and then a simple grep works pretty well... I suppose I sometimes find a bunch of stuff with 'todo' in a variable name, but not real often, so far... I also tend to keep a "todo.txt" file open and add to that instead of strewing things through my code... The

Re: [PHP] problem with shared object file

2007-04-28 Thread Richard Lynch
On Fri, April 27, 2007 5:49 pm, Tijnema ! wrote: >> Also, I think dl() is going away in PHP 6, so you may want to >> re-think >> this from the get-go... > > Yes, if seen it is deprecated, but how could somebody include dynamic > library without editing php.ini? I was a little bit shocked when i > r

Re: [PHP] Parsing CSV files

2007-04-28 Thread Richard Lynch
On Fri, April 27, 2007 5:25 pm, Fernando Cosso wrote: > One word: explode > :D Two Words: Quotes, Commas :-p CSV is a nasty nested mess of escapes for escapes from somebody who clearly did NOT understand how to write a parser/grammar. Oh, yeah, it came from Microsoft, I think. That explains eve

Re: [PHP] [ANNOUNCE] TODO parser

2007-04-28 Thread Gregory Beaver
Edward Vermillion wrote: > > On Apr 27, 2007, at 8:24 PM, Daevid Vincent wrote: > >> For a long time I've wanted a tool that would traverse my source code to >> find all those little forgotten "TODO" entries. >> > > [snip] > > Doesn't phpDocumentor (http://phpdocu.sourceforge.net/) do that alre

[PHP] Re: how to detect type of image

2007-04-28 Thread Al
If it's critical that you can detect the image type accurately, I'd suggest using ImageMagick's "identify" command. It will tell you about everything that you'd ever want to know about an image. http://www.imagemagick.org/script/index.php Post your question on their forum http://www.imagemagick

Re: [PHP] Object-oriented $_REQUEST?

2007-04-28 Thread js
For me, PHP's issetting or emptying $_GET, $_POST or $_REQUEST is cumbersome. want it to be more easy and comfortable. I could say I want a JSP's HttpServletRequest for PHP. (http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpServletRequest.html) I think you're 100% right th

Re: [PHP] Object-oriented $_REQUEST?

2007-04-28 Thread keviN
""Buesching, Logan J"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] I feel that a 'request' class wouldn't be appropriate for the $_REQUEST array. The reason being, is that there isn't to that class other than the $_REQUEST array, and a bunch of 'get' methods. If this were t

[PHP] Re: Object-oriented $_REQUEST?

2007-04-28 Thread keviN
array = &$array; } public function get($key) { if (isset($this->array[$key])) return $this->array[$key]; return null; } } class request { private $types = array('COOKIE', 'REQUEST', 'GET', 'POST', 'SESSION'); function __construct() { foreach ($this->types as $type) { //do not link t

RE: [PHP] phpbb / sessionid nightmare

2007-04-28 Thread Brad Sumrall
The cookie it's self says PHPSESSID=26b7974a5d71c7d0bfebbf71750dac7b Path=/ Host=www.domain.com When I go to the jacked up page, I pickup this one PHPSESSID=a787e077dd18ed18cb824f664d38315d Path=/ Host=domain.com In the directory structure, I have gone from /phpbb/login.php to /contest_stories.p

Re: [PHP] Re: how to detect type of image

2007-04-28 Thread Edward Vermillion
On Apr 28, 2007, at 12:21 PM, tedd wrote: At 9:22 AM -0500 4/28/07, Edward Vermillion wrote: It should, but instead try this: $image_size = getimagesize($filename); echo $image_size['mime']; $image_size['mime'] ? Where did that come from? I duno, maybe the manual. http://us2.php.net/get

Re: [PHP] [ANNOUNCE] TODO parser

2007-04-28 Thread Edward Vermillion
On Apr 28, 2007, at 3:02 PM, Gregory Beaver wrote: Edward Vermillion wrote: On Apr 27, 2007, at 8:24 PM, Daevid Vincent wrote: For a long time I've wanted a tool that would traverse my source code to find all those little forgotten "TODO" entries. [snip] Doesn't phpDocumentor (http://

Re: [PHP] Script feedback: insert string into another string

2007-04-28 Thread Micky Hulse
Tijnema ! wrote: Didn't find anymore bugs yet, maybe later... if i find one i'll let you know :) Thanks again Tijnema! I just read the not from Richard Looks like I might have wasted your time on this one. :( I just woke up... going to test wordwrap() You know, I saw that in the manual

RE: [PHP] Script feedback: insert string into another string

2007-04-28 Thread Brad Sumrall
But! I am now noticing that the main page provides cookies called _utma _utmb _utmc _utmz Hmmm Brad -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Saturday, April 28, 2007 3:48 PM To: [EMAIL PROTECTED] Cc: php php Subject: Re: [PHP] Script feedback: i

Re: [PHP] Re: Object-oriented $_REQUEST?

2007-04-28 Thread Robert Cummings
On Sat, 2007-04-28 at 23:41 +0200, keviN wrote: > > class get I'm sorry but your code indicates an extreme lack of experience using PHP in the real world. Your class should be named such that it will never collide with someone else's class name in the event you might need to use third party libr

Re: [PHP] Script feedback: insert string into another string

2007-04-28 Thread Micky Hulse
Micky Hulse wrote: Shux. I have a feeling that, with the help of Tijnema, I just re-invented wheel. Wait! wordwrap() default behaviour is to count characters, not words. "wordwrap — Wraps a string to a given number of characters using a string break character" I think that is why I initiall

RE: [PHP] phpbb / sessionid nightmare

2007-04-28 Thread Brad Sumrall
Does anyone know what this _utma _utmb _utmc _utmz stuff is? Obviously it is not a php standard. Obviously it is what is actually controlling my sessions? Brad -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Saturday, April 28, 2007 3:46 PM To: Brad Sumrall Cc: 'Ti

Re: [PHP] Script feedback: insert string into another string

2007-04-28 Thread Micky Hulse
Brad Sumrall wrote: But! I am now noticing that the main page provides cookies called _utma _utmb _utmc _utmz Hmmm Wha? Never thought of that. It looks like wordwrap() may not be what I am looking for (though, still researching)... Either way, I am curious to hear what you would

Re: [PHP] Script feedback: insert string into another string

2007-04-28 Thread Micky Hulse
Micky Hulse wrote: Allowing cookies sounds like a security hole... Any suggestions for beefing-up my security would be spectacular! :) Ahhh, would that have anything to do with XSS? I thought striptags() would take care of such problems

RE: [PHP] phpbb / sessionid nightmare

2007-04-28 Thread Brad Sumrall
I understand where you are going with the mysql injection. It would appear as though the entire session is being dictated by this _utmX session which I have never seen before. It would appear as though the /index.php sets this java bases session variable and since phpbb does not use this, it neve

RE: [PHP] phpbb / sessionid nightmare

2007-04-28 Thread Brad Sumrall
Oops! Maybe not. You were right! SFC = stupid flippn' coder = me! I see where you are going with this! if(isset($_SESSION['userid']) && $_SESSION['userid']!="") Not set! Duhhh! The if(isset($_SESSION['userid']) && $_SESSION['userid']!="") Was a silly attempt of mine earlier to force a sess

RE: [PHP] phpbb / sessionid nightmare

2007-04-28 Thread Brad Sumrall
I mean, the get forum Brad -Original Message- From: Brad Sumrall [mailto:[EMAIL PROTECTED] Sent: Saturday, April 28, 2007 7:02 PM To: [EMAIL PROTECTED] Cc: php-general@lists.php.net Subject: RE: [PHP] phpbb / sessionid nightmare Oops! Maybe not. You were right! SFC = stupid flippn' co

Re: [PHP] problem with shared object file

2007-04-28 Thread Tijnema !
On 4/28/07, Richard Lynch <[EMAIL PROTECTED]> wrote: On Fri, April 27, 2007 5:49 pm, Tijnema ! wrote: >> Also, I think dl() is going away in PHP 6, so you may want to >> re-think >> this from the get-go... > > Yes, if seen it is deprecated, but how could somebody include dynamic > library without

RE: [PHP] [ANNOUNCE] TODO parser

2007-04-28 Thread Daevid Vincent
> -Original Message- > From: Gregory Beaver [mailto:[EMAIL PROTECTED] > Sent: Saturday, April 28, 2007 1:03 PM > To: Edward Vermillion > Cc: Daevid Vincent; 'PHP' > Subject: Re: [PHP] [ANNOUNCE] TODO parser > > Edward Vermillion wrote: > > > > On Apr 27, 2007, at 8:24 PM, Daevid Vince

RE: [PHP] [ANNOUNCE] TODO parser

2007-04-28 Thread Daevid Vincent
My tool is case insensitive. It looks for all of these and more: //TODO # TODO @TODO With or without spaces and other extra characters It's smart enough to know the difference between $todo = 1; //TODO: it will match this text, but not the variable It won't match this: TODO list It knows if it

RE: [PHP] Re: [ANNOUNCE] TODO parser

2007-04-28 Thread Daevid Vincent
> -Original Message- > From: Alexander Elder [mailto:[EMAIL PROTECTED] > Sent: Saturday, April 28, 2007 10:30 AM > To: php-general@lists.php.net > Subject: [PHP] Re: [ANNOUNCE] TODO parser > > Daevid Vincent wrote: > > For a long time I've wanted a tool that would traverse my > source co

Re: [PHP] Re: [ANNOUNCE] TODO parser

2007-04-28 Thread Sebe
Daevid Vincent wrote: -Original Message- From: Alexander Elder [mailto:[EMAIL PROTECTED] Sent: Saturday, April 28, 2007 10:30 AM To: php-general@lists.php.net Subject: [PHP] Re: [ANNOUNCE] TODO parser Daevid Vincent wrote: For a long time I've wanted a tool that would traverse my

[PHP] Parse error on a basic call?

2007-04-28 Thread Brad Sumrall
$SESSION = get_include_contents'/phpbb/login.php'; I pulled this tright out of the text book. I am trying to pull a phpbb session on an outside page. Any suggestions? Here is the error! Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/c/u/t/cuteirka/

[PHP] Help me put this into phpinesse!

2007-04-28 Thread Brad Sumrall
What am I missing? Brad

Re: [PHP] Parse error on a basic call?

2007-04-28 Thread Edward Vermillion
On Apr 28, 2007, at 9:08 PM, Brad Sumrall wrote: $SESSION = get_include_contents'/phpbb/login.php'; I pulled this tright out of the text book. I am trying to pull a phpbb session on an outside page. Any suggestions? Here is the error! Parse error: parse error, unexpected T_CONSTANT

Re: [PHP] Parsing CSV files

2007-04-28 Thread Edward Vermillion
On Apr 28, 2007, at 2:59 PM, Richard Lynch wrote: On Fri, April 27, 2007 5:25 pm, Fernando Cosso wrote: One word: explode :D Two Words: Quotes, Commas :-p I think I wrote a "parser" a while back that properly handled commas in quotes for csv files. Probably did it the hard way but it wo

[PHP] Re: [PHP-WIN] Re: [PHP] slow performance

2007-04-28 Thread Stanislav Malyshev
Maybe you need to configure FastCGI for more processes - 500 could be result of getting more requests than there are processes to handle them. How would I do that? The easiest way would be to open WINDOWS/system32/inetsrv/fcgiext.ini and edit the MaxInstances parameter for PHP binary there/ T