[PHP] call function as variable

2003-08-15 Thread adam
Hi! I have folowing function which they are a member in a class. function foo(){ something } function zoo(){ something else } and i have a array such: $test = array(1=>foo,2=zoo); and i want to call the fuction foo() and zoo something like; $object->$test[1](); I have tried this this, it will

[PHP] test

2003-08-15 Thread adam
tst -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to get data from database with a click

2003-08-15 Thread Viraj Kalinga Abayarathna
try java scripts, there is a function called "onChange()", you can attach this with your combo box and can submit (SELF) the form upon the content change in combobox. I have done this long time back, i'll send you the coding if still i have that script in my archives. Viraj - Original Messag

[PHP] How to write my own php extensions

2003-08-15 Thread Dennis Lee
Hi all : I want to write my own php extensions , but I don't know how to start . Please tell me where I can find some examples or resources such as tutorials . Thanks in advance . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to write my own php extensions

2003-08-15 Thread [EMAIL PROTECTED]
There are some documents in the php source tarball itself. this is a good starting point. Then please goto zend.com you will see some fantastic articles. all the best Dennis Lee wrote: Hi all : I want to write my own php extensions , but I don't know how to start . Please tell me where I can

Re: [PHP] HOW DO U SPLIT UP LARGE STRINGS?

2003-08-15 Thread John Ryan
well, it must be big as it says 'mysql server gone away' i cant open the file from mysql, i need to edit a few things each line. i suppose i could open it, then save it to disk and then run that mysql command "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hello,

Re: [PHP] HOW DO U SPLIT UP LARGE STRINGS?

2003-08-15 Thread John W. Holmes
John Ryan wrote: I've a string with a huge mySQL query, seperated by a semi-colon and then line-break. You can't run this query staright to mySQL (and i dont want to try), so Im trying to split up the query into, say, 100 mysql commands at a time. Is it possible to split up a string every 100 semi

Re: [PHP] HOW DO U SPLIT UP LARGE STRINGS?

2003-08-15 Thread [EMAIL PROTECTED]
hello, you can use the split() method to break this up into pieces. Unless you are doing a large number of inserts on tables with several keys mysql will not be troubled too much by the number of queries you run. John Ryan wrote: I've a string with a huge mySQL query, seperated by a semi-colon

[PHP] HOW DO U SPLIT UP LARGE STRINGS?

2003-08-15 Thread John Ryan
I've a string with a huge mySQL query, seperated by a semi-colon and then line-break. You can't run this query staright to mySQL (and i dont want to try), so Im trying to split up the query into, say, 100 mysql commands at a time. Is it possible to split up a string every 100 semi-colons it finds?

Re: [PHP] mysql_num_rows

2003-08-15 Thread John W. Holmes
John Taylor-Johnston wrote: My question got buried on the bottom of the thread. Sorry for the repeat. I'm getting this message: Warning: Supplied argument is not a valid MySQL result resource in /.../testals.php on line 189 Read with me. Supplied argument ($news) is not a valid MySQL result reso

[PHP] mysql_num_rows

2003-08-15 Thread John Taylor-Johnston
My question got buried on the bottom of the thread. Sorry for the repeat. I'm getting this message: Warning: Supplied argument is not a valid MySQL result resource in /.../testals.php on line 189 189> if (mysql_num_rows($news) == 1) Ideas? $server = "localhost"; $user = ""; $pass = "

[PHP] Installing How-To

2003-08-15 Thread Rodney Davis
Does anyone know of a good howto on installing php w/ GD and phplib etc on a Redhat box? Thanks, Rodney -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] executing a shell command within a function

2003-08-15 Thread Mike Brum
Why don't you try to use mkdir() instead of shell commands? http://us2.php.net/manual/en/function.mkdir.php -M -Original Message- From: Sævar Öfjörð [mailto:[EMAIL PROTECTED] Sent: Friday, August 15, 2003 8:19 PM To: [EMAIL PROTECTED] Subject: [PHP] executing a shell command within a fu

[PHP] executing a shell command within a function

2003-08-15 Thread Sævar Öfjörð
Hi, I’m coding a function that will create a set of directories using execution of shell commands within the function. Then the function saves different sizes of images in each directory. Later in the function I open one of these directories to list the content in them. The problem is that the dir

RE: [PHP] Bug in Ereg?

