phplib-users Mailing List for PHPLIB (Page 34)
Brought to you by:
nhruby,
richardarcher
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(106) |
Sep
(99) |
Oct
(44) |
Nov
(97) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(56) |
Feb
(81) |
Mar
(134) |
Apr
(69) |
May
(106) |
Jun
(122) |
Jul
(98) |
Aug
(52) |
Sep
(184) |
Oct
(219) |
Nov
(102) |
Dec
(106) |
2003 |
Jan
(88) |
Feb
(37) |
Mar
(46) |
Apr
(51) |
May
(30) |
Jun
(17) |
Jul
(45) |
Aug
(19) |
Sep
(5) |
Oct
(4) |
Nov
(12) |
Dec
(7) |
2004 |
Jan
(11) |
Feb
(7) |
Mar
|
Apr
(15) |
May
(17) |
Jun
(13) |
Jul
(5) |
Aug
|
Sep
(8) |
Oct
(6) |
Nov
(21) |
Dec
(13) |
2005 |
Jan
(4) |
Feb
(3) |
Mar
(7) |
Apr
(7) |
May
|
Jun
(11) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
2006 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
(5) |
2007 |
Jan
(15) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(9) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
|
Jun
(3) |
Jul
(1) |
Aug
(19) |
Sep
(2) |
Oct
|
Nov
|
Dec
(6) |
2009 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
From: Rob H. <rob...@ws...> - 2002-10-31 21:05:57
|
Yes, because repeated calls to login without cleaning up from the previous ones leaves you with a url like www.url.com?test=one&&&&&&&& which is ugly and I would bet would cause problems with some browser out there... > -----Original Message----- > From: php...@li... > [mailto:php...@li...]On Behalf Of Giancarlo > Sent: Thursday, October 31, 2002 3:54 PM > To: Marko Kaening; phplib-users list > Subject: Re: [Phplib-users] Patch to page.inc > > > Il 10:33, giovedì 31 ottobre 2002, Marko Kaening ha scritto: > > Hi, the following removes even doubled ampersands following the > parameter > > test and wipes it and its value away, leaving the rest of the string > > Are we going to correct wrong urls too? > If we get an url with double ampersands, it is a wrong one, and > we'll leave > the double ampersands. > > Gian > > > ------------------------------------------------------- > This sf.net email is sponsored by: Influence the future > of Java(TM) technology. Join the Java Community > Process(SM) (JCP(SM)) program now. > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > > |
From: Giancarlo <gia...@na...> - 2002-10-31 20:57:55
|
Il 10:33, gioved=EC 31 ottobre 2002, Marko Kaening ha scritto: > Hi, the following removes even doubled ampersands following the paramet= er > test and wipes it and its value away, leaving the rest of the string Are we going to correct wrong urls too? If we get an url with double ampersands, it is a wrong one, and we'll lea= ve=20 the double ampersands. Gian |
From: Giancarlo <gia...@na...> - 2002-10-31 20:48:23
|
For me this worked perfectly, with a single ereg_replace. function login_if( $trig ) { ### you can use auth->login_if("log") or "reg" if ( (bool) ($trig) ) { global $sess, $HTTP_SERVER_VARS; // Remove the "again=yes" from QUERY_STRING. This is required // because the login form will be submitted to the URL of this // page. This URL is constructed from $PHP_SELF and $QUERY_STRING. // So, we need to remove this parameter from QUERY_STRING or else // after the user submits a username and password, we will unauth // them before they even get logged in! echo "BEFORE ". $HTTP_SERVER_VARS["QUERY_STRING"] ."<br>"; $HTTP_SERVER_VARS["QUERY_STRING"] = ereg_replace( "(^|&)".$this->urlaction."=([[:alpha:]]*)(&|$)", "\\1", $HTTP_SERVER_VARS["QUERY_STRING"]); echo "AFTER ". $HTTP_SERVER_VARS["QUERY_STRING"] ."<br>"; if ( "$trig" == "logout" ) { ... ------------------------------------- ------------------------------------------------------- |
From: Rob H. <rob...@ws...> - 2002-10-31 19:43:37
|
This is the regex being generated: var reg = new RegExp("^[A-Za-z0-9]+$", "gi"); and it fails everything... > -----Original Message----- > From: Matt Williams [mailto:li...@ye...] > Sent: Thursday, October 31, 2002 2:39 PM > To: rob...@ws...; Phplib-Users > Subject: Re: [Phplib-users] Invalid Regex > > > On Thursday 31 October 2002 19:00, Rob Hutton wrote: > > > This will match 123$abc. It should fail if there are any other > characters > > besides alphanumeric. > > I just tried > ----------------- > $string = '123$abc'; > if(!eregi("^[a-z0-9]+$",$string)) > echo 'no good'; > else > echo 'you rock'; > ----------------- > and it outputs > ----------------- > X-Powered-By: PHP/4.2.1 > Content-type: text/html > > no good > ---------------- > removing the $ outputs as valid > unless oohforms is doing something different to it > sorry I missed the + off before > > |
From: S. <bj...@ba...> - 2002-10-31 19:43:22
|
* Rob Hutton wrote: > The regex {6,32} expression to match 6 to 32 times gets eaten by the > templates when remove_unknowns is on. That's because it preg_replace()s all between { and }. Solution: set remove_unknowns to off, this should be sufficient (and, if there are any keywords that won't get replaced, manually set_var() them with "KEYWORD" => "" in order to remove it). Same for stylesheets you have in your template (of course one should define them via <link rel ...> so that browsers can cache them). HTH, Björn. -- 35 Kundenportale mit mehreren tausend Nutzern erstellen. Bei geringen Kosten und einer großen Anzahl an Modulen (DMS, CMS, CRM, Community-Funktionen). Wie das geht? => http://testthesystem.com/ * te...@th... |
From: Matt W. <li...@ye...> - 2002-10-31 19:39:35
|
On Thursday 31 October 2002 19:00, Rob Hutton wrote: > This will match 123$abc. It should fail if there are any other charact= ers > besides alphanumeric. I just tried=20 ----------------- $string =3D '123$abc'; if(!eregi("^[a-z0-9]+$",$string)) echo 'no good'; else=20 echo 'you rock'; ----------------- and it outputs ----------------- X-Powered-By: PHP/4.2.1=20 Content-type: text/html=20 =20 no good ---------------- removing the $ outputs as valid unless oohforms is doing something different to it sorry I missed the + off before |
From: S. <bj...@ba...> - 2002-10-31 19:39:31
|
* Rob Hutton wrote: > Just looked at the docs from the SaniSoft site and the only place I can find > it is in the user comments. Sorry, I have to apologize: it isn't either in the docs of v7.2b. Björn. |
From: Rob H. <rob...@ws...> - 2002-10-31 19:38:19
|
The regex {6,32} expression to match 6 to 32 times gets eaten by the templates when remove_unknowns is on. Is there a way to escape this or something to prevent that? Rob Hutton Web Safe www.wsafe.com |
From: Rob H. <rob...@ws...> - 2002-10-31 19:32:25
|
Just looked at the docs from the SaniSoft site and the only place I can find it is in the user comments. > -----Original Message----- > From: Björn Schotte [mailto:bj...@ba...] > Sent: Thursday, October 31, 2002 2:00 PM > To: Rob Hutton > Cc: Phplib-Users > Subject: Re: [Phplib-users] OOHForms and Templates > > > * Rob Hutton wrote: > > I have been using the docs in the snapshot because I am on a dialup > > connection and it is a pain to get online to check the user > comments. Can > > this be added to the docs? Can the user comments be added to the > > downloadable docs? > > At least get_element() and ge() were documented in the documentation > of 7.2d. So it should be also there in newer versions. > > -- > 35 Kundenportale mit mehreren tausend Nutzern erstellen. > Bei geringen Kosten und einer großen Anzahl an Modulen > (DMS, CMS, CRM, Community-Funktionen). Wie das geht? > => http://testthesystem.com/ * te...@th... > > |
From: S. <bj...@ba...> - 2002-10-31 19:00:08
|
* Rob Hutton wrote: > I have been using the docs in the snapshot because I am on a dialup > connection and it is a pain to get online to check the user comments. Can > this be added to the docs? Can the user comments be added to the > downloadable docs? At least get_element() and ge() were documented in the documentation of 7.2d. So it should be also there in newer versions. -- 35 Kundenportale mit mehreren tausend Nutzern erstellen. Bei geringen Kosten und einer großen Anzahl an Modulen (DMS, CMS, CRM, Community-Funktionen). Wie das geht? => http://testthesystem.com/ * te...@th... |
From: Rob H. <rob...@ws...> - 2002-10-31 18:57:10
|
This will match 123$abc. It should fail if there are any other characters besides alphanumeric. > -----Original Message----- > From: Matt Williams [mailto:li...@ye...] > Sent: Thursday, October 31, 2002 1:36 PM > To: rob...@ws...; Phplib-Users > Subject: Re: [Phplib-users] Invalid Regex > > > On Thursday 31 October 2002 18:32, Rob Hutton wrote: > > > I am trying to validate the username field, and just to make up some > > arbitrary rules, it has to be between 6 and 25 characters long > and have no > > punctuation. So my valid regex looks something like > "[A-Za-z0-9]{6,}" but > > how do I tell it to fail if is has anything else? Like invalid_regex = > > "[^A-Za-z0-9]"? > > Hi Rob > > to check for alphanumeric chars between 6 and 25 chars use > > "^[a-zA-Z0-9]{6,25}$" > > This will bail if it's not like that. > > You can drop A-Z bit depending on whether you're using ereg or eregi > > matt > > |
From: Rob H. <rob...@ws...> - 2002-10-31 18:56:00
|
I have been using the docs in the snapshot because I am on a dialup connection and it is a pain to get online to check the user comments. Can this be added to the docs? Can the user comments be added to the downloadable docs? Thanks Rob Hutton Web Safe www.wsafe.com > -----Original Message----- > From: php...@li... > [mailto:php...@li...]On Behalf Of Björn > Schotte > Sent: Thursday, October 31, 2002 1:27 PM > To: Phplib-Users > Subject: Re: [Phplib-users] OOHForms and Templates > > > * Rob Hutton wrote: > > Then buffering the output to calling start(), show_element(), > and finish() > > Yes, by reading the documentation and finding get_start(), > get_element() (or ge()) and get_finish() which is exactly > that what you want to use: > > $t->set_var(array( > "MYFORM_TEXT" => $f->ge("txt"), > "MYFORM_ADDRESS" => $f->ge("address"), > . > . > . > )); > > -- > 35 Kundenportale mit mehreren tausend Nutzern erstellen. > Bei geringen Kosten und einer großen Anzahl an Modulen > (DMS, CMS, CRM, Community-Funktionen). Wie das geht? > => http://testthesystem.com/ * te...@th... > > > ------------------------------------------------------- > This sf.net email is sponsored by: Influence the future > of Java(TM) technology. Join the Java Community > Process(SM) (JCP(SM)) program now. > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > > |
From: Matt W. <li...@ye...> - 2002-10-31 18:37:24
|
On Thursday 31 October 2002 18:32, Rob Hutton wrote: > I am trying to validate the username field, and just to make up some > arbitrary rules, it has to be between 6 and 25 characters long and have= no > punctuation. So my valid regex looks something like "[A-Za-z0-9]{6,}" = but > how do I tell it to fail if is has anything else? Like invalid_regex =3D > "[^A-Za-z0-9]"? Hi Rob to check for alphanumeric chars between 6 and 25 chars use "^[a-zA-Z0-9]{6,25}$" This will bail if it's not like that. You can drop A-Z bit depending on whether you're using ereg or eregi matt |
From: Rob H. <rob...@ws...> - 2002-10-31 18:29:36
|
I disagree on two points. 1) I am new to the php-lib world, but from what I have been told, the 7.2 stuff is much more structured that the curent development stuff, and this is the core issue that I see. 2) Registration may have special needs, but this is the point of having local.inc. Single, two-phase, and approval based registration can easliy be offered as examples, and probably be used "off the shelf" in a lot of circumstances... > -----Original Message----- > From: php...@li... > [mailto:php...@li...]On Behalf Of Matt > Williams > Sent: Thursday, October 31, 2002 9:54 AM > To: Phplib-Users > Subject: Re: [Phplib-users] auth url question > > > > On Thursday 31 October 2002 14:23, Rob Hutton wrote: > > The more I think about this, the less I agree, because I think that auth > > logic was/is flawed. But attached is a version that I think > will drop in. > > hi all > > I've missed most of this thread so forgive me if I've missed > something or am > heading off in the wrong direction. > > From what I gather a summary of this thread is about using mode=reg or > something similar in the url to invoke registration, is this correct? > > From my point of the view this would be a waste of time. Each application > that I use phplib on invariably has different requirements for > registration. > For me it is easier to keep registration to it's own page where I can > control error checking on the form fields, add/remove fields as I wish > without having to worry about anything in phplib that might get > broken/compromised in the process. > > IMHO it seems like that the project has lost it's way a little in terms of > what it should do, what it needs to do as a project as a whole and what > people feel it should do to best help them. > > What I think needs to happen is to maybe have a more defined development > path, possibly. For someone to say, right that's it for new > stuff to go in, > let's get it tested and out. > Just looking at the task manager on sourceforge shows the is very > little in > the way of defined goals for each release. If something good comes up from > feature requests or from someones own development, then fine add it in as > long as it's not gonna put too much on the next release and only > if it's for > the benefit of the project as a whole. > > So for example it has been discussed about getting the latest dev out for > testing then release. I think this would be a good idea, but only > as long as > no more extra stuff keeps getting added in in the meantime. If we do this > we'll never get it our of the door. > > The main aim of the next release seems to be to get it working with php4 > sessions and register globals off. So we should get this tested, > debugged and > released. Then and, only then would it be time to move on. > > my 2p > > matt > > ------------------------------------------------------- > > > ------------------------------------------------------- > This sf.net email is sponsored by: Influence the future > of Java(TM) technology. Join the Java Community > Process(SM) (JCP(SM)) program now. > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > |
From: Rob H. <rob...@ws...> - 2002-10-31 18:29:21
|
I am trying to validate the username field, and just to make up some arbitrary rules, it has to be between 6 and 25 characters long and have no punctuation. So my valid regex looks something like "[A-Za-z0-9]{6,}" but how do I tell it to fail if is has anything else? Like invalid_regex = "[^A-Za-z0-9]"? Thanks, Rob Hutton Web Safe www.wsafe.com |
From: S. <bj...@ba...> - 2002-10-31 18:26:48
|
* Rob Hutton wrote: > Then buffering the output to calling start(), show_element(), and finish() Yes, by reading the documentation and finding get_start(), get_element() (or ge()) and get_finish() which is exactly that what you want to use: $t->set_var(array( "MYFORM_TEXT" => $f->ge("txt"), "MYFORM_ADDRESS" => $f->ge("address"), . . . )); -- 35 Kundenportale mit mehreren tausend Nutzern erstellen. Bei geringen Kosten und einer großen Anzahl an Modulen (DMS, CMS, CRM, Community-Funktionen). Wie das geht? => http://testthesystem.com/ * te...@th... |
From: Joe S. <jo...@be...> - 2002-10-31 17:17:13
|
Thank you Matt. On Thu, Oct 31, 2002 at 02:53:58PM +0000, Matt Williams wrote: > snip! > > The main aim of the next release seems to be to get it working with php4 > sessions and register globals off. So we should get this tested, debugged and > released. Then and, only then would it be time to move on. > This is the current state of cvs. These were the only changes made to the cvs and thus the cvs snapshot. Perhaps unfortunately there hasn't been much discussion of this. All discussion has been about the dev snapshot which is good that development discussion is happening, but I would much rather see on a dedicated phplib developer list. I created the dev snapshot because there didn't seem to be any discussion or feedback to the patches applied to sf.net. Joe > my 2p > > matt > |
From: Matt W. <li...@ye...> - 2002-10-31 16:48:16
|
On Thursday 31 October 2002 14:23, Rob Hutton wrote: > The more I think about this, the less I agree, because I think that aut= h > logic was/is flawed. But attached is a version that I think will drop = in. hi all I've missed most of this thread so forgive me if I've missed something or= am heading off in the wrong direction. =46rom what I gather a summary of this thread is about using mode=3Dreg o= r something similar in the url to invoke registration, is this correct? =46rom my point of the view this would be a waste of time. Each applicati= on that I use phplib on invariably has different requirements for registrat= ion. For me it is easier to keep registration to it's own page where I can control error checking on the form fields, add/remove fields as I wish without having to worry about anything in phplib that might get broken/compromised in the process. IMHO it seems like that the project has lost it's way a little in terms o= f what it should do, what it needs to do as a project as a whole and what people feel it should do to best help them. What I think needs to happen is to maybe have a more defined development path, possibly. For someone to say, right that's it for new stuff to go = in, let's get it tested and out. Just looking at the task manager on sourceforge shows the is very little = in the way of defined goals for each release. If something good comes up fro= m feature requests or from someones own development, then fine add it in as long as it's not gonna put too much on the next release and only if it's = for the benefit of the project as a whole. So for example it has been discussed about getting the latest dev out for testing then release. I think this would be a good idea, but only as long= as no more extra stuff keeps getting added in in the meantime. If we do this we'll never get it our of the door. The main aim of the next release seems to be to get it working with php4 sessions and register globals off. So we should get this tested, debugged= and released. Then and, only then would it be time to move on. my 2p matt ------------------------------------------------------- |
From: Rob H. <rob...@ws...> - 2002-10-31 16:01:15
|
Guys, I am trying to figure out a way to combine OOHforms and Templates. Use login as an example I was thinking of. Template {formstart} <table> <tr> <td>User Name:</td> <td>{usernameprompt}</td> </tr> <tr> <td>Password:</td> <td>{passwordprompt}</td> </tr> <tr> <td collspan="2">{submitbutton}</td> </tr> </table> {formfinish} Then buffering the output to calling start(), show_element(), and finish() into the appropriate variable. Is there a better way of doing this? Rob Hutton Web Safe www.wsafe.com ********************************************************************** Introducing Symantec Client Security - Integrated Anti-Virus, Firewall, and Intrusion Detection for the Client. Learn more: http://enterprisesecurity.symantec.com/symes238.cfm?JID=2&PID=11624271 |
From: Rob H. <rob...@ws...> - 2002-10-31 14:21:39
|
The more I think about this, the less I agree, because I think that auth logic was/is flawed. But attached is a version that I think will drop in. IMHO, auth should have a definite structure. It should not be something where this and that gets tried until something happens to work. And in the case of registration, you could type an existing user name and password and get in. And that is not acceptable on a site that deals with credit cards, or business presentation, or a lot of things. I don't agree with the way that registration is implemented in PHPSlash because it could be used on a business site and someone could fairly easily do something to defame the business by finding a loophole in the auth logic. Thanks, Rob Hutton Web Safe www.wsafe.com > -----Original Message----- > From: Giancarlo Pinerolo [mailto:gia...@na...] > Sent: Wednesday, October 30, 2002 1:59 PM > To: rob...@ws... > Subject: Re: [Phplib-users] auth url question > > > Rob Hutton wrote: > > > > It is partially fixed in session.inc, but not in session4.inc which I am > > using. > > session.inc (session3), always used HTTP_SERVER_VARS[QUERY_STRING]. > I am sure session4 in snapshot has been fixed too quite some time ago. > The one I've downloded just now has (20021022.dev). > > I think the sanpshot is a delicate balance of compromises that > actually works on phplib native sessions too (session3) and can be > used as a drop-in replacement that will work in most existing sites, > except (probably, but may be not true) on PHP3 sites. And (if we want > to) to accomplish this goal we have to provide for those sites that > used to implement login_if() in their pages. > > Gian > > > > |
From: Marko K. <M.K...@os...> - 2002-10-31 14:10:48
|
Hi Benjamin > but there must be a other way to handle it. I know when i turn > warnings of the dont appear but is this a good type of programming to > ignore warnings ? > > i think there must be a other solution to handle this ;) Concerning oohforms.inc I once made a similar comment, because it produces alot of warnings with the latest PHP releases! It's old code and implemented at times when obviously weren't so many warning messages thrown out by PHP itself. The only way to avoid this is to reimplement or improove oohforms! Another way, which I currently use is to temporally set the error handling to a level where error notices are simply disabled and switch back to the original state if the oohforms access is finished. You should use error_reporting(E_ERROR), since you had warnings. See the manual! Marko |
From: Benjamin H. <ho...@eu...> - 2002-10-31 13:44:19
|
but there must be a other way to handle it. I know when i turn warnings of the dont appear but is this a good type = of programming to ignore warnings ? i think there must be a other solution to handle this ;) > ---------- > From: Bj> =F6rn Schotte[SMTP:bj...@ba...] > Sent: 31 October 2002 14:25 > To: 'Php...@li...' > Subject: Re: [Phplib-users] How to validate a oohform with js ? >=20 > * Benjamin Hoft wrote: > > Warning: Variable passed to reset() is not an array or object in = /var/www/html/php/of_text.inc on line 73 > > any suggestions why this happens ? >=20 > *sigh* because your PHP installation has warnings set to ON. >=20 > --=20 > 35 Kundenportale mit mehreren tausend Nutzern erstellen. > Bei geringen Kosten und einer gro=DFen Anzahl an Modulen > (DMS, CMS, CRM, Community-Funktionen). Wie das geht? > =3D> http://testthesystem.com/ * te...@th... >=20 >=20 > ------------------------------------------------------- > This sf.net email is sponsored by: Influence the future=20 > of Java(TM) technology. Join the Java Community=20 > Process(SM) (JCP(SM)) program now.=20 > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users >=20 |
From: S. <bj...@ba...> - 2002-10-31 13:25:21
|
* Benjamin Hoft wrote: > Warning: Variable passed to reset() is not an array or object in /var/www/html/php/of_text.inc on line 73 > any suggestions why this happens ? *sigh* because your PHP installation has warnings set to ON. -- 35 Kundenportale mit mehreren tausend Nutzern erstellen. Bei geringen Kosten und einer großen Anzahl an Modulen (DMS, CMS, CRM, Community-Funktionen). Wie das geht? => http://testthesystem.com/ * te...@th... |
From: Benjamin H. <ho...@eu...> - 2002-10-31 13:15:34
|
hmm the validation works but i have another problem :( Warning: Variable passed to reset() is not an array or object in = /var/www/html/php/of_text.inc on line 73 Warning: Variable passed to each() is not an array or object in = /var/www/html/php/of_text.inc on line 74 this happens when i enter a javascript Name if i make no javascript = validation everything works fine. i tested it with "phplib-0.74.20021008.patches" and the version 7.4 = only the line number differs Warning: Variable passed to reset() is not an array or object in = /var/www/html/php/of_text.inc on line 67 Warning: Variable passed to each() is not an array or object in = /var/www/html/php/of_text.inc on line 68 with version 7.4=20 it=B4s these two lines=20 reset($ndx_array); while (list($k, $n) =3D each($ndx_array)) { any suggestions why this happens ? is it possible that i use javascript validation with template=B4s ? hmm maybe someone know=B4s the answer best regards Benjamin=20 > ---------- > From: Taylor, Stewart[SMTP:Ste...@uk...] > Sent: 30 October 2002 16:49 > To: 'Benjamin Hoft' > Cc: 'Php...@li...' > Subject: RE: [Phplib-users] How to validate a oohform with js ? >=20 > $f =3D new form; >=20 > $f->add_element(.... > ... >=20 > =20 > $f->start("MyFunction","POST","index.php","","FormName"); > ^^^^ This parameter specifies that you > want to create a form onsubmit javascript function. > ... >=20 > $f->finsh("", > " > if (f.input1.value=3D=3D'' && f.input2.value=3D=3D'') > { > alert('your message'); > return false; > } > " > ); >=20 > Use the finish function to put none phplib generated code into the = onsubmit > function. > i.e. function finish($after, $before) >=20 > Therefore, the above call will add onsubmit attribute to the form tag >=20 > <FORM ......."onsubmit"=3D"return MyFunction_Validator(this)"> > ... >=20 >=20 > And generate the javascript function code. > <SCRIPT> > function MyFunction_Validator(f) > { > // $before > if (f.input1.value=3D=3D'' && f.input2.value=3D=3D'') > { > alert('your message'); > return false; > } >=20 > phplib generated javascript code > =20 > =20 > // $after > =20 > ... > } > </SCRIPT> > ... >=20 >=20 >=20 >=20 > -Stewart >=20 > -----Original Message----- > From: Benjamin Hoft [mailto:ho...@eu...] > Sent: 30 October 2002 15:27 > To: 'Php...@li...' > Subject: [Phplib-users] How to validate a oohform with js ? >=20 >=20 > How can i validate if either one or the other of two textfields (or = both) > is being fillied with some sort of text ? >=20 > normally i would use js with a script like this: >=20 > <SCRIPT> > function validate() > { > if (document.form.input1.value=3D=3D"" && > document.form.input2.value=3D=3D"") > { > alert ("please insert some text in one of the input fields"); > } > else > { > document.form.submit(); > } > } > </SCRIPT> >=20 > and use this function on a link >=20 > <a href=3D"javascript:Validate();">submit</a> >=20 > but how can i do that with phplib, with oohforms and templates ? >=20 > i couly only validate both fields if they are empty, but what if only = one > must be entered with text ? >=20 >=20 > best regards Benjamin >=20 >=20 > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users >=20 |
From: Marko K. <M.K...@os...> - 2002-10-31 09:33:52
|
Hi, the following removes even doubled ampersands following the parameter test and wipes it and its value away, leaving the rest of the string untouched: ---snip--- ***script start*** <?php $a='url?test=testen&&test2=test2en&'; echo "Rewrote:".ereg_replace("([?&])test=[^&]*&*", "\\1",$a)."\n"; ?> ***script end*** ***script output start*** X-Powered-By: PHP/4.1.1 Content-type: text/html Rewrote:url?test2=test2en& ***script output end*** ---snip--- Marko |