RE: [PHP] PHP slowness

2005-03-01 Thread Gerard
On Thu, 24 Feb 2005 10:54:02 +0100, Gerard [EMAIL PROTECTED] wrote: Nevertheless, it IS slow and I have no idea why or where to start looking. The phpinfo() can be found on www.debuginc.com/info.php. Any help or hints are highly appreciated. It looks like you are using Debian

RE: [PHP] PHP slowness

2005-02-26 Thread Gerard
and then it suddenly loads. This is not the case with .htm and .html files, they load at once... Somewhere there must be something which slows the execution of .php files for (exactly) 5 seconds. I just don't know what to think of this anymore :S - Gerard Gerard wrote: Hello people, Recently

RE: [PHP] PHP slowness

2005-02-26 Thread Gerard
Gerard wrote: Another interesting note; if you click from page to page fast enough, it doesn't take as long to load. For some reason, after the initial 5 second startup hic, it loads consequent pages smoothly. If you wait for 10 seconds and then click a link, it loads for 5 seconds

RE: [PHP] PHP slowness

2005-02-26 Thread Gerard
--snip-- I'm no expert on this stuff, but I'd be checking my swap space usage and RAM usage with 'top' or any other tools available... I suppose you probably already did that, but... Top shows that there's still normal non-swap memory available, so I don't think that's it. - Gerard -- PHP

RE: [PHP] PHP slowness

2005-02-25 Thread Gerard
don't get this, especially since it seems to affect both PHP4 and PHP5... - Gerard On Feb 24, 2005, at 4:54 AM, Gerard wrote: Hello people, Recently, one of my webservers became rather slow. At first we thought it was the MySQL backend, but when logged in on MySQL using the command

[PHP] PHP slowness

2005-02-24 Thread Gerard
started a couple of days ago without any changes in the config or anything. At first I upped the amount of connections Apache would accept, but it soon turned out that was not the problem. Thanks, - Gerard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

[PHP] Hashing strings

2005-02-17 Thread Gerard Samuel
Im currently using md5() to hash strings to be used, as an id for a cache system. Im trying to determine if md5() would be the fastest, *cheapest* solution. The only native php functions that I know of are md5() and sha1(). Are there any other native php functions that hash strings? Thanks -- PHP

Re: [PHP] Hashing strings

2005-02-17 Thread Gerard Samuel
Richard Lynch wrote: Gerard Samuel wrote: Im currently using md5() to hash strings to be used, as an id for a cache system. Im trying to determine if md5() would be the fastest, *cheapest* solution. The only native php functions that I know of are md5() and sha1(). Are there any other native

Re: [PHP] Hashing strings

2005-02-17 Thread Gerard Samuel
Jason Barnett wrote: Gerard Samuel wrote: ... Im trying to determine if md5() would be the fastest, *cheapest* solution. ... What Im looking for is something where the generated hashes can be reproduced. For example, md5('foo') today, will be equal to md5('foo') tomorrow. Thanks

[PHP] Determine SERVER_NAME

2005-02-13 Thread Gerard Samuel
Via cli that is. Is there anyway besides making an actual system call (i.e. exec()/system()/etc...) to determine the server's name via php's cli??? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: AW: [PHP] Determine SERVER_NAME

