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
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
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
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
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
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 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
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'], $_
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
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
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
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
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
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
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
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
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 =
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
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
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
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
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=
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
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
> 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";
###
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
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
"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
-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
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
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
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
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
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
101 - 134 of 134 matches
Mail list logo