2003-08-15 Thread Wouter van Vliet
ow .. this script won't work .. checkboxes like this: or var calling like this: $_POST['checkbox']['colors'] would do better ;) of course :D:D -Oorspronkelijk bericht- Van: Wouter van Vliet [mailto:[EMAIL PROTECTED] Verzonden: zaterdag 16 augustus 2003 1:06 Aan: Kris Ya

RE: [PHP] Bug in Ereg?

2003-08-15 Thread Wouter van Vliet
Hope I can be of any help again .. what you are doing seems rather complicated... what if you have your checkboxes like: and the recieving script just doing: if (isset($_POST['colors']) && is_array($_POST['colors'])) $colors = join(':', $_POST['colors']); PHP will only register indexes in th

Re: [PHP] Bug in Ereg?

2003-08-15 Thread Marek Kilimajer
Kris Yates wrote: if(ereg("color-", $ThisVar) AND $ThisVal=="on" OR $ThisVal==1){ this condition reads if( (ereg("color-", $ThisVar) AND $ThisVal=="on") OR $ThisVal==1) It is called operator precedence. www.php.net/manual/en/language.operators.html#language.operators.precedence You have POST

Re: [PHP] If you ever had a Vic20

2003-08-15 Thread John Taylor-Johnston
:) Tried that: Warning: Supplied argument is not a valid MySQL result resource in /.../testals.php on line 189 189> if (mysql_num_rows($news) == 1) John > Matt> mysql_num_rows($news) $server = "localhost"; $user = ""; $pass = ""; $db = "redwards"; $table = "testals"; $myconnection = m

Re: [PHP] Bug in Ereg?

2003-08-15 Thread Curt Zirzow
* Thus wrote Kris Yates ([EMAIL PROTECTED]): > Hi, > > I have a form with checkboxes that POSTs to a PHP script. > > What is posted [ from phpinfo() ]: > > _POST["color-1"] on > _POST["color-4"] on > _POST["color-6"] on There is more post data than this. > > > Parser: >for

RE: [PHP] Bug in Ereg?

