Re: [PHP] html forms class in php

2004-04-07 Thread Richard Harb
Then again you can just put the pear stuff into a subdirectory of your project site / whatever. for PHP 4 >= 4.3.0 you could have a look at: http://www.php.net/manual/en/function.set-include-path.php for older versions you can use ini_set (@see same url) I've seen it done - works just as well. Th

Re: [PHP] very large and long if statement

2004-04-07 Thread Tyler Replogle
yeah well they are really close but i add a ")" on line 3 From: "Andy B" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Subject: Re: [PHP] very large and long if statement Date: Thu, 8 Apr 2004 02:03:38 -0400 i dont see any difference in the one you wrote and the one i wrote...they seem to be exa

Re: [PHP] Exceptions and builtin functions in PHP5

2004-04-07 Thread daniel
> If I understand right, PHP5 has an exception > handling mechanism but it is only for "manual" using, i.e. > a programmer can use try/catch but only for own code. > PHP's built-in functions and functions from extensions still > use old "return value" method. Yes? > > -- > PHP General Mailing List

[PHP] html forms class in php

2004-04-07 Thread Andy B
hi yesterday i posted a msg about wanting to know if it was a good idea to write a class that created/dealt with html forms and so on... somebody told me to go look at html_quick_forms class and it looks good like everything i would want to do but there is 1 problem: is there any classes for the s

Re: [PHP] very large and long if statement

2004-04-07 Thread Andy B
i dont see any difference in the one you wrote and the one i wrote...they seem to be exactly the same?? - Original Message - From: "Tyler Replogle" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, April 07, 2004 9:43 PM Subject: RE: [PHP] very large and lo

[PHP] Exceptions and builtin functions in PHP5

2004-04-07 Thread Tumurbaatar S.
If I understand right, PHP5 has an exception handling mechanism but it is only for "manual" using, i.e. a programmer can use try/catch but only for own code. PHP's built-in functions and functions from extensions still use old "return value" method. Yes? -- PHP General Mailing List (http://www.ph

RE: [PHP] problems with md5()

2004-04-07 Thread jdavis
On Wed, 2004-04-07 at 22:59, Chris wrote: > The second, longer, one is the correct one. > > It looks like the column you've got the password stored in is too small, it > must be 32 characters long > > Chris > On Wed, 2004-04-07 at 22:57, Jason Wong wrote: >md5() returns a 32 character string s

Re: [PHP] problems with md5()

2004-04-07 Thread Richard Harb
could it be that the field in the database is of type varchar(25) ? looks like it's too small to hold the complete hash: that one always consists of 32 characters. Thursday, April 8, 2004, 6:35:47 AM, you wrote: > hello, > I have a database containing usernames and md5 encrypted passwords. > Whe

Re: [PHP] problems with md5()

2004-04-07 Thread Jason Wong
On Thursday 08 April 2004 12:35, jdavis wrote: > hello, > I have a database containing usernames and md5 encrypted passwords. > When i use md5() to encrypt a users password recived via a form > to compare to the md5ed passwd in the database i get problems... > > for instance ... > > user foo has p

RE: [PHP] problems with md5()

2004-04-07 Thread Chris
The second, longer, one is the correct one. It looks like the column you've got the password stored in is too small, it must be 32 characters long Chris -Original Message- From: jdavis [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 07, 2004 9:36 PM To: PHP List Subject: [PHP] problems

RE: [PHP] smarty

2004-04-07 Thread Jason Sheets
Some excellent points, however Smarty makes it much easier to do certain tasks than doing it in strait PHP and Smarty is extendable with PHP both directly and indirectly, you can create Smarty modifiers and functions and if necessary write inline PHP code. Web development has an hourly cost eve

[PHP] problems with md5()

2004-04-07 Thread jdavis
hello, I have a database containing usernames and md5 encrypted passwords. When i use md5() to encrypt a users password recived via a form to compare to the md5ed passwd in the database i get problems... for instance ... user foo has passwd 'pass' 'pass' md5ed in database is this 1a1dc91c9073

Re: [PHP] smarty

2004-04-07 Thread Kelly Hallman
Apr 7 at 10:22pm, John W. Holmes wrote: > > Uhhh, yeah--that's not templating, that's called spaghetti code :) > > +1 - Use of buzzword Right about here I could sense where this was going I don't know, what would you call it? Is there a non-buzzword term you'd be happier with? That term pre

