php-general Digest 8 Mar 2006 09:57:33 -0000 Issue 4004

2006-03-08 Thread php-general-digest-help
php-general Digest 8 Mar 2006 09:57:33 - Issue 4004 Topics (messages 231621 through 231648): class constants 231621 by: Arnaldo Gandol 231625 by: Chris 231627 by: Shaunak Kashyap 231628 by: Chris 231629 by: Jared Williams 231631 by: Arnaldo

Re: [PHP] Re: Incremental Date Based ID

2006-03-08 Thread Paul Novitski
At 05:05 PM 3/7/2006, Kevin Murphy wrote: Well, part of the issue is that I want to be able to use this as part of the link: /news.php?article=2006-03-05a /news.php?article=2006-03-05b With respect, I too think you should re-examine your reasons for wanting to number (or letter) the links

Re: [PHP] Mathematical CAPTCHA

2006-03-08 Thread Louie Miranda
What i meant was. A CAPTCHA for: example.. one plus 10 = 11 The answer will be the CAPTCHA string On 3/7/06, Kim Hunter [EMAIL PROTECTED] wrote: a quick google of CAPTCHA php shows quite a few On 3/7/06, Louie Miranda [EMAIL PROTECTED] wrote: Is there a pear package or class for PHP?

[PHP] Re: test security of code

2006-03-08 Thread Barry
Gregory Machin wrote: Hi Is there an application that can pass source code and report potential security problem and or the live site ? Many thanks -- Gregory Machin [EMAIL PROTECTED] [EMAIL PROTECTED] www.linuxpro.co.za www.exponent.co.za Web Hosting Solutions Scalable Linux Solutions

Re: [PHP] Re: test security of code

2006-03-08 Thread gustav
Gregory Machin wrote: Hi Is there an application that can pass source code and report potential security problem and or the live site ? Many thanks -- Gregory Machin [EMAIL PROTECTED] [EMAIL PROTECTED] www.linuxpro.co.za www.exponent.co.za Web Hosting Solutions Scalable Linux

[PHP] Environment Variable

2006-03-08 Thread steff
Hello, I want to define my own environemnt variable APPLICATION_ROOT and be able to retrieve his value from php. As apache module, cgi, cron and command line. Now i'm just be able to get it from command line. In other (module,cgi,cron) when I print $_ENV I never get the same environment :(

Re: [PHP] Re: Incremental Date Based ID

2006-03-08 Thread Björn Bartels
hello there, i had to deal with such an issue for labeling job-tickets -– (yymmdd.nn) so maybe try this... code // today‘s date : yymmdd $use_akt_Datum = date(ymd); // how many jobs (artikels) are there today ? $HeutigeAuftraegeSQL = SELECT * FROM auftrag WHERE Auftragsnummer LIKE

Re: [PHP] Environment Variable

2006-03-08 Thread chris smith
On 3/8/06, steff [EMAIL PROTECTED] wrote: Hello, I want to define my own environemnt variable APPLICATION_ROOT and be able to retrieve his value from php. As apache module, cgi, cron and command line. Now i'm just be able to get it from command line. In other (module,cgi,cron) when I print

Re: [PHP] Environment Variable

2006-03-08 Thread Jarratt Ingram
Hello, If you are running on apache and have access to either the .conf file or .htaccess you can use the apache SetEnv directive eg. SetEnv APPLICATION_ROOT /var/www/html/ and then from php use the $_SERVER['APPLICATION_ROOT'] to access the correct information HTH Jarratt On 3/7/06,

Re: [PHP] AUTHENTIC BRANDED PRODUCTS

2006-03-08 Thread Chris
On Wed, 2006-03-08 at 13:26, 2006-03-08 19:26:11 wrote: AUTHENTIC BRANDED PRODUCTS www.loveinfashion.com email and hotmail:[EMAIL PROTECTED] we supply authtic cards and paperwork Do you supply Spell Checkers ? :) -- Chris Blake Cell: 082 775 1492 Work: +27 11 880 2825 Fax : +27 11 782 0841

Re: [PHP] Environment Variable

2006-03-08 Thread Jarratt Ingram
Sorry i ment to add to my previous email, you will only be able to access the $_SERVER['APPLICATION_ROOT'] when using apache and not from Cron or Command line, for that i suppose you could add the following to the /etc/profile file APPLICATION_ROOT=/var/www/ and then to the export line EXPORT

[PHP] Charsets ?