2003-08-15 Thread Jennifer Goodie
> What is posted [ from phpinfo() ]: > > _POST["color-1"] on > _POST["color-4"] on > _POST["color-6"] on > > > Parser: > foreach($_POST as $ThisVar=>$ThisVal){ > if(ereg("color-", $ThisVar) AND $ThisVal=="on" OR $ThisVal==1){ > $newVarA=explode("-", $ThisVar);

Re: [PHP] Bug in Ereg?

2003-08-15 Thread Kris Yates
Just an addendum.. My parser has $colors=""; right before the foreach loop. Kris Yates wrote: Hi, I have a form with checkboxes that POSTs to a PHP script. What is posted [ from phpinfo() ]: _POST["color-1"] on _POST["color-4"] on _POST["color-6"] on Parser: foreach($_POST as

[PHP] Bug in Ereg?

2003-08-15 Thread Kris Yates
Hi, I have a form with checkboxes that POSTs to a PHP script. What is posted [ from phpinfo() ]: _POST["color-1"] on _POST["color-4"] on _POST["color-6"] on Parser: foreach($_POST as $ThisVar=>$ThisVal){ if(ereg("color-", $ThisVar) AND $ThisVal=="on" OR $ThisVal==1){

Re: [PHP] If you ever had a Vic20

2003-08-15 Thread Matt Babineau
mysql_num_rows($news) On Fri, 2003-08-15 at 17:42, John Taylor-Johnston wrote: > OK, > I tried this, but am getting this error: > Warning: Wrong parameter count for mysql_num_rows() in /.../testals.php on line 189 > 189> if (mysql_num_rows() == 1) > What's up? > John > > $myconnection = mysql_co

Re: [PHP] If you ever had a Vic20

2003-08-15 Thread John Taylor-Johnston
> I had a Vic20 sitting next to a Lisa... :) The debate in them days was whether a timex-simplex would outlast. Commodore sold a lot but never went anywhere past high school labs. I knew a guy with a PC who laughed at every else. Funny how things turned out. -- PHP General Mailing List (http

Re: [PHP] If you ever had a Vic20

2003-08-15 Thread John Taylor-Johnston
OK, I tried this, but am getting this error: Warning: Wrong parameter count for mysql_num_rows() in /.../testals.php on line 189 189> if (mysql_num_rows() == 1) What's up? John $myconnection = mysql_connect($server,$user,$pass); mysql_select_db($db,$myconnection); $news = mysql_query("select Stu

[PHP] Re: Foreach POST VARS problem

2003-08-15 Thread Catalin Trifu
btw! if you use it inside a function, you need to declare it as global! Catalin > Are you sure the data is posted from HTML > through POST ? try adding the lines below: > > > $colors=""; > if(is_array($HTTP_POST_VARS) && !empty($HTTP_POST_VARS )) { > > foreach($HTTP_POST_VARS as $

Re: [PHP] Foreach POST VARS problem

2003-08-15 Thread Curt Zirzow
* Thus wrote Kris Yates ([EMAIL PROTECTED]): > >foreach($HTTP_POST_VARS as $ThisVar=>$ThisVal){ > > ... > > *Warning*: Invalid argument supplied for foreach() in > */devda1/htdocs/2binteractive.com/htdocs/0new/content/lanskyShopAdmin.php* > on line 2 > > I guess I just need to know what thi

[PHP] Re: Foreach POST VARS problem

2003-08-15 Thread Catalin Trifu
hi, Are you sure the data is posted from HTML through POST ? try adding the lines below: > $colors=""; if(is_array($HTTP_POST_VARS) && !empty($HTTP_POST_VARS )) { > foreach($HTTP_POST_VARS as $ThisVar=>$ThisVal){ > if(ereg("color-", $ThisVar) AND $ThisVal=="on" OR $Thi

Re: [PHP] Segmentation Fault

2003-08-15 Thread Curt Zirzow
* Thus wrote Jackson Miller ([EMAIL PROTECTED]): > I am running a PHP script from the command line that is returning > "Segmentation Fault". I run a lot of script from the command line and have > never seen this before. I don't even know where to begin. http://bugs.php.net/how-to-report.php >

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread Curt Zirzow
* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]): > > I believe I spoke too soon. If I use isset() then even if I leave the > field empty it still returns true. I am trying to view the documentation for > this function but php.net seems to be timing out now. > > if (isset($_POST[MI]) && (preg

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread tpc
I believe I spoke too soon. If I use isset() then even if I leave the field empty it still returns true. I am trying to view the documentation for this function but php.net seems to be timing out now. On Fri, 15 Aug 2003 [EMAIL PROTECTED] wrote: > > Thank you. I did the following: > > if (iss

Re: [PHP] Function arguments

2003-08-15 Thread Jim Lucas
Most of my program functions use the first approach I have what ever must be given because the nature of the functions only exists because it does certain things. I then have the last argurment passed be an array. This will contain all the data that I might want to use inside the function other

Re: [PHP] Screen Resoultion

2003-08-15 Thread Kris Yates
Chris W. Parker wrote: Kris Yates on Friday, August 15, 2003 11:55 AM said: However, I also have a PHP program which you can run and edit the source code for the program inside the program itself, hit render and all of a sudden you are running the new version of th

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread tpc
Thank you. I did the following: if (isset($_POST[MI]) && (preg_match('/^[[:alpha:]]{1,1}$/', $_POST[MI]) == 0)) and zero is caught. On Fri, 15 Aug 2003, CPT John W. Holmes wrote: > From: <[EMAIL PROTECTED]> > > > I use preg_match to validate the Middle Initial field of a form and so far > > i

Re: [PHP] How to get data from database with a click

2003-08-15 Thread Comex
<[EMAIL PROTECTED]> Curt Zirzow: > I'm confused, does this message have anything to do with what the > original message, below, is asking? I it is the common mistake of pressing Reply instead of taking the trouble to type in the [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net

RE: [PHP] Screen Resoultion

2003-08-15 Thread Chris W. Parker
Kris Yates on Friday, August 15, 2003 11:55 AM said: > However, I also have a PHP program which you can run and edit the > source code for the program inside the program itself, hit render and > all of a sudden you are running the new version of the program. It is >

Re: [PHP] Screen Resoultion

2003-08-15 Thread Kris Yates
Leif K-Brooks wrote: [EMAIL PROTECTED] wrote: i didnt understand a word of that , please rephrase ?? ASP doesn't do an upload meter by magic. PHP can do anything ASP can do, it simply doesn't have built-in features for anything unessential. So true.. I use PHP a lot to dynamically generate DHT

Re: [PHP] Checkboxes

2003-08-15 Thread Chris Boget
> It could be a solution but only working with a few items. My list(s) > will be filled up with hundreds of items grabbed automatically out of > another MySQL table... would it help too? Maybe naming the check > boxes with each item own ID... anyone? What you could do is this: $query = "SELECT fi

Re: [PHP] Checkboxes

2003-08-15 Thread CPT John W. Holmes
You could name them as: etc... Then $_POST['choice'] will be an array of the boxes chosen. $list = implode(',',$_POST['choice']); will give you a comma separated list of all items chosen. ---John Holmes... - Original Message - From: "Cesar Aracena" <[EMAIL PROTECTED]> To: <[EMAIL P

RE: [PHP] Checkboxes

2003-08-15 Thread Wouter van Vliet
I think I'd just use like then you can loop through it with foreach($_POST[box] as $BoxID => $Value) .. I assume the recieving script knows what boxes it expects? -Oorspronkelijk bericht- Van: Cesar Aracena [mailto:[EMAIL PROTECTED] Verzonden: vrijdag 15 augustus 2003 20:38 Aan: [EMA

RE: [PHP] Checkboxes

2003-08-15 Thread Cesar Aracena
It could be a solution but only working with a few items. My list(s) will be filled up with hundreds of items grabbed automatically out of another MySQL table... would it help too? Maybe naming the checkboxes with each item own ID... anyone? Thanks, Cesar Aracena www.icaam.com.ar > -Mensaje

Re: [PHP] Checkboxes

2003-08-15 Thread Matt Babineau
You could try this: So basically when it get submitted, you'll have either a 0 or 1 response to know whether or not it has been checked. Does this help? Matt On Fri, 2003-08-15 at 14:25, Cesar Aracena wrote: > Hi all, > > I am wondering what would be the best way to handle checkboxes. I am

[PHP] Checkboxes

2003-08-15 Thread Cesar Aracena
Hi all, I am wondering what would be the best way to handle checkboxes. I am making a site that will display several items in a 20-items-per-page format and each item will have a checkbox next to it for the user to select them. Now, what I need to do is to record the items selected by the user wh

RE: [PHP] Segmentation Fault

2003-08-15 Thread Jay Blanchard
[snip] I am running a PHP script from the command line that is returning "Segmentation Fault". I run a lot of script from the command line and have never seen this before. I don't even know where to begin. I know that PHP is set up to run scripts from the command line and plent of other scrip

Re: [PHP] Function arguments

2003-08-15 Thread Mike Migurski
>What is the best way to pass the arguments so it is easy to maintain in >future if function behaviour changes by adding/removing one or more >arguments? > >Currently i am passing arguments in array. But i think it is not the >clean way to do it and another approach i am using is functionName(arg1,

Re: [PHP] how to disable html postings?

2003-08-15 Thread Leif K-Brooks
Merlin wrote: I am wondering how to prevent that users can post html through a form. I process the form with php and save the date to a db. There are a couple of sites I have already seen such thing. No matter what you do, it is not possible to submit html commands. Thats exacly what I want to do

[PHP] Segmentation Fault

2003-08-15 Thread Jackson Miller
I am running a PHP script from the command line that is returning "Segmentation Fault". I run a lot of script from the command line and have never seen this before. I don't even know where to begin. I know that PHP is set up to run scripts from the command line and plent of other scripts run.

RE: [PHP] redhat 8: upgrade php from 4.2.2 to 4.3.2

2003-08-15 Thread Chris W. Parker
Cesar Cordovez on Friday, August 15, 2003 11:01 AM said: > You can use apachetoolbox.com to install apache and php... Does this require that I uninstall everything I've already got? Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: h

RE: [PHP] how to disable html postings?

2003-08-15 Thread Jay Blanchard
[snip] I am wondering how to prevent that users can post html through a form. I process the form with php and save the date to a db. There are a couple of sites I have already seen such thing. No matter what you do, it is not possible to submit html commands. Thats exacly what I want to do for my s

[PHP] how to disable html postings?

2003-08-15 Thread Merlin
Hi there, I am wondering how to prevent that users can post html through a form. I process the form with php and save the date to a db. There are a couple of sites I have already seen such thing. No matter what you do, it is not possible to submit html commands. Thats exacly what I want to do for

[PHP] Foreach POST VARS problem

2003-08-15 Thread Kris Yates
It seems to me that this used to work but I guess something has changed somewhere between PHP 4.2 and 4.3? I am running PHP 4.3.2 as an Apache DSO on an FBSD box. If it is not obvious, I am trying to parse checkbox form POST results as seen below: $colors=""; foreach($HTTP_POST_VARS as $

Re: [PHP] redhat 8: upgrade php from 4.2.2 to 4.3.2

2003-08-15 Thread Cesar Cordovez
You can use apachetoolbox.com to install apache and php... Chris W. Parker wrote: I want to upgrade my php install from 4.2.2 to 4.3.2. I'm pretty new to linux so I don't know how to install from source and I haven't been able to find any Redhat 8 rpm's. -- PHP General Mailing List (http://www.p

[PHP] preg_match issue

2003-08-15 Thread Pascal S.
I have a function that checks the syntax of a string using preg_match. This function is used in a loop and always hangs on the same string (7 out of many more). However, the function acts as expected when used individually on that string (ie when the array of strings to loop on is reduced to just

Re: [PHP] Category and sub-category logic

2003-08-15 Thread CPT John W. Holmes
From: "Richard Baskett" <[EMAIL PROTECTED]> > Wouldn¹t it just be easier to do a relationship table as in > > Personnel > emp ID parent > > 'Albert' 1 0 > 'Bert'2 1 > 'Chuck' 3 1 > 'Donna' 4 0 > 'Eddie' 5 4 > '

Re: [PHP] Acessing session vars

2003-08-15 Thread CPT John W. Holmes
From: "Ed Curtis" <[EMAIL PROTECTED]> > I just started using sessions and am having some trouble understanding how > to pull values out of sessions to use in another page. > > I set the values as: > > session_start(); > session_register{'magazine'); > session_register('company'); > > The data is s

RE: Re: [PHP] PHP.ini file and register_globals

2003-08-15 Thread Jay Blanchard
[snip] Is the change in the php.ini file the only thing that I need to change to turn on register_globals? [/snip] Yes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP.ini file and register_globals

2003-08-15 Thread Jonatan Pugliese.
yes you must to restart your webserver !! type /etc/init.d/httpd restart - Original Message - From: "Jay Blanchard" <[EMAIL PROTECTED]> To: "Jonatan Pugliese." <[EMAIL PROTECTED]>; "Ben C." <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, August 15, 2003 2:18 PM Subject: RE: [PHP]

Re: Re: [PHP] PHP.ini file and register_globals

2003-08-15 Thread Ben C .
Is the change in the php.ini file the only thing that I need to change to turn on register_globals? > > From: "Jonatan Pugliese." <[EMAIL PROTECTED]> > Date: 2003/08/15 Fri PM 01:18:01 EDT > To: "Ben C." <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> > Subject: Re: [PHP] PHP.ini file and register_glo

Re: Re: [PHP] PHP.ini file and register_globals

2003-08-15 Thread Ben C .
Is the change in the php.ini file the only thing that I need to change to turn on register_globals? > > From: "Jonatan Pugliese." <[EMAIL PROTECTED]> > Date: 2003/08/15 Fri PM 01:18:01 EDT > To: "Ben C." <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> > Subject: Re: [PHP] PHP.ini file and register_glo

RE: [PHP] PHP.ini file and register_globals

2003-08-15 Thread Jay Blanchard
[snip] never reboot !! is not necessary ! [/snip] But you might want to restart your web server. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP.ini file and register_globals

2003-08-15 Thread Jonatan Pugliese.
never reboot !! is not necessary ! - Original Message - From: "Ben C." <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, August 15, 2003 2:14 PM Subject: [PHP] PHP.ini file and register_globals > I have a quick simple question. I am using PHP 4.2.3 on Linux. I am trying to turn

[PHP] PHP.ini file and register_globals

2003-08-15 Thread Ben C .
I have a quick simple question. I am using PHP 4.2.3 on Linux. I am trying to turn register_globals from off to on. Is all that I need to do change it from off to on in the php.ini file? Do you I need to reboot to have the changes go into effect? Sorry for a simple question but I am new at

[PHP] cron

2003-08-15 Thread Richard Lynch
Not specific to PHP really, but it all started with a simple PHP script I was automating... I've used cron/crontab on a zillion machines, and it always worked flawlessly. Well, once I'd get the actual shell commands and permissions right anyway. But this time... The cron jobs just aren't having

[PHP] Re: cookies and redirection

2003-08-15 Thread Joaco
Ok, I have changed my code so the headers are sent as: header("HTTP/1.0 302 Redirect"); header("Location: index2.php"); header("Set-Cookie: USER_COOKIE=$sUser"); I have changed the file name to nph-unsecure.php It successfully sends me to the index2.php page, but no cookie... any ideas "Joaco"

[PHP] Acessing session vars

2003-08-15 Thread Ed Curtis
I just started using sessions and am having some trouble understanding how to pull values out of sessions to use in another page. I set the values as: session_start(); session_register{'magazine'); session_register('company'); The data is saved as a session because I can read the file located

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread Curt Zirzow
* Thus wrote Curt Zirzow ([EMAIL PROTECTED]): > * Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]): > > > > I use preg_match to validate the Middle Initial field of a form and so far > > it works, except yesterday a user submitted a "0" (zero) as a middle > > initial! My regexp is: > > > > if (!

[PHP] redhat 8: upgrade php from 4.2.2 to 4.3.2

2003-08-15 Thread Chris W. Parker
Hello eveyone. I want to upgrade my php install from 4.2.2 to 4.3.2. I'm pretty new to linux so I don't know how to install from source and I haven't been able to find any Redhat 8 rpm's. Can someone please give me instructions as to what I should do? (Maybe links to a site where I can find the c

Re: [PHP] Category and sub-category logic

2003-08-15 Thread Mark
--- "CPT John W. Holmes" <[EMAIL PROTECTED]> wrote: > From: "Mark" <[EMAIL PROTECTED]> > > > > I'm trying to get a handle on this algorithm as well. If you add > > additional children to a parent record, doesn't that require > > renumbering all the rgt and lft values in the lineage? For > example

Re: [PHP] How to get data from database with a click

2003-08-15 Thread Curt Zirzow
* Thus wrote Subodh Gupta ([EMAIL PROTECTED]): > Dear Friends, > > When we click a combo box, in a perticular file, the output from the > database should display in the same screen, in a text box or a combo box (We > want this to happen without pressing the submit button). > > Any clue please

Re: [PHP] ereg & preg

2003-08-15 Thread Curt Zirzow
* Thus wrote Eddy-Das ([EMAIL PROTECTED]): > is there any syntax difference between > ereg() and preg() except preg needs / and /? There are a lot of differences in syntax. Curt -- "I used to think I was indecisive, but now I'm not so sure." -- PHP General Mailing List (http://www.php.net/) T

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread Curt Zirzow
* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]): > > I use preg_match to validate the Middle Initial field of a form and so far > it works, except yesterday a user submitted a "0" (zero) as a middle > initial! My regexp is: > > if (!empty($_POST[MI]) && (preg_match('/^[[:alpha:]]{1,1}$/', $_P

Re: [PHP] Category and sub-category logic

2003-08-15 Thread Richard Baskett
Wouldn¹t it just be easier to do a relationship table as in Personnel emp ID parent 'Albert' 1 0 'Bert'2 1 'Chuck' 3 1 'Donna' 4 0 'Eddie' 5 4 'Fred'6 0 'Joe' 7 6 This way you know the

[PHP] howto set locale only once

2003-08-15 Thread Martin Leja
Hi, setting locale with setlocale() to subsequently get localized time strings e.g. works fine. But this way the setlocale function gets executed every time. How can i set the locale only once? Can i specify the locale in the config file php.ini? I'm using php as apache module on a linux debian s

Re: [PHP] Function arguments

2003-08-15 Thread [EMAIL PROTECTED]
Hello, If you are worried about this issue your best option is to switch to an object oriented approach. all the best Hardik Doshi wrote: Hi Group, I have a question on overloaded function. What is the best way to pass the arguments so it is easy to maintain in future if function behaviour c

[PHP] Function arguments

2003-08-15 Thread Hardik Doshi
Hi Group, I have a question on overloaded function. What is the best way to pass the arguments so it is easy to maintain in future if function behaviour changes by adding/removing one or more arguments? Currently i am passing arguments in array. But i think it is not the clean way to do it and

[PHP] ereg & preg

2003-08-15 Thread Eddy-Das
is there any syntax difference between ereg() and preg() except preg needs / and /? -- - Eddy Wong __ inframatrix internet solutions http://www.inframatrix.com/ ¥¿¤KEddy Regular Octa-Eddy [EMAIL PROTECTED]@ [EMAIL PROTECTED]@¡½¢ª¢© [EMAIL PROTECTED]@[EMAIL PROTE

RE: [PHP] Determining where a function is called from..

2003-08-15 Thread Wouter van Vliet
WHOW .. what a great new function in PHP4.3 .. I now have my errorlog populated with stuff like: [Fri 15 Aug 2003 17:34] [error] [database] You have an error in your SQL syntax near 'DELETESBLAH' at line 1 -- -> database->execute() @ HTML/tmp/test.php line 3 -> database->dberr

RE: [PHP] Determining where a function is called from..

2003-08-15 Thread Wouter van Vliet
Nope .. I hadn't studiet the ref.errorfunc.php in this search.. I did some other time and the backtrace function didn't stick around in my head. Thank you all for helping me .. of course, debug_backtrace() was what I needed ;) .. what a magnificent new function in PHP4.3 that is.. Only too bad my

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread CPT John W. Holmes
From: <[EMAIL PROTECTED]> > I use preg_match to validate the Middle Initial field of a form and so far > it works, except yesterday a user submitted a "0" (zero) as a middle > initial! My regexp is: > > if (!empty($_POST[MI]) && (preg_match('/^[[:alpha:]]{1,1}$/', $_POST[MI]) == 0)) > > I tested

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread Marek Kilimajer
Not an answer but '/^[[:alpha:]]{1,1}$/' could be writen as '/^[[:alpha:]]$/' [EMAIL PROTECTED] wrote: I use preg_match to validate the Middle Initial field of a form and so far it works, except yesterday a user submitted a "0" (zero) as a middle initial! My regexp is: if (!empty($_POST[MI]) && (

Re: [PHP] logging data to xml

2003-08-15 Thread Curt Zirzow
* Thus wrote Jay Blanchard ([EMAIL PROTECTED]): > A couple of things occured to me, but I am not sure that they're > desirable... > > With being the last tag (does it occupy its own line?) you could > (pseudo-code, not tested and certain to be incomplete)... > > while(!feof($theXMLLogFile)){ >

Re: [PHP] Category and sub-category logic

2003-08-15 Thread CPT John W. Holmes
From: "Mark" <[EMAIL PROTECTED]> > I'm trying to get a handle on this algorithm as well. If you add > additional children to a parent record, doesn't that require > renumbering all the rgt and lft values in the lineage? For example > (table shamelessly stolen from a website): > > Personnel > emp

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread Greg Wiley
- Original Message - From: <[EMAIL PROTECTED]> > > I use preg_match to validate the Middle Initial field of a form and so far > it works, except yesterday a user submitted a "0" (zero) as a middle > initial! My regexp is: > > if (!empty($_POST[MI]) && (preg_match('/^[[:alpha:]]{1,1}$/', $

RE: [PHP] Determining where a function is called from..

2003-08-15 Thread Jaap van Ganswijk
At 2003-08-15 16:35 +0200, Wouter van Vliet wrote: >I noticed the __LINE__ and __FUNCTION__ magic constants too, but they don't >really contain the values I was looking for, as they have the current >function and line in it. But what I want my Logging class (I have one too >:D) to display is what I

Re: [PHP] Determining where a function is called from..

2003-08-15 Thread Marek Kilimajer
Use debug_backtrace(): if($error=mysql_error()) { $bt=debug_backtrace(); echo $bt[0]['file'].':'.$bt[0]['line'].'' .$error.''.$query; } hope i got everything right Wouter van Vliet wrote: Thanks David, I noticed the __LINE__ and __FUNCTION__ magic constants too,

[PHP] PCRE regexp bug ?

2003-08-15 Thread tpc
I use preg_match to validate the Middle Initial field of a form and so far it works, except yesterday a user submitted a "0" (zero) as a middle initial! My regexp is: if (!empty($_POST[MI]) && (preg_match('/^[[:alpha:]]{1,1}$/', $_POST[MI]) == 0)) I tested it with 0-9 and my regexp catches ever

RE: [PHP] Re: regex problem

2003-08-15 Thread Wouter van Vliet
So, what you want is to pretty much use this regex /^(.*)([^\/]+)\/([^\/]+)$/ when matched on this URI, the backreferences will contain \\1 partner/ \\2 name \\3 contact.html \\4 .html > > partner/name/contact.html I have not tested it, but I just guess it will work ;) Wanna kn

Re: [PHP] Re: How can I load load Additional extensions ?

2003-08-15 Thread Comex
<[EMAIL PROTECTED]> Leif K-Brooks: > Dennis Lee wrote: > >> Why it is wrong when I run php as module under apache 2.0.46 ? >> > PHP and Apache 2 are currently unstable together. They might crash on any high traffic, but they start fine, at least when I've tried it. -- PHP General Mailing List

Re: [PHP] Graduated fills using PHP Images

2003-08-15 Thread Jaap van Ganswijk
At 2003-08-15 08:14 -0400, Adrian wrote: >Is it possible to have PHP creates an image that graduates 1 color to >another, such as create and images 100 pixels wide and in height which >fades red to green top to bottom? It's possible. I have just been experimenting with it using ImageCreateTrueColo

RE: [PHP] Determining where a function is called from..

2003-08-15 Thread Wouter van Vliet
Thanks David, I noticed the __LINE__ and __FUNCTION__ magic constants too, but they don't really contain the values I was looking for, as they have the current function and line in it. But what I want my Logging class (I have one too :D) to display is what I am about to illustrate with an example:

Re: [PHP] configure smtp error

2003-08-15 Thread Mark
--- Jackson Miller <[EMAIL PROTECTED]> wrote: > It looks like sendmail_from should be an smtp server, not an email > address. > > Try setting it to your outgoing mail server that you use with your > email > client (i.e. Outlook). If you can send email from your email > client then the > firewa

Re: [PHP] Re: regex problem

2003-08-15 Thread Curt Zirzow
* Thus wrote Kae Verens ([EMAIL PROTECTED]): > Jay Blanchard wrote: > >if($string == 'test/contact.html') > > >it could be > > > >if($string == "test/contact.html") > > not to start a flame war or anything, but isn't the apostrophe version > quicker, as it doesn't ask the server to parse the str

Re: [PHP] Re: regex problem

2003-08-15 Thread Curt Zirzow
* Thus wrote Merlin ([EMAIL PROTECTED]): > ufff.. sorry guys, but I have to explain that better. I appreciate your > help, maybe I did not give enough info. > > I am trying to redirect with apache modrewrite. To do this you have to use > regex (not if functions:-) I'm not sure what you expect sin

[PHP] Re: regex problem

2003-08-15 Thread Merlin
Good idea, but does not work either - surprisingly! - There should be a clean way with regex for this task. Andy regex expert in here? Merlin "Kae Verens" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Merlin wrote: > > ufff.. sorry guys, but I have to explain that bett

Re: [PHP] Re: regex problem

2003-08-15 Thread Merlin
does not work. Is there not a way to exclude the word "partner" like you triede with !(partner) ? merlin "Marek Kilimajer" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > So > ^[^/]+/[^/]* > > or > > ^!(partner/) > > Merlin wrote: > > > ufff.. sorry guys, but I have to expla

RE: [PHP] Category and sub-category logic

2003-08-15 Thread Mark
I'm trying to get a handle on this algorithm as well. If you add additional children to a parent record, doesn't that require renumbering all the rgt and lft values in the lineage? For example (table shamelessly stolen from a website): Personnel emp lft rgt == 'Al

[PHP] Determining where a function is called from..

2003-08-15 Thread Wouter van Vliet
Howdy Fellas, I've got this problem .. not really a problem but still some thing to my disliking. For a project I wrote some database handling class, no big deal. When a function from this module is called with a query containing an error, or some other error occurs inside this class it reports to

Re: [PHP] Re: regex problem

2003-08-15 Thread Marek Kilimajer
So ^[^/]+/[^/]* or ^!(partner/) Merlin wrote: ufff.. sorry guys, but I have to explain that better. I appreciate your help, maybe I did not give enough info. I am trying to redirect with apache modrewrite. To do this you have to use regex (not if functions:-) My problem is, that there are member

[PHP] Re: regex problem

2003-08-15 Thread Kae Verens
Merlin wrote: ufff.. sorry guys, but I have to explain that better. I appreciate your help, maybe I did not give enough info. I am trying to redirect with apache modrewrite. To do this you have to use regex (not if functions:-) My problem is, that there are member accounts which look like that: me

Re: [PHP] Turck MMCache Feedback, Please

2003-08-15 Thread Jason Sheets
Hello Andrei, I've been using Turck MMCache for over 6 months now. I use it on several severs including FreeBSD (2), Windows (1) and Linux (3). I've been very happy with Turck MMCache and as of the last few releases it is actually faster than Zend's product though not by very much (granted c

  1   2   >