php-general Digest 1 Dec 2006 10:31:53 -0000 Issue 4490

2006-12-01 Thread php-general-digest-help
php-general Digest 1 Dec 2006 10:31:53 - Issue 4490 Topics (messages 245380 through 245396): Re: Preg_match - Find URL and convert to lower case 245380 by: Dave Goodchild 245381 by: Kevin Murphy 245388 by: Jonesy 245389 by: Dave Goodchild Re: Webbased Visual

Re: [PHP] Re: Preg_match - Find URL and convert to lower case

2006-12-01 Thread Dave Goodchild
In that case you could use the /e trailing option to use strtolower on the subpattern.

Re: [PHP] [PHP 4.4.5 / Apache 2.2.3] Abrupt and unrepeatable Segmentationfault (11)

2006-12-01 Thread Jan Schröter
Chris wrote: If nobody provides information then try the -internals list, they'll probably be able to help a bit more. Thanks a lot! I've done so, because it's very urgent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] mssql conflict with sybase...

2006-12-01 Thread Le Phuoc Canh
Dear all, I use php version 4.4.2. When i use mssql and sybase extention, they are conflict together. I don't know how to using them together. Please help me... Thanks Best Regard

Re: [PHP] Tidy HTML source?

2006-12-01 Thread Satyam
This is getting too philosophical for my taste. There are many reasons to justify different ways of programming and each user, according to his/her requirements, experience and circumstances weights them differently and may decide in a different way. I am not about argue in favor of any one

Re: [PHP] EZ array problem - What's wrong with my brain?

2006-12-01 Thread Youri LACAN-BARTLEY
Well, I've only just fallen out of bed, but I'd say you'd be able to access it via $var[0][0][0] as in $var[1.2][code][0] to change 111 to something else and $var[1.2][status][0] to set/change new. I must say this looks like an overly complicated array for what it serves. A little OOP could come

Re: [PHP] Help with strange include problem in PHP 5.2.0

2006-12-01 Thread Markus Mayer
Hi Richard, Hi all, The include path is correct. That was one of the first things I played around with. At the moment, it's include_path = .. I also tried renaming the php.ini file to php.ini.off so that it wasn't found and took all the defaults, but with no success. Last night I built

Re: [PHP] Help with strange include problem in PHP 5.2.0

2006-12-01 Thread Markus Mayer
On Thursday 30 November 2006 19:04, Richard Lynch wrote: [snip...] And of course I forgot to put in the configure arguments './configure' \ '--without-pear' \ '--with-apxs2=/usr/local/apache2/bin/apxs' \ '--enable-mm=shared' \

Re: [PHP] Tidy HTML source?

2006-12-01 Thread Sancar Saran
Dear Paul, Many thanks for replaying my message, It was very helpful and now I really understood why I so negative for templating systems... I haven't got programer background or education. I'm self learner. Many of php programmers have other programming experiences, and if I understand

Re: [PHP] EZ array problem - What's wrong with my brain?

2006-12-01 Thread Jochem Maas
Youri LACAN-BARTLEY wrote: Well, I've only just fallen out of bed, but I'd say you'd be able to access it via $var[0][0][0] as in $var[1.2][code][0] to change 111 to something else and $var[1.2][status][0] to set/change new. I must say this looks like an overly complicated array for what it

Re: [PHP] problem with register globals on new server

2006-12-01 Thread afan
[EMAIL PROTECTED] wrote: hi, I had to move my osComerce store to new hosting company. new server runs on php5/mysql5. got this error: FATAL ERROR: register_globals is disabled in php.ini, please enable it! since evenon old server globals was Off I was adding ifModule mod_php4.c

Re: [PHP] EZ array problem - What's wrong with my brain?

2006-12-01 Thread Brian Dunning
That seems right to me too - but everything I try returns NULL. I set $try=$var[0], and $try ends up being null; print_r($try) gives blank. I even tried $try=$var[1] and it was the same result. Am I in the Twilight Zone? On Dec 1, 2006, at 12:26 AM, Youri LACAN-BARTLEY wrote: -BEGIN

