[PHP] is_a() against instanceof

2005-03-15 Thread Eli
Hi, PHP5 uses the 'instanceof' keyword instead of the deprecated is_a() function. But there's a big difference between the two: - is_a($cls,"ClassName") *doesn't require* from ClassName to be declared, and return false when ClassName is not declared. - ($cls instanceof ClassName) *requires* fro

[PHP] Re: Calling a function from the parent class

2005-03-15 Thread Jason Barnett
Eli wrote: ... > How can I call func() of class A from $cls object (that when I call > func() it will echo "A" and not "B")? > ... func(); /** Produces A as expected If you don't need $this in your function A::func then this is the best way to go. */ A::func(); /** Produces A, as expected */ $met

[PHP] Re: is_a() against instanceof

2005-03-15 Thread Jason Barnett
Eli wrote: ... > - is_a($cls,"ClassName") *doesn't require* from ClassName to be > declared, and return false when ClassName is not declared. ... Try is_subclass_of() http://php.net/manual/en/function.is-subclass-of.php -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-quest

[PHP] Re: Update db with $_POST

2005-03-15 Thread Jason Barnett
Danny Brow wrote: > Thanks for looking, > > I figured it out, after RTFM for db, I found that I needed to do field=? > instead of using VALUES (). > > > > Example: > > $db->query('UPDATE items SET item_name=?, item_desc=?, item_price=?, > extraprice=? WHERE item_id = 3', > array($_POS

Re: [PHP] How to call a function from $classname

2005-03-15 Thread Jochem Maas
Colin Ross wrote: under PHP5 at least, you should only be able to use $Class::method for public methods with a class, correct? there is a reason the class is called Test. say it slowly. let it sink in... ;-) basically write a test class and play with it, e.g: class Test { public static functio

Re: [PHP] Re: PHP-CLI Debugging Question

2005-03-15 Thread Jason Barnett
Jochem Maas wrote: > Jason Barnett wrote: > >> Davy Durham wrote: >> >>> No, I was looking for php to print each line of the code as it >>> executes it. >>> >> >> >> In that case, you want ob_implicit_flush() >> >> http://php.net/manual/en/function.ob-implicit-flush.php > > > I think he is looking

[PHP] Re: recommending a PHP book?

2005-03-15 Thread Jeremiah Fisher
"PHP 5 Power Programming" by Andi Gutmans, Stig Bakken, and Derick Rethans may be worth the read for you. It doesn't mention an MVC, but they do talk a little about patterns in PHP. However, you probably won't find much in-depth coverage of patterns in PHP. There are alot of good books written

[PHP] RE: Update db with $_POST

2005-03-15 Thread Danny Brow
Thanks for looking, I figured it out, after RTFM for db, I found that I needed to do field=? instead of using VALUES (). Example: $db->query('UPDATE items SET item_name=?, item_desc=?, item_price=?, extraprice=? WHERE item_id = 3', array($_POST['title'], $_POST['description'], $_

[PHP] opendir

2005-03-15 Thread Steve Buehler
So that I could use the opendir feature with an ftp url, I downloaded php-5.0.3 and used the following to make the cgi version: ./configure --enable-ftp make cp ./sapi/cgi/php /root Here is my script: start of script /root/z.php #!/root/php ftp://login:[EMAIL PROTECTED]/SHARE1/')) { ech

[PHP] Re: Can I use ftp_put to bypass upload_max_filesize?

2005-03-15 Thread Eli
Sed wrote: Is it somehow possible, to use ftp_put to upload a file bigger than the upload_max_filesize is set in the php.ini? (eg. upload 100Mb while upload_max_filesize is set to 16MB) You will have also to consider the browser's timeout limit. Uploading a 100MB file via HTTP POST will probably t

Re: [PHP] Re: PHP-CLI Debugging Question

2005-03-15 Thread Jochem Maas
Jason Barnett wrote: Davy Durham wrote: No, I was looking for php to print each line of the code as it executes it. In that case, you want ob_implicit_flush() http://php.net/manual/en/function.ob-implicit-flush.php I think he is looking to print out the actual line of sourcecode that are being run

[PHP] Update db with $_POST

2005-03-15 Thread Danny Brow
I'm trying to update some form data with this db update query and it's not working, I'm not getting an error either. $db->query("UPDATE items SET item_name = $_POST[title], item_desc = $_POST[description], item_price = $_POST[price], extraprice = $_POST[extraprice] WHERE item_id = 3"); & I've t

[PHP] Calling a function from the parent class

2005-03-15 Thread Eli
Hi, func(); //echo: B ?> How can I call func() of class A from $cls object (that when I call func() it will echo "A" and not "B")? Changing functions names or declaring another function in class B that will call parent::func() are not good for me. -thanks, Eli -- PHP General Mailing List (http

Re: [PHP] Can I use ftp_put to bypass upload_max_filesize?

2005-03-15 Thread Vidyut Luther
I don't think so. Considering you won't be able to initiate an ftp connection via a form.you could write some rpc type thing to do it, but it'd be more work than just changing your .ini setting. -- Vidyut Luther http://www.phpcult.com/ SED wrote: I have been thinking about a way to upload a fil

[PHP] if table not exists

2005-03-15 Thread John Taylor-Johnston
How do I get PHP to create a table, if one does not already exist? I have to do something with: $news = mysql_query($sql) or die(print mysql_error()); What can I also add something to $sql? $sql = "if not exists CREATE TABLE `demo_assignment1` ... John snip $server = "local

Re: [PHP] php compiler

2005-03-15 Thread Manuel Lemos
Hello, on 03/15/2005 03:05 AM Warren Vail said the following: I could be wrong, but I believe that all the Java apps out there are not native binary machine code either? unless you count the JRE (Java Runtime Environment). Seems to me that is the way things are today, with JRE's all having "run t

Re: [PHP] if table not exists

2005-03-15 Thread Steve Buehler
http://dev.mysql.com/doc/mysql/en/create-table.html At 03:29 PM 3/15/2005, John Taylor-Johnston wrote: How do I get PHP to create a table, if one does not already exist? I have to do something with: $news = mysql_query($sql) or die(print mysql_error()); What can I also add something to $sql? $sql =

Re: [PHP] Re: bulk emailer

2005-03-15 Thread Manuel Lemos
Hello, on 03/14/2005 07:37 PM Chris W. Parker said the following: Usually you can tell the sendmail program to just queue the messages instead of deliverying them immediately using the delivery mode switch od . If you want to see how that is done, take a look at the sendmail_message_class of this p

Re: [PHP] Re: recommending a PHP book?

2005-03-15 Thread Matt Zandstra
As the author, I'm precluded from _recommending_ my book 'PHP 5 Objects Patterns and Practice'. Nevertheless it does cover design patterns in general and enterprise patterns in particular, so it's relevant to the thread. http://www.amazon.com/exec/obidos/tg/detail/-/1590593804 It's worth taking

[PHP] Re: is_a() against instanceof

2005-03-15 Thread Eli
Jason Barnett wrote: Eli wrote: ... - is_a($cls,"ClassName") *doesn't require* from ClassName to be declared, and return false when ClassName is not declared. ... Try is_subclass_of() http://php.net/manual/en/function.is-subclass-of.php is_subclass_of() is not exactly like is_a(), in that it will

Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-15 Thread Brian
session_write_close() is also nice in that freeing the lock doesn't destroy your existing copy of the session variables, you can still use them in the rest of your script just remember that they exist in your current script as they were when you called session_start(), even if some other script mod

Re: [PHP] Re: Update db with $_POST

2005-03-15 Thread Danny Brow
On Tue, 2005-03-15 at 18:45 -0500, Jason Barnett wrote: > Danny Brow wrote: > > Thanks for looking, > > > > I figured it out, after RTFM for db, I found that I needed to do field=? > > instead of using VALUES (). > > > > > > > > Example: > > > > $db->query('UPDATE items SET item_name=?, item_desc=

RE: [PHP] Re: Can I use ftp_put to bypass upload_max_filesize?

2005-03-15 Thread SED
Are you meaning timeout limit? Not PHP script execution limit in php.ini? What I understand, the PHP script does not run until the file is uploaded to the server via POST. SED -Original Message- From: Eli [mailto:[EMAIL PROTECTED] Sent: 15. mars 2005 23:27 To: php-general@lists.php.net S

[PHP] Reading posted form variables

2005-03-15 Thread Simon Allison
Hey, I have a form which allows users to enter a message and then submits to a confirmation page which displays the submitted message, and it has a form with a hidden field which uses php to retrieve the message posted from the initial page and posts that message if the user clicks the submit b

Re: [PHP] if table not exists

2005-03-15 Thread John Taylor-Johnston
> http://dev.mysql.com/doc/mysql/en/create-table.html Thanks. Then this looks reasonable? Would anyone code it differently? # $server = "localhost"; $user = "myname"; $pass = "mypass"; $db = "mydb"; $table = "demo_assignment1"; ###

[PHP] Ad software

2005-03-15 Thread Ryan A
Hey, I am looking for a software that just lists adverts... eg: Like ebay but without the bidding Requirements are simple, so simple that i am sure something like this exists and i dont have to write it myself: 0.They must register first then... 1.offer the person to put in his ad details, a few o

Re: [PHP] Ad software

2005-03-15 Thread James Williams
Ryan A wrote: Hey, I am looking for a software that just lists adverts... eg: Like ebay but without the bidding Requirements are simple, so simple that i am sure something like this exists and i dont have to write it myself: 0.They must register first then... 1.offer the person to put in his ad det

Re: [PHP] password Boxes

2005-03-15 Thread Kevin
"Richard Lynch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Does anyone know how to change the style of password boxes so when the > > characters are entered an asterisk appears rather that a smal circle? > > > > Or is this just determed by the OS and uncangable with CSS or Jav

[PHP] Re: is_a() against instanceof

2005-03-15 Thread Christian Stadler
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Eli schrieb: > - ($cls instanceof ClassName) *requires* from ClassName to be declared, > and generates a fatal error when ClassName is not declared. How about if (class_exists('ClassName') AND $cls instanceof ClassName) { ... } Regards, Christia

Re: [PHP] Reading posted form variables

2005-03-15 Thread Ligaya Turmelle
I cheat. when I am putting something into a hidden field that will have HTML - I base64_encode it. then when the receiving page gets it I decode it. It keeps the html from accidentally showing up and "hides" it from the user. It's ugly - but effective. Simon Allison wrote: Hey, I have a

[PHP] QuickForm->process()

2005-03-15 Thread Esad Hajdarevic
Hi everyone, Shouldn't void HTML_QuickForm::process (mixed $callback [, bool $mergeFiles = TRUE]) actually return the value returned by the callback function? One example when this may be handy: if ($form->process(array(&$fb,'processForm'), false)) { //data processed (FormBuilder's processForm

[PHP] Re: Can I use ftp_put to bypass upload_max_filesize?

2005-03-15 Thread Esad Hajdarevic
I'm not sure, but using multipart encoding may help, it essentially breaks the huge file into smaller chunks. Esad Sed wrote: I have been thinking about a way to upload a file through a web-browser, bigger than the upload_max_filesize is set in the php.ini on the server. Is it somehow possible, to

Re: [PHP] if table not exists

2005-03-15 Thread Ligaya Turmelle
have you looked at the MySQL manual? http://dev.mysql.com/doc/mysql/en/create-table.html John Taylor-Johnston wrote: How do I get PHP to create a table, if one does not already exist? I have to do something with: $news = mysql_query($sql) or die(print mysql_error()); What can I also add something t

Re: [PHP] Update db with $_POST

2005-03-15 Thread Ligaya Turmelle
assuming you are using PEAR DB - $result =& $db->query("UPDATE items SET (item_name, item_desc, item_price, extraprice) VALUES (?,?,?,?) WHERE item_id = 3", array($_POST['title'], $_POST['description'], $_POST['price'], $_POST['extraprice'])); if (PEAR::isError($result)) { echo "Error: There

<    1   2