Re: [PHP] very large and long if statement

2004-04-07 Thread Richard Harb
Thursday, April 8, 2004, 3:59:39 AM, you wrote: >> I have this very large and long if statement: >> if >> (!empty($_SESSION['add']['type']) >> && !empty($_SESSION['add']['start_date'] >> && !empty($_SESSION['add']['end_date']) >> && !empty($_SESSION['add']['name']) >> && !empty($_SESSION['add

Re: [PHP] simple mysql_result() question

2004-04-07 Thread Richard Harb
Uhm .. I usually do: SELECT COUNT(id) FROM users WHERE name='$username' AND password='$password' if (username is found) // hopefully it's unique found ya else sorry This way you aleays have a value returned... HTH Richard Thursday, April 8, 2004, 3:29:11 AM, you wrote: > hello, > I am

Re: [PHP] smarty

2004-04-07 Thread Justin French
On 08/04/2004, at 11:35 AM, Kelly Hallman wrote: Apr 8 at 10:26am, Justin French wrote: PHP itself is a great templating language :) '> Uhhh, yeah--that's not a templating, that's called spaghetti code :) I fail to see the difference in complexity. Taking an example straight form the sma

Re: [PHP] PDF Page Pulling

2004-04-07 Thread Evan Nemerson
http://marc.theaimsgroup.com/?l=php-general&m=107723910931417&w=2 On Wednesday 07 April 2004 05:53 pm, Jason Sheets wrote: > I'd suggest taking a look at ghostscript it, it is available under AFPL and > GPL licenses and offers the ability to convert individual pages to jpeg or > other file format

Re: [PHP] smarty

2004-04-07 Thread Kelly Hallman
Apr 7 at 10:01pm, Robert Cummings wrote: > Smarty is a bit of a hack too... why do I need to declare my templates > within the PHP code? If I'm an HTML designer I'd like to create a new > page, include templates, use some data that's been made available and > have it all in the template. I sure as

Re: [PHP] smarty

2004-04-07 Thread John W. Holmes
Kelly Hallman wrote: Apr 8 at 10:26am, Justin French wrote: PHP itself is a great templating language :) '> Uhhh, yeah--that's not a templating, that's called spaghetti code :) +1 - Use of buzzword You get the concept. Smarty, as you know, basically takes a Smarty template and writes PH

Re: [PHP] SMS from pc to mobile phone

2004-04-07 Thread saepudin
On Wednesday 07 April 2004 10:29, saepudin wrote: > hi, > I want to send an SMS(to mobile phone etc) based on a database trigger or > on completion of an php page. the site runs on linux. > how to do this. How do i send the mobile no . what is the language, > protocol, syntax and platform. > if

Re: [PHP] smarty

2004-04-07 Thread Robert Cummings
On Wed, 2004-04-07 at 21:35, Kelly Hallman wrote: > Apr 8 at 10:26am, Justin French wrote: > > PHP itself is a great templating language :) > > > > > > > > > > > > > > '> > > > > Uhhh, yeah--that's not a templating, that's called spaghetti code :) > > You get the concept. Smarty, as you k

RE: [PHP] very large and long if statement

2004-04-07 Thread Chris de Vidal
> I have this very large and long if statement: > if > (!empty($_SESSION['add']['type']) > && !empty($_SESSION['add']['start_date'] > && !empty($_SESSION['add']['end_date']) > && !empty($_SESSION['add']['name']) > && !empty($_SESSION['add']['county']) > && !empty($_SESSION['add']['discription

RE: [PHP] Cookies

2004-04-07 Thread Tyler Replogle
yes i do but here is a really good tutorial on it http://www.phpfreaks.com/tutorials/120/0.php From: "Wykis" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: [PHP] Cookies Date: Fri, 2 Apr 2004 16:52:23 +0100 Does Any One Knows How To Set And Get Cookies? -- PHP General Mailing List (http://w

RE: [PHP] very large and long if statement

2004-04-07 Thread Tyler Replogle
hey, i don't know how to make it smaller but should it be if (!empty($_SESSION['add']['type']) && !empty($_SESSION['add']['start_date']) && !empty($_SESSION['add']['end_date']) && !empty($_SESSION['add']['name']) && !empty($_SESSION['add']['county']) && !empty($_SESSION['add']['discription']) && !e

Re: [PHP] smarty

2004-04-07 Thread Kelly Hallman
Apr 8 at 10:26am, Justin French wrote: > PHP itself is a great templating language :) > > > > > > > '> > Uhhh, yeah--that's not a templating, that's called spaghetti code :) You get the concept. Smarty, as you know, basically takes a Smarty template and writes PHP code similar to what you

[PHP] Unsubscribe!!

2004-04-07 Thread Ken Heath
Please remove me from the mailing list. Many different efforts has failed. :-( I apology to everyone who receive this message. _ Get rid of annoying pop-up ads with the new MSN Toolbar – FREE! http://toolbar.msn.com/go/onm00200414

[PHP] simple mysql_result() question

2004-04-07 Thread jdavis
hello, I am trying to authenticate users. I run this MySQL query using vars provided via a form select password from dealers where username = '$user' this works great if $user is actually a user in the database. otherwise i get this error Warning: mysql_result(): Unable to jump to row 0

Re: [PHP] Can someone with list access please remove these two?

2004-04-07 Thread Curt Zirzow
* Thus wrote Richard Davey ([EMAIL PROTECTED]): > Hi, > > Subject says it all - they're causing auto-responder junk to any list > poster and it's annoying: > > Information Desk <[EMAIL PROTECTED]> > Advance Credit Suisse Bank <[EMAIL PROTECTED]> Forwarding mail to [EMAIL PROTECTED] just gets rej

[PHP] Combining SimpleXML objects

2004-04-07 Thread Dan Phiffer
Another quickie: is there an easy way to combine SimpleXML objects? Something Like: $a = simplexml_load_string(''); $c = simplexml_load_string('Foo'); $a->b = $c->d; print_r($a); Here's what I get: Warning: It is not possible to assign complex types to nodes in D:\...\test.php on line 5 simplex

RE: [PHP] PDF Page Pulling

2004-04-07 Thread Jason Sheets
I'd suggest taking a look at ghostscript it, it is available under AFPL and GPL licenses and offers the ability to convert individual pages to jpeg or other file formats. http://www.ghostscript.com Jason -Original Message- From: Adam Voigt [mailto:[EMAIL PROTECTED] Sent: Wednesday, Ap

RE: [PHP] smarty

2004-04-07 Thread Jason Sheets
I can see your point and have used this technique in very small applications where the benefit of Smarty or other template engines are negated by the performance/resource usage overhead. However intermixing markup and PHP has introduced many problems in too many PHP projects for me to use this tec

[PHP] Re: Adding a new entry using PHP

2004-04-07 Thread Justin Patrin
Alistair Hayward wrote: Hi, I am an ASP user, now learning PHP. When adding a record in ASP, I do this: Recordset.AddNew Field1 = whatever RecordSet.Update How is this done in PHP? I have built a recordset using a query, and have all the information needed to go into the different fields, but

[PHP] Re: Password

2004-04-07 Thread Ligaya Turmelle
You have an error with your brackets. Your code looks like this if (strlen($_POST['password1']) > 0) { if ($_POST['password1'] ==($_POST['password2'] { $password = TRUE; } if (strlen($_POST['password1']) > 0) { if ($_POST['password1'] ==$_POST['passw

Re: [PHP] smarty

2004-04-07 Thread Justin French
On 07/04/2004, at 1:33 AM, Angelo Zanetti wrote: hi all has anyone used smarty before? what do you think of it? I think it's pretty nice to seperate your script (code) from your design. i would like to hear your comments and if you have any alternatives let me know. PHP itself is a great templa

[PHP] Adding a new entry using PHP

2004-04-07 Thread Alistair Hayward
Hi, I am an ASP user, now learning PHP. When adding a record in ASP, I do this: Recordset.AddNew Field1 = whatever RecordSet.Update How is this done in PHP? I have built a recordset using a query, and have all the information needed to go into the different fields, but how do I 'Edit' or 'AddN

[PHP] Re: Newbie question about operators

2004-04-07 Thread Ligaya Turmelle
it is refering to the associative array, specifically the $key => $value . Note here (http://www.php.net/manual/en/language.types.array.php). Respectfully, Ligaya Turmelle "Gabe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Looking at the code below, what exactly is happening wit

Re: [PHP] Cookies

2004-04-07 Thread Larry E . Ullman
Does Any One Knows How To Set And Get Cookies? The PHP manual is really good for stuff like this. Check out the setcookie() function. Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] path to binary for php on linux

2004-04-07 Thread Andy B
it was installed with get and which php doesnt do anything just returns to the prompt with no output - Original Message - From: "Curt Zirzow" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, April 07, 2004 8:11 PM Subject: Re: [PHP] path to binary for php on linux > * Thus w

[PHP] Cookies

2004-04-07 Thread Wykis
Does Any One Knows How To Set And Get Cookies? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: stuck with simple query..... Plz have a look

2004-04-07 Thread Ligaya Turmelle
You need to do a join. SELECT table1.ID AS PL_NAME, table1.ID AS PC_NAME, table1.ID AS PA_NAME FROM table1, table2 WHERE (table2.PL = table1.ID) AND (table2.PC = table1.ID) and (table2.PA = table1.ID) ; Or something like that. Sorry I couldn't be of more help. Respectfully, Ligaya Turmelle "T

Re: [PHP] path to binary for php on linux

2004-04-07 Thread Curt Zirzow
* Thus wrote Andy B ([EMAIL PROTECTED]): > anybody know what the exact path for the php binary on linux is? Depends on how it was installed, a common place is: /usr/local/bin/php Or you can type: which php and it will tell you where it is. Curt -- "I used to think I was indecisive, but no

[PHP] Re: APACHE

2004-04-07 Thread zerof
http://www.apache.org/foundation/mailinglists.html - zerof - "Wykis" <[EMAIL PROTECTED]> escreveu na mensagem news:[EMAIL PROTECTED] > Guys... I Think I Am In Wrong Place... But What Is Address Of Apache > Newsgroups? :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, v

[PHP] Re: stuck with simple query..... Plz have a look

2004-04-07 Thread Yayati Kasralikar
Try something like is: select a.Name as PL_Name,b.Name as PC_Name,c.Name as PA_Name from (select * from table1,table2 where table1.ID=table2.PL) a, (select * from table1,table2 where table1.ID=table2.PC) b, (select * from table1,table2 where table1.ID=table2.PA) c where a.description=b.description

[PHP] path to binary for php on linux

2004-04-07 Thread Andy B
anybody know what the exact path for the php binary on linux is? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Administrator page and password problem

2004-04-07 Thread Red Wingate
Add this into the VERY last line : [...] 0) { $name = TRUE; } else { $name = FALSE; echo 'you have forgot to enter your name'; } // check for email adress if (strlen($_POST['email']) > 0) { $email = TRUE; } else { $email = FALSE; echo 'you have forgot to enter your email adress'; }

Re: [PHP] Re: Dynamic method calling

2004-04-07 Thread Darren Beale
Justin Patrin wrote: > For member fuctions: > $a = 'nameOfMemberFunction'; > $this->$a(); Typically the only thing I didn't try thanks++ Darren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP based Voice Chat Module

2004-04-07 Thread DvDmanDT
Hmm.. I'm pretty sure you can get Flash for Mac.. -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com "Pushpinder Singh" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > Thanks Raditha, > > Yes we are primarily looking at a PHP chat module which will allow > us

[PHP] Re: Dynamic method calling

2004-04-07 Thread Justin Patrin
Darren Beale wrote: Hi I'm trying to dynamically choose and call a method from within a class but actually calling a method dynamically does not seem to work whatever I try using php 4.3.3 Hopefully this test script will illustrate my point better, I always get to the "I know we get to here"

Re: [PHP] very large and long if statement

2004-04-07 Thread Robert Cummings
On Wed, 2004-04-07 at 19:01, Justin Patrin wrote: > Robert Cummings wrote: > > > On Wed, 2004-04-07 at 18:47, Andy B wrote: > > > >>I have this very large and long if statement: > >>if > >> (!empty($_SESSION['add']['type']) > >> && !empty($_SESSION['add']['start_date'] > >> && !empty($_SESSION['a

[PHP] Dynamic method calling

2004-04-07 Thread Darren Beale
Hi I'm trying to dynamically choose and call a method from within a class but actually calling a method dynamically does not seem to work whatever I try using php 4.3.3 Hopefully this test script will illustrate my point better, I always get to the "I know we get to here" bit, but there is no

Re: [PHP] PHP based Voice Chat Module

2004-04-07 Thread DvDmanDT
That's because he post to the newsgroup, Cc to the list, and the list system automaticly sends one to you personally.. :p -- // DvDmanDT MSN: dvdmandt¤hotmail.com Mail: dvdmandt¤telia.com "Raditha Dissanayake" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > Pushpinder, 1 message

Re: [PHP] very large and long if statement

2004-04-07 Thread Justin Patrin
Robert Cummings wrote: On Wed, 2004-04-07 at 18:47, Andy B wrote: I have this very large and long if statement: if (!empty($_SESSION['add']['type']) && !empty($_SESSION['add']['start_date'] && !empty($_SESSION['add']['end_date']) && !empty($_SESSION['add']['name']) && !empty($_SESSION['add']['cou

Re: [PHP] very large and long if statement

2004-04-07 Thread Robert Cummings
On Wed, 2004-04-07 at 18:47, Andy B wrote: > I have this very large and long if statement: > if > (!empty($_SESSION['add']['type']) > && !empty($_SESSION['add']['start_date'] > && !empty($_SESSION['add']['end_date']) > && !empty($_SESSION['add']['name']) > && !empty($_SESSION['add']['county'])

[PHP] very large and long if statement

2004-04-07 Thread Andy B
I have this very large and long if statement: if (!empty($_SESSION['add']['type']) && !empty($_SESSION['add']['start_date'] && !empty($_SESSION['add']['end_date']) && !empty($_SESSION['add']['name']) && !empty($_SESSION['add']['county']) && !empty($_SESSION['add']['discription']) && !empty($

Re: [PHP] confused big time

2004-04-07 Thread Andy B
- Original Message - From: "Chris W. Parker" <[EMAIL PROTECTED]> To: "Andy B" <[EMAIL PROTECTED]> Sent: Wednesday, April 07, 2004 6:30 PM Subject: RE: [PHP] confused big time Andy B on Wednesday, April 07, 2004 2:09 PM said: >> yes you can absolutely do i

[PHP] Re: Administrator page and password problem

2004-04-07 Thread Erik Gjertsen
Thanks for help Red. Cut and past is not always wok But I have a new problem in the last line. I don't understand why it's problem here Thanks Erik Gjertsen http://www.w3.org/TR/html4/loose.dtd";> http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"> Black PHP script 0) { $name = TRUE;

[PHP] Re: Administrator page and password problem

2004-04-07 Thread Erik Gjertsen
Thanks for help Red. Cut and past is not always work But I got a new problem in the last line. I don't understand watt the problem is here Thanks Erik Gjertsen "Erik Gjertsen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I try to made a administrator page that I need to writ user

Re: [PHP] assigning NULL to a variable

2004-04-07 Thread Justin Patrin
Marek Kilimajer wrote: William Lovaton wrote: El mar, 06-04-2004 a las 07:41, Marek Kilimajer escribió: Andy B wrote: how would you assign NULL to a variable if its original value is ""? otherwise leave it with its value... if($var === '') $var = NULL; what about: if ($var == '') unset($v

Re: [PHP] assigning NULL to a variable

2004-04-07 Thread Marek Kilimajer
William Lovaton wrote: El mar, 06-04-2004 a las 07:41, Marek Kilimajer escribió: Andy B wrote: how would you assign NULL to a variable if its original value is ""? otherwise leave it with its value... if($var === '') $var = NULL; what about: if ($var == '') unset($var); No - NULL is not the s

Re: [PHP] Validating form field text input to be a specificvariable type

2004-04-07 Thread William Lovaton
Red, Chris, Good advice, I rarely have to use it, though. -William El mi? 07-04-2004 a las 16:44, Chris Shiflett escribió: > --- William Lovaton <[EMAIL PROTECTED]> wrote: > > Yeah, sometimes this is an annoying problem with PHP. Somehow, "", > > null, 0 and "0" is the same thing. > > You ca

Re: [PHP] Re: session_exist() ?? Can this be done?

2004-04-07 Thread Jochem Maas
Jochem Maas wrote: for those who haven't yet read it: I meant to add a link above to a tutorial (which I later decided was rubbish!) - it was not meant to be some strange 'dis' to Monty. BTW: if Monty is the Monty from Smarty fame: good on ya! :-) Monty wrote: Hi Red... Actually, I have my si

Re: [PHP] Re: Can someone with list access please remove these two?

2004-04-07 Thread Red Wingate
yep William Lovaton wrote: me too! -William El mi? 07-04-2004 a las 16:44, Justin Patrin escribió: Richard Davey wrote: Hi, Subject says it all - they're causing auto-responder junk to any list poster and it's annoying: Information Desk <[EMAIL PROTECTED]> Advance Credit Suisse Bank <[EMAIL

Re: [PHP] Re: Can someone with list access please remove these two?

2004-04-07 Thread William Lovaton
me too! -William El mi? 07-04-2004 a las 16:44, Justin Patrin escribió: > Richard Davey wrote: > > Hi, > > > > Subject says it all - they're causing auto-responder junk to any list > > poster and it's annoying: > > > > Information Desk <[EMAIL PROTECTED]> > > Advance Credit Suisse Bank <[EMAIL

[PHP] Re: Hinding URL

2004-04-07 Thread Wykis
You Can try -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: writing a class in php to print form elements

2004-04-07 Thread Justin Patrin
Andy B wrote: hi... is it totally usefull/reasonable to write a class in php that prints different different form elements in html... i.e. inputs, buttons, drop downs, multi selects and son? that way (at least i think) then it would be easier to change the element attributes dynamically... Sure i

Re: [PHP] Validating form field text input to be a specificvariable type

2004-04-07 Thread Chris Shiflett
--- William Lovaton <[EMAIL PROTECTED]> wrote: > Yeah, sometimes this is an annoying problem with PHP. Somehow, "", > null, 0 and "0" is the same thing. You can always use === if you don't want it to cast. Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming Fa

[PHP] Re: Can someone with list access please remove these two?

2004-04-07 Thread Justin Patrin
Richard Davey wrote: Hi, Subject says it all - they're causing auto-responder junk to any list poster and it's annoying: Information Desk <[EMAIL PROTECTED]> Advance Credit Suisse Bank <[EMAIL PROTECTED]> I second the motion! -- paperCrane -- PHP General Mailing List (http://www.php.net/) To uns

Re: [PHP] Validating form field text input to be a specificvariable type

2004-04-07 Thread Red Wingate
They are typecasted to match the current contexts needs - often a problem but even - but this is one of PHPs strenghs :-) -- red William Lovaton wrote: Yeah, sometimes this is an annoying problem with PHP. Somehow, "", null, 0 and "0" is the same thing. The last two are considered empty() too

[PHP] Password

2004-04-07 Thread Erik Gjertsen
I try to made a administrator page that I need to writ user name and password. But I have problem with the password. There comes one error where I writ 1..(one) I have not made a table on MySql but in the book I read it scowl work. Can some one tell me why it not work. Here is the code: 0) { $

Re: [PHP] Validating form field text input to be a specificvariable type

2004-04-07 Thread William Lovaton
Yeah, sometimes this is an annoying problem with PHP. Somehow, "", null, 0 and "0" is the same thing. The last two are considered empty() too. -William El mi? 07-04-2004 a las 16:34, Red Wingate escribió: > JFYI : > > var_dump ( '' == 0 ) eq TRUE > > William Lovaton wrote: > > > I don't t

Re: [PHP] Administrator page and password problem

2004-04-07 Thread Red Wingate
You mixed up here a little :-) [...] > if (strlen($_POST['password1']) > 0) { > if ($_POST['password1'] == >($_POST['password2'] { > 1. $password = TRUE; > > } else { > $password = FALSE; > echo '' > } > } else { > $password = FALSE; >

[PHP] writing a class in php to print form elements

2004-04-07 Thread Andy B
hi... is it totally usefull/reasonable to write a class in php that prints different different form elements in html... i.e. inputs, buttons, drop downs, multi selects and son? that way (at least i think) then it would be easier to change the element attributes dynamically... -- PHP General Mai

[PHP] Administrator page and password problem

2004-04-07 Thread Erik Gjertsen
I try to made a administrator page that I need to writ user name and password. But I have problem with the password. There comes one error where I writ 1..(one) I have not made a table on MySql but in the book I read it scowl work. Can some one tell me why it not work. Here is the code: 0) { $

Re: [PHP] Validating form field text input to be a specificvariable type

2004-04-07 Thread Red Wingate
JFYI : var_dump ( '' == 0 ) eq TRUE William Lovaton wrote: I don't think so, Wouldn't be better if ctype_digit() return false on an empty string?? any way an empty string is not a digit. This change will brake backward compatibility so it is not an option. if you look carefully the function th

Re: [PHP] Validating form field text input to be a specificvariable type

2004-04-07 Thread William Lovaton
I don't think so, Wouldn't be better if ctype_digit() return false on an empty string?? any way an empty string is not a digit. This change will brake backward compatibility so it is not an option. if you look carefully the function that you propose is doing two things at once... at this level t

Re: [PHP] Newbie question about operators

2004-04-07 Thread Red Wingate
arrays :-) you are defining arrays like: $x = array ( 'a' => 'Apple' , 'b' => 'Banana' , ... ); -- red Gabe wrote: Thanks for the page. That was helpful. Just to make sure, is that operator only typically used then with foreach loops and arrays? "Matt Matijevich" <[EMAIL PROTECTED]> wrote i

Re: [PHP] Newbie question about operators

2004-04-07 Thread Gabe
Thanks for the page. That was helpful. Just to make sure, is that operator only typically used then with foreach loops and arrays? "Matt Matijevich" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [snip] > foreach ($some_array as $name=>$value) > { > ... some code ... > } > [/sni

Re: [PHP] OOP Question

2004-04-07 Thread Robert Cummings
On Wed, 2004-04-07 at 17:07, Richard Lewis wrote: > What do members think that this code should do: > > class A > { > var $a, $b; > function A($a) > { > $this->$a = $a; > } > function prnt() > { > echo "a=" . $this->$a; > } > } > > class B extends A > { > function B($a, $b

[PHP] APACHE

2004-04-07 Thread Wykis
Guys... I Think I Am In Wrong Place... But What Is Address Of Apache Newsgroups? :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP OO concepts

2004-04-07 Thread Red Wingate
You will find some usefull ressources over at http://www.phppatterns.com/ -- red Robert Cummings wrote: [...] Hello, I have am checking out PHP OOP and it's pretty smooth. I have a decent amount of Java experience so PHP OOP is really easy to pick up. However I have a few questions I was hop

Re: [PHP] Newbie question about operators

2004-04-07 Thread Matt Matijevich
[snip] foreach ($some_array as $name=>$value) { ... some code ... } [/snip] http://www.php.net/foreach will give you a good explanation. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP 5: SimpleXML attributes

2004-04-07 Thread Red Wingate
Guess it was quite luck i saw the little note in the documentation: Note: SimpleXML has made a rule of adding iterative properties to most methods. They cannot be viewed using var_dump() or anything else which can examine objects. Guess i will have to take a look at my config parser again :-)

[PHP] Newbie question about operators

2004-04-07 Thread Gabe
Looking at the code below, what exactly is happening with the $name=>$value part? I looked in the PHP online documentation and I can't find that operator. What is it doing exactly and what is it called? foreach ($some_array as $name=>$value) { ... some code ... } Thanks alot! -- PHP General

Re: [PHP] PHP 5: SimpleXML attributes

2004-04-07 Thread Dan Phiffer
Red Wingate wrote: So, this one will work out quite well ( maybe one should take a look at the documentation of attributes() :-) Wow I can't believe I missed that. Hehe. I guess the lesson here is don't always trust what you get from print_r(). Thanks for the responses, -Dan foreach ( $xml->lib

[PHP] OOP Question

2004-04-07 Thread Richard Lewis
What do members think that this code should do: class A { var $a, $b; function A($a) { $this->$a = $a; } function prnt() { echo "a=" . $this->$a; } } class B extends A { function B($a, $b) { parent::A($a); $this->$b = $b; } function prnt() { parent::prn

Re: [PHP] PHP OO concepts

2004-04-07 Thread Robert Cummings
On Wed, 2004-04-07 at 16:44, jdavis wrote: > Hello, > > I have am checking out PHP OOP and it's pretty smooth. I have a decent > amount of Java experience so PHP OOP is really easy > to pick up. However I have a few questions I was hoping someone > could help me with. > > Can php have a main()

Re: [PHP] PHP 5: SimpleXML attributes

2004-04-07 Thread Red Wingate
So, this one will work out quite well ( maybe one should take a look at the documentation of attributes() :-) foreach ( $xml->lib_error->param AS $param ) { $n = 0 ; while ( is_object ( $xml->lib_error->param[$n] ) ) { foreach( $xml->lib_error->param[$n]->attributes() AS $a => $b ){

Re: [PHP] PHP 5: SimpleXML attributes

2004-04-07 Thread Dan Phiffer
John W. Holmes wrote: Have you seen Example 4 here: http://us2.php.net/manual/en/ref.simplexml.php Not sure if that helps or not, though, but it looks like it's already an associative array. It certainly looks like an associative array, but the array_keys() function chokes on it: Warning: array

[PHP] PHP OO concepts

2004-04-07 Thread jdavis
Hello, I have am checking out PHP OOP and it's pretty smooth. I have a decent amount of Java experience so PHP OOP is really easy to pick up. However I have a few questions I was hoping someone could help me with. Can php have a main()? If not ... how to you start a program that is purley PHP

Re: [PHP] PHP 5: SimpleXML attributes

2004-04-07 Thread Dan Phiffer
Red Wingate wrote: FALSE > $xml = simplexml_load_file( 'config.xml' ); foreach ( $xml->lib_error->param AS $id => $param ) { echo $param['name'] ; // will output 'boolean' ! } I think you mean that would output 'error_logfile_write'. However, what I'm asking is i

Re: [PHP] radio buttons checked or not

2004-04-07 Thread Andy B
- Original Message - From: "Daniel Clark" <[EMAIL PROTECTED]> To: "Andy B" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, April 07, 2004 4:22 PM Subject: Re: [PHP] radio buttons checked or not > My understanding is if the variable "exists" then the radio button was > check

Re: [PHP] PHP 5: SimpleXML attributes

2004-04-07 Thread John W. Holmes
From: "Dan Phiffer" <[EMAIL PROTECTED]> > I have what I hope to be a simple question about SimpleXML. Is it > possible to get the attributes of a SimpleXML node as an associative array? > > Consider the following: > > $sxe = simplexml_load_string(''); > print_r($sxe->attributes()); > // Gives: si

Re: [PHP] radio buttons checked or not

2004-04-07 Thread Daniel Clark
My understanding is if the variable "exists" then the radio button was checked. > i have this code: > > accesskey="y">Yes > > accesskey="n">No > was just wondering if that was the right way to determine the state of a > radio button...? > if the value of $old['Type']="Annual" then the yes but

Re: [PHP] PHP 5: SimpleXML attributes

2004-04-07 Thread Red Wingate
There is a way, but somehow i don't like it though ( but you can find this in the documentation ): This is config.xml: FALSE And my Testfile: $xml = simplexml_load_file( 'config.xml' ); foreach ( $xml->lib_error->param AS $id => $param ) { echo $param['name'] ; /

[PHP] PHP 5: SimpleXML attributes

2004-04-07 Thread Dan Phiffer
Hello, I have what I hope to be a simple question about SimpleXML. Is it possible to get the attributes of a SimpleXML node as an associative array? Consider the following: '); print_r($sxe->attributes()); // Gives: simplexml_element Object ( [0] => value ) ?> Is there some way to find out that

[PHP] creating sql statements?? was:confused big time

2004-04-07 Thread Andy B
> I always found this way of inserting data into a database messy. Here is > a handy function to do array inserts and it builds the sql for you. > > function arrayINSERT($a,$tablename) > { > $sql = "INSERT INTO $tablename ("; > foreach($a as $key => $value) > { > $sql .= $key .","; > } > $sql[strle

Re: [PHP] update mysql from php web page

2004-04-07 Thread Daniel Clark
Something I like to do during troubleshooting is to have the page display the SQL statement I'm processing. Something like: print sql_query ; That was I can verify all the parameters are correct. Do you have autocommit ON? Or need to pass a commit statement? Daniel Clark > Of course, I d

Re: [PHP] smarty

2004-04-07 Thread John W. Holmes
From: "Chris de Vidal" <[EMAIL PROTECTED]> > Or are you saying: > $pt = new MyPage; > $pt->render('contact.tpl'); > OR > $pt = new MyPage; > $pt ->render('prices.tpl'); > OR > $pt = new MyPage; > $pt->render('index.tpl'); > > I can see the benefit of this method if that's what you mean. That's w

Re: [PHP] smarty

2004-04-07 Thread Jochem Maas
Chris W. Parker wrote: Chris de Vidal on Tuesday, April 06, 2004 11:43 AM said: I could have put a tag in the template like {bio} but that'd mean maintaining HTML in the PHP code which I wanted to avoid (left the "prettyness" to the Front Page developer). Instead, I

Re: [PHP] update mysql from php web page

2004-04-07 Thread Chip Wiegand
"Daniel Clark" <[EMAIL PROTECTED]> wrote on 04/07/2004 10:17:36 AM: > For the submit button to work it has to be in a form. > > > > > > Hope this helps. > > Daniel Clark Of course, I didn't notice I left that line out of my code, although I did remember to put in the closing form tag. B

  1   2   >