[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 mu

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] 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 si

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 rushed

[PHP] Submitting "get" form

2004-08-22 Thread Gerard Samuel
Say I have a form like -> ... 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

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: Thanks John/Chris for the explanations... -- PHP General Mailing List (http://www.php.net/) To unsubscri

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

2004-08-22 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-22 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) Yo

Re: [PHP] 5.0.1 broke mbstring regex?

2004-08-29 Thread Gerard Samuel
b/php/20040412/mbstring.so' - /usr/local/lib/php/20040412/mbstring.so: Undefined symbol "zif_mb_regex_encoding" 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 Mos

[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 t

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] 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 cl

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 (ht

[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; cla

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, bu

[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 l

Re: [PHP] Recursion help?

2004-09-19 Thread Gerard Samuel
'AB4wFQI2QUpzujZ8' => array ( 'id' => 'AB4wFQI2QUpzujZ8', 'pid' => 'AB4wFQI2QUewz3P7', 'name' => 'Register', 'url' => 'modules/user/register.php', ), ); function foo(&$arr

[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 me

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 c

[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

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

2004-09-22 Thread Gerard Samuel
#x27;m not going to pursue this any 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 lear

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,

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&#

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 http://us2.php.net/manual/en/lang

[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 $array = array(0 => array('world')); class RecursiveArrayIterator extends ArrayIterator implements RecursiveIterato

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

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

[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_NA

[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 G

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

[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 (http://www.php

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.

[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 e

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

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. > > Anyon

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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[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' => '' . $array['key_1'] . '' ); And the array structure would be something like

[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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.p

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

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 situat

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 mysel

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].''; > > Produces > > $_SERVER[HTTP_REFERER] = > > Is this a problem with my server configuration, if so is there a SERVER > variable I can use instead? > I

[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 tel

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 cod

php-general@lists.php.net

2004-01-28 Thread Gerard Samuel
On Wednesday 28 January 2004 09:32 am, Stuart wrote: > Diana Castillo wrote: > > is there any function that will always replace a "&" with a "&" in a > > string? > > $string = str_replace('&', ' ', $string); > Just a heads up on using the above method. If there are more than one & in the string it

php-general@lists.php.net

2004-01-28 Thread Gerard Samuel
On Wednesday 28 January 2004 10:23 am, Stuart wrote: > Not from where I'm sitting [PHP 4.3.3RC1 (cli) (built: Jun 21 2003 > 23:40:27) on FreeBSD built from ports]. Code... > Hey, as least we can agree with something. FreeBSD :) > print str_replace('&', '&', 'Here is one & and here is another

php-general@lists.php.net

2004-01-28 Thread Gerard Samuel
On Wednesday 28 January 2004 01:35 pm, John W. Holmes wrote: > Depends how you define "mess them up"... If you want to display   > literally on a web page, then you need to write   in the source. > So this may not be messing things up but rather preparing them to be shown > on a web page, lite

[PHP] Minor Heads Up

2004-02-09 Thread Gerard Samuel
Tested on winXP/Apache 2.0.48 (cgi) php 4.3.3 var_dump( __FILE__ ); gives -> C:\Program Files\Apache Group\Apache2\htdocs\index.php php 4.3.4 var_dump( __FILE__); gives -> c:\program files\apache group\apache2\htdocs\index.php php 4.3.5RC2 var_dump( __FILE__ ); gives -> C:\Program Files\Apache G

Re: [PHP] Mp3 with php?

2004-02-12 Thread Gerard Samuel
On Thursday 12 February 2004 06:52 pm, carlos castillo wrote: > does anyone know how to reproduce a mp3 file with php? > reproduce??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Constant PHP_OS and Mac Server

2004-02-13 Thread Gerard Samuel
I dont have a Mac handy to get the value of the constant PHP_OS. If anyone has access to a Mac, please reply to me with the output of var_dump( PHP_OS ); Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: PHP License question

2004-02-13 Thread Gerard Samuel
On Friday 13 February 2004 01:27 pm, Ben Ramsey wrote: > > In addition, as a special exception, Ben Ramsey gives permission to link > the code of this program with those files in the PEAR library that are > licensed under the PHP License (or with modified versions of those files > that use the sam

Re: [PHP] Re: Constant PHP_OS and Mac Server

2004-02-14 Thread Gerard Samuel
On Saturday 14 February 2004 02:34 am, - Edwin - wrote: > I don't have a Mac Server here; only a G5 with the "ordinary" Panther ;) > > The answer must be the same though... > > >var_dump(PHP_OS); >// result is -> string(6) "Darwin" > > ?> > Thanks -- PHP General Mailing List (http://www.

Re: [PHP] tmp_dir

2004-02-17 Thread Gerard Samuel
On Wednesday 18 February 2004 12:20 am, ajay wrote: > how do i set this variable? > Set it via php.ini. Usually php knows the temp directory the OS is using, so only set this if you need something other than the OS's temp directory... Windows: c:\windows\temp *nix: /tmp -- PHP General Mailing

Re: [PHP] mem

2004-02-17 Thread Gerard Samuel
On Wednesday 18 February 2004 01:25 am, John Taylor-Johnston wrote: > I'm not even sure if this is a Unix thing, or if it can be done, but ... > How can I read the amount of memory used in a directory /var/something/ > (and maybe sub-directories) and echo it? John The amount of memory or the amoun

Re: [PHP] mem

2004-02-17 Thread Gerard Samuel
On Wednesday 18 February 2004 01:38 am, John Taylor-Johnston wrote: > Both for that matter. I have root access. I want to echo how much /var/xxx > contains, and while I'm at it, how much my partition contains and how much > is used. > Im not sure about memory, but for diskspace you can look at ht

Re: [PHP] '

2004-02-18 Thread Gerard Samuel
On Wednesday 18 February 2004 11:24 am, Diana Castillo wrote: > How do I convert ' to ' before displaying it in HTML? > Thanks, > You could leave it as it is, and the browser would convert it to ' if its an HTML page... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: h

[PHP] Ideas on modifying array keys

2004-02-18 Thread Gerard Samuel
Im looking for the fastest way to modify array keys. For example, changing -> $foo['hello_world'] = 'HELLO WORLD'; to $foo['hello'] = 'HELLO WORLD'; The only way I can think of is to loop through the array, copying array values to new keys, and unsetting the old key. Thanks for any insight you m

Re: [PHP] Re: Ideas on modifying array keys

2004-02-18 Thread Gerard Samuel
On Wednesday 18 February 2004 12:03 pm, Ben Ramsey wrote: > You might be able to create some function that uses a combination of > array_keys(), array_values(), and array_combine() to do what you want. > Check the manual at http://www.php.net/array for more information on > these functions. > True

Re: [PHP] Re: Ideas on modifying array keys

2004-02-18 Thread Gerard Samuel
On Wednesday 18 February 2004 12:38 pm, Ben Ramsey wrote: > I know that it may be somewhat irrelevant to solving the problem at hand > (and, in fact, I think your current method is probably the best method), > but I was just wondering why you needed to change the names of your keys > at all. Why i

Re: [PHP] using xp home

2004-02-21 Thread Gerard Samuel
Cant say for XP home, but on XP Pro, I've run both without any problems. Just follow the instructions at the php manual... On Saturday 21 February 2004 07:11 pm, danny cobbinah wrote: > is it better to use apache 1.3.29 or apache 2.0.48? > > i am having the worst trouble ever trying to get this th

[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] 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 wond

[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

[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] 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

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

[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. A

[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. As

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] 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 do_somethin

[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 modifyin

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] 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, LOCK_

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) Tha

[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

[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 i

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

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 connectio

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 l

[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 recursiveArrayItera

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

[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: 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 i

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-2

[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

[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: http://www.php.ne

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] 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, sinc

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

<    1   2   3   4   5   >