Re: [PHP] EZ array problem - What's wrong with my brain?

2006-12-01 Thread Fredrik Thunberg
Try $try = $var[1.2]; If your array looks like the one below then there is no $var[0] and therefore you get NULL /Thunis Brian Dunning skrev: That seems right to me too - but everything I try returns NULL. I set $try=$var[0], and $try ends up being null; print_r($try) gives blank. I even

Re: [PHP] EZ array problem - What's wrong with my brain?

2006-12-01 Thread Youri LACAN-BARTLEY
Hi Jochem, I meant overly-complicated in this specific context. If each key of this array is going to contain only one value why not reduce the array to something like this : array(1) { [1.2]= array(2) { [code]= string(3) 111 [status]= string(3) new } } That's all I was referring

Re: [PHP] EZ array problem - What's wrong with my brain?

2006-12-01 Thread Brian Dunning
That works, but the value 1.2 is unknown, I can't hardcode it. On Dec 1, 2006, at 6:52 AM, Fredrik Thunberg wrote: Try $try = $var[1.2]; If your array looks like the one below then there is no $var[0] and therefore you get NULL /Thunis Brian Dunning skrev: That seems right to me too -

RE: [PHP] EZ array problem - What's wrong with my brain?

2006-12-01 Thread Ray Hauge
http://www.php.net/manual/en/language.types.array.php If you check out the documentation on arrays, you will see the second code example shows the expected behavior of arrays in this case. $arr = array(foo = bar, 12 = true); echo $arr[foo]; // bar echo $arr[12];// 1 Now, since each element

RE: [PHP] EZ array problem - What's wrong with my brain?

2006-12-01 Thread Ray Hauge
I forgot to mention that you won't be able to use 0, 1, etc. as PHP will convert those to integers. If you do use them, then they will replace [0] with whatever you put in there, and if you are using the references, it will replace both instances with your new [0] HTH -- Ray Hauge Application

Re: [PHP] EZ array problem - What's wrong with my brain?

2006-12-01 Thread Youri LACAN-BARTLEY
Well if the key of your array is unknown, you could always gather the key names with array_keys() and fiddle something from there or just change the structure of you array to be more adapted to you needed or use what Ray just proposed in another post concerning references and the creation of a

Re: [PHP] Re: mail header questions

2006-12-01 Thread Chantal Rosmuller
The strange thing is that even the fifth parameter solution doesn't work. I use Postfix as MTA by the way. Strange - I use postfix on my dev server and it works fine. Are you running anything non-default in postfix (eg chroot) ? -- Postgresql php tutorials http://www.designmagick.com/

Re: [PHP] problem with register globals on new server

2006-12-01 Thread Youri LACAN-BARTLEY
[EMAIL PROTECTED] wrote: yup! that was the problem. snip btw, any free cart that is well supported in php5/mysql5/apache2 and register globals off etc. to recomend? thanks. -afan Well I would really be tempted to say, MINE ! Although it's still in a sick state alpha version right now ...

Re: FW: [PHP] Re: Please hack my app

