OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: php-general-digest-helplists.php.net
Date: Thu Oct 18 2001 - 14:19:21 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    php-general Digest 18 Oct 2001 19:19:21 -0000 Issue 942

    Topics (messages 71445 through 71521):

    authentifiaction http and php
            71445 by: fincom

    dbm manage
            71446 by: fincom

    How-to put something at bottom of page
            71447 by: Jean-Christian Imbeault
            71449 by: Rudi Ahkers
            71453 by: Richard Baskett
            71458 by: Jean-Christian Imbeault
            71459 by: Richard Baskett

    Performance question
            71448 by: Fredrik Wahlberg
            71451 by: Rasmus Lerdorf

    Create A New File
            71450 by: Mark Lo
            71452 by: Rasmus Lerdorf
            71454 by: Mark Lo
            71455 by: Rasmus Lerdorf
            71456 by: Mark Lo

    FREE S E X O 20935
            71457 by: hagstime23.aol.com
            71495 by: The Doctor

    PHP/MySQL speed
            71460 by: anders nawroth

    Variable & Configuration Problem
            71461 by: Patrick Quaedackers

    IMAP Question
            71462 by: Valentin V. Petruchek
            71493 by: Valentin V. Petruchek
            71498 by: DL Neil

    !!! URGENT [PHP] php mail() function Problem
            71463 by: Simos Varelakis

    Re: Object and reference problem
            71464 by: SafeV
            71477 by: SafeV

    Re: executing script at specified time
            71465 by: Mike Payson
            71480 by: DL Neil

    Another [PHP] Simple Session Problem...
            71466 by: Brian Aitken
            71467 by: Dave Watkinson
            71473 by: Rudolf Visagie
            71474 by: Rudolf Visagie
            71476 by: Dave Watkinson
            71487 by: Rudolf Visagie

    erratic escaping backslashes in all PHP output on the whole system
            71468 by: Joerg Dechert

    Re: zip_open in 4.0.6 ?
            71469 by: Christian C.
            71475 by: Ilya V. Lazarev

    file upload problem
            71470 by: Brian Aitken
            71478 by: SafeV

    PDF Download / View
            71471 by: Ville Mattila
            71481 by: SafeV

    Web portals
            71472 by: veber.ptt.yu

    Always running script
            71479 by: Ville Mattila
            71482 by: SafeV

    Re: domxml
            71483 by: Arpad Tamas

    class problems
            71484 by: Matt Williams
            71488 by: Valentin V. Petruchek
            71489 by: Matt Williams
            71491 by: Valentin V. Petruchek

    Re: [PHP-DB] LDAP multiple actions in modify?
            71485 by: Derek Mailer

    Re: Create a list of links
            71486 by: Tim

    Help, please!
            71490 by: Valentin V. Petruchek
            71501 by: Papp Gyozo

    PHP 4.0.6 & Mysql 4.0
            71492 by: Jeroen Geusebroek

    Annotated PHP Manual
            71494 by: Khalid Hazmi

    Re: Header() don't work
            71496 by: Web user

    Spam messages (Was: FREE S E X O
            71497 by: Carl W. Brown
            71499 by: Sam Masiello
            71500 by: Jon Farmer
            71507 by: Jeroen Geusebroek
            71510 by: Jon Farmer

    MySQL query
            71502 by: Srinivasan Ramakrishnan
            71504 by: Dave Watkinson

    remembering variables between pages when using forms ...
            71503 by: baker downloads
            71505 by: Dave Watkinson
            71506 by: baker downloads
            71509 by: Dave Watkinson

    parsing a string
            71508 by: John A. Grant
            71511 by: Jason G.
            71512 by: DL Neil
            71513 by: Mike Eheler
            71515 by: James, Yz

    PHP Filesystem functions/reference table
            71514 by: DL Neil

    urlencode() and rawurlencode()
            71516 by: Olexandr Vynnychenko

    Re: Download Function in PHP
            71517 by: ArsenKirillov

    Multidimensional Array...
            71518 by: Roy van Pelt

    slashes and quotes
            71519 by: Peter
            71520 by: Richard Baskett

    Auto-Stretch and the BACK - FORWARD buttons -- HELP!
            71521 by: Jason Caldwell

    Administrivia:

    To subscribe to the digest, e-mail:
            php-general-digest-subscribelists.php.net

    To unsubscribe from the digest, e-mail:
            php-general-digest-unsubscribelists.php.net

    To post to the list, e-mail:
            php-generallists.php.net

    ----------------------------------------------------------------------

    attached mail follows:


    Hi,

    Is it possible to use the authentification http using apache's dbm module
    (yes i know that :-)), using an form's to send the user's name and password
    to apache ?

    Thanks

    attached mail follows:


    hi,

    does anyone had developped an equivalent php script to the "dbmmanage"
    perl's script delivred with apache.

    thanks

    attached mail follows:


    I'm not sure if this is a PHP or HTML question but can anyone tell me of a
    way to place an image or text at the bottom of a browser window?

    I have some pages that have only a bit of text and when I place my footer on
    that page I would like it to line up nicely with the bottom of the browser
    window. Right now my footer appears wherever the text on my page finished
    ...

    Thanks!

    Jc

    _________________________________________________________________
    Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

    attached mail follows:


    You can use frames for that. Create a frame, say index.html, and then two
    pages, one for the footer, and one for the other pages which will load
    inside the frameset. Look at http://www.bonzai.org.za/home.php?id=offer
    ample

    Rudi Ahlers
    UNIX Specialist and Web Developer
    Bonzai Web Design - http://www.bonzai.org.za
    Cell: 082 926 1689
    ----- Original Message -----
    From: "Jean-Christian Imbeault" <jean_christianhotmail.com>
    To: <php-generallists.php.net>
    Sent: Thursday, October 18, 2001 10:09 AM
    Subject: [PHP] How-to put something at bottom of page

    > I'm not sure if this is a PHP or HTML question but can anyone tell me of a
    > way to place an image or text at the bottom of a browser window?
    >
    > I have some pages that have only a bit of text and when I place my footer
    on
    > that page I would like it to line up nicely with the bottom of the browser
    > window. Right now my footer appears wherever the text on my page finished
    > ...
    >
    > Thanks!
    >
    > Jc
    >
    > _________________________________________________________________
    > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
    >
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    > For additional commands, e-mail: php-general-helplists.php.net
    > To contact the list administrators, e-mail: php-list-adminlists.php.net
    >
    >

    attached mail follows:


    You can do this with html, just make your page a table with height="100%",
    and then have your footer in it's own row at the bottom with valign="bottom"
    and make sure your table cell with your main content is valign="top". Since
    I can not see what you're doing I cant give you specifics, but I think from
    what I wrote you'll be able to figure out what you want to do :)

    I try to stay away from frames. I am not sure if I am in the minority, I do
    use frames, but when don't have to.. I dont.

    Rick

    > I'm not sure if this is a PHP or HTML question but can anyone tell me of a
    > way to place an image or text at the bottom of a browser window?
    >
    > I have some pages that have only a bit of text and when I place my footer on
    > that page I would like it to line up nicely with the bottom of the browser
    > window. Right now my footer appears wherever the text on my page finished
    > ...
    >
    > Thanks!
    >
    > Jc
    >
    > _________________________________________________________________
    > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
    >
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    > For additional commands, e-mail: php-general-helplists.php.net
    > To contact the list administrators, e-mail: php-list-adminlists.php.net
    >

    attached mail follows:


    This almost works ...

    The only problem is that all cells are stretched vertically.

    For example my table has four rows. The first one is aligned with the top
    (good) and the last one is aligned with the bottom of the screen (good). Bu
    the two in the middle have been stretched to fill out the rest of the rest
    of the screen ... I just want them to be as wide as they need to be, no more
    ...

    Is there some tag I can use to do this?

    Jc

    >From: Richard Baskett <rickbaskettcase.com>
    >To: Jean-Christian Imbeault <jean_christianhotmail.com>
    >Subject: Re: [PHP] How-to put something at bottom of page
    >Date: Thu, 18 Oct 2001 01:13:58 -0700
    >
    >You can do this with html, just make your page a table with height="100%",
    >and then have your footer in it's own row at the bottom with
    >valign="bottom"
    >and make sure your table cell with your main content is valign="top".
    >Since
    >I can not see what you're doing I cant give you specifics, but I think from
    >what I wrote you'll be able to figure out what you want to do :)
    >
    >Rick
    >
    > > I'm not sure if this is a PHP or HTML question but can anyone tell me of
    >a
    > > way to place an image or text at the bottom of a browser window?
    > >
    > > I have some pages that have only a bit of text and when I place my
    >footer on
    > > that page I would like it to line up nicely with the bottom of the
    >browser
    > > window. Right now my footer appears wherever the text on my page
    >finished
    > > ...
    > >
    > > Thanks!
    > >
    > > Jc
    > >
    > > _________________________________________________________________
    > > Get your FREE download of MSN Explorer at
    >http://explorer.msn.com/intl.asp
    > >
    > >
    > > --
    > > PHP General Mailing List (http://www.php.net/)
    > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    > > For additional commands, e-mail: php-general-helplists.php.net
    > > To contact the list administrators, e-mail: php-list-adminlists.php.net
    > >
    >

    _________________________________________________________________
    Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

    attached mail follows:


    Hmm.. using frames would work, but let's try something else. Make a whole
    new table underneath your main table and make it 100% height and see if that
    works. It should crunch your first table to normal size and then your second
    footer table 'should' take up the rest of the space on the page. If that
    doesnt work.. I've ran out of ideas and you'll need to use frames ;)

    Rick

    Happy Birthday to me! :)

    > This almost works ...
    >
    > The only problem is that all cells are stretched vertically.
    >
    > For example my table has four rows. The first one is aligned with the top
    > (good) and the last one is aligned with the bottom of the screen (good). Bu
    > the two in the middle have been stretched to fill out the rest of the rest
    > of the screen ... I just want them to be as wide as they need to be, no more
    > ...
    >
    > Is there some tag I can use to do this?
    >
    > Jc
    >
    >
    >> From: Richard Baskett <rickbaskettcase.com>
    >> To: Jean-Christian Imbeault <jean_christianhotmail.com>
    >> Subject: Re: [PHP] How-to put something at bottom of page
    >> Date: Thu, 18 Oct 2001 01:13:58 -0700
    >>
    >> You can do this with html, just make your page a table with height="100%",
    >> and then have your footer in it's own row at the bottom with
    >> valign="bottom"
    >> and make sure your table cell with your main content is valign="top".
    >> Since
    >> I can not see what you're doing I cant give you specifics, but I think from
    >> what I wrote you'll be able to figure out what you want to do :)
    >>
    >> Rick
    >>
    >>> I'm not sure if this is a PHP or HTML question but can anyone tell me of
    >> a
    >>> way to place an image or text at the bottom of a browser window?
    >>>
    >>> I have some pages that have only a bit of text and when I place my
    >> footer on
    >>> that page I would like it to line up nicely with the bottom of the
    >> browser
    >>> window. Right now my footer appears wherever the text on my page
    >> finished
    >>> ...
    >>>
    >>> Thanks!
    >>>
    >>> Jc
    >>>
    >>> _________________________________________________________________
    >>> Get your FREE download of MSN Explorer at
    >> http://explorer.msn.com/intl.asp
    >>>
    >>>
    >>> --
    >>> PHP General Mailing List (http://www.php.net/)
    >>> To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    >>> For additional commands, e-mail: php-general-helplists.php.net
    >>> To contact the list administrators, e-mail: php-list-adminlists.php.net
    >>>
    >>
    >
    >
    > _________________________________________________________________
    > Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
    >
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    > For additional commands, e-mail: php-general-helplists.php.net
    > To contact the list administrators, e-mail: php-list-adminlists.php.net
    >

    attached mail follows:


    Hi!

    I have a page that uses server-side includes to display different
    features. Something like this:
    <html>
      <!--#include virtual="feature1.php"--> (a few db calls)
      <!--#include virtual="feature2.cgi"--> (perl-script with db calls)
      <!--#include virtual="feature3.php"--> (even more db calls)
    </html>

    If everything is embedded in a php-page I assume that the parser would
    start only once, and that the db-connections would be open until the
    whole page closes?

    If the assumption above is correct, does the same apply to a .shtml-page?
    Or does the parser execute eache php-script one at the time, each time
    invoking the parser?

    Somehow I'm afraid I have to rewrite my perl code to php and put
    everything on one page, but I would sure like to hear a few arguments on
    how to plan for performance.

    /Fredrik

    -- 
    ----------------------------------------------
    Fredrik Wahlberg     Tel: 08-54 54 56 12
    Fusage               Fax: 08-54 54 56 10
    Kungstensgatan 38a   Mobil: 070-576 16 51
    113 59  STOCKHOLM    http://www.fusage.com
    ----------- fredrikfusage.com ---------------
    

    attached mail follows:


    > Hi! > > I have a page that uses server-side includes to display different > features. Something like this: > <html> > <!--#include virtual="feature1.php"--> (a few db calls) > <!--#include virtual="feature2.cgi"--> (perl-script with db calls) > <!--#include virtual="feature3.php"--> (even more db calls) > </html> > > If everything is embedded in a php-page I assume that the parser would > start only once, and that the db-connections would be open until the > whole page closes? > > If the assumption above is correct, does the same apply to a .shtml-page? > Or does the parser execute eache php-script one at the time, each time > invoking the parser?

    include virtual invokes an Apache sub-request. It is basically like sending another GET request back to Apache. It goes through all the same layers and the php or cgi script that is run sees it as a completely separate request. It has no idea it is part of a single .shtml page. So no, there can't be any sharing of resources across multiple include virtuals from a .shtml page.

    I would suggest doing the bulk in PHP and if you need a Perl cgi run, use PHP's virtual() function which does the same as include virtual in a .shtml page.

    -Rasmus

    attached mail follows:


    Hi,

    I would like to know which function use to create a New File in PHP.

    Many Thanks

    Mark Lo

    attached mail follows:


    http://php.net/fopen

    On Thu, 18 Oct 2001, Mark Lo wrote:

    > Hi, > > I would like to know which function use to create a New File in PHP. > > > Many Thanks > > > Mark Lo > > >

    attached mail follows:


    Dear Rasmus Lerdorf,

    I mean to create a new file, Not to open a file.

    Thank you

    Mark Lo

    ----- Original Message ----- From: "Rasmus Lerdorf" <rasmusphp.net> To: "Mark Lo" <mark3dsources.com> Cc: <php-generallists.php.net> Sent: Thursday, October 18, 2001 4:18 PM Subject: Re: [PHP] Create A New File

    > http://php.net/fopen > > On Thu, 18 Oct 2001, Mark Lo wrote: > > > Hi, > > > > I would like to know which function use to create a New File in PHP. > > > > > > Many Thanks > > > > > > Mark Lo > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > > >

    attached mail follows:


    http://php.net/fopen please read it again. Pay careful attention to the mode flags. 'w' would create a new file.

    -Rasmus

    On Thu, 18 Oct 2001, Mark Lo wrote:

    > Dear Rasmus Lerdorf, > > I mean to create a new file, Not to open a file. > > Thank you > > > Mark Lo > > ----- Original Message ----- > From: "Rasmus Lerdorf" <rasmusphp.net> > To: "Mark Lo" <mark3dsources.com> > Cc: <php-generallists.php.net> > Sent: Thursday, October 18, 2001 4:18 PM > Subject: Re: [PHP] Create A New File > > > > http://php.net/fopen > > > > On Thu, 18 Oct 2001, Mark Lo wrote: > > > > > Hi, > > > > > > I would like to know which function use to create a New File in > PHP. > > > > > > > > > Many Thanks > > > > > > > > > Mark Lo > > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > > > > > >

    attached mail follows:


    Thanks

    ----- Original Message ----- From: "Rasmus Lerdorf" <rasmusphp.net> To: "Mark Lo" <mark3dsources.com> Cc: <php-generallists.php.net> Sent: Thursday, October 18, 2001 4:25 PM Subject: Re: [PHP] Create A New File

    > http://php.net/fopen please read it again. Pay careful attention to the > mode flags. 'w' would create a new file. > > -Rasmus > > On Thu, 18 Oct 2001, Mark Lo wrote: > > > Dear Rasmus Lerdorf, > > > > I mean to create a new file, Not to open a file. > > > > Thank you > > > > > > Mark Lo > > > > ----- Original Message ----- > > From: "Rasmus Lerdorf" <rasmusphp.net> > > To: "Mark Lo" <mark3dsources.com> > > Cc: <php-generallists.php.net> > > Sent: Thursday, October 18, 2001 4:18 PM > > Subject: Re: [PHP] Create A New File > > > > > > > http://php.net/fopen > > > > > > On Thu, 18 Oct 2001, Mark Lo wrote: > > > > > > > Hi, > > > > > > > > I would like to know which function use to create a New File in > > PHP. > > > > > > > > > > > > Many Thanks > > > > > > > > > > > > Mark Lo > > > > > > > > > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > > For additional commands, e-mail: php-general-helplists.php.net > > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > > > > > > > > > > > > > > >

    attached mail follows:


    *** NEVER PAY FOR XXX AGAIN! TOTALLY FREE-4-LIFE ***

    How do you like 100% FREE XXX??? Would you like a FREE XXX Membership to see my tight teenage pussy???

    http://206.47.217.53/pta/index.html

    WARNING: Too Controversial for the public Web! Must be 18 or older to continue! We are not responsible for your actions! SHOCKING CONTENT!

    http://206.47.217.53/pta/index.html

    C-ya inside sexy!

    XoXoXoXoXoX

    Tonya

    Hey Sexy!

    attached mail follows:


    Anti-spam filters needed on php list.

    On Thu, Oct 18, 2001 at 03:52:24AM -0700, hagstime23aol.com wrote: > > *** NEVER PAY FOR XXX AGAIN! TOTALLY FREE-4-LIFE *** > > How do you like 100% FREE XXX??? Would you like a FREE > XXX Membership to see my tight teenage pussy??? > > http://206.47.217.53/pta/index.html > > WARNING: Too Controversial for the public Web! Must be 18 > or older to continue! We are not responsible for your > actions! SHOCKING CONTENT! > > http://206.47.217.53/pta/index.html > > C-ya inside sexy! > > XoXoXoXoXoX > > Tonya > > > > > > > > > > > > > > > > > Hey Sexy! > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    -- 
    Member - Liberal International	On 11 Sept 2001 the WORLD was violated.
    This is doctornl2k.ab.ca	Ici doctornl2k.ab.ca
    Society MUST be saved! Extremists must dissolve.  
    

    attached mail follows:


    I'm running win98 / apache 1.3.20 / php 4.0.6 / MySQL 3.23.38

    Just doing

    mysql_connect('localhost', 'foo', 'bar'); mysql_select_db('xyz');

    is 0.06 second.

    Is this normal??

    My queries take 0.01 second or less, that works fine.

    But why is the connect so slow?

    Anders

    www.nawroth.com

    attached mail follows:


    Hello all! I installed PHP 4.0.6 om my server (Winnt server, Apache), and I started testing with it.

    The problem I have now is this: I want to read the data passed from a form trough a variable. Let's say the form field is called Test. I want to use $Test in my PHP script to read that variable.

    But all variables stay empty. I don't wan't to use the Query_string to get my variables.

    Can anybody tell me what INI-setting(s) I got to turn on or off??????

    Thanks!!!

    Greetz Patrick

    attached mail follows:


    Hello, Masters! I'm sending a mail through with imap_mail() and want to save a copy of it in "Sent Items" folders. I can not find function which an do it.

    It seemes to me it should look like saving letter to specified mailbox (e.g. "Drafts").

    Thank you

    Val.zp.ua.

    attached mail follows:


    Is it possible to use imap_mail() on php 4.0.6 on NT machine? Maybe anyone has dll for this.

    Thank you

    Val.zp.ua

    attached mail follows:


    > Is it possible to use imap_mail() on php 4.0.6 on NT machine? > Maybe anyone has dll for this.

    Yes Val. It is possible. See related thread/discussion list: [PHP-WIN] Help on using mail() function =dn

    attached mail follows:


    Hi to everyone

    i have problem with php4 mail() function.

    Os:mandrake 7.2 Mailprog:Sendmail

    the following php code

    <?php

    mail("aaafoo.com","subject","body","From:bbbfoo.com"); ?>

    does not send e-mail

    my /var/log/mail/info files log the following

    thewall sendmail[8313]: f9HAE9I08313: from=apache, size=0, class=0, nrcpts=0, relay=apachelocalhost

    my php.ini sendmail path is /usr/sbin/sendmail -t

    Ive try to make apache sendmail trusted user + change my php.ini path to is /usr/sbin/sendmail -t -f rootlocalhost

    but nothing :-)

    any ideas thanks in advance for any help :-)

    Simos

    attached mail follows:


    Yes, thanks, but then I can't pass a string or int as a parameter as well, which is what a want.

    Neil Kimber wrote:

    > You're not passing by reference. > Change: > > function add($child) { > $this->children[] = $child; > } > > to > > function add(&$child) { > $this->children[] = &$child; > } > > This should work. When you pass an object as a parameter PHP makes a copy of > that object as a local instance in your method. So, your original code: > > 4 $obj2->add(", something else"); > 5 $obj1->add($obj2); > > would alter $obj2 and store a copy of that altered object in $obj1. But, > > 5 $obj1->add($obj2); > 4 $obj2->add(", something else"); > > would store a copy of unaltered $obj2 in $obj1. You'd then alter a different > instance of $obj2 in the succeeding line. > By using the suggested altered code at the top of this email, line 5 would > not pass a copy but would pass a reference to the actual instance of the > object. Note, you also have to ensure that you store a reference to this guy > in your array as by default adding items to arrays causes copies to be made. > So you also need the line: > > $this->children[] = &$child; > > Hope this helps. > > > >>-----Original Message----- >>From: Brian White [mailto:bwhitesteptwo.com.au] >>Sent: 17 October 2001 04:41 >>To: SafeV; php-generallists.php.net >>Subject: Re: [PHP] Object and reference problem >> >> >>I think you are going to have to live with it. >> >>Functional overloading only really makes sense in strongly typed >>languages, and I bet is a bugger to implement in a name based >>scripting language so I don't think you are goign to get it. >> >>What I have sometimes wished for was that all objects and arrays >>were passed around as pointers by default, with the ability >>to create a copy when required, but that is such a fundamental >>change that I doubt if it will happen, and there are probably >>goo reasons not to ( have I ever told people how much I like >>Python ... ) >> >>Maybe you are just going to have to bite the bullet and have >>an "AddRef" method...... >> >> >>At 04:28 17/10/2001 +0200, SafeV wrote: >> >>>Someone, have a go at this! >>> >>>I have encountered a very troublesome problem, which I don't see how to >>>solve in an elegant way, since PHP doesn't support method overloading. >>> >>>Suppose my class is, kind of a tree, like: >>> >>>class A { >>> var $children; >>> >>> function A() { >>> $this->children = array(); >>> } >>> >>> // I want this to accept both objects and strings etc. >>> // IE. mixed >>> function add($child) { >>> $this->children[] = $child; >>> } >>> >>> function printStuff() { >>> foreach ($this->children as $child) { >>> if (is_object($child)) >>> $child->printStuff(); >>> else >>> echo $child; >>> } >>> } >>>} >>> >>>Now this is fine: >>> >>>1 $obj1 = new A(); >>>2 $obj2 = new A(); >>>3 $obj1->add("Something"); >>>4 $obj2->add(", something else"); >>>5 $obj1->add($obj2); >>>6 $obj1->printStuff(); >>> >>>and prints out "something, something else" >>> >>>But if I swap lines 4 and 5 it only prints out "something". >>>Obviously, the add method of $obj1 only receives a copy of $obj2, and >>>if I try to add something to $obj2 afterwards, even thought it's >>> >>supposed >> >>>to be hooked with $obj1, it will "disappear". >>> >>>For objects only I could solve this with declaring add() like: >>>function add(&$child) { >>> $this->children[] = $child; >>>} >>>So it receives a reference of the object, but then I can't add a string >>>(fatal error, cannot pass string as reference), or an integer or double, >>>for that matter! And I really don't want to use different method names! >>> >>>I don't have full control over the reference stuff in PHP, does anyone >>>know how I can fix this? Or a workaround? >>> >>>Thanx! >>> >>> >>>-- >>>PHP General Mailing List (http://www.php.net/) >>>To unsubscribe, e-mail: php-general-unsubscribelists.php.net >>>For additional commands, e-mail: php-general-helplists.php.net >>>To contact the list administrators, e-mail: php-list-adminlists.php.net >>> >>------------------------- >>Brian White >>Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy >>Phone: +612-93197901 >>Web: http://www.steptwo.com.au/ >>Email: bwhitesteptwo.com.au >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, e-mail: php-general-unsubscribelists.php.net >>For additional commands, e-mail: php-general-helplists.php.net >>To contact the list administrators, e-mail: php-list-adminlists.php.net >> >

    attached mail follows:


    Sigh, I guess you're right... But I think a better solution is to wrap strings in a String object

    Thanks for your input!

    Brian White wrote:

    > I think you are going to have to live with it. > > Functional overloading only really makes sense in strongly typed > languages, and I bet is a bugger to implement in a name based > scripting language so I don't think you are goign to get it. > > What I have sometimes wished for was that all objects and arrays > were passed around as pointers by default, with the ability > to create a copy when required, but that is such a fundamental > change that I doubt if it will happen, and there are probably > goo reasons not to ( have I ever told people how much I like > Python ... ) > > Maybe you are just going to have to bite the bullet and have > an "AddRef" method...... > > > At 04:28 17/10/2001 +0200, SafeV wrote: > >> Someone, have a go at this! >> >> I have encountered a very troublesome problem, which I don't see how >> to solve in an elegant way, since PHP doesn't support method overloading. >> >> Suppose my class is, kind of a tree, like: >> >> class A { >> var $children; >> >> function A() { >> $this->children = array(); >> } >> >> // I want this to accept both objects and strings etc. >> // IE. mixed >> function add($child) { >> $this->children[] = $child; >> } >> >> function printStuff() { >> foreach ($this->children as $child) { >> if (is_object($child)) >> $child->printStuff(); >> else >> echo $child; >> } >> } >> } >> >> Now this is fine: >> >> 1 $obj1 = new A(); >> 2 $obj2 = new A(); >> 3 $obj1->add("Something"); >> 4 $obj2->add(", something else"); >> 5 $obj1->add($obj2); >> 6 $obj1->printStuff(); >> >> and prints out "something, something else" >> >> But if I swap lines 4 and 5 it only prints out "something". >> Obviously, the add method of $obj1 only receives a copy of $obj2, and >> if I try to add something to $obj2 afterwards, even thought it's >> supposed to be hooked with $obj1, it will "disappear". >> >> For objects only I could solve this with declaring add() like: >> function add(&$child) { >> $this->children[] = $child; >> } >> So it receives a reference of the object, but then I can't add a >> string (fatal error, cannot pass string as reference), or an integer >> or double, for that matter! And I really don't want to use different >> method names! >> >> I don't have full control over the reference stuff in PHP, does anyone >> know how I can fix this? Or a workaround? >> >> Thanx! >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: php-general-unsubscribelists.php.net >> For additional commands, e-mail: php-general-helplists.php.net >> To contact the list administrators, e-mail: php-list-adminlists.php.net > > > ------------------------- > Brian White > Step Two Designs Pty Ltd - SGML, XML & HTML Consultancy > Phone: +612-93197901 > Web: http://www.steptwo.com.au/ > Email: bwhitesteptwo.com.au >

    attached mail follows:


    As far as I know, there is no way to do this in Apache. Instead, use cron & lynx:

    59 23 * * * lynx -dump http://domain.com/script.php > ~/phpdump.txt

    If you don't need to save the results, use:

    59 23 * * * lynx -dump http://domain.com/script.php > /dev/null

    On Wed, 2001-10-17 at 17:05, Richard Baskett wrote: > How can I execute a php script at a specified time using an Apache server? > Let's say I wanted to send everyone an email, who had updated their personal > information within the last 24 hours, every night at midnight... > > I would write a script that would get the current date and time, check a > mysql database for all rows that met the date critieria, and automatically > email everyone that met that criteria. > > I am guessing most administrators would not want to make sure they are in > front of a browser at midnight every night to run the script, so how can I > do this? :) > > Thanks ahead of time! > > Rick > >

    attached mail follows:


    The answer "cron" refers to *nix OpSys. It is the name of a demon/daemon that kicks of commands/jobs at a pre-specified time and/or on a regular basis. M$ spell it "at". Was that your question? =dn

    ----- Original Message ----- From: "Lucas Chan" <lucas_chanhotmail.com> To: <php-generallists.php.net> Sent: 18 October 2001 01:15 Subject: [PHP] Re: executing script at specified time

    > cron? > > Regards, > > [ lucas ] > > > > > "Richard Baskett" <rickbaskettcase.com> wrote in message > news:B7F36AC3.4B3D%rickbaskettcase.com... > > How can I execute a php script at a specified time using an Apache server? > > Let's say I wanted to send everyone an email, who had updated their > personal > > information within the last 24 hours, every night at midnight... > > > > I would write a script that would get the current date and time, check a > > mysql database for all rows that met the date critieria, and automatically > > email everyone that met that criteria. > > > > I am guessing most administrators would not want to make sure they are in > > front of a browser at midnight every night to run the script, so how can I > > do this? :) > > > > Thanks ahead of time! > > > > Rick > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    attached mail follows:


    Hiya

    I've got the same problem as the one Rudolf Visagie posted yesterday - when I start a session I get the error message:

    "Warning: open(E:\Inetpub\sessions\sess_955aa3bdd517c3a345f29fe1e021d054, O_RDWR) failed: m (13) in D:\Inetpub\wwwroot\HATII\admn\php\moss\sc_head.inc on line 3"

    We've tried changing the php.ini file to point to a different session directory (it was /tmp) but the problem persists.

    As far as I'm aware the sessions directory does exist.

    Any ideas?

    Brian

    attached mail follows:


    does E:\Inetpub\sessions exist as a directory?

    I notice your webdir is on D:\

    and I wouldn't put your session files in your web root (if you are) - use c:\temp or c:\winnt\temp or something

    hope this helps

    dave

    -----Original Message----- From: Brian Aitken [mailto:b.aitkenhatii.gla.ac.uk] Sent: 18 October 2001 11:22 To: php-generallists.php.net Subject: [PHP] Another [PHP] Simple Session Problem...

    Hiya

    I've got the same problem as the one Rudolf Visagie posted yesterday - when I start a session I get the error message:

    "Warning: open(E:\Inetpub\sessions\sess_955aa3bdd517c3a345f29fe1e021d054, O_RDWR) failed: m (13) in D:\Inetpub\wwwroot\HATII\admn\php\moss\sc_head.inc on line 3"

    We've tried changing the php.ini file to point to a different session directory (it was /tmp) but the problem persists.

    As far as I'm aware the sessions directory does exist.

    Any ideas?

    Brian

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    Hi

    It wasn't me who posted the problem - I was involved in trying to find a solution. However, it seems to me as if the problem has to do with which operating system one is using. On Windows the save path could be [drive:]\temp and on *nix it would be /tmp (and the directories have to exist).

    Cheers

    -----Original Message----- From: Brian Aitken [mailto:b.aitkenhatii.gla.ac.uk] Sent: 18 October 2001 12:22 To: php-generallists.php.net Subject: [PHP] Another [PHP] Simple Session Problem...

    Hiya

    I've got the same problem as the one Rudolf Visagie posted yesterday - when I start a session I get the error message:

    "Warning: open(E:\Inetpub\sessions\sess_955aa3bdd517c3a345f29fe1e021d054, O_RDWR) failed: m (13) in D:\Inetpub\wwwroot\HATII\admn\php\moss\sc_head.inc on line 3"

    We've tried changing the php.ini file to point to a different session directory (it was /tmp) but the problem persists.

    As far as I'm aware the sessions directory does exist.

    Any ideas?

    Brian

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    On Windows you could try C:\\temp or D:\\temp. (For some reason it picks it up with two slashes but not with one).

    -----Original Message----- From: Brian Aitken [mailto:b.aitkenhatii.gla.ac.uk] Sent: 18 October 2001 12:22 To: php-generallists.php.net Subject: [PHP] Another [PHP] Simple Session Problem...

    Hiya

    I've got the same problem as the one Rudolf Visagie posted yesterday - when I start a session I get the error message:

    "Warning: open(E:\Inetpub\sessions\sess_955aa3bdd517c3a345f29fe1e021d054, O_RDWR) failed: m (13) in D:\Inetpub\wwwroot\HATII\admn\php\moss\sc_head.inc on line 3"

    We've tried changing the php.ini file to point to a different session directory (it was /tmp) but the problem persists.

    As far as I'm aware the sessions directory does exist.

    Any ideas?

    Brian

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    not true

    mine's set to

    session.save_path = c:\temp

    and it works just fine

    but you're right in that the directory has to exist

    Dave

    -----Original Message----- From: Rudolf Visagie [mailto:Rudolfqedi.co.za] Sent: 18 October 2001 13:00 To: Brian Aitken Cc: php-generallists.php.net Subject: RE: [PHP] Another [PHP] Simple Session Problem...

    On Windows you could try C:\\temp or D:\\temp. (For some reason it picks it up with two slashes but not with one).

    -----Original Message----- From: Brian Aitken [mailto:b.aitkenhatii.gla.ac.uk] Sent: 18 October 2001 12:22 To: php-generallists.php.net Subject: [PHP] Another [PHP] Simple Session Problem...

    Hiya

    I've got the same problem as the one Rudolf Visagie posted yesterday - when I start a session I get the error message:

    "Warning: open(E:\Inetpub\sessions\sess_955aa3bdd517c3a345f29fe1e021d054, O_RDWR) failed: m (13) in D:\Inetpub\wwwroot\HATII\admn\php\moss\sc_head.inc on line 3"

    We've tried changing the php.ini file to point to a different session directory (it was /tmp) but the problem persists.

    As far as I'm aware the sessions directory does exist.

    Any ideas?

    Brian

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    A colleague of mine says that's how he had to enter the save_path eventually with IIS on Windows 98 to get it to work. I use Unix myself (/tmp).

    -----Original Message----- From: Dave Watkinson [mailto:d.watkinsonmightymatch.com] Sent: 18 October 2001 02:44 To: Rudolf Visagie; Brian Aitken Cc: php-generallists.php.net Subject: RE: [PHP] Another [PHP] Simple Session Problem...

    not true

    mine's set to

    session.save_path = c:\temp

    and it works just fine

    but you're right in that the directory has to exist

    Dave

    -----Original Message----- From: Rudolf Visagie [mailto:Rudolfqedi.co.za] Sent: 18 October 2001 13:00 To: Brian Aitken Cc: php-generallists.php.net Subject: RE: [PHP] Another [PHP] Simple Session Problem...

    On Windows you could try C:\\temp or D:\\temp. (For some reason it picks it up with two slashes but not with one).

    -----Original Message----- From: Brian Aitken [mailto:b.aitkenhatii.gla.ac.uk] Sent: 18 October 2001 12:22 To: php-generallists.php.net Subject: [PHP] Another [PHP] Simple Session Problem...

    Hiya

    I've got the same problem as the one Rudolf Visagie posted yesterday - when I start a session I get the error message:

    "Warning: open(E:\Inetpub\sessions\sess_955aa3bdd517c3a345f29fe1e021d054, O_RDWR) failed: m (13) in D:\Inetpub\wwwroot\HATII\admn\php\moss\sc_head.inc on line 3"

    We've tried changing the php.ini file to point to a different session directory (it was /tmp) but the problem persists.

    As far as I'm aware the sessions directory does exist.

    Any ideas?

    Brian

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    Help!

    Erratic Behaviour with PHP 4.06 on Apache 1.3.20: in unreproduceable intervals (1 out of 10 page requests), all PHP output will have single and double quotes escaped by backslashes - no matter if the output is produced by echo, readfile, include, or any other PHP command. No special problematic sourcecode; this behaviour occurs with ALL types of code our this machine.

    Since our websites draw their complete HTML code from a database via PHP, these erratic backslashes crash always the whole site. With a previous PHP version (4.0.3), this problem NEVER occured using the same PHP code and the same ini-file settings.

    Joerg

    attached mail follows:


    "Ilya V. Lazarev" <iliancom.ru.tam> wrote in message news:3BCE6B46.3020308ncom.ru.tam... > Hi ! > Has anyone tried zip_open in PHP 4.0.6 ? > It says me that no such function. I've looked at php src and found > zzip_open(), but this one expect more than 1 arg ( supposedly 2 ).

    File/path name and password?

    Christian

    attached mail follows:


    No . I've found next lines in ext/zziplib/zziplib.c (next is excerpt from file ):

    /* {{{ proto resource zzip_opendir(string filename) Open a new zzip archive for reading */

    --
    /* {{{ proto resource zzip_readdir(resource zzipp)
        Returns the next file in the archive */
    --
    /* {{{ proto void zzip_closedir(resource zzipp)
        Close a Zip archive */
    --
    /* {{{ proto string zzip_entry_name(resource zzip_entry)
        Return the name given a ZZip entry */
    --
    /* {{{ proto int zzip_entry_compressedsize(resource zzip_entry)
        Return the compressed size of a ZZip entry */
    --
    /* {{{ proto int zzip_entry_filesize(resource zzip_entry)
        Return the actual filesize of a ZZip entry */
    --
    /* {{{ proto string zzip_entry_compressionmethod(resource zzip_entry)
        Return a string containing the compression method used on a 
    particular entry */
    --
    /* {{{ proto bool zzip_open(resource zzip_dp, resource zzip_entry, 
    string mode)
        Open a Zip File, pointed by the resource entry */
    --
    /* {{{ proto string zzip_read(resource zzip_ent)
        Read X bytes from an opened zzip entry */
    --
    /* {{{ proto void zzip_close(resource zzip_ent)
        Close a zzip entry */
    

    I'm going to test it now, will report about results.

    Christian C. wrote:

    > "Ilya V. Lazarev" <iliancom.ru.tam> wrote in message > news:3BCE6B46.3020308ncom.ru.tam... > >>Hi ! >>Has anyone tried zip_open in PHP 4.0.6 ? >>It says me that no such function. I've looked at php src and found >>zzip_open(), but this one expect more than 1 arg ( supposedly 2 ). >> > > File/path name and password? > > Christian > > >

    attached mail follows:


    Hiya

    I promise I won't keep perstering you after this question :-)

    My problem is this - I've got a complete system that works perfectly on Linux but I've got to set it up on a new server that's running Windows. When I try to handle file uploads I get errors (when the same code worked perfectly under Linux).

    When I try to use mkdir like this:

    $name4loc = urlencode($mname); $loc = "./images/$name4loc"; mkdir("$loc",0777);

    I get the error:

    Warning: MkDir failed (Permission denied) in D:\Inetpub\wwwroot\HATII\admn\php\moss\mregdone.php on line 98

    When I try to copy a file like this:

    if (!copy ($test, $test_name))

    echo("Problem: Unable to copy image. <br>Please try again."); exit; }

    I get the error:

    Warning: Unable to create 'vinlogo.jpg': Permission denied in D:\Inetpub\wwwroot\HATII\admn\php\a2paw\uptestdone.php on line 41

    I'm guessing PHP is somehow lacking permission to write to the file system but the technicians have tried changing the file permission for the directory I'm trying to write to and the same error is given. We don't know what else to do.

    Any ideas?

    Thanks Brian

    attached mail follows:


    I've run into the same problem, I had to 'chmod 777 images' to be able to create dirs or files, which is BAD security!

    Brian Aitken wrote:

    > Hiya > > I promise I won't keep perstering you after this question :-) > > My problem is this - I've got a complete system that works perfectly on > Linux but I've got to set it up on a new server that's running Windows. > When I try to handle file uploads I get errors (when the same code worked > perfectly under Linux). > > When I try to use mkdir like this: > > $name4loc = urlencode($mname); > $loc = "./images/$name4loc"; > mkdir("$loc",0777); > > I get the error: > > Warning: MkDir failed (Permission denied) in > D:\Inetpub\wwwroot\HATII\admn\php\moss\mregdone.php on line 98 > > When I try to copy a file like this: > > if (!copy ($test, $test_name)) > > > echo("Problem: Unable to copy image. <br>Please try again."); > exit; > } > > I get the error: > > Warning: Unable to create 'vinlogo.jpg': Permission denied in > D:\Inetpub\wwwroot\HATII\admn\php\a2paw\uptestdone.php on line 41 > > I'm guessing PHP is somehow lacking permission to write to the file system > but the technicians have tried changing the file permission for the > directory I'm trying to write to and the same error is given. We don't know > what else to do. > > Any ideas? > > Thanks > Brian > > > >

    attached mail follows:


    Hello world,

    I've made a little script which simply returns a pdf file through it (script file called dl.php in the chart-directory):

    <? $file_size = filesize($filepath); Header("Content-Type: application/pdf"); Header("Content-Length: ".$file_size);

    readfile($filepath); ?>

    This script works fine when there is Acrobat Reader Browser -plug-in installed to users' box so that the PDF File appears into the IE's or Netscapes' normal window. But if and when user wants to save the pdf file (which should be allowed), some problem appear. In the case that user right-clicks the link to this script and selects "Save the file as..." (or something, I have Finnish version of IE ;) the browser thinks that user is downloading chart.html -file! I suppose that same "phenomenon" appears when there is no Acrobat plug-in installed and browser doesn't find corresponding action for application/pdf -mime type -> it begins to download file.

    Any suggestions how user can download the file via that script as the file will be saved as pdf-file?

    Thanks and cheers, - Ville

    ................................................................. Ville Mattila Ikaalinen, Finland gsm +358-40-8497506 ville.mattilapilotmedia.fi www.pilotmedia.fi

    attached mail follows:


    I'm not 100% sure, but try adding one more header:

    Header("Content-Disposition: attachment; filename=\"" . $filename. "\"");

    Ville Mattila wrote:

    > Hello world, > > I've made a little script which simply returns a pdf file through it (script file called dl.php in the chart-directory): > > <? > $file_size = filesize($filepath); > Header("Content-Type: application/pdf"); > Header("Content-Length: ".$file_size); > > readfile($filepath); > ?> > > This script works fine when there is Acrobat Reader Browser -plug-in installed to users' box so that the PDF File appears into the IE's or Netscapes' normal window. But if and when user wants to save the pdf file (which should be allowed), some problem appear. In the case that user right-clicks the link to this script and selects "Save the file as..." (or something, I have Finnish version of IE ;) the browser thinks that user is downloading chart.html -file! I suppose that same "phenomenon" appears when there is no Acrobat plug-in installed and browser doesn't find corresponding action for application/pdf -mime type -> it begins to download file. > > Any suggestions how user can download the file via that script as the file will be saved as pdf-file? > > Thanks and cheers, > - Ville > > > ................................................................. > Ville Mattila > Ikaalinen, Finland > gsm +358-40-8497506 > ville.mattilapilotmedia.fi > www.pilotmedia.fi > > >

    attached mail follows:


    Hi ! I am looking for an efficient web portal, sutable for medium/big corporation sites, with a searcable product catalog etc. The catalog is the main emphasis of the site. One more thing : Is there a tutorial or an article that covers the web portal building ? Thanks Nikola

    attached mail follows:


    Hi there again,

    I was wondering that would it be possible to make a script which is always running? Maybe it should be started via console, but there is anyway that maximum execution time limit which should be revoke in this case. Any ideas?

    - Ville

    attached mail follows:


    If you 'set_time_limit(0);' your script won't time out. But it's probably better to have some other kind of background script to run on the server...

    Ville Mattila wrote:

    > Hi there again, > > I was wondering that would it be possible to make a script which is always running? Maybe it should be started via console, but there is anyway that maximum execution time limit which should be revoke in this case. Any ideas? > > - Ville > > > >

    attached mail follows:


    On Wednesday 17 October 2001 19:47, php wrote: > Hello, > > Warning: Unknown list entry type in request shutdown (0) in > Unknown on line 0 > appears on the bottom of every script I call that uses domxml. > I have no idea was causes it... Any tips? try to use (and compile php with) another version of libxml library I used to get many warning messages like yours, and changing of libxml solved the problem.

    Arpi

    attached mail follows:


    Any ideas why this won't output anything

    <?php class test { var $table = "matt";

    function showName() { return $this->table; }

    }

    echo test::showName();

    ?>

    I have other classes along the similar lines but a lot bigger which work fine. I'm also using phplib which has a lot of this stuff going on...

    I remeber seeing something regarding it in the manual but i don't get how it's all worked before.

    I'm using php4.06 apache 1.3.19 on win2k.

    TIA

    M:

    attached mail follows:


    Try to create an instant of the class like this: <?php class test { var $table = "val";

    function showName() { return $this->table; }

    } $test = new Test; echo $test->showName();

    ?> ----- Original Message ----- From: "Matt Williams" <mattyewlands.com> To: "PHP General List" <php-generallists.php.net>; "PHP_UKegroups." <PHP_UKegroups.com> Sent: Thursday, October 18, 2001 4:25 PM Subject: [PHP] class problems

    > Any ideas why this won't output anything > > <?php > class test > { > var $table = "matt"; > > function showName() > { > return $this->table; > } > > } > > echo test::showName(); > > ?> > > I have other classes along the similar lines but a lot bigger which work > fine. > I'm also using phplib which has a lot of this stuff going on... > > I remeber seeing something regarding it in the manual but i don't get how > it's all worked before. > > I'm using php4.06 apache 1.3.19 on win2k. > > TIA > > M: > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    attached mail follows:


    Ok got it from here.

    http://uk.php.net/manual/en/keyword.paamayim-nekudotayim.php

    using :: allows use of a class function but doesn't allow access the object, so to access $this I do need to instantiate the class

    Thanks

    M:

    > Try to create an instant of the class like this: > <?php > class test > { > var $table = "val"; > > function showName() > { > return $this->table; > } > > } > $test = new Test; > echo $test->showName(); > > ?> >

    M:

    > -----Original Message----- > From: Valentin V. Petruchek [mailto:petruchekzsu.zp.ua] > Sent: 18 October 2001 14:39 > To: php-generallists.php.net > Subject: Re: [PHP] class problems > > > Try to create an instant of the class like this: > <?php > class test > { > var $table = "val"; > > function showName() > { > return $this->table; > } > > } > $test = new Test; > echo $test->showName(); > > ?> > ----- Original Message ----- > From: "Matt Williams" <mattyewlands.com> > To: "PHP General List" <php-generallists.php.net>; "PHP_UKegroups." > <PHP_UKegroups.com> > Sent: Thursday, October 18, 2001 4:25 PM > Subject: [PHP] class problems > > > > Any ideas why this won't output anything > > > > <?php > > class test > > { > > var $table = "matt"; > > > > function showName() > > { > > return $this->table; > > } > > > > } > > > > echo test::showName(); > > > > ?> > > > > I have other classes along the similar lines but a lot bigger which work > > fine. > > I'm also using phplib which has a lot of this stuff going on... > > > > I remeber seeing something regarding it in the manual but i > don't get how > > it's all worked before. > > > > I'm using php4.06 apache 1.3.19 on win2k. > > > > TIA > > > > M: > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    Sorry and thanks - have not use it before/ But i've tried this:

    <?php class test {

    function showName() { $this->qtable = 'val'; return $this->qtable; }

    }

    echo test::showName();

    ?>

    worked :)

    attached mail follows:


    If this suggestion isn't what you're after then it's probably because I don't fully understand your problem, but here goes...

    if you are simply replacing an old password with a new one in a directory entry you don't need to delete and then add; instead you would use...

    ldap_mod_replace to replace the value of userPasswd for the specified entry. (see http://www.php.net/manual/en/ref.ldap.php)

    If you need to do this for multiple entries you would simply repeat the process in a loop specifying a different dn and newPasswd each time.

    I've got a feeling this isn't going to answer your question. Post more information about your problem if this is the case.

    Cheers the noo, Derek

    ----- Original Message ----- From: "Matt McFarlane" <matt.mcfarlanewheaton.edu> To: <php-dblists.php.net> Sent: Thursday, October 18, 2001 2:09 PM Subject: [PHP-DB] LDAP multiple actions in modify?

    > Using jsp I can create an array of multiple actions and pass them to an ldap > server as one request. Is there a way to do this using php. > > Specifically I need to perform a delete action on "userPassword" where > value="oldPassword" and an add action passing "userPassword" and > value="newPassword". The actions must be contained in a single request and > the delete function must specify the old password. > > Thanks. > > Matt McFarlane > Wheaton College > matt.mcfarlanewheaton.edu > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribelists.php.net > For additional commands, e-mail: php-db-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    ********************************************************************************** This e-mail (and any attachment) is intended only for the attention of the addressee(s). Its unauthorised use, disclosure, storage or copying is not permitted. If you are not the intended recipient, please destroy all copies and inform the sender by return e-mail. This e-mail (whether you are the sender or the recipient) may be monitored, recorded and retained by Business Information Publications Limited (BiP). E-mail monitoring/ blocking software may be used, and e-mail content may be read at any time.You have a responsibility to ensure laws are not broken when composing or forwarding e-mails and their contents. **********************************************************************************

    attached mail follows:


    On Wed, 2001-10-17 at 16:00, Lauri Vain wrote: > Hello all, > > I need a script that would find all the links (both -- web sites and mail > addresses) on a given page with the link text. > With the uttermost probability, somebody has written such a script. Can somebody > help?

    There is a class floating around called Snoopy which does at least most of what you'd like...not sure about the link text. You could tweak it's regex and code to do that though.

    http://snoopy.sourceforge.com

    - Tim

    attached mail follows:


    Hello, Professionals!

    I've such problem: i need to change parameters from php.ini (such as sendmail_from) during execution script. Is it possible to perform and if is, how can i do it.

    Thanks

    Val.zp.ua

    attached mail follows:


    check: http://www.php.net/manual/en/function.ini-set.php

    ----- Original Message ----- From: "Valentin V. Petruchek" <petruchekzsu.zp.ua> To: "php-generallists.php.ne" <php-generallists.php.net> Sent: Thursday, October 18, 2001 4:00 PM Subject: [PHP] Help, please!

    > Hello, Professionals! > > I've such problem: i need to change parameters from php.ini (such as > sendmail_from) during execution script. > Is it possible to perform and if is, how can i do it. > > Thanks > > Val.zp.ua > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    Hi there, Does the current stable PHP (4.06) support the use of the newly released Mysql 4? Thanks, Jeroen

    attached mail follows:


    How I can download the current Annotated PHP Manual???

    _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

    attached mail follows:


    The original scripts of login.php have the line: require("lib.inc");, the lib.inc is as below

    <? function connectdb(){ $handler=mysql_connect("localhost","",""); if($handler==false){ echo "Failed connecting to database."; exit(); } $handler=mysql_select_db("database"); if($handler==false){ echo "Failed connecting to database."; exit(); } return $handler; } ?>

    After I deleted the require() line, and use myslq_connect() and mysql_select_db() in the login.php, the header() does work. So I think there must be some output while running at the line of "return $handler;"

    Regards Mike

    attached mail follows:


    Most lists that I subscribe to block all messages except from subscribers.

    This whould be a great feature for the PHP lists. The PHP lists are the worst spamming lists.

    Carl

    > -----Original Message----- > From: The Doctor [mailto:doctordoctor.nl2k.ab.ca] > Sent: Thursday, October 18, 2001 8:03 AM > To: hagstime23aol.com > Cc: php-i18nlists.php.net; php-generallists.php.net > Subject: [PHP-I18N] Re: [PHP] FREE S E X O 20935 > > > Anti-spam filters needed on php list. >

    attached mail follows:


    ...but then what do you do about the people who have legitimate questions who don't want to subscribe to the list? This is a fairly high traffic list and not everyone wants that much mail coming at them just to have the occasional one-off question answered.

    Sam Masiello Software Quality Assurance Engineer Synacor (716) 853-1362 X289 smasiellosynacor.com

    ----- Original Message ----- From: "Carl W. Brown" <cbrownxnetinc.com> To: <php-i18nlists.php.net>; <php-generallists.php.net> Sent: Thursday, October 18, 2001 11:23 AM Subject: [PHP] Spam messages (Was: FREE S E X O

    > Most lists that I subscribe to block all messages except from subscribers. > > This whould be a great feature for the PHP lists. The PHP lists are the > worst spamming lists. > > Carl > > > -----Original Message----- > > From: The Doctor [mailto:doctordoctor.nl2k.ab.ca] > > Sent: Thursday, October 18, 2001 8:03 AM > > To: hagstime23aol.com > > Cc: php-i18nlists.php.net; php-generallists.php.net > > Subject: [PHP-I18N] Re: [PHP] FREE S E X O 20935 > > > > > > Anti-spam filters needed on php list. > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    > ...but then what do you do about the people who have legitimate questions > who don't want to subscribe to the list? This is a fairly high traffic list > and not everyone wants that much mail coming at them just to have the > occasional one-off question answered.

    See as this list is mirrored to a newsgroup they could use that instead.

    I agree filter software is needed to junk the spam.

    Regards

    Jon

    --
    Jon Farmer
    Systems Programmer, Entanet www.enta.net
    Tel 01952 428969 Mob 07763 620378
    PGP Key available, send blank email to pgpkeybctech.co.uk
    

    attached mail follows:


    >> ...but then what do you do about the people who have legitimate questions >> who don't want to subscribe to the list? This is a fairly high traffic list >> and not everyone wants that much mail coming at them just to have the >> occasional one-off question answered.

    >See as this list is mirrored to a newsgroup they could use that instead. >I agree filter software is needed to junk the spam.

    And then the spammers can use NNTP again. I think it goes both ways. NNTP <> LIST

    A good spam filter (blacklist) would be a good option.

    Jeroen Geusebroek

    attached mail follows:


    > And then the spammers can use NNTP again. I think it goes both ways. > NNTP <> LIST > > A good spam filter (blacklist) would be a good option.

    Yeah thats what i said

    --
    Jon Farmer
    Systems Programmer, Entanet www.enta.net
    Tel 01952 428969 Mob 07763 620378
    PGP Key available, send blank email to pgpkeybctech.co.uk
    

    attached mail follows:


    Hi all,

    I'm looking at the following scenario: I have MySQL two tables with usernames in both of them, I need to get usernames(A) - usernames(B)

    In Oracle I would use: SELECT username FROM user MINUS SELECT username FROM task_assignment

    Since MySQL does not support MINUS, I tried using the following

    SELECT DISTINCT A.username FROM user A WHERE A.username NOT IN(SELECT B.username FROM task_assignment B);

    Here's what I get from MySQL:

    mysql> SELECT DISTINCT A.username FROM user A WHERE A.username NOT IN(SELECT B.username FROM task_assignment B); ERROR 1064: You have an error in your SQL syntax near 'SELECT B.username FROM ta sk_assignment B)' at line 1

    It appears to me that MySQL's NOT IN cannot handle recordsets, so as a fix I'm currently doing like so, which works, but I'd really like to get it as a single MySQL statement.

    $query = "SELECT DISTINCT username FROM task_assignment"; $db_result = mysql_query($query); $data = mysql_fetch_array($db_result); $not_in = $data[0]; while($data = mysql_fetch_array($db_result)){ $not_in .= ', ' . $data[0]; }

    $query = "SELECT DISTINCT username FROM user"; $query .= "WHERE username NOT IN($not_in)";

    Any help will be appreciated.

    Cheers, -Srini

    --
    http://www.symonds.net/~sriniram
    

    attached mail follows:


    select table1.* from table1 LEFT JOIN table2 ON table1.id=table2.id where table2.id is NULL;

    http://www.mysql.com/doc/J/O/JOIN.html

    -----Original Message----- From: Srinivasan Ramakrishnan [mailto:cheenicyberwaveindia.com] Sent: 18 October 2001 17:06 To: php-generallists.php.net Subject: [PHP] MySQL query

    Hi all,

    I'm looking at the following scenario: I have MySQL two tables with usernames in both of them, I need to get usernames(A) - usernames(B)

    In Oracle I would use: SELECT username FROM user MINUS SELECT username FROM task_assignment

    Since MySQL does not support MINUS, I tried using the following

    SELECT DISTINCT A.username FROM user A WHERE A.username NOT IN(SELECT B.username FROM task_assignment B);

    Here's what I get from MySQL:

    mysql> SELECT DISTINCT A.username FROM user A WHERE A.username NOT IN(SELECT B.username FROM task_assignment B); ERROR 1064: You have an error in your SQL syntax near 'SELECT B.username FROM ta sk_assignment B)' at line 1

    It appears to me that MySQL's NOT IN cannot handle recordsets, so as a fix I'm currently doing like so, which works, but I'd really like to get it as a single MySQL statement.

    $query = "SELECT DISTINCT username FROM task_assignment"; $db_result = mysql_query($query); $data = mysql_fetch_array($db_result); $not_in = $data[0]; while($data = mysql_fetch_array($db_result)){ $not_in .= ', ' . $data[0]; }

    $query = "SELECT DISTINCT username FROM user"; $query .= "WHERE username NOT IN($not_in)";

    Any help will be appreciated.

    Cheers, -Srini

    --
    http://www.symonds.net/~sriniram
    

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-helplists.php.net To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    i hope i can make my question understood ...

    i've input a value $city in my form, and i can retrieve it on the following page (the page which was the "action" of the form) ... but then, when i try to use a "hidden" type to move it to my next page (which is a form), i lose the value ... i cannot access it from a page within the form ...

    does that make sense? if so, can anyone help?

    thanks in advance.

    ken

    attached mail follows:


    where's your code ken?

    are you being strict with the case of the variable name?

    is the hidden element within the forms tags???

    -----Original Message----- From: baker downloads [mailto:kmurrahbakergrfx.com] Sent: 18 October 2001 17:13 To: php-generallists.php.net Subject: [PHP] remembering variables between pages when using forms ...

    i hope i can make my question understood ...

    i've input a value $city in my form, and i can retrieve it on the following page (the page which was the "action" of the form) ... but then, when i try to use a "hidden" type to move it to my next page (which is a form), i lose the value ... i cannot access it from a page within the form ...

    does that make sense? if so, can anyone help?

    thanks in advance.

    ken

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    didn't want to bother everyone with all the code, but here's a mildly edited version ...

    here's the form: <form name="form1" method="post" action="main.php" target="_top" > <input type="hidden" name="city" value="<?php echo $city; ?>" > <input type="hidden" name="password" value="<?php echo $password; ?>" >

    <?php echo "city is " . $city. "<br>password is " . $password; ?>

    You're authorized ! Click <input type="submit" name="Submit" value="HERE"> to continue. </form>

    -------------- here's the framed page called by the form: <html> <head> <title>Paymentech Print Orders</title> <base target="main"> </head>

    <frameset rows="85,*">

    <frameset cols="200,*"> <frame frameborder="0" noresize marginwidth="0" marginheight="0" scrolling="no" src="top.html"> <frame frameborder="0" noresize marginwidth="0" marginheight="0" scrolling="no" src="top_right.html" bordercolor="#c32933"> </frameset>

    <frameset cols="200,*"> <frame frameborder="0" noresize marginwidth="0" marginheight="0" scrolling="no" src="middle_left.php" > <frame frameborder="0" noresize marginwidth="20" marginheight="20" src="middle.php" name="main" > </frameset>

    </frameset><noframes> <body bgcolor="#FFFFFF"> </noframes>

    ---------------------

    and here's the page within the frame where i'm trying to use the values from the form above:

    <?php echo "city is " . $city . "<br>password is " . $password; ?> <table width="520" border="0" cellspacing="3" cellpadding="5" height="348">

    thanks again,

    ken

    ----- Original Message ----- From: "Dave Watkinson" <d.watkinsonmightymatch.com> To: "baker downloads" <kmurrahbakergrfx.com>; <php-generallists.php.net> Sent: Thursday, October 18, 2001 11:04 AM Subject: RE: [PHP] remembering variables between pages when using forms ...

    where's your code ken?

    are you being strict with the case of the variable name?

    is the hidden element within the forms tags???

    -----Original Message----- From: baker downloads [mailto:kmurrahbakergrfx.com] Sent: 18 October 2001 17:13 To: php-generallists.php.net Subject: [PHP] remembering variables between pages when using forms ...

    i hope i can make my question understood ...

    i've input a value $city in my form, and i can retrieve it on the following page (the page which was the "action" of the form) ... but then, when i try to use a "hidden" type to move it to my next page (which is a form), i lose the value ... i cannot access it from a page within the form ...

    does that make sense? if so, can anyone help?

    thanks in advance.

    ken

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    it looks fine to me, except i have a personal dislike for forms ;-)

    i didn't know you could post to a form and set a target for it.

    also i couldn't see a frame called _top which you named in the form action, nor could i see a page called main.php being called by the frameset.

    other than that (which is probably due to the edited code) i'm afraid i'm stumped!

    sorry mate :-(

    dave

    -----Original Message----- From: Kenn Murrah [mailto:kmurrahbakergrfx.com] Sent: 18 October 2001 17:19 To: Dave Watkinson; php-generallists.php.net Subject: Re: [PHP] remembering variables between pages when using forms ...

    didn't want to bother everyone with all the code, but here's a mildly edited version ...

    here's the form: <form name="form1" method="post" action="main.php" target="_top" > <input type="hidden" name="city" value="<?php echo $city; ?>" > <input type="hidden" name="password" value="<?php echo $password; ?>" >

    <?php echo "city is " . $city. "<br>password is " . $password; ?>

    You're authorized ! Click <input type="submit" name="Submit" value="HERE"> to continue. </form>

    -------------- here's the framed page called by the form: <html> <head> <title>Paymentech Print Orders</title> <base target="main"> </head>

    <frameset rows="85,*">

    <frameset cols="200,*"> <frame frameborder="0" noresize marginwidth="0" marginheight="0" scrolling="no" src="top.html"> <frame frameborder="0" noresize marginwidth="0" marginheight="0" scrolling="no" src="top_right.html" bordercolor="#c32933"> </frameset>

    <frameset cols="200,*"> <frame frameborder="0" noresize marginwidth="0" marginheight="0" scrolling="no" src="middle_left.php" > <frame frameborder="0" noresize marginwidth="20" marginheight="20" src="middle.php" name="main" > </frameset>

    </frameset><noframes> <body bgcolor="#FFFFFF"> </noframes>

    ---------------------

    and here's the page within the frame where i'm trying to use the values from the form above:

    <?php echo "city is " . $city . "<br>password is " . $password; ?> <table width="520" border="0" cellspacing="3" cellpadding="5" height="348">

    thanks again,

    ken

    ----- Original Message ----- From: "Dave Watkinson" <d.watkinsonmightymatch.com> To: "baker downloads" <kmurrahbakergrfx.com>; <php-generallists.php.net> Sent: Thursday, October 18, 2001 11:04 AM Subject: RE: [PHP] remembering variables between pages when using forms ...

    where's your code ken?

    are you being strict with the case of the variable name?

    is the hidden element within the forms tags???

    -----Original Message----- From: baker downloads [mailto:kmurrahbakergrfx.com] Sent: 18 October 2001 17:13 To: php-generallists.php.net Subject: [PHP] remembering variables between pages when using forms ...

    i hope i can make my question understood ...

    i've input a value $city in my form, and i can retrieve it on the following page (the page which was the "action" of the form) ... but then, when i try to use a "hidden" type to move it to my next page (which is a form), i lose the value ... i cannot access it from a page within the form ...

    does that make sense? if so, can anyone help?

    thanks in advance.

    ken

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net
    To contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    I'm reading some HTML text from a file and echoing it to stdout. The HTML text contains <IMG> but I would rather have the server do the work of looking up the image size. I know how to lookup the image size with getimagesize(). My problem is in coming up with a good format for embedding a reference to the image in the text and then writing the code to parse it.

    So instead of this: here is some text <img src=bird.gif width=100 height=20 alt="this is a bird"> and here is more text and another image <img src=plane.gif width=123 height=23 alt="this is a plane"> and more text

    I would like to have something like this: here is some text [bird.gif,this is a bird] and here is more text and another image [plane.gif, this is a plane] and more text

    Crossing line boundaries is not an issue - each text string is complete. I need to be able to dump out the string until I see a reference to an image, then extract the name and alt text, handle it (by emitting <IMG>) and continue to echo text from the string until I encounter another image reference.

    My problem is in coming up with a syntax for this and then to write the code to extract the information.

    In the above example, I'm using the syntax: [filename,text]

    but it's conceivable that the HTML text might also contain [some plain text not related to images]

    so I thought about some of these: {filename,alt text} - not good, text might contain {plain text] filename, alt text img(filename,alt text)

    Using the same delimiter at each end might make it easier to use explode() to split the text. But perhaps img(filename,text) is more elegant, but it might need more skills than I have in using regex to recognize it and extract it. Also I need to figure out how to extract and echo the plain text around it.

    Any ideas are appreciated. Thanks.

    --
    John A. Grant  * I speak only for myself *  (remove 'z' to reply)
    Radiation Geophysics, Geological Survey of Canada, Ottawa
    If you followup, please do NOT e-mail me a copy: I will read it here
    

    attached mail follows:


    Why don't you do something like this:

    <servimg:name.jpg:This is the alt text Buddy>

    Then search for a regx something like <servimg*> (I am not sure of the exact syntax). Then parse the found tag, generate your <img tag and replace the original tag with the generated tag.

    I hope it gives you some good ideas.

    -Jason Garber IonZoft.com

    At 12:11 PM 10/18/2001 -0400, John A. Grant wrote: >I'm reading some HTML text from a file and echoing it to >stdout. The HTML text contains <IMG> but I would rather >have the server do the work of looking up the image size. >I know how to lookup the image size with getimagesize(). >My problem is in coming up with a good format for embedding >a reference to the image in the text and then writing the code >to parse it. > >So instead of this: > here is some text <img src=bird.gif width=100 height=20 > alt="this is a bird"> and here is more text and another > image <img src=plane.gif width=123 height=23 > alt="this is a plane"> and more text > >I would like to have something like this: > here is some text [bird.gif,this is a bird] and here > is more text and another image [plane.gif, this is a plane] > and more text > >Crossing line boundaries is not an issue - each text string >is complete. I need to be able to dump out the string until I >see a reference to an image, then extract the name and alt text, >handle it (by emitting <IMG>) and continue to echo text from >the string until I encounter another image reference. > >My problem is in coming up with a syntax for this and then >to write the code to extract the information. > >In the above example, I'm using the syntax: > [filename,text] > >but it's conceivable that the HTML text might also contain > [some plain text not related to images] > >so I thought about some of these: > {filename,alt text} - not good, text might contain {plain text] > filename, alt text > img(filename,alt text) > >Using the same delimiter at each end might make it easier >to use explode() to split the text. But perhaps img(filename,text) >is more elegant, but it might need more skills than I have in using >regex to recognize it and extract it. Also I need to figure out how >to extract and echo the plain text around it. > >Any ideas are appreciated. Thanks. > >-- >John A. Grant * I speak only for myself * (remove 'z' to reply) >Radiation Geophysics, Geological Survey of Canada, Ottawa >If you followup, please do NOT e-mail me a copy: I will read it here > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribelists.php.net >For additional commands, e-mail: php-general-helplists.php.net >To contact the list administrators, e-mail: php-list-adminlists.php.net

    attached mail follows:


    John,

    Two inter-dependent problems: 1 a means of identifying a cipher within the text 2 a means of replacing the cipher with HTML code

    1 there are a limited number of graphics formats (.GIF, .JPG, .PNG, etc) and the number you are prepared to contemplate may be even shorter. Thus it would not be difficult to use the filetype as a means to trigger a RegExp - and thus have no need for a "label mechanism" at all.

    2 I'm finding RegExps a bit hairy too. However there are a number of illustrations 'out there', eg in PHP and Perl web site articles, and I'm sure there are some you could borrow/amend - I'm coming up to needing one fairly similar if you want to 'trade'/division of labor.

    Now I just know you're going to say that so far I've dealt with just the first component of [bird.gif,this is a bird] - and just like every Canuck, you'd be right (or at least that's how the rest of us humor you(s))! First let's restate that cipher as

    space+bird.gif"this is a bird"

    where "space+" is at least one character of them immediately prior to the file name. Now you can see that the very same RegExp that recognises/pulls out the graphic filename, should also be able to pull out the alt-text, because that is enclosed within quotes (ie just as the HTML will require it). Because the quotes (could even offer the user/author a choice of single or double!) are paired, and the first is immediately after the filename, you won't have problems with other quoted strings getting caught up/misinterpreted!

    It takes a warped mind...

    Warped enough for you? =dn

    ----- Original Message ----- From: "John A. Grant" <jazrantzsc.nrcan.zc.ca> To: <php-generallists.php.net> Sent: 18 October 2001 17:11 Subject: [PHP] parsing a string

    > I'm reading some HTML text from a file and echoing it to > stdout. The HTML text contains <IMG> but I would rather > have the server do the work of looking up the image size. > I know how to lookup the image size with getimagesize(). > My problem is in coming up with a good format for embedding > a reference to the image in the text and then writing the code > to parse it. > > So instead of this: > here is some text <img src=bird.gif width=100 height=20 > alt="this is a bird"> and here is more text and another > image <img src=plane.gif width=123 height=23 > alt="this is a plane"> and more text > > I would like to have something like this: > here is some text [bird.gif,this is a bird] and here > is more text and another image [plane.gif, this is a plane] > and more text > > Crossing line boundaries is not an issue - each text string > is complete. I need to be able to dump out the string until I > see a reference to an image, then extract the name and alt text, > handle it (by emitting <IMG>) and continue to echo text from > the string until I encounter another image reference. > > My problem is in coming up with a syntax for this and then > to write the code to extract the information. > > In the above example, I'm using the syntax: > [filename,text] > > but it's conceivable that the HTML text might also contain > [some plain text not related to images] > > so I thought about some of these: > {filename,alt text} - not good, text might contain {plain text] > filename, alt text > img(filename,alt text) > > Using the same delimiter at each end might make it easier > to use explode() to split the text. But perhaps img(filename,text) > is more elegant, but it might need more skills than I have in using > regex to recognize it and extract it. Also I need to figure out how > to extract and echo the plain text around it. > > Any ideas are appreciated. Thanks. > > -- > John A. Grant * I speak only for myself * (remove 'z' to reply) > Radiation Geophysics, Geological Survey of Canada, Ottawa > If you followup, please do NOT e-mail me a copy: I will read it here > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > >

    attached mail follows:


    Beyond that, why not keep it conforming to HTML, and use an <IMG> tag, for example:

    This is some text <img src="name.jpg" alt="Alt Text" processat="server">.

    That way if you need to view the page "as-is" in a browser or whatever, it'd still look fine.. go grab yourself some good free html parser code, and analyse the options. If processat="server" then do your thing, and re-write the <img> tag. :)

    Mike

    Jason G. wrote:

    > Why don't you do something like this: > > <servimg:name.jpg:This is the alt text Buddy> > > Then search for a regx something like <servimg*> (I am not sure of > the exact syntax). > Then parse the found tag, generate your <img tag and replace the > original tag with the generated tag. > > I hope it gives you some good ideas. > > -Jason Garber > IonZoft.com > > > > > > At 12:11 PM 10/18/2001 -0400, John A. Grant wrote: > >> I'm reading some HTML text from a file and echoing it to >> stdout. The HTML text contains <IMG> but I would rather >> have the server do the work of looking up the image size. >> I know how to lookup the image size with getimagesize(). >> My problem is in coming up with a good format for embedding >> a reference to the image in the text and then writing the code >> to parse it. >> >> So instead of this: >> here is some text <img src=bird.gif width=100 height=20 >> alt="this is a bird"> and here is more text and another >> image <img src=plane.gif width=123 height=23 >> alt="this is a plane"> and more text >> >> I would like to have something like this: >> here is some text [bird.gif,this is a bird] and here >> is more text and another image [plane.gif, this is a plane] >> and more text >> >> Crossing line boundaries is not an issue - each text string >> is complete. I need to be able to dump out the string until I >> see a reference to an image, then extract the name and alt text, >> handle it (by emitting <IMG>) and continue to echo text from >> the string until I encounter another image reference. >> >> My problem is in coming up with a syntax for this and then >> to write the code to extract the information. >> >> In the above example, I'm using the syntax: >> [filename,text] >> >> but it's conceivable that the HTML text might also contain >> [some plain text not related to images] >> >> so I thought about some of these: >> {filename,alt text} - not good, text might contain {plain text] >> filename, alt text >> img(filename,alt text) >> >> Using the same delimiter at each end might make it easier >> to use explode() to split the text. But perhaps img(filename,text) >> is more elegant, but it might need more skills than I have in using >> regex to recognize it and extract it. Also I need to figure out how >> to extract and echo the plain text around it. >> >> Any ideas are appreciated. Thanks. >> >> -- >> John A. Grant * I speak only for myself * (remove 'z' to reply) >> Radiation Geophysics, Geological Survey of Canada, Ottawa >> If you followup, please do NOT e-mail me a copy: I will read it here >> >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: php-general-unsubscribelists.php.net >> For additional commands, e-mail: php-general-helplists.php.net >> To contact the list administrators, e-mail: php-list-adminlists.php.net > > >

    attached mail follows:


    Hey John, something like this might work:

    <?

    $string = "This is a string with an embedded image [bird.gif,this is a bird]";

    $string = preg_replace("/\[(.*?\.)(gif|jpg),(.*?)\]/i", "<img src=\"\\1\\2\" alt=\"\\3\">", $string);

    echo $string;

    ?>

    James

    "John A. Grant" <jazrantzsc.nrcan.zc.ca> wrote in message news:20011018162235.59221.qmailpb1.pair.com... > I'm reading some HTML text from a file and echoing it to > stdout. The HTML text contains <IMG> but I would rather > have the server do the work of looking up the image size. > I know how to lookup the image size with getimagesize(). > My problem is in coming up with a good format for embedding > a reference to the image in the text and then writing the code > to parse it. > > So instead of this: > here is some text <img src=bird.gif width=100 height=20 > alt="this is a bird"> and here is more text and another > image <img src=plane.gif width=123 height=23 > alt="this is a plane"> and more text > > I would like to have something like this: > here is some text [bird.gif,this is a bird] and here > is more text and another image [plane.gif, this is a plane] > and more text > > Crossing line boundaries is not an issue - each text string > is complete. I need to be able to dump out the string until I > see a reference to an image, then extract the name and alt text, > handle it (by emitting <IMG>) and continue to echo text from > the string until I encounter another image reference. > > My problem is in coming up with a syntax for this and then > to write the code to extract the information. > > In the above example, I'm using the syntax: > [filename,text] > > but it's conceivable that the HTML text might also contain > [some plain text not related to images] > > so I thought about some of these: > {filename,alt text} - not good, text might contain {plain text] > filename, alt text > img(filename,alt text) > > Using the same delimiter at each end might make it easier > to use explode() to split the text. But perhaps img(filename,text) > is more elegant, but it might need more skills than I have in using > regex to recognize it and extract it. Also I need to figure out how > to extract and echo the plain text around it. > > Any ideas are appreciated. Thanks. > > -- > John A. Grant * I speak only for myself * (remove 'z' to reply) > Radiation Geophysics, Geological Survey of Canada, Ottawa > If you followup, please do NOT e-mail me a copy: I will read it here > > >

    attached mail follows:


    Isn't it fun when people asking questions on the list spark off your own thoughts/inspiration!?

    Has anyone seen a tabulation of the functions in (manual: IV Function Reference XXVI. Filesystem functions) that shows which functions [don't] work under what conditions? eg

    Col1: function name, Col2: if it works under *nix/Windows/etc, Col3: if it works for remote files/URLs

    Please advise, =dn

    attached mail follows:


    Hello php-general,

    People, tell me please what's the difference between subj, except that the 1st translates space into +.

    -- 
    Best regards,
     Olexandr Vynnychenko                          mailto:supaboyi.com.ua
    

    attached mail follows:


    recursion + ftp_get...

    > Hi All, > > I would like to know how to download the whole directory using PHP. > > > Thanks > > > Mark Lo > >

    attached mail follows:


    Hello there...

    The problem is that I can only add one value into the array... Anyone knows what I'm doing wrong here....(First project by the way!!) ===================================================== <?php session_start(); session_register("offer");

    // Make a new offer if it doesn't exist yet if (!is_array($offer)) { $offer = array(array('pid' => '', 'pname' => '', 'pqty' => '')); $nrItems = 0; }

    // Get variables from products.php $productID=trim(${"pid"}); $productName=trim(${"productName"});

    // Add product to offer if ($productID!="") { $nrItems = $nrItems + 1; for ($i=0; $i<$nrItems; $i=$i+1) { if ($offer[$i]['pid']=="") { $productQTY = 1; $offer[$i]['pid'] = $productID; $offer[$i]['pname'] = $productName; $offer[$i]['pqty'] = $productQTY; } } }

    //if there are no items in the offer, print a message if ($offer[0]['pid']=="") { echo "No items in the offer"."<br>\n"; var_dump($offer)."<br>\n"; echo "<a href=producten.php>back</a>"; } //else print the contents of the offer else { for ($i=0; $i<$nrItems; $i=$i+1) { echo "The offer:"."<br>\n";

    var_dump($offer)."<br>\n";

    echo "The offer contains items: "; echo $nrItems."<br>\n"; echo $offer[$i]['pid']."<br>\n"; echo $offer[$i]['pname']."<br>\n"; echo $offer[$i]['pqty']."<br>\n"; echo "<br>\n"; echo "<a href=producten.php>back</a>"; echo "<br>\n"; } } ======================================================

    THNX in advance

    attached mail follows:


    Hi,

    I was looking through some PHP books and scripts on the web and I have noticed different syntax for inputting and outputting data.

    For example the book PHP essentials used a format of slash and quotations:

    $sql = "INSERT INTO USER_TRACK VALUES (\"$user_id\", "$sel

    echo "$user_id";

    Another script which was used for discussion group, , used the following format:

    $sql = "INSERT INTO discussion_board ('$name', '$subject'

    echo $name;

    I was wondering what is the difference between using single quotes and double quotes with slashes and the difference between using the "echo" command with or without the quotation around the variable?

    Thanks.

    Peter

    attached mail follows:


    Well basically you would use double quotes whenever you want the data/text in between the quotes to be parsed, so for instance:

    $name = 'Rick'; echo "My name is $name"; // output = My name is Rick echo 'My name is $name'; // output = My name is $name echo "My name is \"$name\""; // output = My name is "Rick" echo 'My name is "$name"'; // output = My name is "$name" echo "My name is '$name'"; // output = My name is 'Rick'

    Whenever a string does not need to be parsed go ahead and use the single quote, whenever it needs to be parsed use double quotes, but remember whichever quote you decide to use, if you want to use the same quote inside your string you're going to have to escape the quote inside your string using the forward slash.

    I try to make sure all my html has double quotes so if I echo just plain html I use the single quotes that way I do not have to escape my double quotes... example: echo '<img src="hello.gif">'; instead of echo "<img src=\"hello.gif\">";

    I hope all of that made sense! :)

    Rick

    > I was looking through some PHP books and scripts on the web and I have > noticed different syntax for inputting and outputting data. > > For example the book PHP essentials used a format of slash and quotations: > > $sql = "INSERT INTO USER_TRACK VALUES (\"$user_id\", "$sel > > echo "$user_id"; > > > Another script which was used for discussion group, , used the following > format: > > $sql = "INSERT INTO discussion_board ('$name', '$subject' > > echo $name; > > I was wondering what is the difference between using single quotes and > double quotes with slashes and the difference between using the > "echo" command with or without the quotation around the variable? > > Thanks. > > Peter > > > > -- > PHP General Mailing List (