2006-03-08 Thread Ruben Rubio Rey
Hi, I hace a functions that does a think, it cleans strange characters: $trash_string='whateverwithstrangecharacterslikeñ'; $clean_string=strtr(trim($trash_string), 'ç/-àáãèéìíòóõùúüñ()äëïö,, __c__aaaeeiiooouuun__aeio_); Its strange, but if I work with php's charset iso8859-15 it works fine,

[PHP] Query : Facing Error

2006-03-08 Thread Rahul sharma
I have installed php5 manually and pws also on Windows 98. I checked execute button of pws also. But the problem is, when i execute any php programe my browser show me following message pThis PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be

[PHP] Re: Charsets ?

2006-03-08 Thread Barry
Ruben Rubio Rey wrote: Hi, I hace a functions that does a think, it cleans strange characters: $trash_string='whateverwithstrangecharacterslikeñ'; $clean_string=strtr(trim($trash_string), 'ç/-àáãèéìíòóõùúüñ()äëïö,, __c__aaaeeiiooouuun__aeio_); Its strange, but if I work with php's charset

Re: [PHP] Query : Facing Error

2006-03-08 Thread Jochem Maas
Rahul sharma wrote: I have installed php5 manually and pws also on Windows 98. I checked execute button of pws also. But the problem is, when i execute any php programe my browser show me following message pThis PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a

[PHP] .DAT file with PHP

2006-03-08 Thread Jabez
I want to use PHP to show the contents of the DAT from back to front. HOw do I do that? Thanks!

[PHP] Re: .DAT file with PHP

2006-03-08 Thread Barry
Jabez wrote: I want to use PHP to show the contents of the DAT from back to front. HOw do I do that? Thanks! Put it into an array and sort it backwards with krsort() Greets Barry -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General

RE: [PHP] .DAT file with PHP

2006-03-08 Thread jblanchard
[snip] I want to use PHP to show the contents of the DAT from back to front. HOw do I do that? [/snip] Open the file, read it into an array, read the array backwards and close the file. Start with http://www.php.net/fopen and http://www.php.net/array they are both in the manual. -- PHP

Re: [PHP] Prepared statements

2006-03-08 Thread Julius Hacker
Curt Zirzow wrote: On Mon, Mar 06, 2006 at 10:03:10PM +0100, Julius Hacker wrote: Curt Zirzow wrote: I assume your loop is something like: while(condition) { $auction_parts['id'] = 'some value'; $auction_parts['name'] = 'some value'; ...

[PHP] Re: .DAT file with PHP

2006-03-08 Thread M. Sokolewicz
Barry wrote: Jabez wrote: I want to use PHP to show the contents of the DAT from back to front. HOw do I do that? Thanks! Put it into an array and sort it backwards with krsort() Greets Barry why use such an cpu-intensive function? using array_reverse is a lot faster... -

[PHP] Re: .DAT file with PHP

2006-03-08 Thread Barry
M. Sokolewicz wrote: Barry wrote: Jabez wrote: I want to use PHP to show the contents of the DAT from back to front. HOw do I do that? Thanks! Put it into an array and sort it backwards with krsort() Greets Barry why use such an cpu-intensive function? using array_reverse is

RE: [PHP] .DAT file with PHP

2006-03-08 Thread Jabez Gan
Sorry im new but, how do we read from a file to an array? I've studied C but not with PHP and it's not working for me... Suggestions? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 08, 2006 9:58 PM To: [EMAIL PROTECTED];

Re: [PHP] .DAT file with PHP

2006-03-08 Thread Barry
Jabez Gan wrote: Sorry im new but, how do we read from a file to an array? I've studied C but not with PHP and it's not working for me... Suggestions? By line ? -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] .DAT file with PHP

2006-03-08 Thread M. Sokolewicz
Jabez Gan wrote: Sorry im new but, how do we read from a file to an array? I've studied C but not with PHP and it's not working for me... Suggestions? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 08, 2006 9:58 PM To: [EMAIL PROTECTED];

RE: [PHP] .DAT file with PHP

2006-03-08 Thread jblanchard
[snip] Sorry im new but, how do we read from a file to an array? I've studied C but not with PHP and it's not working for me... Suggestions? [/snip] First, read and understand, as much as possible, TFM. It should go something like this $foo = fopen(my.dat, r); while(!feof($foo)){ $bar =

[PHP] Calling Curt Z, Curt Z to the white courtesy phone please

2006-03-08 Thread jblanchard
Sorry for the post listites, I have lost Curt Z's info and need him to contact me. More to the point, can you post the Newbie Guide that you revamped so well? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] .DAT file with PHP

2006-03-08 Thread Paul Novitski
At 07:41 AM 3/8/2006, Jabez Gan wrote: Sorry im new but, how do we read from a file to an array? I've studied C but not with PHP and it's not working for me... Suggestions? file() Reads entire file into an array http://php.net/file Doesn't require open close. Paul -- PHP General Mailing

Re: [PHP] Re: Incremental Date Based ID

2006-03-08 Thread Kevin Murphy
Thanks for the info, but I think you are misunderstanding what I am trying to do. I am simply trying to create a sequential ID based on a Date and a Letter (or number, if I have to) field that will be used as part of the link. After they are created, they will not change. And Its not about

[PHP] preg_replace problem (or possibly bug)

2006-03-08 Thread Michael
I am currently writing a forum system, but at the moment I have a bug that no one can seem to get to the root cause of. Basically I am using preg_replace with the pattern as '\[url=(.*?)\](.*?)\[/url\]'is. However for most links it works fine but for others it just doesn't render the bbcode to a

Re: [PHP] preg_replace problem (or possibly bug)

2006-03-08 Thread Anthony Ettinger
On 3/8/06, Michael [EMAIL PROTECTED] wrote: I am currently writing a forum system, but at the moment I have a bug that no one can seem to get to the root cause of. Basically I am using preg_replace with the pattern as '\[url=(.*?)\](.*?)\[/url\]'is. However for most links it works fine but for

[PHP] Re: preg_replace problem (or possibly bug)

2006-03-08 Thread Rafael
What I see in the page you sent is a [url] bbcode-tag that is not closed (i.e. it has no [/url] or it's not displayed) If that's not the problem, could you send some example that isn't working (and some others that are working) Michael wrote: I am currently writing a forum system, but at

Re: [PHP] .DAT file with PHP

2006-03-08 Thread Rory Browne
$filename = filename.txt; $file_content = join(\n, array_reverse(file($filename))); echo $file_content; Questions? BTW I haven't tested this, so it may be completely wrong. On 3/8/06, Paul Novitski [EMAIL PROTECTED] wrote: At 07:41 AM 3/8/2006, Jabez Gan wrote: Sorry im new but, how do

[PHP] php tests failures on windows

2006-03-08 Thread Manish Marathe
Hello, Some of the tests, mostly bugs, are failing on cygwin environment on Windows Server 2003. The http://bugs.php.net site says those bugs have been fixed, although I am still getting the failure. Here are those bugs : http://bugs.php.net/bug.php?id=27780 http://bugs.php.net/bug.php?id=32555

[PHP] Zoomable map

2006-03-08 Thread jblanchard
I have been searching for this, but maybe one of you has seen it before and can save me some time. I need a class that will allow me to create a zoomable map application. I have a map, I just need folks to be able to zoom and scroll,etc. TIA! -- PHP General Mailing List (http://www.php.net/) To

RE: [PHP] .DAT file with PHP

2006-03-08 Thread Jabez Gan
I use: $frob = fopen('data/rob.dat','r'); if ($frob) { while (!feof($frob)) { $buffer = fgets($frob, 4096); echo $buffer; $glorp[] = $buffer; // places line in array } } $read = array_reverse($glorp); However, only Array

Re: [PHP] Zoomable map

2006-03-08 Thread John Nichel
[EMAIL PROTECTED] wrote: I have been searching for this, but maybe one of you has seen it before and can save me some time. I need a class that will allow me to create a zoomable map application. I have a map, I just need folks to be able to zoom and scroll,etc. TIA! Got something against the

Re: [PHP] .DAT file with PHP

2006-03-08 Thread Paul Novitski
At 10:27 AM 3/8/2006, Rory Browne wrote: $filename = filename.txt; $file_content = join(\n, array_reverse(file($filename))); echo $file_content; Rory, I think you've got the logic right. Tangentially, however, I recommend that you break it out into separate statements and not throw

Re: [PHP] Re: Incremental Date Based ID

2006-03-08 Thread Kevin Murphy
I think I have it all figured out now, so as promised, here is the code. Thanks everyone for your suggestions. $id_query = select id from table WHERE id LIKE '$post_date%' ORDER BY id DESC LIMIT 1 ; $id_results = mysql_query($id_query,$conn); $id_row = mysql_fetch_array($id_results);

Re: [PHP] Calling Curt Z, Curt Z to the white courtesy phone please

2006-03-08 Thread Curt Zirzow
I'm including the list in this reply in case any wants to give some feedback. On Wed, Mar 08, 2006 at 09:52:29AM -0600, [EMAIL PROTECTED] wrote: Sorry for the post listites, I have lost Curt Z's info and need him to contact me. More to the point, can you post the Newbie Guide that you revamped

RE: [PHP] Calling Curt Z, Curt Z to the white courtesy phone please

2006-03-08 Thread jblanchard
[snip] You mean this? :) http://zirzow.dyndns.org/php-general/NEWBIE It might need some rewording and a few tweeks here and there. It is almost turning more into a php-general charter. For those wanting to know the original: http://zirzow.dyndns.org/php-general/NEWBIE.orig [/snip] Yes, that

Re: [PHP] Zoomable map

2006-03-08 Thread Philip Hallstrom
I have been searching for this, but maybe one of you has seen it before and can save me some time. I need a class that will allow me to create a zoomable map application. I have a map, I just need folks to be able to zoom and scroll,etc. TIA! http://script.aculo.us/ might have what you need...

RE: [PHP] Zoomable map

2006-03-08 Thread jblanchard
[snip] I have been searching for this, but maybe one of you has seen it before and can save me some time. I need a class that will allow me to create a zoomable map application. I have a map, I just need folks to be able to zoom and scroll,etc. TIA! http://script.aculo.us/ might have what

Re: [PHP] Zoomable map

2006-03-08 Thread Paul Scott
On Wed, 2006-03-08 at 13:12 -0600, Philip Hallstrom wrote: I have been searching for this, but maybe one of you has seen it before and can save me some time. I need a class that will allow me to create a zoomable map application. I have a map, I just need folks to be able to zoom and

Re: [PHP] Calling Curt Z, Curt Z to the white courtesy phone please

2006-03-08 Thread Rafael
Also (not sure if all are missing or not): a) when looking for a specific function in PHP.net you can also use other word-separators and not only _, such as: -, + and space (or %20), haven't heavy-tested this, so may as well be others b) if possible, look for a mirror prepending you

RE: [PHP] Zoomable map

2006-03-08 Thread Philip Hallstrom
[snip] I have been searching for this, but maybe one of you has seen it before and can save me some time. I need a class that will allow me to create a zoomable map application. I have a map, I just need folks to be able to zoom and scroll,etc. TIA! http://script.aculo.us/ might have

RE: [PHP] Zoomable map

2006-03-08 Thread jblanchard
[snip] http://script.aculo.us/ might have what you need... [/snip] No zoomable maps here, a bunch of Ajax and Javascript stuff though. Right. If you have a map, this will give you tools to zoom and scroll... [/snip] Really, I did not see those tools. I must not have looked closely enough.

Re: [PHP] Zoomable map

2006-03-08 Thread Mike Smith
I bought the Beta PDF of Pragmatic Ajax (http://www.pragmaticprogrammer.com/titles/ajax/?ajaxian). It actually has a chapter that walks you through creating a zooming movable map (ala Google Maps). Nice intro to Ajax too (and Frameworks). If you don't find a tutorial online somewhere I'd recommend

Re: [PHP] Re: Converting HTML to BBCode

2006-03-08 Thread Curt Zirzow
I dont know where this thread came from but... On Mon, Mar 06, 2006 at 12:33:32PM -0700, J_K9 wrote: ... ---CODE--- ?php $text = $_REQUEST['text']; echo 'br /br /'; $translate_array = array( ... 'a href=' = '[url=', '/a' = '[/url]', ... ); $find_array=

[PHP] Make all emails links

2006-03-08 Thread Benjamin Adams
I'm pulling data from a database; When the data is pulled emails look like [EMAIL PROTECTED] Is there a way to just make all email address in the text that it pulls so, bla bla bla okjsokdf [EMAIL PROTECTED] ksnow noduowe... Make the email in the text be a mailto link automatically? Thanks

[PHP] Re: Make all emails links

2006-03-08 Thread El Bekko
Benjamin Adams wrote: I'm pulling data from a database; When the data is pulled emails look like [EMAIL PROTECTED] Is there a way to just make all email address in the text that it pulls so, bla bla bla okjsokdf [EMAIL PROTECTED] ksnow noduowe... Make the email in the text be a mailto link

Re: [PHP] LDAP and Single Sign On

2006-03-08 Thread Rory Browne
Kerberos - there is an apache module for it. On 3/7/06, Justin Cook [EMAIL PROTECTED] wrote: We are developing an intranet for my company. I would like to implement a single sign on service. We have Active Directory on one server and the intranet is being housed on a Redhat Linux server. When

[PHP] ebay/nusoap example?

2006-03-08 Thread jon
Howdy... I don't suppose that any of you would happen to have an example of how to use the ebay API with nusoap? I've done plenty o' projects with nusoap, but working with the ebay api has me stumped. I don't really even know how to get started, coding-wise. (I've setup all the developer

Re: [PHP] .DAT file with PHP

2006-03-08 Thread Rory Browne
On 3/8/06, Paul Novitski [EMAIL PROTECTED] wrote: At 10:27 AM 3/8/2006, Rory Browne wrote: $filename = filename.txt; $file_content = join(\n, array_reverse(file($filename))); echo $file_content; Rory, I think you've got the logic right. Tangentially, however, I recommend that you break

Re: [PHP] .DAT file with PHP

2006-03-08 Thread Rory Browne
last mail got accidently sent before completion - please reply to that, or the OP and not this. I don't have much of a problem with code that takes a less blatent inspiration of the following: $file = filename.txt; $file = file_get_contents($file); $file = explode(\n, $file); $file =

Re: [PHP] php tests failures on windows

2006-03-08 Thread Chris
Manish Marathe wrote: Hello, Some of the tests, mostly bugs, are failing on cygwin environment on Windows Server 2003. The http://bugs.php.net site says those bugs have been fixed, although I am still getting the failure. Here are those bugs : http://bugs.php.net/bug.php?id=27780

Re: [PHP] test security of code

2006-03-08 Thread Chris
Gregory Machin wrote: Hi Is there an application that can pass source code and report potential security problem and or the live site ? Many thanks -- Gregory Machin [EMAIL PROTECTED] [EMAIL PROTECTED] www.linuxpro.co.za www.exponent.co.za Web Hosting Solutions Scalable Linux Solutions

Re: [PHP] php tests failures on windows

2006-03-08 Thread Manish Marathe
On 3/8/06, Manish Marathe [EMAIL PROTECTED] wrote: On 3/8/06, Chris [EMAIL PROTECTED] wrote: Manish Marathe wrote: Hello, Some of the tests, mostly bugs, are failing on cygwin environment on Windows Server 2003. The http://bugs.php.net site says those bugs have been fixed,

RE: [PHP] .DAT file with PHP

2006-03-08 Thread Jabez
I used the following code that Paul suggested, but it didn't reverse my content. The file I would want to have the content reversed is as attached. Chinese characters is in the file so... Suggestions? -Original Message- From: Paul Novitski [mailto:[EMAIL PROTECTED] Sent: Thursday,

RE: [PHP] .DAT file with PHP

2006-03-08 Thread Paul Novitski
At 07:05 PM 3/8/2006, Jabez wrote: I used the following code that Paul suggested, but it didn't reverse my content. The file I would want to have the content reversed is as attached. Chinese characters is in the file so... Suggestions? Jabez, The data in your file is all in one text line.

[PHP] Random permission strangeness

2006-03-08 Thread Paul Scott
I am pretty much randomly getting the following error: .. ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13) in ... As far as I can see the session write directory has no problems with permissions. The *really* strange thing is that it only fails at certain times,

Re: [PHP] Random permission strangeness

2006-03-08 Thread Chris
Paul Scott wrote: I am pretty much randomly getting the following error: .. ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13) in ... As far as I can see the session write directory has no problems with permissions. The *really* strange thing is that it only fails

[PHP] Re: Make all emails links

2006-03-08 Thread Rafael
I agree, your regexp are bad (jk) What you need is a regexp that matches an email address. Look for something like regexp email on Google (without the quotes) or something similar and you should find some regexp to validate an email address; once you have it use it with preg_replace() like

Re: [PHP] Random permission strangeness

2006-03-08 Thread Paul Scott
On Thu, 2006-03-09 at 16:05 +1100, Chris wrote: What's the whole error message (ie context)? Is it coming from cron or randomly in your scripts? From Xdebug... Its random. I am just thinking though that what it *might* be is that the initial session is timing out between the app launch and

Re: [PHP] test security of code

2006-03-08 Thread Gregory Machin
Thanks looks good will read on further . On 3/9/06, Chris [EMAIL PROTECTED] wrote: Gregory Machin wrote: Hi Is there an application that can pass source code and report potential security problem and or the live site ? Many thanks -- Gregory Machin [EMAIL PROTECTED] [EMAIL

Re: [PHP] test security of code

2006-03-08 Thread Björn Bartels
Hello there... i think you can lessen this effort by improving your qualitymanagement during the planing and development phase of your projects (means making a lot of UML diagrams and so on...). You may try to let the application handle its missbehavours by itself. If you don't want anyone to