2006-12-01 Thread Ivo F.A.C. Fokkema
Hi Jordan, Thank you for your offer. As you know, I've signed up a couple of days ago. I ran a scan yesterday and have gotten a big PDF file out of it. I've quickly scanned through the results and it appears there are a lot of times when I use one of my own functions (sometimes even without an

Re: [PHP] Re: mail header questions

2006-12-01 Thread Youri LACAN-BARTLEY
Hi there Chantal, Hi all, have you ever thought of using phpMailer or swiftmailer? That has solved me a lot of hassle with time, especially as far as correctly setting the Return-Path is concerned. Good luck ! Chantal Rosmuller wrote: The strange thing is that even the fifth parameter solution

Re: [PHP] Re: Preg_match - Find URL and convert to lower case

2006-12-01 Thread Kevin Murphy
On Nov 30, 2006, at 7:50 PM, Jonesy wrote: On Thu, 30 Nov 2006 14:16:16 -0800, Kevin Murphy wrote: I have some text that comes out of a database all in uppercase (old IBM Mainframe that only supports uppercase characters). I see via other followups that you have your kludge working.

Re: [PHP] hiding passwd in cmdlines that appear in the process list

2006-12-01 Thread Richard Lynch
On Thu, November 30, 2006 12:29 pm, Edwin Barrios wrote: This is not triue because a shell vars declered on a shell is only exposed to its subshells, that means that only exec's and system functions calls into the php itself resive those vars declared into the php ! You can see this

Re: [PHP] hiding passwd in cmdlines that appear in the process list

2006-12-01 Thread tg-php
If you did use ENV to set the username and password, you could always unset it using the same method after you ran the mysql command. So it'd only be exposed for a very brief period of time and slightly less accessible than just running a process list. It still falls under the category of

[PHP] Remote MySQL connection via PHP file

2006-12-01 Thread Scott
Hi all, I've been searching around for a while, but cannot find a solution. For a project of mine, I need to keep the connection information to a MySQL server database on another server. Example remote file: ?php $user = joe; $pass = 1234; ? Example local file: ?php include

[PHP] Re: ?=$var? on OS X

2006-12-01 Thread Michelle Konzack
Hello DC, Am 2006-11-27 02:43:41, schrieb Dotan Cohen: Exactly for that reason I don't recommend that you use it. Just use ?php print $var; ? as it's portable and doesn't add that much typing- certainly not enough to justify the headache. Thanks for this info. This is new for me and since I

[PHP] Re: ?=$var? on OS X

2006-12-01 Thread Michelle Konzack
Am 2006-11-27 03:28:08, schrieb Dotan Cohen: Actually, it does. He can global replace ?= with ?php print and I think you meen: replace ?= $ with ?php print $ Greetings Michelle Konzack Systemadministrator Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User

Re: [PHP] Remote MySQL connection via PHP file

2006-12-01 Thread cajbecu
i suggest you: database.conf (the file on another server) host=localhost user=test pass=test anothervar=anothervalue on your script: $temp = file(http://../database.conf); foreach($temp as $val) { $temp2 = explode(=,$val); $$temp2[0] = $temp[1]; } after that, you`ll have: $host =

Re: [PHP] Detecting naughty sites

2006-12-01 Thread Satyam
- Original Message - From: Satyam [EMAIL PROTECTED] The Wikipedia article of the day provides some interesting facts about when if became naughty: http://en.wikipedia.org/wiki/History_of_erotic_depictions -- May I add something that came to my mind related to this. As the

Re: [PHP] Detecting naughty sites

2006-12-01 Thread Robert Cummings
On Fri, 2006-12-01 at 20:41 +0100, Satyam wrote: - Original Message - From: Satyam [EMAIL PROTECTED] The Wikipedia article of the day provides some interesting facts about when if became naughty: http://en.wikipedia.org/wiki/History_of_erotic_depictions -- May I add

Re: [PHP] Re: Preg_match - Find URL and convert to lower case

2006-12-01 Thread Jonesy
On Fri, 1 Dec 2006, Kevin Murphy wrote: On Nov 30, 2006, at 7:50 PM, Jonesy wrote: On Thu, 30 Nov 2006 14:16:16 -0800, Kevin Murphy wrote: I have some text that comes out of a database all in uppercase (old IBM Mainframe that only supports uppercase characters). I see via other followups

RE: [PHP] Remote MySQL connection via PHP file

2006-12-01 Thread Ray Hauge
That seems like it wouldn't be very secure at all. Maybe it's just because I don't understand the reason for *having* to do it that way. My first suggestion would be to see if there's any way you don't have to do that. If you have to do it, I would suggest maybe having it on an NFS share, or

Re: [PHP] Remote MySQL connection via PHP file

2006-12-01 Thread Paul Novitski
At 12/1/2006 10:17 AM, Scott wrote: For a project of mine, I need to keep the connection information to a MySQL server database on another server. I'm sure there are more efficient ways to do this, but here's a fall-back: Write a PHP program (web service) to run on the server where the

Re: [PHP] Remote MySQL connection via PHP file

2006-12-01 Thread clive
cajbecu wrote: i suggest you: database.conf (the file on another server) host=localhost user=test pass=test anothervar=anothervalue have you thought of the security implications of this, a text file with user names/passwords, thats rather insecure I would say, on your script: $temp =

Re: [PHP] Remote MySQL connection via PHP file

2006-12-01 Thread clive
Scott wrote: Hi all, I've been searching around for a while, but cannot find a solution. For a project of mine, I need to keep the connection information to a MySQL server database on another server. ?php include http://www.remoteserver.com/remote_file.php;; // Use variables $user and $pass

Re: [PHP] magic_quotes

2006-12-01 Thread Johannes Lindenbaum
Hello, without trying to embarrass myself, but Here the smart quoting function off php.net |function quote_smart($value) { // Stripslashes if (get_magic_quotes_gpc()) { $value = stripslashes($value); } // Quote if not a number or a numeric string if (!is_numeric($value)) {

Re: [PHP] magic_quotes

2006-12-01 Thread Eric Butera
On 12/1/06, Johannes Lindenbaum [EMAIL PROTECTED] wrote: Hello, without trying to embarrass myself, but Here the smart quoting function off php.net |function quote_smart($value) { // Stripslashes if (get_magic_quotes_gpc()) { $value = stripslashes($value); } // Quote if

Re: [PHP] magic_quotes

2006-12-01 Thread Johannes Lindenbaum
Eric Butera schrieb: You almost have it. What you need to do is if magic quotes is on, then stripslashes and apply mysql_real_escape_string. If magic quotes is off only apply mysql_real_escape_string since php didn't escape values for you. Also in your mysql_real_escape_string I would

Re: [PHP] magic_quotes

2006-12-01 Thread Eric Butera
On 12/1/06, Johannes Lindenbaum [EMAIL PROTECTED] wrote: Eric Butera schrieb: You almost have it. What you need to do is if magic quotes is on, then stripslashes and apply mysql_real_escape_string. If magic quotes is off only apply mysql_real_escape_string since php didn't escape values

Re: [PHP] Remote MySQL connection via PHP file

2006-12-01 Thread Richard Lynch
On Fri, December 1, 2006 12:17 pm, Scott wrote: I've been searching around for a while, but cannot find a solution. For a project of mine, I need to keep the connection information to a MySQL server database on another server. Example remote file: ?php $user = joe; $pass = 1234; ?

Re: [PHP] Help with strange include problem in PHP 5.2.0

2006-12-01 Thread Richard Lynch
Try running it under some kind of debugger and see if you can figure out what directories it's even checking when it doesn't find the file... I dunno if Zend IDE (or whatever it's called now) or Komodo or XDebug or whatnot will do that, but it's definitely sounding very odd if your include_path

Re: [PHP] mssql conflict with sybase...

2006-12-01 Thread Richard Lynch
On Fri, December 1, 2006 2:28 am, Le Phuoc Canh wrote: I use php version 4.4.2. When i use mssql and sybase extention, they are conflict together. I don't know how to using them together. It might be easiest to dump mssql and use sybase exclusively. Last I heard, Microsoft hasn't actually

Re: [PHP] EZ array problem - What's wrong with my brain?

2006-12-01 Thread Richard Lynch
There is no $var[0]; It's $var['1.2]; There is no $var[0][0]; It's $var['1.2']['code']; The remainder of this email composition is left as an exercise for the reader. On Fri, December 1, 2006 8:46 am, Brian Dunning wrote: That seems right to me too - but everything I try returns NULL. I set

Re: [PHP] Preg_match - Find URL and convert to lower case

2006-12-01 Thread Richard Lynch
On Thu, November 30, 2006 5:04 pm, Kevin Murphy wrote: Well the problem would be then that the entire string would be lower case, and I only can have the link as lower case. Is there a way to apply strtolower into the preg_match? Why not use lower(link) in SQL to get the link out in the first

RE: [PHP] EZ array problem - What's wrong with my brain?

2006-12-01 Thread Richard Lynch
On Fri, December 1, 2006 9:28 am, Ray Hauge wrote: I forgot to mention that you won't be able to use 0, 1, etc. as PHP will convert those to integers. If you do use them, then they will replace [0] with whatever you put in there, and if you are using the references, it will replace both

[PHP] Acceptably Converting a 24bit PNG to a JPEG?

2006-12-01 Thread Graham Anderson
Is there some trick to getting PHP GD to properly convert a 24bit PNG [with alpha] into a JPEG without garbling the image output? The below will output the jpg image, but it appears that the alpha channel from the original png is garbling the jpeg a bit To no avail, I tried setting

Re: [PHP] Tidy HTML source?

2006-12-01 Thread Richard Lynch
On Thu, November 30, 2006 6:47 pm, Paul Novitski wrote: A templating system requires the processor to merge content with template. An inline markup assembly system requires the processor to build the markup from function calls. Where is the technique that doesn't take machine cycles? You

Re: [PHP] magic_quotes

2006-12-01 Thread Richard Lynch
On Fri, December 1, 2006 2:32 pm, Johannes Lindenbaum wrote: Here the smart quoting function off php.net |function quote_smart($value) { // Stripslashes if (get_magic_quotes_gpc()) { $value = stripslashes($value); } // Quote if not a number or a numeric string if

Re: [PHP] Preg_match - Find URL and convert to lower case

2006-12-01 Thread Kevin Murphy
On Dec 1, 2006, at 1:56 PM, Richard Lynch wrote: On Thu, November 30, 2006 5:04 pm, Kevin Murphy wrote: Well the problem would be then that the entire string would be lower case, and I only can have the link as lower case. Is there a way to apply strtolower into the preg_match? Why not use

Re: [PHP] magic_quotes

2006-12-01 Thread Johannes Lindenbaum
Blah sorry, I saw your second example not your final code. Some scripts I use have different database connections and because of that it is very important to always make sure I am using the correct link identifier. The php best practice example checks the string to see if it is a number. If it

[PHP] signal handling

2006-12-01 Thread Aras
Hello Despite all of my results to succeed, i can not make this work. What i want to do is to write a simple socket server in PHP. My current example just prints the same character, you send to server from keyboard. It is successfull in forking, and generates child as people connect. However in

Re: [PHP] Tidy HTML source?

2006-12-01 Thread Paul Novitski
At 12/1/2006 02:22 PM, Richard Lynch wrote: On Thu, November 30, 2006 6:47 pm, Paul Novitski wrote: A templating system requires the processor to merge content with template. An inline markup assembly system requires the processor to build the markup from function calls. Where is the

Re: [PHP] Tidy HTML source?

2006-12-01 Thread Robert Cummings
On Fri, 2006-12-01 at 17:51 -0800, Paul Novitski wrote: At 12/1/2006 02:22 PM, Richard Lynch wrote: Try 10 X as many for most templating solutions. Ten times as many templates as there are pages on the site? Wow, that's a lot. Fortunately I don't use any of those templating

Re: [PHP] problems with exec() SOLVED

2006-12-01 Thread Ray
Thanks for the help. :) I posted to the freeBSD list and was given the answer there. in case anyone is interested and for the sake of the archive, I needed a path specified in the shell script. The following URL provides the necessary info for fixing the script.