[PHP] Re: invalid range

2002-12-02 Thread Nick Eby
looks like because you have a dash inside your character class; when inside a character class the dash is a special character and you'd have to escape it eregi("^([a-zåäö_\.\- ]+)$", $value); "Peter A" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... when I do thi

[PHP] Re: Show Folder Contents in Form

2002-12-02 Thread Nick Eby
you could first read the files and their modified-dates into an array; sort the array; and finally build a select widget from the array... function sortByTime($a, $b) { if ($a["time"] == $b["time"]) return 0; return ($a["time"] < $b["time"]) ? -1 : 1; } while (false !== ($file = readdir("

[PHP] Re: mail() question!

2002-11-25 Thread Nick Eby
you can use the (optional) headers argument to mail() and add the From header: mail ($to, $subject, $body, "From: $from"); "Beauford.2002" <[EMAIL PROTECTED]> wrote in message 000f01c294e0$6ce1fcd0$6401a8c0@p1">news:000f01c294e0$6ce1fcd0$6401a8c0@p1... > Hi, > > I have a form where a user enters

[PHP] function args declared by-reference, with default value?

2002-11-25 Thread Nick Eby
true or false: when declaring a function, a given argument can be declared to pass by reference, or can be declared to have a default value, but never both. i.e., you can only write one of: function foo(&$param) function foo($param = "bar") but never the equivalent of: function foo(&$param = "ba

[PHP] Re: Linux and Apache

2002-11-22 Thread Nick Eby
i think you have to have an Options directive set for a particular directory to turn on or off the directory listing page. the particular feature in question is called Indexes. check out this page for more info: http://httpd.apache.org/docs/mod/core.html#options for example, to disable indexes

Re: [PHP] How to unregister a single array item...

2002-11-20 Thread Nick Eby
"Nick Eby" <[EMAIL PROTECTED]> wrote : > that will work just fine. think of it this way- the array $item is > registered (and maybe unregistered) with the session, but its elements > aren't individually registered with the . just register/unregister the &g

Re: [PHP] How to unregister a single array item...

2002-11-20 Thread Nick Eby
"@ Nilaab" <[EMAIL PROTECTED]> wrote: > Hello, > How do I unregister a single array item from an array? For example: > > > session_start() > session_register("item"); > > $item['name'] = "Some Name"; > $item['img'] = "some_image_name.jpg"; > $item['desc'] = "Some Description"; > $item['price'] = 40

[PHP] Re: Parsing an array from a posted form

2002-11-20 Thread Nick Eby
you can use the implode() function: for ($z=0;$z wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi All :) > > I have a form that is being passed to a mail function when submitted. It is > working OK, except that I am having trouble with values from arrays such as > checkbox lists.

Re: [PHP] this oop-script still doesn't work

2002-11-19 Thread Nick Eby
seems to me that you're trying to have an object's member behave as if it had global scope. you never say "$foo = new bar()". instead you say "$this->foo = new foo()" where $this is an instance of Overall. you can't instantiate a Foo as a member of an Overall instance, and then expect to talk to

Re: [PHP] how to read text file one line at a time

2002-11-19 Thread Nick Eby
even further, instead of using fgets() to get each line and then exploding it, you can use fgetcsv() which reads the line and breaks it into chunks by any delimiter, returning the chunks in an array. $fp = fopen($filename, "r"); while (!feof($fp)) { $line = fgetcsv($fp, 9, "|"); ... }

Re: [PHP] Re: wanted: array_diff for more than values

2002-11-08 Thread Nick Eby
"Kevin Stone" <[EMAIL PROTECTED]> wrote: > I think you're trying to defy logic here. How will the function know that > you want to keep color=>cherry or flavor=>cherry? What logical construct > makes that decision? The example you've given will result in an array that > looks eactly like $arr1 r

[PHP] Re: wanted: array_diff for more than values

2002-11-08 Thread Nick Eby
021109001822.33085.qmail@;pb1.pair.com... > array_diff check value, not keys.. > > "Nick Eby" <[EMAIL PROTECTED]> a écrit dans le message de news: > [EMAIL PROTECTED] > > example: > > $arr1 = array("color" => "red", "flavor" =>

[PHP] Re: wanted: array_diff for more than values

2002-11-08 Thread Nick Eby
in case anyone cares, here is my solution so far, please comment if you feel the need. function myArrayDiff($thing1, $thing2) { $diff = array(); while (list($key, $val) = each($thing1)) { if ((string)$val !== (string)$thing2[$key]) $diff[$key] = $val; } return $diff; } -- PHP Genera

[PHP] wanted: array_diff for more than values

2002-11-08 Thread Nick Eby
example: $arr1 = array("color" => "red", "flavor" => "cherry"); $arr2 = array("color" => "cherry", "flavor" => "red"); print_r(array_diff($arr1, $arr2)); those 2 arrays are different, but array_diff doesn't know it since it doesn't compare values at particular keys, just values in general. i want

Re: [PHP] Getting Newest

2002-11-06 Thread Nick Eby
you could make a union of all the records, and order by newest date first: (select id, date, name, text from table1) union (select id, date, name, text from table2) union (select id, date, name, text from table3) order by date desc then select the first record /nick -- PHP General Mailing Lis

[PHP] Re: Secure PHP Form

2002-10-30 Thread Nick Eby
be wary of IE on a macintosh, i seem to remember that IE5 on a mac has the same nuts and bolts as IE4 on windows. can anyone back me up on that? "Pushpinder Singh Garcha" <[EMAIL PROTECTED]> wrote in message news:9787EE5E-EC3E-11D6-A12B-003065DBDE68@;masterstream.com... > hi all > > I am using a

[PHP] Re: CSS pulls me back in

2002-10-30 Thread Nick Eby
is Constants.inc in the same directory as Stylesheet.php? "Liam Gibbs" <[EMAIL PROTECTED]> wrote in message news:D64360C926B9F34F8B35F78D07B8E7A2716E23@;postman.dfait-maeci.gc.ca... > Still having trouble with CSSs. Now it's a different error. Below is my CSS > code. For some reason, I can't get

[PHP] Re: POST-ing or GET-ing an array

2002-10-29 Thread Nick Eby
Hi, I disagree that serialize/unserialize is the way to go, unless you're absolutely completely sure that there will only be a relatively small number of things in the array. As somebody mentioned briefly, the get request is limited to a certain number of bytes, and the string representing your s

Re: [PHP] oracle: updating clob causes error 600

2002-10-28 Thread Nick Eby
"Maxim Maletsky" <[EMAIL PROTECTED]> wrote in message news:20021028122405.4F05.MAXIM@;php.net... > What's the Oracle version? 8.1.7 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] oracle: updating clob causes error 600

2002-10-27 Thread Nick Eby
I'm running oracle 8.1.7 w/ php 4.2. I use the oci8 functions to update clob columns, and maybe 1 out of every 15 or 20 times, updating a clob column causes the mysterious "ora-600, internal error code". Anybody out there experienced this (and hopefully resolved it) who can shed some light? thank

[PHP] Re: Understanding the =& operator...

2002-10-25 Thread Nick Eby
"Chris Boget" <[EMAIL PROTECTED]> wrote in message news:023501c27c62$23b74dd0$8c01a8c0@;ENTROPY... > Ok, let me see if I have this right: > > When you do: > > $var = new myClass(); > > $var instantiates and holds a copy of myClass. No. The "new" operator makes a new object which is an instance o

[PHP] Re: upload directory

2002-10-14 Thread Nick Eby
"Jennifer Swofford" <[EMAIL PROTECTED]> wrote: >Is there an easy way to upload an entire directory? Rather than selecting the 19 files in a directory, to just select the directory, and have all its contents go with it? (Or even a not-such-an easy way?) Since uploading a file to your webserver

Re: [PHP] Re: two submit buttons redirecting to two scripts

2002-10-14 Thread Nick Eby
> here is the error message, > Warning: Cannot add header information - headers already sent by > (output started at /home3/www/antriksh/resources/action2.php:5) in > /home3/www/antriksh/resources/action2.php on line 13 > > any help? > that warning is probably generated because you're using the h

[PHP] Re: ASP Option Explicit equivalent in PHP

2002-10-09 Thread Nick Eby
wait, I take that back... I meant "to see uninitialized variable use", since there's really no such thing as "declaring" a variable in PHP unless it's a class member. "Nick Eby" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:

[PHP] Re: ASP Option Explicit equivalent in PHP

2002-10-09 Thread Nick Eby
There's 2 ways to get that: use the php.ini setting ERROR_REPORTING, or the function error_reporting(). to see undeclared variable use, call error_reporting(E_NOTICE) at the top of your script. http://www.php.net/manual/en/function.error-reporting.php /nick "R . Z ." <[EMAIL PROTECTED]> wrote

[PHP] Re: elseifs and ereg

2002-10-04 Thread Nick Eby
check the manual page for ereg... you'll find that it takes 2 parameters minimum, and the return value is not what your code expects it to be. http://www.php.net/ereg "Bryan Koschmann - Gkt" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Okay, I think I'm just

Re: [PHP] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Nick Eby
have to know on what class they were called. anyway thanks again /nick - Original Message - From: "Rasmus Lerdorf" <[EMAIL PROTECTED]> To: "Nick Eby" <[EMAIL PROTECTED]> Cc: "Debbie Dyer" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent:

Re: [PHP] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Nick Eby
icFunc() { echo get_class($this); } } Class B extends A {} B::staticFunc(); thanks again /nick - Original Message - From: "Rasmus Lerdorf" <[EMAIL PROTECTED]> To: "Debbie Dyer" <[EMAIL PROTECTED]> Cc: "Nick Eby" <[EMAIL PROTECTED]>; <[EMAIL

Re: [PHP] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Nick Eby
esult. sorry this is so confusing, I probably should've used the term "static" from the beginning. /nick - Original Message - From: "Debbie Dyer" <[EMAIL PROTECTED]> To: "Nick Eby" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wedn

Re: [PHP] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Nick Eby
; > print $c->foo(); > > Is this what you mean? > > Debbie > > - Original Message - > From: "Nick Eby" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, October 02, 2002 6:29 PM > Subject: [PHP] Inheritance and a cl

[PHP] Inheritance and a class function: on what class was it called?

2002-10-02 Thread Nick Eby
Assume you've got some class that has one or more classes inherited from it. The parent class has a function that is normally called using the :: operator (a class function). Assume also that the class function is never called from an object function. Is it possible to find if the class function