2005-02-13 Thread Gerard Samuel
Mirco Blitz wrote: Probably the Global Variable $SERVER_NAME helps you out. The global variable $SERVER_NAME is not available via cli (at least for me) -Ursprüngliche Nachricht- Von: Gerard Samuel [mailto:[EMAIL PROTECTED] Gesendet: Sonntag, 13. Februar 2005 19:33 An: php-general

Re: AW: [PHP] Determine SERVER_NAME

2005-02-13 Thread Gerard Samuel
Bostjan Skufca @ domenca.com wrote: php_uname() That works - $ php -r var_dump(php_uname('n')); string(20) gladiator.trini0.org Thanks On Sunday 13 February 2005 20:37, Gerard Samuel wrote: Mirco Blitz wrote: Probably the Global Variable $SERVER_NAME helps you out. The global

[PHP] php in free() error

2005-02-10 Thread Gerard Samuel
Im playing around with iterators, and Im getting this error - php in free(): warning: chunk is already free Im running php 5.0.3 on FreeBSD 5.3. Any ideas what may be wrong? Thanks ?php $array = array(0 = array('world')); class RecursiveArrayIterator extends ArrayIterator implements

Re: [PHP] Re: php in free() error

2005-02-10 Thread Gerard Samuel
Jason Barnett wrote: Gerard Samuel wrote: ... ?php $array = array(0 = array('world')); class RecursiveArrayIterator extends ArrayIterator implements RecursiveIterator { function hasChildren() { return (is_array($this-current())); } function getChildren() { return new

[PHP] PHP5 Exception Handling

2005-02-04 Thread Gerard Samuel
Just bouncing a thought on you. I currently have a default exception handler setup. So far in the code, I throw an exception when something is wrong. i.e. Missing file, invalid argument, failed db connection etc... My thought was centering around if I still needed to use try/catch in the code,

Re: [PHP] PHP5 Exception Handling

2005-02-04 Thread Gerard Samuel
Jochem Maas wrote: Gerard Samuel wrote: Just bouncing a thought on you. I currently have a default exception handler setup. So far in the code, I throw an exception when something is wrong. i.e. Missing file, invalid argument, failed db connection etc... My thought was centering around if I still

Re: [PHP] Re: debug_backtrace trick

2005-01-28 Thread Gerard Samuel
David Robley wrote: On Friday 28 January 2005 17:09, Gerard Samuel wrote: There used to be a link in the manual user notes, I believe under debug_backtrace(). Where, there was some javascript voodoo, that would hide/unhide the backtrace. Does anyone have a link to this site? Thanks Maybe

[PHP] debug_backtrace trick

2005-01-27 Thread Gerard Samuel
There used to be a link in the manual user notes, I believe under debug_backtrace(). Where, there was some javascript voodoo, that would hide/unhide the backtrace. Does anyone have a link to this site? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] round

2005-01-26 Thread Gerard Petersen
You can use the number_format($number, decimal_places) function. -Original Message- From: blackwater dev [mailto:[EMAIL PROTECTED] Sent: 26 January 2005 01:33 PM To: php-general@lists.php.net Subject: [PHP] round Hello, I have these values: 8.26456 9.7654 3. 5.2689 and I want

[PHP] Eval string to array

2005-01-24 Thread Gerard Samuel
Im trying to evaluate a string representation of the output of var_export(), as an array. To make a long story short, Im using curl to fetch another php page, that uses var_export to echo out php data structures. The fetched data via curl, is a string. Something like - array ( 'foo' = 'bar', )

Re: [PHP] Eval string to array

2005-01-24 Thread Gerard Samuel
Jochem Maas wrote: Gerard Samuel wrote: Im trying to evaluate a string representation of the output of var_export(), as an array. To make a long story short, Im using curl to fetch another php page, that uses var_export to echo out php data structures. The fetched data via curl, is a string

Re: [PHP] Re: SPL Exceptions

2005-01-20 Thread Gerard Samuel
M. Sokolewicz wrote: Gerard Samuel wrote: Does anyone know when the exception objects listed in item #6 at http://www.php.net/~helly/php/ext/spl/ will be available in base php5?? Thanks when you install the SPL extension :) I don't think it's planned for php5-source though [UPDATE 1-20-2005] Im

Re: [PHP] Re: SPL Exceptions

2005-01-19 Thread Gerard Samuel
M. Sokolewicz wrote: Gerard Samuel wrote: Does anyone know when the exception objects listed in item #6 at http://www.php.net/~helly/php/ext/spl/ will be available in base php5?? Thanks when you install the SPL extension :) I don't think it's planned for php5-source though Correct me if Im wrong

[PHP] Recursive Array Iterator

2005-01-18 Thread Gerard Samuel
Im trying to figure out how to create this. But Im stuck in the foreach loop. For some reason, $value in the foreach loop is not an object (Isn't is supposed to be?) Any hints to get me in the right direction. Thanks $array = array(1 = array(2 = array(3 = array(4; class

Re: [PHP] Recursive Array Iterator

2005-01-18 Thread Gerard Samuel
Gerard Samuel wrote: Im trying to figure out how to create this. But Im stuck in the foreach loop. For some reason, $value in the foreach loop is not an object (Isn't is supposed to be?) Any hints to get me in the right direction. Thanks $array = array(1 = array(2 = array(3 = array(4; class

[PHP] SPL Exceptions

2005-01-18 Thread Gerard Samuel
Does anyone know when the exception objects listed in item #6 at http://www.php.net/~helly/php/ext/spl/ will be available in base php5?? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: PHP5 silently throwing exceptions???

2005-01-17 Thread Gerard Samuel
Jason Barnett wrote: Gerard Samuel wrote: Im currently using php 5.0.3 on a dev box, trying to figure out how to correctly use exceptions in my code. Exceptions can be A Good Thing. Per chance, I was monitoring the __autoload() function, and Im noticing that calls are being made to exception

Re: [PHP] Re: PHP5 silently throwing exceptions???

2005-01-17 Thread Gerard Samuel
Jason Barnett wrote: Gerard Samuel wrote: Jason Barnett wrote: Gerard Samuel wrote: I've debugged it down to this - //try //{ $db-connect(); //} //catch(databaseException $e) //{ //throw $e; //} The ::connect() method is supposed to throw a databaseException if a connection cannot be made

Re: [PHP] Re: PHP5 silently throwing exceptions???

2005-01-17 Thread Gerard Samuel
Jochem Maas wrote: Jason Barnett wrote: Gerard Samuel wrote: ... I haven't checked the source on this one so I can't guarantee that what I've said above is true, but I believe it to be true. Someone correct me if I'm wrong (wouldn't be the first time ;) seems to me like you 'on the money'. I

[PHP] PHP5 silently throwing exceptions???

2005-01-15 Thread Gerard Samuel
Im currently using php 5.0.3 on a dev box, trying to figure out how to correctly use exceptions in my code. Per chance, I was monitoring the __autoload() function, and Im noticing that calls are being made to exception classes that I've setup. But nothing is being actually thrown. As I understand

[PHP] dba_open(), NFS file locking test please

2005-01-11 Thread Gerard Samuel
If you have php installed with the dba extension, and have access to NFS, could you try out the code below, to see if it works for you. Doesn't matter what OS you're using (as long as the OS professes its capable of locking over NFS). Im currently using FreeBSD 5.3 (server client), with NFS the

Re: [PHP] dba_open(), NFS file locking test please

2005-01-11 Thread Gerard Samuel
Gerard Samuel wrote: If you have php installed with the dba extension, and have access to NFS, could you try out the code below, to see if it works for you. Doesn't matter what OS you're using (as long as the OS professes its capable of locking over NFS). Im currently using FreeBSD 5.3 (server

Re: [PHP] Understanding flock()

2004-12-31 Thread Gerard Samuel
Marek Kilimajer wrote: Gerard Samuel wrote: Im trying to simulate conditions, to see how flock works. Can anyone verify with the example code below, that data, never gets written to the file. //1 //2 are supposed to be processes??? For me, the var_dump() reports - int(7) bool(false) Thanks $fp

[PHP] Understanding flock()

2004-12-30 Thread Gerard Samuel
Im trying to simulate conditions, to see how flock works. Can anyone verify with the example code below, that data, never gets written to the file. //1 //2 are supposed to be processes??? For me, the var_dump() reports - int(7) bool(false) Thanks $fp = fopen('foo.txt', 'w'); //1 flock($fp,

Re: [PHP] Re: Interfaces and Access Levels

2004-12-29 Thread Gerard Samuel
Jason Barnett wrote: Gerard Samuel wrote: I would like bar::do_something_internal() to have an access level of *private* But this would fail, as the interface can only have *public* methods. Is there a way to get bar::do_something_internal() to be private? Or am I SOL, and it has be public

[PHP] PHP5 and File Locking

2004-12-28 Thread Gerard Samuel
I started to put together a few classes that reads/writes files, using the fopen() function, injunction with flock() to lock files while reading/writing. And I also was wrapping fopen()/flock() around copy()/unlink()/rename() with the thinking that they needed file locking *features* while

[PHP] Interfaces and Access Levels

2004-12-26 Thread Gerard Samuel
I would like bar::do_something_internal() to have an access level of *private* But this would fail, as the interface can only have *public* methods. Is there a way to get bar::do_something_internal() to be private? Or am I SOL, and it has be public? Thanks interface foo { function

[PHP] [Repost] Recursive Directory Iterator

2004-12-20 Thread Gerard Samuel
This is my first time trying out the SPL iterators. Im trying to figure out how to recursively move over a directory. With the code that I've provided 1. Is this the correct way to use it? Im using recursive functions to go deep. I thought, that the class would do that for me somehow... 2.

Re: [PHP] first letter

2004-12-20 Thread Gerard Samuel
Ahmed Abdel-Aliem wrote: hi if i have for example this variable $name = John; how can i echo the first letter only so the result on the browser will be J can anyone help ? echo $name{0}; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Recursive Directory Iterator

2004-12-18 Thread Gerard Samuel
This is my first time trying out the SPL iterators. Im trying to figure out how to recursively move over a directory. With the code that I've provided 1. Is this the correct way to use it? Im using recursive functions to go deep. I thought, that the class would do that for me somehow... 2.

Re: [PHP] File Locking during *other* file operations

2004-12-17 Thread Gerard Samuel
Michael Sims wrote: Yes, have your scripts attempt to lock a separate lock file before performing deleting or moving operations. Jason Barnett wrote: Sure... just acquire the exclusive lock like you would for writing to a file, but do the delete / move instead. Your apps must actually try to

[PHP] File Locking during *other* file operations

2004-12-16 Thread Gerard Samuel
Im talking about file locking during deleting, and moving files. Is it possible to perform file locking for these file operations? If so, can you provide psuedo code. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: File locking file_[get|put]_contents

2004-12-15 Thread Gerard Samuel
Jason Barnett wrote: Gerard Samuel wrote: I was wondering. Does file_get_contents() or file_put_contents() utilise any kind of file locking? Thanks Not that I am aware of (I haven't checked source on this so someone correct me if I'm wrong here). file_get_contents() is a shortcut for using

[PHP] File locking file_[get|put]_contents

2004-12-14 Thread Gerard Samuel
I was wondering. Does file_get_contents() or file_put_contents() utilise any kind of file locking? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] mssql_fetch_array() vs. mssql_fetch_assoc

2004-11-11 Thread Gerard Samuel
Alex Hogan wrote: In terms of performance which is faster. mssql_fetch_array($var,mssql_assoc) or mssql_fetch_assoc()? I read in the manual that mssql_fetch_array() isn't noticably slower than mssql_fetch_row(), but I didn't see anything about mssql_fetch_assoc() in terms of performance. I was

[PHP] PHP5 syntax question

2004-11-04 Thread Gerard Samuel
I dont see it in the documentation, but I've seen samples of code using something to the effect of - $foo-method1()-method2() Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] include()ing into a variable

2004-10-14 Thread Gerard Samuel
Mag wrote: Hi, I have never done this before (but in my first test it seems to work), I am include()ing a file into a variable like this: $a=include(th-file.php); Will this give me any extra problems later on? or is this resource intensive? I've seen other people do something similar to this, but

[PHP] PHP5 Type Hints

2004-10-02 Thread Gerard Samuel
Im unable to find documentation on this. Does one exist? If so can you point me to it. Thanks... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP5 Type Hints

2004-10-02 Thread Gerard Samuel
Curt Zirzow wrote: * Thus wrote Gerard Samuel: Im unable to find documentation on this. Does one exist? If so can you point me to it. I dont think anything officially exist in the manual, yet. The type hint can only be an Object, and will cause a fatal error if not the paticular object isn't

Re: [PHP] PHP5 Type Hints

2004-10-02 Thread Gerard Samuel
Aidan Lister wrote: Hi Gerald, If you did see something like that, it was a mistake in our manual :) I've documented typehinting now, though it will take a while to show up in the manual. http://php.net/language.oop5.typehinting It may have been Example 18-23 at

[PHP] Does PHP need another mailing list???

2004-09-22 Thread Gerard Samuel
Just wondering. With the advent of php5 with its OO capabilities, is php-general too *general* for advanced php5 users? For me, I've learned quite a lot from listening to others, and participating in threads on php-general php-db. Currently, Im investigating OO theory, and how I can translate it

Re: [PHP] Does PHP need another mailing list???

2004-09-22 Thread Gerard Samuel
raditha dissanayake wrote: Gerard Samuel wrote: Just wondering. With the advent of php5 with its OO capabilities, is php-general too *general* for advanced php5 users? This topic has been discussed at least once a month. Please refer to list archives. I wasn't aware of this. So I searched MARC

Re: [PHP] Re: Does PHP need another mailing list???

2004-09-22 Thread Gerard Samuel
further, as my original post was meant as an inquiry and not as an arguement. Thanks for replying... Gerard Samuel wrote: Just wondering. With the advent of php5 with its OO capabilities, is php-general too *general* for advanced php5 users? For me, I've learned quite a lot from listening to others

Re: [PHP] Re: Does PHP need another mailing list???

2004-09-22 Thread Gerard Samuel
Marek Kilimajer wrote: Gerard Samuel wrote: Niklas Lampén wrote: It's wrong to think people here don't know how to code object oriented. You can do that with PHP4 too - and you should in many cases. In some time PHP4 will be old school and PHP5 will be the general one. In my oppinion, it's good

[PHP] Recursion help?

2004-09-19 Thread Gerard Samuel
Im trying to dynamically construct a multidimensional array to be used with PEAR's HTML_Menu. http://pear.php.net/manual/en/package.html.html-menu.intro.php. Basically, Im pulling the data from a DB table, and trying to attempt to convert the original array to what is needed for HTML_Menu. If you

Re: [PHP] Recursion help?

2004-09-19 Thread Gerard Samuel
) { if ($value['pid'] === $id) { $data[$key] = $GLOBALS['array'][$key]; } } return $data; } ? Gerard Samuel wrote: Im trying to dynamically construct a multidimensional array to be used with PEAR's HTML_Menu. http://pear.php.net/manual/en/package.html.html-menu.intro.php

[PHP] References Explained... (This time Im stumped)

2004-09-19 Thread Gerard Samuel
I could have sworn that references and I used to get along... In the menu::hasChild method, I cant seem to reference $this-_data. $this-_data is supposed to be a reference to the original array $array in the local scope. The only way to make this script work is to call on the $GLOBALS array in

Re: [PHP] References Explained... (This time Im stumped)

2004-09-19 Thread Gerard Samuel
Gerard Samuel wrote: I could have sworn that references and I used to get along... In the menu::hasChild method, I cant seem to reference $this-_data. $this-_data is supposed to be a reference to the original array $array in the local scope. The only way to make this script work is to call

Re: [PHP] php - no results - display other message

2004-09-14 Thread Gerard Samuel
Dustin Krysak wrote: Hi there... I have a simple search page (mysql database), and I can get it to display the results no issues, but i was wondering how I could display a message stating there were no results, instead of just having the field blank. I am familiar with IF and ELSE statements,

[PHP] Class Instance Inheritance

2004-09-13 Thread Gerard Samuel
Is it possible for a class to extend the state of its parent class? In the example provided, I was hoping for the statement to say - I wish 10 equals to 10 If there is a solution, I would like it to work with php 4+ Thanks - class foo { var $foo = 0; } $foo = new foo; $foo-foo = 10; class

Re: [PHP] Assigning one var to multiple vars

2004-09-09 Thread Gerard Samuel
Matthew Sims wrote: Just mostly curious but is there a way to assign one variable to multiple variables in one single line? Rather than do this: $var2 = $var1; $var3 = $var1; Is there a method to perform a: ($var2,$var3) = $var1; $var1 = $var2 = $var3 = 'some_value'; -- PHP General Mailing List

Re: [PHP] Is a PECL a black whole?

2004-09-03 Thread Gerard Samuel
Frédéric Hardy wrote: What is PECL ? PECL is a repository for PHP Extensions, providing a directory of all known extensions and hosting facilities for downloading and development of PHP extensions. The packaging and distribution system used by PECL is shared with its sister, PEAR. ... Is it

[PHP] Bitwise operations criticism needed

2004-08-31 Thread Gerard Samuel
The situation. Im currently using a home brewed groups permission code in my site, but for limited users/groups its ok. Beyond that, the code will take the fast road to hell. I started to look in depth at bitwise operations today, and after much googling, and looking at other code, came up with

Re: [PHP] Bitwise operations criticism needed

2004-08-31 Thread Gerard Samuel
Marek Kilimajer wrote: Gerard Samuel wrote: The situation. Im currently using a home brewed groups permission code in my site, but for limited users/groups its ok. Beyond that, the code will take the fast road to hell. I started to look in depth at bitwise operations today, and after much

Re: [PHP] Bitwise operations criticism needed

2004-08-31 Thread Gerard Samuel
Marek Kilimajer wrote: Your checks are something like if($user['tom'] $perm['read']) echo 'Tom can read'; Only the 3rd bit is checked, all others are ignored and won't do any harm. Anyway, the clean way of setting permissions is: $user['tom'] = $perm['execute'] | $perm['write'] | $perm['read'];

Re: [PHP] 5.0.1 broke mbstring regex?

2004-08-29 Thread Gerard Samuel
/20040412/mbstring.so' - /usr/local/lib/php/20040412/mbstring.so: Undefined symbol quot;zif_mb_regex_encodingquot; in Unknown on line 0 Anyone heard of this problem or suggest a solution? Gerard Samuel [EMAIL PROTECTED] wrote: Dont cross post your messages to other lists Most likely a FreeBSD

[PHP] Output Compression issue (a bit long/rantish, but looking for ideas to fix)

2004-08-23 Thread Gerard Samuel
Ok, I know what it does, but Im currently trying to track some oddity down. My script works fine when output compression is turn off (its off in php.ini, and ob_start('gz_handler') is not being used. If I turn on compression via ob_start('gz_handler'), I get sporadic problems with page loading.

Re: [PHP] After upgrading PHP, Session Values not stored properly

2004-08-23 Thread Gerard Samuel
Sheni R. Meledath wrote: session.use_trans_sid On On Im currently running FBSC 4.10/php 4.3.6, and the only difference with our session setup is session.use_trans_sid. Mine is off. For sessions to get lost means that either a) You have cookies disabled in the browser b)

[PHP] Submitting get form

2004-08-22 Thread Gerard Samuel
Say I have a form like - form action=./foo.php?id=20 method=get ... input type=submit... / /form If this form is submitted, the $_GET['id'] variable *is not* available. If the method is changed to post, the $_GET['id'] variable *is* available. Is this how forms are supposed to work??? Thanks --

Re: [PHP] Submitting get form

2004-08-22 Thread Gerard Samuel
Chris Shiflett wrote: Yes, when you use the GET method, the query string of the URL that your browser requests contains the form data. I think you want to have something like this in your form: input type=hidden name=id value=20 / Thanks John/Chris for the explanations... -- PHP General Mailing

Re: [PHP] Securing Forms???

2004-08-18 Thread Gerard Samuel
Chris Shiflett wrote: You might find these resources helpful: http://education.nyphp.org/phundamentals/PH_spoofed_submission.php http://shiflett.org/talks/oscon2004/php-security/36 Hope that helps. Just wanted to chime in to the list and to Chris. I've been mulling the example in the second link

Re: [PHP] Weather php SDK for weather - Historical, current and forecast

2004-08-18 Thread Gerard Samuel
Eugene Voznesensky wrote: I am looking for sources for weather information and found the site http://www.nws.noaa.gov/forecasts/xml/ Is there any way to get historical weather data via a PHP Script or any available SDK? Take a look at http://www.weather.com/services/xmloap.html Unfortunately they

Re: [PHP] Securing Forms???

2004-08-18 Thread Gerard Samuel
Peter Brodersen wrote: On Wed, 18 Aug 2004 17:59:34 -0700, in php.general [EMAIL PROTECTED] (John Holmes) wrote: $token = md5(uniqid(rand(), true)); .. is a pretty bad idea, since the output could include quotes, newlines, low-ascii-characters, thereby messing up the form. How do you figure that?

Re: [PHP] Securing Forms???

2004-08-18 Thread Gerard Samuel
Chris Shiflett wrote: This doesn't provide any benefit that I can see, but I'm ready to admit that I might be missing something. If the token is captured, the conditional statement can still be bypassed, because the value of $some_hidden_key isn't necessary for this at all. Anyway, I'm a bit

[PHP] Securing Forms???

2004-08-13 Thread Gerard Samuel
I've read (at least on 2 occasions) that one can secure their forms, to ensure that the form came from the site, and not via a script kiddie. Not the method where one puts a graphic of random text to copy to the form, but via a hidden field. It has to do with having a hidden field of data, that

Re: [PHP] Securing Forms???

2004-08-13 Thread Gerard Samuel
Chris Shiflett wrote: You might find these resources helpful: http://education.nyphp.org/phundamentals/PH_spoofed_submission.php http://shiflett.org/talks/oscon2004/php-security/36 Hope that helps. Thanks. These are doable.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Re: Advise on parsing XML

2004-08-07 Thread Gerard Samuel
On Saturday 07 August 2004 11:22 am, Jason Barnett wrote: I assume you are using PHP4's DOMXML functions? If that's the case then you have a bit of a problem. XML support changed between 4.0 and 5.0, we use libxml2 (which supports UTF-8), but the object model / methods changed to better

[PHP] Advise on parsing XML

2004-08-05 Thread Gerard Samuel
Im writing an xml parser. Most of the documents Im parsing, is written by someone else, so have no control over the validity of the xml file. Im running into problems with parsing a few documents where the author uses exotic characters such as é. Characters like this kill the parser. Ok. Im

Re: [PHP] Advise on parsing XML

2004-08-05 Thread Gerard Samuel
On Thursday 05 August 2004 11:33 pm, CD Baby wrote: I'm writing an xml parser. Gerard - All of that stuff has already been taken care of for you. Hundreds of hours have gone into developing GREAT xml parsers! http://www.php.net/dom and http://www.php.net/simplexml They take care

[PHP] XML Breaking Help!

2004-08-03 Thread Gerard Samuel
Im parsing a document, and its stopping prematurely. I get this error - not well-formed (invalid token) Its breaking on the word - Exposé in the document. Is the é an illegal character? Any ideas how to work around this??? Thanks for any pointers... -- PHP General Mailing List

Re: [PHP] Should I wait for PHP 5.1?

2004-08-01 Thread Gerard Samuel
On Sunday 01 August 2004 12:19 pm, Randall Perry wrote: Any major gotchas going from 4 to 5? Any problems with PostgreSQL connectivity? Will I have to scour and rewrite current scripts? My opininon would be to wait on maybe 5.0.1, especially if its on a production box. Im not having an

[PHP] Means of collecting HTTP response headers

2004-07-30 Thread Gerard Samuel
A means that is not specifically tied to Apache functions. Just looking for a way so that it works no matter the webserver. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Means of collecting HTTP response headers

2004-07-30 Thread Gerard Samuel
On Friday 30 July 2004 01:32 pm, Gerard Samuel wrote: A means that is not specifically tied to Apache functions. Just looking for a way so that it works no matter the webserver. Seems like the function stream_get_meta_data() will fill the job.. -- PHP General Mailing List (http

Re: [PHP] Emulating sprintf???

2004-07-09 Thread Gerard Samuel
On Thursday 08 July 2004 10:12 pm, Michal Migurski wrote: Much easier recommendation: use provided sprintf, but parse out any unwanted placeholders first, using preg_replace. After some thought, I think I'll follow this recommendation. With the frequency that I would have to execute this code,

[PHP] Emulating sprintf???

2004-07-08 Thread Gerard Samuel
Im trying to do something like sprintf() because I would like to have control over placeholders. The code I've posted works for the most part, but when I introduce content that has the same characters as my placeholders (%s and %i), it breaks to hell... Anyone got any ideas on how to fix, or

Re: [PHP] $_SERVER[HTTP_REFERER]

2004-07-07 Thread Gerard Samuel
On Wednesday 07 July 2004 05:43 pm, Shaun wrote: Hi, Can someone tell me why echo '$_SERVER[HTTP_REFERER] = '.$_SERVER[HTTP_REFERER].'br'; Produces $_SERVER[HTTP_REFERER] = Is this a problem with my server configuration, if so is there a SERVER variable I can use instead? It could be

Re: [PHP] session id changing all the time on some pc's

2004-07-02 Thread Gerard Samuel
On Friday 02 July 2004 12:12 pm, Zilvinas Saltys wrote: I looked at server configurations but i couldn't find anything usefull. I tried to change IE settings to accept all cookies but nothing changed. Maybe someone knows where's the problem.. I dont know of all the specifics of your

Re: [PHP] session id changing all the time on some pc's

2004-07-02 Thread Gerard Samuel
On Friday 02 July 2004 02:13 pm, Torsten Roehr wrote: Passing the session id via GET/POST may be ugly but makes you independent of the browser's cookie settings. I would have to agree... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] session id changing all the time on some pc's

2004-07-02 Thread Gerard Samuel
On Friday 02 July 2004 04:38 pm, Matthew Sims wrote: As long as the user keeps his browser pointing at your site, then they'll stay in the currect session. The moment they shut down the web browser, the session is lost. The logic doesnt compute with me. I guess I'll have to try this

Re: [PHP] ISAPI vs CGI

2004-06-23 Thread Gerard Samuel
On Wednesday 23 June 2004 05:08 am, Jason Wong wrote: On Wednesday 23 June 2004 16:42, Vincent DUPONT wrote: I have a script that need to run on ISAPI module on one server and on CGI on anther server. I would like my code to be able to react differently depending on the CGI/ISAPI mode.

[PHP] Improving my Regex?

2004-06-10 Thread Gerard Samuel
Looking for suggestions on if this bit of code can be improved.. The goal. To extract the conditions in the WHERE of an sql statement. I would appreciate any pointers you may have... Thanks ?php $hello = 'Hello'; $world = 'World'; $foo_bar = 'foo bar'; $sql = SELECT FROM TABLE WHERE id =

[PHP] Array keys referencing value from another array key???

2004-06-06 Thread Gerard Samuel
Not sure if the subject was worded correctly, but I was looking to see if this (or something like it) is possible. $array = array('key_1' = 'This is some text', 'key_2' = 'b' . $array['key_1'] . '/b' ); And the array structure would be something

Re: [PHP] How to obtain MAC address of server where PHP is running

2004-05-29 Thread Gerard Samuel
On Saturday 29 May 2004 10:21 am, Andrei Verovski (aka MacGuru) wrote: Hi, Anyone knows ho to obtain MAC address of server where PHP is running (with PHP function, of course)? Thanks in advance for any suggestion(s) I use passthru() to execute shell commands, and use preg_match() to get

Re: [PHP] PHP Coding Standards

2004-05-29 Thread Gerard Samuel
On Saturday 29 May 2004 08:55 am, charles kline wrote: Hi all, I was having a conversation with a friend and talking about coding standards in the open source community (focusing on PHP). I seem to remember there being a document out there that sort of laid it out pretty well. Anyone know

Re: [PHP] How to obtain MAC address of server where PHP is running

2004-05-29 Thread Gerard Samuel
On Saturday 29 May 2004 12:35 pm, Andrei Verovski (aka MacGuru) wrote: Hi, Gerard, Can you please be so kind to post your code snippet you have described below? ?php ob_start(); passthru('/sbin/ifconfig | grep ether'); $dump = ob_get_contents(); preg_match('/[A-F0-9]{2}:[A-F0-9]{2}:[A-F0-9

[PHP] PHP5 CGI with Apache2

2004-05-28 Thread Gerard Samuel
I installed php5 RC2 on winXP with Apache 2 on my dev box. I started with the sapi module and it worked great there. I edited apache's httpd.conf file to try out php as a CGI, (as mentioned in the install file), and I keep getting server 500 errors -- Internal Server Error The server

[PHP] Decompressing files via php

2004-05-21 Thread Gerard Samuel
Looking for libraries that are capable of decompressing files, such as those in zip or tar format. Im aware of PCL(Tar/Zip), and was wondering if there were any others out there. Just want to see whats out there before I settle on one of them. Thanks -- PHP General Mailing List

Re: [PHP] Re: Decompressing files via php

2004-05-21 Thread Gerard Samuel
On Friday 21 May 2004 04:44 pm, Justin Patrin wrote: Gerard Samuel wrote: Looking for libraries that are capable of decompressing files, such as those in zip or tar format. Im aware of PCL(Tar/Zip), and was wondering if there were any others out there. Just want to see whats out

Re: [PHP] mail() to own domain not working

2004-03-18 Thread Gerard L Petersen
gets routed to the correct host according to the mx records on the DNS :) - Original Message - From: Raditha Dissanayake [EMAIL PROTECTED] To: Gerard L Petersen [EMAIL PROTECTED] Cc: Php-General [EMAIL PROTECTED] Sent: Wednesday, March 17, 2004 6:52 PM Subject: Re: [PHP] mail() to own

[PHP] mail() to own domain not working

2004-03-17 Thread Gerard L Petersen
Hi all Im having a problem with sending mails using the mail function to my own domain. Mails to any other domain works perfectly. Also our mail server sitting on a different machine. Any ideas how to fix this?

  1   2   3   4   5   >