OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general-digest-help_at_lists.php.net
Date: Wed Jul 17 2002 - 16:46:26 CDT

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

    php-general Digest 17 Jul 2002 21:46:26 -0000 Issue 1470

    Topics (messages 108046 through 108171):

    Re: Multiple Tables -add, edit, delete
            108046 by: Paul Dionne

    To fill an Array
            108047 by: Gabor Niederlaender
            108048 by: Andrey Hristov

    Re: Strong Web Hosts in Canada?
            108049 by: Andre Dubuc
            108051 by: Adam Alkins

    Re: Sessions / logins / cookies / security
            108050 by: Justin French
            108057 by: John Holmes
            108060 by: René Moonen

    php 4.2.1 compilation errors with apache 2.0
            108052 by: electroteque

    php Similar to C in Pointer Memory Accessing or not?
            108053 by: Kondwani Spike Mkandawire
            108131 by: Miguel Cruz

    Sessions Vars under 4.0.4pl1
            108054 by: Henry

    Forms problem?
            108055 by: Mark Colvin
            108056 by: Jason Wong

    Regular expression for correcting proper nouns
            108058 by: Henry
            108062 by: Jason Wong

    DPHPEdit new version
            108059 by: Davor Pleskina

    function for finding one character in a string?
            108061 by: Scott Fletcher
            108064 by: Jason Wong
            108068 by: Adam Voigt

    CRON JOB
            108063 by: MAAS
            108066 by: José León Serna
            108067 by: Jason Wong
            108069 by: val petruchek
            108070 by: Jay Blanchard
            108125 by: Miguel Cruz

    Debugging LDAP_connect problems
            108065 by: Brad Harriger

    imap connection problem
            108071 by: Korbinian Schmid
            108089 by: Latex Master
            108122 by: Korbinian Schmid

    win32 mail()
            108072 by: val petruchek
            108078 by: Jason Wong
            108082 by: val petruchek

    Classes Constructor syntax
            108073 by: David Russell
            108075 by: Matthew Gray
            108077 by: Michael Hall
            108081 by: Michael Hall
            108116 by: Analysis & Solutions

    Regular expression
            108074 by: Michal Albrecht
            108076 by: Andrey Hristov
            108080 by: Michal Albrecht
            108107 by: Analysis & Solutions

    File reading help with Syntax
            108079 by: Chris Crane
            108138 by: Analysis & Solutions

    $HTTP_SESSION_VARS ? Have I got it wrong
            108083 by: Henry
            108084 by: Martin Clifford
            108085 by: Martin Clifford
            108100 by: John Holmes

    querying for one specific row number
            108086 by: Phil Schwarzmann
            108087 by: Martin Clifford
            108088 by: René Moonen
            108098 by: John Holmes

    Of Jobs and Certs
            108090 by: Martin Clifford
            108130 by: Miguel Cruz
            108132 by: Danny Shepherd
            108167 by: Peter J. Schoenster

    $_SESSION - autostart, or session_start() ?
            108091 by: Matt Babineau
            108092 by: Andrey Hristov
            108094 by: Martin Clifford
            108097 by: John Holmes

    Queries - Sometimes I need to use apostrophe, other times i don't
            108093 by: Phil Schwarzmann
            108095 by: Asmodean
            108096 by: John Holmes

    Re: OT [PHP] querying for one specific row number
            108099 by: John Holmes

    timer on sessions?
            108101 by: Jas
            108102 by: Asmodean
            108105 by: Jas
            108106 by: Asmodean
            108108 by: Asmodean
            108109 by: Jas
            108111 by: Asmodean

    Re: Problem on file_exists() function
            108103 by: Analysis & Solutions

    ARRAY_PUSH()
            108104 by: Chris Crane
            108158 by: Analysis & Solutions

    New York PHP Presents: Implementing an Object-based Web Framework in PHP
            108110 by: Daniel Kushner

    Tips for better PHP, wish I read yesterday
            108112 by: Peter J. Schoenster
            108118 by: Jay Blanchard

    regex in_array or array_search
            108113 by: Dave [Hawk-Systems]
            108114 by: Chris Boget

    Confused about the list() function
            108115 by: DonPro
            108117 by: John Holmes
            108119 by: Asmodean
            108160 by: Analysis & Solutions

    remove header tags - include file
            108120 by: Juan Pablo Aqueveque
            108121 by: Asmodean
            108123 by: Juan Pablo Aqueveque
            108128 by: Asmodean

    Someone Help please
            108124 by: Chris Crane
            108127 by: Kevin Stone
            108134 by: John Holmes
            108140 by: Chris Crane
            108161 by: Analysis & Solutions

    Restart process from code?
            108126 by: Noah Spitzer-Williams
            108133 by: John Holmes
            108135 by: Noah Spitzer-Williams
            108139 by: John Holmes
            108142 by: Noah Spitzer-Williams
            108163 by: Analysis & Solutions
            108170 by: Peter

    ErrorDocument 404 & Form
            108129 by: Fabien Penso
            108151 by: Tom Ray
            108169 by: Peter

    Re: Opening and Editing Quark Binaries
            108136 by: Miguel Cruz

    how many requests can php serve?
            108137 by: Andy
            108141 by: Miguel Cruz
            108144 by: Andy
            108147 by: Blair Colbey
            108149 by: Chris Hewitt

    Re: Of Jobs and Certs [long]
            108143 by: Jay Blanchard
            108148 by: Chris Hewitt

    imap_mail_move and imap_mail_copy
            108145 by: Jeff Schwartz

    Re: [PHP-WIN] CRON JOB
            108146 by: Svensson, B.A.T. (HKG)

    sorting and searching an Array
            108150 by: rdkurth.starband.net
            108155 by: Dan Koken
            108156 by: Kevin Stone
            108159 by: Monty

    Re: Printer margins
            108152 by: Paul Roberts

    preg_replace_callback
            108153 by: Rafael Fernandes

    Segmentation fault with Sablotron xslt_process()
            108154 by: William S.

    Includes vs. Functions
            108157 by: Monty
            108165 by: John Holmes
            108168 by: Chris Crane
            108171 by: Monty

    how to access javascipt variables in PHP
            108162 by: Seppo Laukkanen
            108164 by: John Holmes
            108166 by: Martin Clifford

    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:


    Thanks Dan

    Paul

    Analysis & Solutions wrote:

    > Oh, yes! I forgot about deleting countries that have been unchecked!
    > Hmm... Lock the table to prevent people from reading from it, delete
    > all records for that company, then loop through and insert the new
    > data, then unlock the table.
    >
    > --Dan
    >

    attached mail follows:


    Hi all!

    I would like to fill the values from my $_POST array to another array
    called xy which is not an associative array.

    F.Ex:

    $_POST['smthing'] should be $xy[0] etc...

    How do I do this?

    Best regards,
    Gabor

    attached mail follows:


     $xy = array_values($_POST);

    HTH

    Regards,
    Andrey Hristov

    ----- Original Message -----
    From: "Gabor Niederlaender" <gabor.niederlaenderwu-wien.ac.at>
    To: <php-generallists.php.net>
    Sent: Wednesday, July 17, 2002 1:19 PM
    Subject: [PHP] To fill an Array

    > Hi all!
    >
    > I would like to fill the values from my $_POST array to another array
    > called xy which is not an associative array.
    >
    > F.Ex:
    >
    > $_POST['smthing'] should be $xy[0] etc...
    >
    > How do I do this?
    >
    > Best regards,
    > Gabor
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php
    >
    >

    attached mail follows:


    Hi Dan,

    Try http://www.hub.org.

    Hth,
    Andre

    On Wednesday 17 July 2002 02:23 am, you wrote:
    > Hi Folks:
    >
    > A client of mine has a large series of high traffic, PHP/MySQL intensive
    > websites. They're looking for dedicated hosting in Canada. Any
    > recommendations?
    >
    > Enjoy,
    >
    > --Dan

    attached mail follows:


    > Hi Folks:
    >
    > A client of mine has a large series of high traffic, PHP/MySQL intensive
    > websites. They're looking for dedicated hosting in Canada. Any
    > recommendations?

    You might have better luck getting recommendation on
    http://www.webhostingtalk.com

    --------------
    Adam Alkins
    http://www.rasadam.com
    --------------

    attached mail follows:


    on 17/07/02 6:51 PM, John Holmes (holmes072000charter.net) wrote:

    >> ... and I am -- A shared host server that is.
    >
    > Now I'm not sure on this, I haven't tested it. Has anyone?

    Is this particular vulnerability only in existence when the server is pretty
    open? I mean, on my particular host, I can't FTP to anything outside my
    docroot, and I can't use SSH, telnet, etc.

    phpinfo() says my session.save-path is /tmp -- since (in theory) I can't get
    the files via telnet, FTP or HTTP, the only option I can think of would be
    another user on the host gaining access to it via a PHP script... which I'm
    not sure can be done, and can't really test, because I wouldn't know how to
    do it.

    Justin

    attached mail follows:


    > >> ... and I am -- A shared host server that is.
    > >
    > > Now I'm not sure on this, I haven't tested it. Has anyone?
    >
    > Is this particular vulnerability only in existence when the server is
    > pretty
    > open? I mean, on my particular host, I can't FTP to anything outside
    my
    > docroot, and I can't use SSH, telnet, etc.

    That's for you, but when you run a PHP script, you run it as user
    Apache, www, nobody, etc...however your system is set up (if PHP is a
    module).

    > phpinfo() says my session.save-path is /tmp -- since (in theory) I
    can't
    > get
    > the files via telnet, FTP or HTTP, the only option I can think of
    would be
    > another user on the host gaining access to it via a PHP script...
    which
    > I'm
    > not sure can be done, and can't really test, because I wouldn't know
    how
    > to
    > do it.

    Yes, the attack could only come from someone on the same server. That's
    why dedicated servers are preferred and why safe_mode is used on virtual
    aervers. Safe_mode may protect the sessions, too, not sure.

    <?
    $_SESSION['Logged_On'] = 1;
    $_SESSION['Admin'] = 1;
    $s = serialize($_SESSION);

    $fp = fopen("/tmp/bad_session.file","w");
    fwrite($fp,$s);
    fclose($fp);
    ?>

    http://www.yoursite.com?PHPSESSID=bad_session

    I don't have a virtual server environment to actually test this out
    with, though...and it would require a lot of work from the hacker...but
    what else do they have to do. Get a dedicated server...they really
    aren't that expensive anymore.

    ---John Holmes...

    attached mail follows:


    <snip>

    >What I'm looking to do is when a user logs in, I start up the session.. I
    >then have the registered session var to verify they are authenticated as
    >they move throughout the site.
    >
    </snip>

    This solution is no garantuee that the authenticated user is in control
    during that session. The only thing you realy *know* is that there was a
    succesful authentication at the beginning of the current session and you
    would *assume* that the user is at the client screen during the
    complete session. (the authenticated user could leave the browser
    unattended).

    <snip>

    >Now, when they close the browser and come back, I want them to still be
    >authenticated.
    >
    </snip>

    The only thing you *know* for sure is that there was a valid
    authentication during some *previous* session. And that *some* user has
    still access to that client based on some client specific authentication
    (pressing ESC during Windows login dialog). So what's your definition of
    'authenticated'.

    <snip>

    >What's the most secure way, that's not easily spoofed?
    >
    </snip>

    My point is this. You will never know for sure if the authenticated user
    is still in control in whatever session (not even the first). If you
    realy need to be sure, you would use authentication more than once
    during a session. For example a first time login and then again just
    before the user wants to post or read important information.

    If this is of no concern to your application, than it will be no problem
    to use cookies with some session identifier to allow continuing without
    authentication during the next session. But it might be wise to force
    authentication if a user where to enter some kind of admin area of your
    site during the second session.

    Success

    René

    attached mail follows:


    hi guys i am getting this message when trying to compile php 4.2.1 with
    apache 2.0

    os.h: No such file or directory , there is a missing file, i tried a symlink
    to /os/unix/os.h but still didnt work ??

    attached mail follows:


    Hi Folks:

    Just for interest sake, for those of you who have messed
    with C know about Pointers hence probably know that
    one can access stuff from Memory Locations in very wierd
    ways via pointers and Arrays:

    int * ptr;
    ptr = array[0];
    ptr=ptr-1;

    The last statement does not generate an error but lets you
    access that location...
    Firstly I want to know if PHP has pointers (I know it uses
    dereferencing values via &) and if it does use pointers
    does it let you do stuff like this (or does its nature not
    let you interact with the lower level hardware components?
    I've never seen the need to investigate if there are pointers
    in PHP but it would be an interesting thing to know...
    Being a Server Side tool, it would not surprise me if it did,
    it appears to have some similarities to C anywayz notably
    function printf()

    Spike...

    attached mail follows:


    On Wed, 17 Jul 2002, Kondwani Spike Mkandawire wrote:
    > Just for interest sake, for those of you who have messed
    > with C know about Pointers hence probably know that
    > one can access stuff from Memory Locations in very wierd
    > ways via pointers and Arrays:
    >
    > int * ptr;
    > ptr = array[0];
    > ptr=ptr-1;
    >
    > The last statement does not generate an error but lets you
    > access that location...

    It may generate an error. Depends on where ptr-1 happens to be. In any
    case it's not a bright thing to do as the effects are undefined and
    unknowable.

    > Firstly I want to know if PHP has pointers (I know it uses
    > dereferencing values via &) and if it does use pointers
    > does it let you do stuff like this (or does its nature not
    > let you interact with the lower level hardware components?

    PHP doesn't have pointers as such. It has references but you can't do math
    on them to create other references.

    Pointers don't have anything to do with lower level hardware components.
    They're just one way of dealing with memory.

    miguel

    attached mail follows:


    Hello All,

    I, having problems getting HTTP_SESSION_VARS to work the way I think they
    should.
    Shouldn't I just be able to do something like:

    in a file called index.php I have the following;

    <?php
    session_start();
    ?>
    <html>
    <head></head>
    <body>
    The session_id is <?php echo "\"".session_id()."\""; ?>

    <a href="index2.php">Next</a>
    <?php
    $HTTP_SESSION_VARS['count']=123;
    ?>
    </body>
    </html>

    In index2.php I then have
    <?php
    session_start();
    ?>
    <html>
    <head></head>
    <body>
    The session_id is <?php echo "\"".session_id()."\""; ?>
    <?php
    echo "\$HTTP_SESSION_VARS['count']=".$HTTP_SESSION_VARS['count'].".<BR>";
    ?>
    </body>
    </html>

    Now when I go to the first one all is great and the session id is shown. But
    when I click on the "Next" link I get the next page with the same session id
    shown (all well and good) but no value in $HTTP_SESSION_VARS['count']!!!

    Where am I going wrong?

    Henry

    attached mail follows:


    I have a php script that queries a mysql db and build a form on a page for
    each row returned. Each form has four fields and a thumbnail of a JPEG.
    Below the image is a link to view the full image in a new window by using a
    javascript function. (No javascript jibes before I go any further, it was
    the only way I knew how). When I enter a query and say 10 records are
    returned (10 forms are created with the same name), the data and appropriate
    thumbnails are displayed correctly. When I click on the link the full image
    is only displayed for the first six links. After this clicking on the link
    has no effect. In the example above, the first five images were the same and
    the last five were also the same. I should also mention that when I load
    this page, I get an IE error 'unterminated string constant' but the page
    does load correctly. I have checked my code for closing quotes etc but they
    seem OK. Is there a max number of forms that can be created on a page or do
    I have to name them all different or is there some other explanation as to
    why the images won't display. Any ideas would be helpful and I can post more
    code if required.

    The call to the function is:

    echo "<td width='200' colspan='2' align='center' class=labels><a
    href='javascript:void(0)' onclick='ViewFullImage(\"$img_code\")'>View full
    size</a></td>";

    The function is:

    function ViewFullImage(strCode)
       {

    msg=window.open("","msg","height=400,width=750,left=20,top=80,scrollbars=yes
    ,resizable=yes");
          msg.document.write("<html><title>Decoration Image</title>");
          msg.document.write("<body bgcolor='white' onblur=window.close()>");

          msg.document.write("<center><img src=images/" + strCode + ".jpg
    align=center valign=center></center>");
          msg.document.write("</body></html><p>");
       }

    ****************************************************
    This e-mail is intended for the recipient only and
    may contain confidential information. If you are
    not the intended recipient then you should reply
    to the sender and take no further ation based
    upon the content of the message.
    Internet e-mails are not necessarily secure and
    CCM Limited does not accept any responsibility
    for changes made to this message.
    Although checks have been made to ensure this
    message and any attchments are free from viruses
    the recipient should ensure that this is the case.
    ****************************************************

    attached mail follows:


    On Wednesday 17 July 2002 19:17, Mark Colvin wrote:

    Misleading subject. Nothing to do with php or forms.

    [snip]

    > mention that when I load this page, I get an IE error 'unterminated string
    > constant' but the page does load correctly.

    Obviously there is a problem. What does 'load correctly' mean?

    My guess is that $img_code contains a space?

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* Veni, vidi, vici. [I came, I saw, I conquered]. -- Gaius Julius Caesar */

    attached mail follows:


    Hi All,

    I'm looking for a simple was to correct a list of proper nouns given all in lower case!

    For example

    given $string="london paris rome";

    I would like "London Paris Rome".

    However there is one cavet; if the word already has a captital anywhere in it, it should be left alone!!!

    Is there a soultion using regular expressions?

    Also is there one for removing multiple spaces?

    i..e given "A B C D E" it would give "A B C D E".

    I have never used regular expression before and thought that if I had some examples like these, I could go from there.

    Henry

    attached mail follows:


    On Wednesday 17 July 2002 20:07, Henry wrote: > Hi All, > > I'm looking for a simple was to correct a list of proper nouns given all in > lower case! > > For example > > given $string="london paris rome"; > > I would like "London Paris Rome". > > However there is one cavet; if the word already has a captital anywhere in > it, it should be left alone!!!

    ucwords()

    > Is there a soultion using regular expressions?

    Yes.

    > Also is there one for removing multiple spaces?

    Yes.

    > i..e given "A B C D E" it would give "A B C D E".

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* Stability itself is nothing else than a more sluggish motion. */

    attached mail follows:


    PHP (and other) programmers,

    Feel free to download and use this small PHP IDE.

    There is a new, completely stable version 0.9.2.3 available at http://www.pleskina.com/dphped

    Thanks all you guys who helped me making this program better and more usable!

    Keep looking ahead for more features in the future.

    __________________________________________________________________ Davor Pleskina - davorpleskina.com http://www.pleskina.com ICQ#: 38632789 Programmers don't die; they just GOSUB without RETURN... __________________________________________________________________

    attached mail follows:


    I have been looking around in the PHP function listing for a function that can find or match one character from a string. I thought it would be something like post_str() or something but never found anything close to that. I get the idea of post and str from the SQL command. I did check the ereg() but it is so confusing, no clear instruction on it.

    --clip-- $str = ""; $str = "X"; $str = "XY" $str = "Y"; $str = "YX"; --clip--

    Those same variables from above, I only need to know if hte "X" exist in the string, nothing else.

    Thanks, FletchSOD

    attached mail follows:


    On Wednesday 17 July 2002 05:36, Scott Fletcher wrote: > I have been looking around in the PHP function listing for a function that > can find or match one character from a string. I thought it would be > something like post_str() or something but never found anything close to > that. I get the idea of post and str from the SQL command. I did check > the ereg() but it is so confusing, no clear instruction on it. > > --clip-- > $str = ""; > $str = "X"; > $str = "XY" > $str = "Y"; > $str = "YX"; > --clip-- > > Those same variables from above, I only need to know if hte "X" exist in > the string, nothing else.

    strstr()

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* "Think of it this way: threads are like salt, not like pasta. You like salt, I like salt, we all like salt. But we eat more pasta."

    - Larry McVoy */

    attached mail follows:


    Or, if you want a count of the number of times a character (or string if you want) ocurrs in a string, you could use: substr_count()

    http://www.php.net/manual/en/function.substr-count.php

    Adam Voigt adam.voigtcryptocomm.com

    On Tue, 2002-07-16 at 17:36, Scott Fletcher wrote: > I have been looking around in the PHP function listing for a function that > can find or match one character from a string. I thought it would be > something like post_str() or something but never found anything close to > that. I get the idea of post and str from the SQL command. I did check the > ereg() but it is so confusing, no clear instruction on it. > > --clip-- > $str = ""; > $str = "X"; > $str = "XY" > $str = "Y"; > $str = "YX"; > --clip-- > > Those same variables from above, I only need to know if hte "X" exist in the > string, nothing else. > > Thanks, > FletchSOD > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    What do I have to do before I can run my file.php as a cron job in Linux?

    attached mail follows:


    MAAS wrote:

    >What do I have to do before I can run my file.php as a cron job in Linux? > What problem do you have? I have no problems with it calling it as php myfile.php

    -- 
    Best Regards.
    ------------------------------------------
    QaDRAM Studio, RAD development for the web
    http://studio.qadram.com
    

    attached mail follows:


    On Wednesday 17 July 2002 20:51, MAAS wrote: > What do I have to do before I can run my file.php as a cron job in Linux?

    search archives for "cron".

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* "Never underestimate the power of a small tactical nuclear weapon." */

    attached mail follows:


    */1 * * * * val /usr/local/bin/lynx -source http://php.net/crontab/steward.php - example of how to call script every minute

    --
    Sincerely, val petruchek
    "Maas" <maastelia.com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
    news:20020717125122.21029.qmailpb1.pair.com...
    >
    > What do I have to do before I can run my file.php as a cron job in Linux?
    >
    >
    >
    

    attached mail follows:


    [snip] What do I have to do before I can run my file.php as a cron job in Linux? [/snip]

    Look at the archives for the past couple of days, it has been covered in some detail. Make sure to compile PHP without apsx, and for practical purposes move the PHP executable to the /usr/local/bin directory. Then put this as the first line of the PHP file you want to run from a CRON;

    #!/usr/local/bin/php

    Then set up your CRON.

    HTH!

    Jay

    "Philosophy is a study that lets us be unhappy more intelligently."

    ************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************

    attached mail follows:


    On Wed, 17 Jul 2002, Jay Blanchard wrote: > Look at the archives for the past couple of days, it has been covered in > some detail. Make sure to compile PHP without apsx, and for practical > purposes move the PHP executable to the /usr/local/bin directory. Then put > this as the first line of the PHP file you want to run from a CRON; > > #!/usr/local/bin/php > > Then set up your CRON.

    Might want to add the -q flag to the php bangpath invocation.

    miguel

    attached mail follows:


    I'm trying to connect to a server using ldap_connect. The connection is failing, but I'm not sure why. When I try to use ldap_error() to narrow down the problem, I get a messaging saying "... 0 is not a LDAP link index at ...." I'm not sure what other options I have. Any suggestions would be apprecieated.

    Thanks in advance,

    Brad

    attached mail follows:


    when i try to connect to my local imap server by php i get the message (standard ie message) that the page can't be shown. with another server (imap.web.de) everything works fine. with outlook i can access my server without any problems and also mtest seems to work without any errors. what's wrong. would be nice if anybody could help me.

    CU Korbi

    attached mail follows:


    Hello Korbinian, Can you provide the script code? Let's see how we can help

    Wednesday, July 17, 2002, 4:50:44 PM, you wrote:

    KS> when i try to connect to my local imap server by php i get the message KS> (standard ie message) that the page can't be shown. with another server KS> (imap.web.de) everything works fine. with outlook i can access my server KS> without any problems and also mtest seems to work without any errors. what's KS> wrong. would be nice if anybody could help me.

    KS> CU Korbi

    -- 
    Best regards,
     Latex                            mailto:freemansubmission.org.ru
    

    attached mail follows:


    the important part (without this line the script works):

    $mbox = imap_open ("{localhost/imap}INBOX","xxxx", "xxxx");

    it`s the same without "INBOX" i also tried different downloaded mailbox scripts so i think it's a php-system problem.

    Latex Master <freemansubmission.org.ru> schrieb in im Newsbeitrag: 111197396040.20020717185156submission.org.ru... > Hello Korbinian, > Can you provide the script code? > Let's see how we can help > > Wednesday, July 17, 2002, 4:50:44 PM, you wrote: > > KS> when i try to connect to my local imap server by php i get the message > KS> (standard ie message) that the page can't be shown. with another server > KS> (imap.web.de) everything works fine. with outlook i can access my server > KS> without any problems and also mtest seems to work without any errors. what's > KS> wrong. would be nice if anybody could help me. > > KS> CU Korbi > > > > > > > -- > Best regards, > Latex mailto:freemansubmission.org.ru >

    attached mail follows:


    don't be afraid - it works perfect.

    i mean mail() on win32 server

    my question is - how to set up SMTP authorization in php ini (if smtp server requires pop auth)

    is it possible or should i use direct smtp connection?

    --
    Sincerely, val petruchek
    

    attached mail follows:


    On Wednesday 17 July 2002 21:18, val petruchek wrote: > don't be afraid - it works perfect. > > i mean mail() on win32 server > > my question is - how to set up SMTP > authorization in php ini > (if smtp server requires pop auth)

    Standard mail() doesn't do auth.

    > is it possible or should i use direct smtp > connection?

    Have a look the the Pear mail.php or google for "php smtp auth"

    -- 
    Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    

    /* The full impact of parenthood doesn't hit you until you multiply the number of your kids by thirty-two teeth. */

    attached mail follows:


    > Have a look the the Pear mail.php or google for "php smtp auth"

    already done, but i've my own smtp class anyway.

    i hoped to avoid rewriting code which used mail().

    thanks

    --
    Sincerely, val petruchek
    "Jason Wong" <php-generalgremlins.com.hk> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
    ÓÌÅÄÕÀÝÅÅ: news:200207172154.50892.php-generalgremlins.com.hk...
    

    attached mail follows:


    Hi all,

    I am finally spending some time converting a million and one functions into a class - this is for a software issue tracking system.

    I have:

    class issue { var var ...

    function issue() { //default constructor //initialise all variables to defaults, and start getting the stuff from forms }

    function issue($number) { //1 variable constructor // Query database and populate variables accordingly } }

    My question is: will this work? does PHP OOP support more than one constructor? If my syntax is wrong, please let me know the correct syntax.

    Thanks

    David R

    attached mail follows:


    PHP does not support multiple constructors. But, It does support variable argument lists, so you can fake it with func_get_args() and func_get_num_args():

    function issue() {

    if( func_get_num_args() > 0 ) { $args = func_get_args()

    } else {

    // do something else... } }

    Matt

    David Russell wrote:

    > Hi all, > > I am finally spending some time converting a million and one functions > into a class - this is for a software issue tracking system. > > I have: > > class issue { > var > var > ... > > function issue() { //default constructor > //initialise all variables to defaults, and start getting the > stuff from forms > } > > function issue($number) { //1 variable constructor > // Query database and populate variables accordingly > } > } > > My question is: will this work? does PHP OOP support more than one > constructor? If my syntax is wrong, please let me know the correct > syntax. > > Thanks > > David R >

    attached mail follows:


    PHP does not support multiple constructors.

    Michael

    On Wed, 17 Jul 2002, David Russell wrote:

    > Hi all, > > I am finally spending some time converting a million and one functions > into a class - this is for a software issue tracking system. > > I have: > > class issue { > var > var > ... > > function issue() { //default constructor > //initialise all variables to defaults, and start getting the stuff > from forms > } > > function issue($number) { //1 variable constructor > // Query database and populate variables accordingly > } > } > > My question is: will this work? does PHP OOP support more than one > constructor? If my syntax is wrong, please let me know the correct syntax. > > Thanks > > David R > > >

    -- 
    --------------------------------
    n   i   n   t   i  .   c   o   m
    php-python-perl-mysql-postgresql
    --------------------------------
    Michael Hall     nintininti.com
    --------------------------------
    

    attached mail follows:


    I'm no guru, but here goes anyway ...

    default variable values can simply be set with a "var" statement:

    var $somevar1 = "value1"; var $somevar2 = "value2";

    or with a "set" function:

    var $somevar1; var $somevar2;

    function setsomevar1() { $this->somevar1 = "value1"; }

    function setsomevar2() { $this->somevar2 = "value2"; }

    One "set" function could probably query a database and set all your vars in one go:

    function setallvars() { // query db, get values $this->somevar1 = "value1"; $this->somevar2 = "value2"; }

    Amyway, you could then call the set var functions from within your constructor:

    function issue() { setallvars(); or setsomevar1(); setsomevar2(); }

    Just a suggestion. No doubt someone will correct me if I'm wrong ... I'm new to OOP myself.

    Michael

    On Wed, 17 Jul 2002, David Russell wrote:

    > Hi all, > > I am finally spending some time converting a million and one functions > into a class - this is for a software issue tracking system. > > I have: > > class issue { > var > var > ... > > function issue() { //default constructor > //initialise all variables to defaults, and start getting the stuff > from forms > } > > function issue($number) { //1 variable constructor > // Query database and populate variables accordingly > } > } > > My question is: will this work? does PHP OOP support more than one > constructor? If my syntax is wrong, please let me know the correct syntax. > > Thanks > > David R > > >

    -- 
    --------------------------------
    n   i   n   t   i  .   c   o   m
    php-python-perl-mysql-postgresql
    --------------------------------
    Michael Hall     nintininti.com
    --------------------------------
    

    attached mail follows:


    On Wed, Jul 17, 2002 at 03:26:15PM +0200, David Russell wrote: > > class issue { > function issue() { //default constructor > } > function issue($number) { //1 variable constructor > } > } > > My question is: will this work? does PHP OOP support more than one > constructor?

    No. But, here's a workaround:

    class issue {

    function issue($number=NULL) { if ( is_null($number) ) { echo 'doing the first function'; } else { $this->issue1($number); } }

    function issue1($number) { echo 'in the second function'; }

    }

    # To call first function only... $Obj = new issue();

    echo '<hr />';

    # To call second function... $Obj = new issue('blue');

    Enjoy,

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    Hi,

    Could anyone help me with the following:

    I have to strip the domain from string only if it is not preceded with which means - when it is not an e-mail address.

    Examples:

    1. blah blah blah someonesomething.org blah blah

    should result in:

    blah blah blah someonesomething.org blah blah

    2. blah blah blah something.org blah blah

    should result in:

    blah blah blah blah blah

    Thanks a lot,

    Michal

    attached mail follows:


    Something like this. $your_string = preg_replace('/[\d\w]+([\w\d]{3,}\.)+([\w]{2,4})/','', $your_string);

    HTH

    Best regards, Andrey Hristov

    ----- Original Message ----- From: "Michal Albrecht" <michal.albrechtastercity.net> To: <php-generallists.php.net> Sent: Wednesday, July 17, 2002 1:08 PM Subject: [PHP] Regular expression

    > Hi, > > Could anyone help me with the following: > > I have to strip the domain from string only if it is not preceded with > which means - when it is not an e-mail address. > > Examples: > > 1. blah blah blah someonesomething.org blah blah > > should result in: > > blah blah blah someonesomething.org blah blah > > 2. blah blah blah something.org blah blah > > should result in: > > blah blah blah blah blah > > Thanks a lot, > > > Michal > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Andrey Hristov wrote: > Something like this. > $your_string = preg_replace('/[\d\w]+([\w\d]{3,}\.)+([\w]{2,4})/','', > $your_string); > > HTH > > Best regards, > Andrey Hristov

    Thank you very much for your time, but this strips the e-mail address and lives the domain. Could you give me some hints on how to make it working the opposite way?

    Regards,

    Michal

    attached mail follows:


    On Wed, Jul 17, 2002 at 04:03:02PM +0200, Michal Albrecht wrote: > Andrey Hristov wrote: > > >$your_string = preg_replace('/[\d\w]+([\w\d]{3,}\.)+([\w]{2,4})/','', > > Thank you very much for your time, but this strips the e-mail address > and lives the domain. Could you give me some hints on how to make it > working the opposite way?

    Let alone, it assumes TLD's are 2-4 characters long, when in reality, they're presently up to 6 characters long.

    preg_replace('/^([a-z0-9_.=+-])+([a-z0-9-]+\.)+([a-z]{2,6})$/', '\\1', $your_string);

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    I am getting data froma website for stock information. If I type in the brower the URL I get a text file display list this;

    Date,Open,High,Low,Close,Volume 16-Jul-02,7.92,8.10,7.68,7.82,605500 15-Jul-02,7.98,8.02,7.59,8.02,577200 12-Jul-02,7.80,8.00,7.57,7.95,411100 11-Jul-02,7.82,7.94,7.34,7.80,802400

    Now I want to break each line and then seperate each line by the commas. The amount of linesin the file is never known so I assume I have to use something like a foreach or while statement,but I am not sure the best way to do it. This is what I have so far.

    $Symbol = "IKN"; $LookupUrl = "http://demos.inxdesign.com/download?sym=$Symbol&format=.txt"; $Results = implode('', file("$LookupUrl")); $Data = array(); split("\n", $Results) = array_push($Data, $line)

    The end result I am trying to get is each line to be an element in an array. Later I will go back and stepthrough each element of the array and then split that by the commas and have it output into an HTML table.At least this is the best way I can think to deal with it. I suppose a better way to do this would be to make this an associative array and have the data of each line be associated with the date then I could producea variable something like $StockData[16-Jul-02][value], but I don't know how to do any of that.

    attached mail follows:


    On Wed, Jul 17, 2002 at 10:00:29AM -0400, Chris Crane wrote: > I am getting data froma website for stock information. If I type in the > brower the URL I get a text file display list this; > > Date,Open,High,Low,Close,Volume > 16-Jul-02,7.92,8.10,7.68,7.82,605500 > 15-Jul-02,7.98,8.02,7.59,8.02,577200 > 12-Jul-02,7.80,8.00,7.57,7.95,411100 > 11-Jul-02,7.82,7.94,7.34,7.80,802400

    So, now you're working an another approach to the stock quote question, eh?

    Use these functions: fopen() fgetcsv()

    Look at the manual on how to use them. If, for some reason, that's not clear, check out the archives for this list on http://groups.google.com/.

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    The answer is probably yes.

    I do a "session_start()" followed by a "$HTTP_SESSION_VARS['count']=2" on one page. Then I go to another page and do a "session_start()" again; unfortunately the $HTTP_SESSION_VARS['count'] is empty!!!

    I tried doing a "session_register('count2'); $count2=123;" in the first page followed by another page where I display "$count2" and that works fine.

    Why?

    Henry

    attached mail follows:


    Define the value of $count before registering it, and it should work fine :o)

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    >>> "Henry" <henryteacake.f9.co.uk> 07/17/02 10:14AM >>> The answer is probably yes.

    I do a "session_start()" followed by a "$HTTP_SESSION_VARS['count']=2" on one page. Then I go to another page and do a "session_start()" again; unfortunately the $HTTP_SESSION_VARS['count'] is empty!!!

    I tried doing a "session_register('count2'); $count2=123;" in the first page followed by another page where I display "$count2" and that works fine.

    Why?

    Henry

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php 
    

    attached mail follows:


    Ignore that, I'll just go grab my copy of Hooked on Phonics so I can learn to read before replying.

    :trots off:

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    >>> "Martin Clifford" <MLC1nrc.gov> 07/17/02 10:15AM >>> Define the value of $count before registering it, and it should work fine :o)

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    >>> "Henry" <henryteacake.f9.co.uk> 07/17/02 10:14AM >>> The answer is probably yes.

    I do a "session_start()" followed by a "$HTTP_SESSION_VARS['count']=2" on one page. Then I go to another page and do a "session_start()" again; unfortunately the $HTTP_SESSION_VARS['count'] is empty!!!

    I tried doing a "session_register('count2'); $count2=123;" in the first page followed by another page where I display "$count2" and that works fine.

    Why?

    Henry

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php 
    

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    If you're going to use $HTTP_SESSION_VARS, then you have to use session_register().

    <? session_start(); session_register('count'); ?>

    Next page: <? session_start(); echo $HTTP_SESSION_VARS['count']; ?>

    That should work. If you use $_SESSION, instead, then you don't have to use session_register.

    That's how I understand it...

    ---John Holmes...

    >>> "Henry" <henryteacake.f9.co.uk> 07/17/02 10:14AM >>> The answer is probably yes.

    I do a "session_start()" followed by a "$HTTP_SESSION_VARS['count']=2" on one page. Then I go to another page and do a "session_start()" again; unfortunately the $HTTP_SESSION_VARS['count'] is empty!!!

    I tried doing a "session_register('count2'); $count2=123;" in the first page followed by another page where I display "$count2" and that works fine.

    Why?

    Henry

    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    

    -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    I want query my mysql table and get one particular row. So let's say my table had 5 rows (entries) in it, and I want to pull just row #2, how would I do this?? THANKS!!

    attached mail follows:


    If you are using an auto_increment primary key field named id, then you would use this:

    SELECT * FROM table WHERE id=2 LIMIT 1

    Just so long as you know that if for some reason you delete that row, there will NEVER Be another id of 2, unless you set it that way.

    If you only want to select certain columns from the row, then list those columns in place of the wildcard.

    SELECT first_name, last_name FROM table WHERE id=1 LIMIT 1

    HTH!

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    >>> "Phil Schwarzmann" <pschwarjhmi.edu> 07/17/02 10:21AM >>> I want query my mysql table and get one particular row. So let's say my table had 5 rows (entries) in it, and I want to pull just row #2, how would I do this?? THANKS!!

    attached mail follows:


    Phil Schwarzmann wrote:

    >I want query my mysql table and get one particular row. > >So let's say my table had 5 rows (entries) in it, and I want to pull >just row #2, how would I do this?? > >THANKS!! > > > It's OT but OK:

    SELECT * FROM table LIMIT 1,1;

    Have another look at the MySQL manual (6.4.1. Select Syntax)

    René

    attached mail follows:


    > I want query my mysql table and get one particular row. > > So let's say my table had 5 rows (entries) in it, and I want to pull > just row #2, how would I do this??

    What is row #2?? The second row when the table is ordered by the first column? second column? ascending? decending? without an ORDER BY in your query...row #2 can be different every time.

    Once you add your ORDER BY, you can use LIMIT 1,1 on the end of your query to have it just return the second row.

    ---John Holmes...

    attached mail follows:


    Howdy everyone,

    I'd like to get everyone's input on Jobs and Certs. I know there are a couple Certifications for web developers out there, such as the CIW and CWP certifications.

    Here are my questions:

    1. What is the best method to go about becoming certified? 2. What is the best way to go about getting into the web development industry? 3. If you have ever taken online courses relating to web development, what is your opinion on them? Good, bad, ugly? 4. Which certification is most beneficial? I know that CWP requires work experience before becoming certified past certain points, and CIW does not require this. 5. Why can't I remember what question five was? Doh.

    At any rate, I'm current a data entry clerk, but have quite a bit of web experience (none at a job, though), and I know that I have TONS more to learn, but I am very passionate about it and want to be able to do it as a career. I just don't know where the hell to start, and I know that some of you might be able to offer some advice in this area.

    Thanks in advance! This is very important to me, so I thought I'd ask the people that would know best :o)

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    attached mail follows:


    On Wed, 17 Jul 2002, Martin Clifford wrote: > I'd like to get everyone's input on Jobs and Certs. I know there are a > couple Certifications for web developers out there, such as the CIW and > CWP certifications.

    I don't know if this is what you want to hear, but I can tell you that as a rule, I don't hire people who advertise certifications on their resume.

    I've found that they correlate pretty strongly with incompetence, to the point where nothing saves me more time when filtering through resumes than first throwing away the ones covered with acroyms starting with C or MC.

    People who have the skills, demonstrate it through their work experience, walking through their sample code with me, and their ability to explain how they would perform a task. People who trumpet certifications overwhelmingly seem to be people who were unable to advance their careers based on the strength of their skills, and so chose to resort to a paper method instead. I'm not saying anything about you here, just suggesting that you consider alternate means of impressing employers.

    miguel

    attached mail follows:


    I agree - nothing beats a good portfolio.

    Danny.

    ----- Original Message ----- From: "Miguel Cruz" <mncstoic.net> To: "Martin Clifford" <MLC1nrc.gov> Cc: <php-generallists.php.net> Sent: Wednesday, July 17, 2002 6:55 PM Subject: Re: [PHP] Of Jobs and Certs

    > On Wed, 17 Jul 2002, Martin Clifford wrote: > > I'd like to get everyone's input on Jobs and Certs. I know there are a > > couple Certifications for web developers out there, such as the CIW and > > CWP certifications. > > I don't know if this is what you want to hear, but I can tell you that as > a rule, I don't hire people who advertise certifications on their resume. > > I've found that they correlate pretty strongly with incompetence, to the > point where nothing saves me more time when filtering through resumes than > first throwing away the ones covered with acroyms starting with C or MC. > > People who have the skills, demonstrate it through their work experience, > walking through their sample code with me, and their ability to explain > how they would perform a task. People who trumpet certifications > overwhelmingly seem to be people who were unable to advance their careers > based on the strength of their skills, and so chose to resort to a paper > method instead. I'm not saying anything about you here, just suggesting > that you consider alternate means of impressing employers.

    attached mail follows:


    On 17 Jul 2002 at 12:55, Miguel Cruz wrote:

    > On Wed, 17 Jul 2002, Martin Clifford wrote: > > I'd like to get everyone's input on Jobs and Certs. I know there > > are a couple Certifications for web developers out there, such as > > the CIW and CWP certifications. > > I don't know if this is what you want to hear, but I can tell you that > as a rule, I don't hire people who advertise certifications on their > resume. > > I've found that they correlate pretty strongly with incompetence, to > the point where nothing saves me more time when filtering through > resumes than first throwing away the ones covered with acroyms > starting with C or MC. > > People who have the skills, demonstrate it through their work > experience, walking through their sample code with me, and their > ability to explain how they would perform a task. People who trumpet > certifications overwhelmingly seem to be people who were unable to > advance their careers based on the strength of their skills, and so > chose to resort to a paper method instead. I'm not saying anything > about you here, just suggesting that you consider alternate means of > impressing employers.

    :) ... this is a laugh.

    There must be one Miguel for 10,000 other managers. What Miguel said above is what any rational, competent manager would do. I cannot tell you how many times I send my resume but I put a link to my code (they can download entire apps so they can see not only snippets but how I organize or disorganize my code). No one, not one, has ever bothered to look at my code and questioned me. I interviewed with Jeffrey Friedl of regex fame and even he did not look at my code (although when I said I did not know something he laughed and said he did not know either, "that's why we have reference books").

    I think getting the CERTS is not bad. Certainly the smart person will do as Miguel suggests, but I think he's in the VAST minority. I know a guy who has a consulting firm. It's a M$ shop. They BLAST their M$ certs everywhere. The software business is too new imho. Most people who should know better will be bamboolzed by CERTS.

    One manager sent out an email to everyone who responded to an ad. He offered general suggestions to everyone. I thought that was a dern good thing. He suggested people send Brainbench exam results. I'm sure certs would have helped as well. Even though this guy was "nice" I doubt he could get around code. imho, there are just far, far too few people who can judge someone by their code. I say get the certs. Personally, I could never work for someone who needed that so I don't bother, but if you want a job, I can't see that it hurts AT ALL.

    Heck, I'm gonna rant if I keep going ... ever have someone ask you if you know FTP :) ... like a smart person could not show another smart person about that in 15 minutes. It's just amazing what passes for competence in the IT world. I had a boss who I swear sincerely said he could "double click a mouse". The guy was serious. I did not last at that job :)

    Peter

    attached mail follows:


    If I set the SESSION autostart = 1 in the PHP config, would that eliminate my need to use session_start() in my code? I have some PHP inline with some HTML, and the PHP is telling me: Warning: Cannot send session cookie - headers already sent Any ideas how to remedy this? Matt Babineau MCWD / CCFD ----------------------------------------- e: <mailto:mattcriticalcode.com> mattcriticalcode.com p: 603.943.4237 w: <http://www.criticalcode.com/> http://www.criticalcode.com PO BOX 601 Manchester, NH 03105

    attached mail follows:


    Try with output buffering.

    Regards, Andrey Hristov ----- Original Message ----- From: "Matt Babineau" <mattcriticalcode.com> To: <php-generallists.php.net> Sent: Wednesday, July 17, 2002 6:20 PM Subject: [PHP] $_SESSION - autostart, or session_start() ?

    > If I set the SESSION autostart = 1 in the PHP config, would that > eliminate my need to use session_start() in my code? I have some PHP > inline with some HTML, and the PHP is telling me: > > Warning: Cannot send session cookie - headers already sent > > Any ideas how to remedy this? > > Matt Babineau > MCWD / CCFD > ----------------------------------------- > e: <mailto:mattcriticalcode.com> mattcriticalcode.com > p: 603.943.4237 > w: <http://www.criticalcode.com/> http://www.criticalcode.com > PO BOX 601 > Manchester, NH 03105 > >

    attached mail follows:


    The error is pretty self-explanatory. You aren't starting the session before soemthing is being written to the page.

    This will yeild the same error:

    ¯-----top of document------ <!-- BEGIN DOCUMENT ¯> <?php session_start(); ?> ¯-----botton of doc---------

    This is because something has been sent to the browser (the comment line), which is after the HTTP headers have already returned from the server.

    HTH

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    >>> "Matt Babineau" <mattcriticalcode.com> 07/17/02 11:20AM >>> If I set the SESSION autostart = 1 in the PHP config, would that eliminate my need to use session_start() in my code? I have some PHP inline with some HTML, and the PHP is telling me: Warning: Cannot send session cookie - headers already sent Any ideas how to remedy this? Matt Babineau MCWD / CCFD ----------------------------------------- e: <mailto:mattcriticalcode.com> mattcriticalcode.com p: 603.943.4237 w: <http://www.criticalcode.com/> http://www.criticalcode.com PO BOX 601 Manchester, NH 03105

    attached mail follows:


    Call session_start() before ANY output. <html> is OUTPUT.

    ---John Holmes...

    ----- Original Message ----- From: "Matt Babineau" <mattcriticalcode.com> To: <php-generallists.php.net> Sent: Wednesday, July 17, 2002 11:20 AM Subject: [PHP] $_SESSION - autostart, or session_start() ?

    > If I set the SESSION autostart = 1 in the PHP config, would that > eliminate my need to use session_start() in my code? I have some PHP > inline with some HTML, and the PHP is telling me: > > Warning: Cannot send session cookie - headers already sent > > Any ideas how to remedy this? > > Matt Babineau > MCWD / CCFD > ----------------------------------------- > e: <mailto:mattcriticalcode.com> mattcriticalcode.com > p: 603.943.4237 > w: <http://www.criticalcode.com/> http://www.criticalcode.com > PO BOX 601 > Manchester, NH 03105 > >

    attached mail follows:


    When running a mysql_query, sometimes i need to have apostrophes surrounding variables...other times i don't example... $query = "SELECT * FROM table WHERE id='$id'"; or $query = "SELECT * FROM table WHERE id=$id"; ...it kinda seems random when it wants apostrophes and when it doesn't want them. Any ideas?

    attached mail follows:


    QUOTE//

    When running a mysql_query, sometimes i need to have apostrophes surrounding variables...other times i don't example... $query = "SELECT * FROM table WHERE id='$id'"; or $query = "SELECT * FROM table WHERE id=$id"; ...it kinda seems random when it wants apostrophes and when it doesn't want them. Any ideas?

    //QUOTE

    Use apostrophes when $id is a string.

    // Asmodean asmodeanlka.nu

    attached mail follows:


    It's not random. Strings need to be enclosed. You can use single or double quotes, but you have to use them.

    ---John Holmes...

    ----- Original Message ----- From: "Phil Schwarzmann" <pschwarjhmi.edu> To: <php-generallists.php.net> Sent: Wednesday, July 17, 2002 11:19 AM Subject: [PHP] Queries - Sometimes I need to use apostrophe, other times idon't

    > When running a mysql_query, sometimes i need to have apostrophes > surrounding variables...other times i don't > > example... > > $query = "SELECT * FROM table WHERE id='$id'"; > > or > > $query = "SELECT * FROM table WHERE id=$id"; > > ...it kinda seems random when it wants apostrophes and when it doesn't > want them. > > Any ideas? >

    attached mail follows:


    Off topic...

    > >So let's say my table had 5 rows (entries) in it, and I want to pull > >just row #2, how would I do this??

    > SELECT * FROM table LIMIT 1,1;

    Technically, without an ORDER BY in your query, the database can return a different row each time with this query. Without an ORDER BY, how do you define row #2? The database just stores the data in any way it wants to and doesn't order it unless you tell it to.

    ---John Holmes...

    attached mail follows:


    Not sure how to go about setting up a function to parse the date, hour, minutes, seconds, take the seconds and register them in a session var, then do a check on the session var (seconds) vs. the seconds var + 5*60 (or 5 minutes) to time out the session and force the user to log back in. My problem is finding the correct way to check the seconds in php. Any help or pointers is appreciated. Jas

    attached mail follows:


    J> Not sure how to go about setting up a function to parse the date, hour, J> minutes, seconds, take the seconds and register them in a session var, then J> do a check on the session var (seconds) vs. the seconds var + 5*60 (or 5 J> minutes) to time out the session and force the user to log back in. My J> problem is finding the correct way to check the seconds in php. Any help or J> pointers is appreciated. J> Jas

    time() will give you a UNIX timestamp. Use it to do the math.

    -- 
    Best regards,
     Asmodean                            mailto:asmodeanlka.nu
    

    attached mail follows:


    I am not able to test from this machine so please tell me if I am right or wrong on this: $tmp = time(); $tme = time() - 5*60; session_register('tmp'); if ($tmp >= $tme) { echo 'Time has not reached 5 minutes, session still valid'; } else { echo 'Timer has reached 5 minutes, you will need to log back in to continue.'; }

    "Asmodean" <asmodeanlka.nu> wrote in message news:8312607156.20020717174408lka.nu... > J> Not sure how to go about setting up a function to parse the date, hour, > J> minutes, seconds, take the seconds and register them in a session var, then > J> do a check on the session var (seconds) vs. the seconds var + 5*60 (or 5 > J> minutes) to time out the session and force the user to log back in. My > J> problem is finding the correct way to check the seconds in php. Any help or > J> pointers is appreciated. > J> Jas > > time() will give you a UNIX timestamp. Use it to do the math. > > -- > Best regards, > Asmodean mailto:asmodeanlka.nu >

    attached mail follows:


    J> I am not able to test from this machine so please tell me if I am right or J> wrong on this: J> $tmp = time(); J> $tme = time() - 5*60; J> session_register('tmp'); if ($tmp >>= $tme) { J> echo 'Time has not reached 5 minutes, session still valid'; J> } else { J> echo 'Timer has reached 5 minutes, you will need to log back in to J> continue.'; }

    J> "Asmodean" <asmodeanlka.nu> wrote in message J> news:8312607156.20020717174408lka.nu... >> J> Not sure how to go about setting up a function to parse the date, hour, >> J> minutes, seconds, take the seconds and register them in a session var, J> then >> J> do a check on the session var (seconds) vs. the seconds var + 5*60 (or J> 5 >> J> minutes) to time out the session and force the user to log back in. My >> J> problem is finding the correct way to check the seconds in php. Any J> help or >> J> pointers is appreciated. >> J> Jas >> >> time() will give you a UNIX timestamp. Use it to do the math. >> >> -- >> Best regards, >> Asmodean mailto:asmodeanlka.nu >>

    Let's assume you've set your session timestamp (assume it's called $session_time) to time() at the time of login. Now, in the script...

    if ((time() + 300) > $session_time) {

    }

    This would be a check to see if the session is still valid. Timewise.

    -- 
    Best regards,
     Asmodean                            mailto:asmodeanlka.nu
    

    attached mail follows:


    J>> I am not able to test from this machine so please tell me if I am right or J>> wrong on this: J>> $tmp = time(); J>> $tme = time() - 5*60; J>> session_register('tmp'); if ($tmp >>>= $tme) { J>> echo 'Time has not reached 5 minutes, session still valid'; J>> } else { J>> echo 'Timer has reached 5 minutes, you will need to log back in to J>> continue.'; }

    J>> "Asmodean" <asmodeanlka.nu> wrote in message J>> news:8312607156.20020717174408lka.nu... >>> J> Not sure how to go about setting up a function to parse the date, hour, >>> J> minutes, seconds, take the seconds and register them in a session var, J>> then >>> J> do a check on the session var (seconds) vs. the seconds var + 5*60 (or J>> 5 >>> J> minutes) to time out the session and force the user to log back in. My >>> J> problem is finding the correct way to check the seconds in php. Any J>> help or >>> J> pointers is appreciated. >>> J> Jas >>> >>> time() will give you a UNIX timestamp. Use it to do the math. >>> >>> -- >>> Best regards, >>> Asmodean mailto:asmodeanlka.nu >>>

    A> Let's assume you've set your session timestamp (assume it's called A> $session_time) to time() at the time of login. Now, in the script...

    if ((time() + 300) >> $session_time) {

    A> }

    A> This would be a check to see if the session is still valid. Timewise.

    A> -- A> Best regards, A> Asmodean mailto:asmodeanlka.nu

    Wrong. My fault. ;)

    It's...

    if (time() > $session_time + 300) {

    }

    Sorry.

    -- 
    Best regards,
     Asmodean                            mailto:asmodeanlka.nu
    

    attached mail follows:


    So under the time() call, comparing it to a simple numerical value such as "300" it knows that you are talking about 300 seconds? Is that because it is a unix timestamp? I previously tried using date("s") to give me the seconds from today's date then tried the compare, so using time() will work better. Thanks a ton. Jas "Asmodean" <asmodeanlka.nu> wrote in message news:14814144515.20020717180945lka.nu... > J> I am not able to test from this machine so please tell me if I am right or > J> wrong on this: > J> $tmp = time(); > J> $tme = time() - 5*60; > J> session_register('tmp'); > if ($tmp >>= $tme) { > J> echo 'Time has not reached 5 minutes, session still valid'; > J> } else { > J> echo 'Timer has reached 5 minutes, you will need to log back in to > J> continue.'; } > > J> "Asmodean" <asmodeanlka.nu> wrote in message > J> news:8312607156.20020717174408lka.nu... > >> J> Not sure how to go about setting up a function to parse the date, hour, > >> J> minutes, seconds, take the seconds and register them in a session var, > J> then > >> J> do a check on the session var (seconds) vs. the seconds var + 5*60 (or > J> 5 > >> J> minutes) to time out the session and force the user to log back in. My > >> J> problem is finding the correct way to check the seconds in php. Any > J> help or > >> J> pointers is appreciated. > >> J> Jas > >> > >> time() will give you a UNIX timestamp. Use it to do the math. > >> > >> -- > >> Best regards, > >> Asmodean mailto:asmodeanlka.nu > >> > > Let's assume you've set your session timestamp (assume it's called > $session_time) to time() at the time of login. Now, in the script... > > if ((time() + 300) > $session_time) { > > } > > This would be a check to see if the session is still valid. Timewise. > > -- > Best regards, > Asmodean mailto:asmodeanlka.nu >

    attached mail follows:


    J> So under the time() call, comparing it to a simple numerical value such as J> "300" it knows that you are talking about 300 seconds? Is that because it J> is a unix timestamp? I previously tried using date("s") to give me the J> seconds from today's date then tried the compare, so using time() will work J> better. Thanks a ton. J> Jas

    Yes. time() returns a UNIX timestamp (currently a 10-digit number) representing the number of seconds since a certain date (sometime in 1972).

    -- 
    Best regards,
     Asmodean                            mailto:asmodeanlka.nu
    

    attached mail follows:


    On Wed, Jul 17, 2002 at 03:55:10PM +0800, Jack wrote: > > if (file_exists("c:\\pdf_reports\\dealing\\test.txt")) > It seems that php can't detect the file in such path!!!

    While this isn't your problem, it's nicer coding. Single quotes and forward slashes:

    if ( file_exists('c:/pdf_reports/dealing/test.txt') )

    > if (file_exists("c:\\pdf_reports\\test.txt")) > Then it can detect the file is there! why?

    Probably, PHP doesn't have permissions on the "dealing" directory or you misspelled it.

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    I am getting data froma website for stock information. If I type in the brower the URL I get a text file display list this;

    Date,Open,High,Low,Close,Volume 16-Jul-02,7.92,8.10,7.68,7.82,605500 15-Jul-02,7.98,8.02,7.59,8.02,577200 12-Jul-02,7.80,8.00,7.57,7.95,411100 11-Jul-02,7.82,7.94,7.34,7.80,802400

    Now I want to break each line and then seperate each line by the commas. The amount of linesin the file is never known so I assume I have to use something like a foreach or while statement,but I am not sure the best way to do it. This is what I have so far.

    $Symbol = "IKN"; $LookupUrl = "http://demos.inxdesign.com/download?sym=$Symbol&format=.txt"; $Results = implode('', file("$LookupUrl")); $Data = array(); split("\n", $Results) = array_push($Data, $line)

    The end result I am trying to get is each line to be an element in an array. Later I will go back and stepthrough each element of the array and then split that by the commas and have it output into an HTML table.At least this is the best way I can think to deal with it. I suppose a better way to do this would be to make this an associative array and have the data of each line be associated with the date then I could producea variable something like $StockData[16-Jul-02][value], but I don't know how to do any of that.

    attached mail follows:


    Chris:

    Why'd you start a second thread on this? See my reply in the "File reading help with Syntax" thread.

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    Posted by Daniel Kushner (on behalf of Hans Zaunere)

    New York PHP Presents:

    "Implementing an Object-based Web Framework in PHP"

    NYPHP's monthly meeting is a week away (7/24), and after an informal networking event last month, we're excited to offer what certainly will be a highly valuable presentation to many.

    Web frameworks and object-orientated programming are forging the way for increasingly functional Internet applications, and PHP is continuing to be an integral part of the progress. Two top developers from Tanjero (http://tanjero.com) will be showing us how they've leveraged the AMP Technology suite to quickly provide powerful, yet reusable and cost-effective web applications for their clients.

    NYPHP meetings are the 4th Wednesday of every month at 6:30pm, with this meeting slated for 7/24. Please visit http://nyphp.org for location details, a map, and further information.

    Thank you,

    Hans Zaunere New York PHP http://nyphp.org

    attached mail follows:


    Hi,

    Awhile back I was asking for just what I'm reading here:

    http://www.php9.com/index.php/section/articles/name/PHP%20Guidelines

    Some snippets to give you an idea what you will find on that page:

    > Another mistake I see around a lot is people writing scripts that will > not work if register_globals is off. In the next release of PHP > register_globals will be off by default, so you need to start writing > your scripts with this in mind.

    > <?php > $name = 'Bill'; > echo "<table align=\"center\"><tr><td>My name is > $name</td></tr></table>"; ?> > > No, don't do that.

    > <?=$name?> > > This is a short-hand in PHP for: > > <?php echo $name; ?>

    I have come across some of this in the documentation but not in your face like it is here (and should be).

    Does anyone have any more links to articles like that?

    Thanks, Peter

    attached mail follows:


    [snip] Awhile back I was asking for just what I'm reading here:

    http://www.php9.com/index.php/section/articles/name/PHP%20Guidelines

    I have come across some of this in the documentation but not in your face like it is here (and should be).

    Does anyone have any more links to articles like that? [/snip]

    http://www.zend.com/zend/columns.php http://www.zend.com/zend/art/mistake.php http://www.zend.com/zend/art/

    Jay

    Nobody in football should be called a genius. A genius is a guy like Norman Einstein. -Joe Theismann

    ************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************

    attached mail follows:


    other than each'ing an array and performing a regex match, is there an easier way to parse through the values in an array for a value matching *something*somethingelse*

    thanks

    Dave

    attached mail follows:


    > other than each'ing an array and performing a regex match, is there an easier > way to parse through the values in an array for a value matching > *something*somethingelse*

    No, I don't believe so. But I'm sure you can set up something to use with array_walk().

    Chris

    attached mail follows:


    Hi,

    I have the following situation. I have an array of colors that I would like to print out. My first course of action would be to convert the array to a string so that I can parse it. My command would be:

    $color_list = explode(",", $color);

    Now that I have a string of colors delimited by commas, I would like to parse the string and print out all my colors. I have read the documentation on using the list() function but I find it confusing. Can someone clear the fog from my mind please?

    Thanks, Don

    attached mail follows:


    How do you want to parse the string? why not just echo $color_list?

    ---John Holmes...

    ----- Original Message ----- From: "DonPro" <donprolclcan.com> To: "php list" <php-generallists.php.net> Sent: Wednesday, July 17, 2002 12:26 PM Subject: [PHP] Confused about the list() function

    Hi,

    I have the following situation. I have an array of colors that I would like to print out. My first course of action would be to convert the array to a string so that I can parse it. My command would be:

    $color_list = explode(",", $color);

    Now that I have a string of colors delimited by commas, I would like to parse the string and print out all my colors. I have read the documentation on using the list() function but I find it confusing. Can someone clear the fog from my mind please?

    Thanks, Don

    attached mail follows:


    D> Hi,

    D> I have the following situation. I have an array of colors that I would like to print out. My first course of action would be to convert the array to a string so that I can parse it. My command D> would be:

    D> $color_list = explode(",", $color);

    D> Now that I have a string of colors delimited by commas, I would like to parse the string and print out all my colors. I have read the documentation on using the list() function but I find it D> confusing. Can someone clear the fog from my mind please?

    D> Thanks, D> Don

    Assuming you have an array of colors called $color (and assuming I haven't misread or misinterpreted any information), you can do the following to directly print your colors.

    // Prints out all colors comma-separated. print(join(", ", $color));

    // Prints out all colors linebreak-separated (HTML-wise). print(join("<br>", $color));

    -- 
    Best regards,
     Asmodean                            mailto:asmodeanlka.nu
    

    attached mail follows:


    On Wed, Jul 17, 2002 at 12:26:08PM -0400, DonPro wrote: > > $color_list = explode(",", $color); > > Now that I have a string of colors delimited by commas, I would like to > parse the string and print out all my colors.

    Start with turning on line wrapping in your email client...

    Now, your sentence isn't specific enough. What do you mean by you "want the print out all my colors?" Specifically what do you want your output to look like?

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    Hi guys, me again. (thanks kevin, but i'm afraid you didn't understand me).

    After looking for untiringly in the archives I have I decide to ask again.

    This is my problem: I want include the file html.html inside of my file index.php, but before include it I want to remove <html>..</head> tags from my html.html file. My pseudo code would be look like this:

    > index.php

    <?php

    include_once("common.php");

    header("Welcome to my page"); include_html_file("html.html"); footer() ?>

    > common.php function include_html_file($f) { (your kind contribution:-) ) }

    thanks!!

    --jp

    attached mail follows:


    JPA> Hi guys, me again. JPA> (thanks kevin, but i'm afraid you didn't understand me).

    JPA> After looking for untiringly in the archives I have I decide to ask again.

    JPA> This is my problem: JPA> I want include the file html.html inside of my file index.php, but before JPA> include it I want to remove <html>..</head> tags from my html.html file. JPA> My pseudo code would be look like this:

    JPA> > index.php

    JPA> <?php

    JPA> include_once("common.php");

    JPA> header("Welcome to my page"); JPA> include_html_file("html.html"); JPA> footer() ?>>

    JPA> > common.php JPA> function include_html_file($f) JPA> { JPA> (your kind contribution:-) ) JPA> }

    JPA> thanks!!

    JPA> --jp

    How do you mean remove? Do you mean you want to include the file html.html but not the "<html>...</head>" part? And why?

    -- 
    Best regards,
     Asmodean                            mailto:asmodeanlka.nu
    

    attached mail follows:


    >Do you mean you want to include the file html.html but not the "<html>...</head>" part? Yes!!. In other words I just want show the part inside of <body> tag of the html.html

    I know the answer is in a Regulars expression.. but.. i don't know much about it.

    At 19:08 17-07-2002, you wrote: >JPA> Hi guys, me again. >JPA> (thanks kevin, but i'm afraid you didn't understand me). > >JPA> After looking for untiringly in the archives I have I decide to ask >again. > >JPA> This is my problem: >JPA> I want include the file html.html inside of my file index.php, but >before >JPA> include it I want to remove <html>..</head> tags from my html.html file. >JPA> My pseudo code would be look like this: > >JPA> > index.php > >JPA> <?php > >JPA> include_once("common.php"); > >JPA> header("Welcome to my page"); >JPA> include_html_file("html.html"); >JPA> footer() >?>> > > >JPA> > common.php >JPA> function include_html_file($f) >JPA> { >JPA> (your kind contribution:-) ) >JPA> } > >JPA> thanks!! > >JPA> --jp > >How do you mean remove? Do you mean you want to include the file >html.html but not the "<html>...</head>" part? And why? > >-- >Best regards, > Asmodean mailto:asmodeanlka.nu > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    ________________________________________________________ Juan Pablo Aqueveque <juqueuct.cl> Ingeniero de Sistemas Departamento de Redes y Comunicaciones http://www.drc.uct.cl Universidad Católica de Temuco. Tel:(5645) 205 630 Fax:(5645) 205 628

    attached mail follows:


    JPA> >Do you mean you want to include the file JPA> html.html but not the "<html>...</head>" part? JPA> Yes!!. In other words I just want show the part inside of <body> tag of the JPA> html.html

    JPA> I know the answer is in a Regulars expression.. but.. i don't know much JPA> about it.

    JPA> At 19:08 17-07-2002, you wrote: >>JPA> Hi guys, me again. >>JPA> (thanks kevin, but i'm afraid you didn't understand me). >> >>JPA> After looking for untiringly in the archives I have I decide to ask >>again. >> >>JPA> This is my problem: >>JPA> I want include the file html.html inside of my file index.php, but >>before >>JPA> include it I want to remove <html>..</head> tags from my html.html file. >>JPA> My pseudo code would be look like this: >> >>JPA> > index.php >> >>JPA> <?php >> >>JPA> include_once("common.php"); >> >>JPA> header("Welcome to my page"); >>JPA> include_html_file("html.html"); >>JPA> footer() >>?>> >> >> >>JPA> > common.php >>JPA> function include_html_file($f) >>JPA> { >>JPA> (your kind contribution:-) ) >>JPA> } >> >>JPA> thanks!! >> >>JPA> --jp >> >>How do you mean remove? Do you mean you want to include the file >>html.html but not the "<html>...</head>" part? And why? >> >>-- >>Best regards, >> Asmodean mailto:asmodeanlka.nu >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php

    JPA> ________________________________________________________ JPA> Juan Pablo Aqueveque <juqueuct.cl> JPA> Ingeniero de Sistemas JPA> Departamento de Redes y Comunicaciones http://www.drc.uct.cl JPA> Universidad Católica de Temuco. JPA> Tel:(5645) 205 630 Fax:(5645) 205 628

    Seems like a... strange thing to do. Anyway. Since I do not know of any other way (if there is, anyone, tell), this is what you will have to do.

    1. Open the file with fopen() 2. Perform a regular expression on the content 3. Print the parsed cntents

    For example:

    $fp = fopen('html.html', 'r'); $content = fread($fp, filesize(html.html));

    preg_match("/<body>(.*?)<\/body>/s", $content, $matches);

    The parsed contents are now in $matches[1].

    I still don't understand why you want to do this, though. Seems like there must be a better way.

    -- 
    Best regards,
     Asmodean                            mailto:asmodeanlka.nu
    

    attached mail follows:


    I am getting data froma website for stock information. If I type in the brower the URL I get a text file display list this;

    Date,Open,High,Low,Close,Volume 16-Jul-02,7.92,8.10,7.68,7.82,605500 15-Jul-02,7.98,8.02,7.59,8.02,577200 12-Jul-02,7.80,8.00,7.57,7.95,411100 11-Jul-02,7.82,7.94,7.34,7.80,802400

    Now I want to break each line and then seperate each line by the commas. The amount of linesin the file is never known so I assume I have to use something like a foreach or while statement,but I am not sure the best way to do it. This is what I have so far.

    $Symbol = "IKN"; $LookupUrl = "http://demos.inxdesign.com/download?sym=$Symbol&format=.txt"; $Results = implode('', file("$LookupUrl")); $Data = array(); split("\n", $Results) = array_push($Data, $line)

    The end result I am trying to get is each line to be an element in an array. Later I will go back and stepthrough each element of the array and then split that by the commas and have it output into an HTML table.At least this is the best way I can think to deal with it. I suppose a better way to do this would be to make this an associative array and have the data of each line be associated with the date then I could producea variable something like $StockData[16-Jul-02][value], but I don't know how to do any of that.

    attached mail follows:


    Parse all lines of a txt file into an array.. $ary = explode("\n", $results); -Kevin

    ----- Original Message ----- From: "Chris Crane" <ccraneinxdesign.com> To: <php-generallists.php.net> Sent: Wednesday, July 17, 2002 11:16 AM Subject: [PHP] Someone Help please

    > I am getting data froma website for stock information. If I type in the > brower the URL I get a text file display list this; > > Date,Open,High,Low,Close,Volume > 16-Jul-02,7.92,8.10,7.68,7.82,605500 > 15-Jul-02,7.98,8.02,7.59,8.02,577200 > 12-Jul-02,7.80,8.00,7.57,7.95,411100 > 11-Jul-02,7.82,7.94,7.34,7.80,802400 > > Now I want to break each line and then seperate each line by the commas. The > amount of linesin the file is never known so I assume I have to use > something like a foreach or while statement,but I am not sure the best way > to do it. This is what I have so far. > > $Symbol = "IKN"; $LookupUrl = > "http://demos.inxdesign.com/download?sym=$Symbol&format=.txt"; $Results = > implode('', file("$LookupUrl")); > $Data = array(); split("\n", $Results) = array_push($Data, $line) > > The end result I am trying to get is each line to be an element in an array. > Later I will go back and stepthrough each element of the array and then > split that by the commas and have it output into an HTML table.At least this > is the best way I can think to deal with it. I suppose a better way to do > this would be to make this an associative array and have the data of each > line be associated with the date then I could producea variable something > like $StockData[16-Jul-02][value], but I don't know how to do any of that. > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    File() will read the file into an array, each element of the array will be a line from the file. Explode() will then split that line by the delimiter you choose...

    So something like this:

    $file = file("filename.txt"); foreach($file as $line) { $part = explode(',',$line); //now you have an array, $part[], //that holds each element of the //current line, do what you will }

    ---John Holmes...

    > -----Original Message----- > From: Chris Crane [mailto:ccraneinxdesign.com] > Sent: Wednesday, July 17, 2002 1:17 PM > To: php-generallists.php.net > Subject: [PHP] Someone Help please > > I am getting data froma website for stock information. If I type in the > brower the URL I get a text file display list this; > > Date,Open,High,Low,Close,Volume > 16-Jul-02,7.92,8.10,7.68,7.82,605500 > 15-Jul-02,7.98,8.02,7.59,8.02,577200 > 12-Jul-02,7.80,8.00,7.57,7.95,411100 > 11-Jul-02,7.82,7.94,7.34,7.80,802400 > > Now I want to break each line and then seperate each line by the commas. > The > amount of linesin the file is never known so I assume I have to use > something like a foreach or while statement,but I am not sure the best way > to do it. This is what I have so far. > > $Symbol = "IKN"; $LookupUrl = > "http://demos.inxdesign.com/download?sym=$Symbol&format=.txt"; $Results = > implode('', file("$LookupUrl")); > $Data = array(); split("\n", $Results) = array_push($Data, $line) > > The end result I am trying to get is each line to be an element in an > array. > Later I will go back and stepthrough each element of the array and then > split that by the commas and have it output into an HTML table.At least > this > is the best way I can think to deal with it. I suppose a better way to do > this would be to make this an associative array and have the data of each > line be associated with the date then I could producea variable something > like $StockData[16-Jul-02][value], but I don't know how to do any of that. > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    I will try it now...Thank you. "John Holmes" <holmes072000charter.net> wrote in message news:000301c22dbe$b5caacf0$b402a8c0mango... > File() will read the file into an array, each element of the array will > be a line from the file. Explode() will then split that line by the > delimiter you choose... > > So something like this: > > $file = file("filename.txt"); > foreach($file as $line) > { > $part = explode(',',$line); > //now you have an array, $part[], > //that holds each element of the > //current line, do what you will > } > > ---John Holmes... > > > -----Original Message----- > > From: Chris Crane [mailto:ccraneinxdesign.com] > > Sent: Wednesday, July 17, 2002 1:17 PM > > To: php-generallists.php.net > > Subject: [PHP] Someone Help please > > > > I am getting data froma website for stock information. If I type in > the > > brower the URL I get a text file display list this; > > > > Date,Open,High,Low,Close,Volume > > 16-Jul-02,7.92,8.10,7.68,7.82,605500 > > 15-Jul-02,7.98,8.02,7.59,8.02,577200 > > 12-Jul-02,7.80,8.00,7.57,7.95,411100 > > 11-Jul-02,7.82,7.94,7.34,7.80,802400 > > > > Now I want to break each line and then seperate each line by the > commas. > > The > > amount of linesin the file is never known so I assume I have to use > > something like a foreach or while statement,but I am not sure the best > way > > to do it. This is what I have so far. > > > > $Symbol = "IKN"; $LookupUrl = > > "http://demos.inxdesign.com/download?sym=$Symbol&format=.txt"; > $Results = > > implode('', file("$LookupUrl")); > > $Data = array(); split("\n", $Results) = array_push($Data, $line) > > > > The end result I am trying to get is each line to be an element in an > > array. > > Later I will go back and stepthrough each element of the array and > then > > split that by the commas and have it output into an HTML table.At > least > > this > > is the best way I can think to deal with it. I suppose a better way to > do > > this would be to make this an associative array and have the data of > each > > line be associated with the date then I could producea variable > something > > like $StockData[16-Jul-02][value], but I don't know how to do any of > that. > > > > > > > > > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Chris:

    Geez, this is your third thread on this today... Lame.

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    Is there a way to restart a process (actually the process to handle ASP pages) from code?

    - Noah

    attached mail follows:


    You can use exec(), as long as the user PHP is running as has permission to execute the program...

    ---John Holmes...

    > -----Original Message----- > From: Noah Spitzer-Williams [mailto:noahchasen.com] > Sent: Wednesday, July 17, 2002 1:20 PM > To: php-generallists.php.net; php-windowslists.php.net > Subject: [PHP] Restart process from code? > > Is there a way to restart a process (actually the process to handle ASP > pages) from code? > > - Noah > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    But I would like to restart the process.... as in it's currently running and I want to end it and then start it again...

    - Noah

    ----- Original Message ----- From: "John Holmes" <holmes072000charter.net> To: "'Noah Spitzer-Williams'" <noahchasen.com>; <php-generallists.php.net>; <php-windowslists.php.net> Sent: Wednesday, July 17, 2002 2:18 PM Subject: RE: [PHP] Restart process from code?

    > You can use exec(), as long as the user PHP is running as has permission > to execute the program... > > ---John Holmes... > > > -----Original Message----- > > From: Noah Spitzer-Williams [mailto:noahchasen.com] > > Sent: Wednesday, July 17, 2002 1:20 PM > > To: php-generallists.php.net; php-windowslists.php.net > > Subject: [PHP] Restart process from code? > > > > Is there a way to restart a process (actually the process to handle > ASP > > pages) from code? > > > > - Noah > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    So? Use exec(). Use it twice if you have to. If you can run a command on the command line, then you can run it through exec. Only difference is if the user PHP is running as can run the command.

    ---John Holmes...

    > -----Original Message----- > From: Noah Spitzer-Williams [mailto:noahchasen.com] > Sent: Wednesday, July 17, 2002 2:10 PM > To: holmes072000charter.net; php-generallists.php.net; php- > windowslists.php.net > Subject: Re: [PHP] Restart process from code? > > But I would like to restart the process.... as in it's currently running > and > I want to end it and then start it again... > > > - Noah > > ----- Original Message ----- > From: "John Holmes" <holmes072000charter.net> > To: "'Noah Spitzer-Williams'" <noahchasen.com>; > <php-generallists.php.net>; <php-windowslists.php.net> > Sent: Wednesday, July 17, 2002 2:18 PM > Subject: RE: [PHP] Restart process from code? > > > > You can use exec(), as long as the user PHP is running as has permission > > to execute the program... > > > > ---John Holmes... > > > > > -----Original Message----- > > > From: Noah Spitzer-Williams [mailto:noahchasen.com] > > > Sent: Wednesday, July 17, 2002 1:20 PM > > > To: php-generallists.php.net; php-windowslists.php.net > > > Subject: [PHP] Restart process from code? > > > > > > Is there a way to restart a process (actually the process to handle > > ASP > > > pages) from code? > > > > > > - Noah > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    How do I end the process using exec? Is there an equivalent to NET STOP?

    - Noah

    ----- Original Message ----- From: "John Holmes" <holmes072000charter.net> To: "'Noah Spitzer-Williams'" <noahchasen.com>; <php-generallists.php.net>; <php-windowslists.php.net> Sent: Wednesday, July 17, 2002 2:28 PM Subject: RE: [PHP] Restart process from code?

    > So? Use exec(). Use it twice if you have to. If you can run a command on > the command line, then you can run it through exec. Only difference is > if the user PHP is running as can run the command. > > ---John Holmes... > > > -----Original Message----- > > From: Noah Spitzer-Williams [mailto:noahchasen.com] > > Sent: Wednesday, July 17, 2002 2:10 PM > > To: holmes072000charter.net; php-generallists.php.net; php- > > windowslists.php.net > > Subject: Re: [PHP] Restart process from code? > > > > But I would like to restart the process.... as in it's currently > running > > and > > I want to end it and then start it again... > > > > > > - Noah > > > > ----- Original Message ----- > > From: "John Holmes" <holmes072000charter.net> > > To: "'Noah Spitzer-Williams'" <noahchasen.com>; > > <php-generallists.php.net>; <php-windowslists.php.net> > > Sent: Wednesday, July 17, 2002 2:18 PM > > Subject: RE: [PHP] Restart process from code? > > > > > > > You can use exec(), as long as the user PHP is running as has > permission > > > to execute the program... > > > > > > ---John Holmes... > > > > > > > -----Original Message----- > > > > From: Noah Spitzer-Williams [mailto:noahchasen.com] > > > > Sent: Wednesday, July 17, 2002 1:20 PM > > > > To: php-generallists.php.net; php-windowslists.php.net > > > > Subject: [PHP] Restart process from code? > > > > > > > > Is there a way to restart a process (actually the process to > handle > > > ASP > > > > pages) from code? > > > > > > > > - Noah > > > > > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    On Wed, Jul 17, 2002 at 02:21:27PM -0400, Noah Spitzer-Williams wrote: > How do I end the process using exec? Is there an equivalent to NET STOP?

    Inside the exec(), issue whatever commands you'd type into a command line...

    exec('NET STOP foo');

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    You need a program to control the ASP process. This is proably some sort of command line tool and you just put whatever you would type in the commandline into the exec() function. (in quotes of course!)

    "Noah Spitzer-Williams" <noahchasen.com> wrote in message news:20020717173206.75964.qmailpb1.pair.com... > Is there a way to restart a process (actually the process to handle ASP > pages) from code? > > - Noah > >

    attached mail follows:


    Hi.

    I got a trouble I don't know if Apache or PHP is in fault. Let's say I got something like :

    ErrorDocument 404 /engine.php

    If I make a form which use POST and redirect to something which doesn't exist, then a phpinfo() in engine.php won't show the variables. Am I wrong thinking it should ? Is there a way to make this work ?

    Thanks.

    -- 
    Fabien Penso <pensolinuxfr.org> | LinuxFr a toujours besoin de :
    http://perso.LinuxFr.org/penso/  | http://linuxFr.org/dons/
    

    attached mail follows:


    Actaully, neither Apache or PHP is at fault. The ErrorDocument (either in httpd.conf or an .htaccess file) follows absolute paths, so you are calling your engine.php out of the root directory of the machine. So the question is, do you have engine.php in the / folder? If not you can put it there or just adjust your ErrorDocument command to point to the path of the file.

    Hope this helps.

    ----- Original Message ----- From: "Fabien Penso" <pensolinuxfr.org> To: <php-generallists.php.net> Sent: Wednesday, July 17, 2002 1:21 PM Subject: [PHP] ErrorDocument 404 & Form

    > Hi. > > I got a trouble I don't know if Apache or PHP is in fault. Let's say I > got something like : > > ErrorDocument 404 /engine.php > > If I make a form which use POST and redirect to something which doesn't > exist, then a phpinfo() in engine.php won't show the variables. Am I > wrong thinking it should ? Is there a way to make this work ? > > Thanks. > > -- > Fabien Penso <pensolinuxfr.org> | LinuxFr a toujours besoin de : > http://perso.LinuxFr.org/penso/ | http://linuxFr.org/dons/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Can posting to a non existent page give a different error? I know it gives 404 on mine. Probably not much help but it's a thought!

    "Fabien Penso" <pensolinuxfr.org> wrote in message news:plop87r8i2tgmk.fsflinuxfr.org... > Hi. > > I got a trouble I don't know if Apache or PHP is in fault. Let's say I > got something like : > > ErrorDocument 404 /engine.php > > If I make a form which use POST and redirect to something which doesn't > exist, then a phpinfo() in engine.php won't show the variables. Am I > wrong thinking it should ? Is there a way to make this work ? > > Thanks. > > -- > Fabien Penso <pensolinuxfr.org> | LinuxFr a toujours besoin de : > http://perso.LinuxFr.org/penso/ | http://linuxFr.org/dons/

    attached mail follows:


    On Wed, 17 Jul 2002, Justin French wrote: > I've attached a file I received with Quark 3.32, which has sample text > complete with Quark Xpress tags.

    XPress Tags is a great format, and easy to work with for auto-generated content.

    However, all you can do with it is prepare text for a single running block - not lay out an entire document (unless you're extremely creative with rules and positioning, I guess).

    > Just to throw a complete spanner in the works, Adobe InDesign2.0 has a lot > of XML capabilities, and much more integrated PDF capabilities than Quark... > perhaps either an XML based solution, or a PDFLib based solution can be > achieved? > > Considering InDesign is about 1/3rd the price of Quark, *maybe* you might > want to consider other options aside from Quark.

    Good luck convincing seasoned Quark operators to change, though!

    miguel

    attached mail follows:


    Hi there,

    I am wondering how many requests at one time php can serve before the site brakes down. Someone told me that my site has been down yesterday for a while after I did anounce it through a university email list going to 2500 users.

    Maybe there is a smart artikle on that.

    Thanx for any help,

    Andy-

    attached mail follows:


    On Wed, 17 Jul 2002, Andy wrote: > I am wondering how many requests at one time php can serve before the site > brakes down. Someone told me that my site has been down yesterday for a > while after I did anounce it through a university email list going to 2500 > users.

    It depends on:

    - Your network connection

    - Your hard drive

    - Your RAM

    - Your CPU

    - Your database

    - The design of your site

    - What the users are doing

    - Your caching strategy

    miguel

    attached mail follows:


    ok .. you are right. But how about an average.. between 20 users per minute or similar is this a common rate on this data? :

    > - Your network connection > 100 MBit > - Your hard drive > pretty fast > - Your RAM > 256MB > - Your CPU > Celleron 900 > - Your database > mysql > - The design of your site > as good as it gets:-) > - What the users are doing > mainly displaying images 4 - 40 kb > - Your caching strategy ? No cashing server site.

    Is there something like a benchmark available on such thing?

    Andy

    "Miguel Cruz" <mncstoic.net> schrieb im Newsbeitrag news:Pine.LNX.4.44.0207171331250.12977-100000stoic.net... > On Wed, 17 Jul 2002, Andy wrote: > > I am wondering how many requests at one time php can serve before the site > > brakes down. Someone told me that my site has been down yesterday for a > > while after I did anounce it through a university email list going to 2500 > > users. > > It depends on: > > - Your network connection > > - Your hard drive > > - Your RAM > > - Your CPU > > - Your database > > - The design of your site > > - What the users are doing > > - Your caching strategy > > miguel >

    attached mail follows:


    Ever tried the basic ab (apache benchmark)?? It comes with the unix distro of it.. not sure about windows.. YOu can test say 1000 requests with as many as you want at the same time..

    Works good for load testing a group of servers behind a load balancer..

    On Wed, 17 Jul 2002, Andy wrote:

    > ok .. you are right. But how about an average.. between 20 users per minute > or similar is this a common rate on this data? : > > > - Your network connection > > 100 MBit > > - Your hard drive > > pretty fast > > - Your RAM > > 256MB > > - Your CPU > > Celleron 900 > > - Your database > > mysql > > - The design of your site > > as good as it gets:-) > > - What the users are doing > > mainly displaying images 4 - 40 kb > > - Your caching strategy > ? No cashing server site. > > Is there something like a benchmark available on such thing? > > Andy > > > > "Miguel Cruz" <mncstoic.net> schrieb im Newsbeitrag > news:Pine.LNX.4.44.0207171331250.12977-100000stoic.net... > > On Wed, 17 Jul 2002, Andy wrote: > > > I am wondering how many requests at one time php can serve before the > site > > > brakes down. Someone told me that my site has been down yesterday for a > > > while after I did anounce it through a university email list going to > 2500 > > > users. > > > > It depends on: > > > > - Your network connection > > > > - Your hard drive > > > > - Your RAM > > > > - Your CPU > > > > - Your database > > > > - The design of your site > > > > - What the users are doing > > > > - Your caching strategy > > > > miguel > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Andy wrote:

    >ok .. you are right. But how about an average.. between 20 users per minute >or similar is this a common rate on this data? : > > >Is there something like a benchmark available on such thing? > Apache comes with ab for load testing. Maybe that will provide you with a means of making meaningful comparisons. There will be a "php" aspect to it, php opposed to say 3-tier java, but also things like is php a cgi, apache module or actually compiled into apache.

    When I hear of sites "going down" I perhaps incorrectly start saying there is something wrong. They should get slower but with connection throttling etc they should never actually crash. Or am I in WonderWorld?

    HTH Chris

    attached mail follows:


    [snip] I don't know if this is what you want to hear, but I can tell you that as a rule, I don't hire people who advertise certifications on their resume.

    I've found that they correlate pretty strongly with incompetence, to the point where nothing saves me more time when filtering through resumes than first throwing away the ones covered with acroyms starting with C or MC.

    People who have the skills, demonstrate it through their work experience, walking through their sample code with me, and their ability to explain how they would perform a task. People who trumpet certifications overwhelmingly seem to be people who were unable to advance their careers based on the strength of their skills, and so chose to resort to a paper method instead. I'm not saying anything about you here, just suggesting that you consider alternate means of impressing employers. [/snip]

    +1 Miguel

    I recently had the opportunity to hire someone for a basic web developer position, so I decided to approach the process differently. I decided that in all fairness I would give each candidate who applied the chance to prove themselves. I started with a written test with 20 questions, basic web development, mostly multiple choice. The highest score was a 68, (out of a possible 100) posted by a recent (less than 6 months earlier) college graduate with a degree in Computer Science. Needless to say I was shocked! I saw all sorts of certs attached to this group.

    I brought in the top 5 scorers (they took the original test during the application process, or were sent the test if they e-mailed their apps with a requirement to complete and return the test is 24 hours ... and these e-mail resume senders didn't bother to use the 24 given them TO LOOK UP THE ANSWERS...DUH!) who actually sent URL's for me to look at (I looked at the source to see if FrontPage or anything such as that had been used - if so they were eliminated) for 2 additional tests.

    I gave each a 5 question verbal exam which included questions about standards, documentation, identification of code, basic database knowledge, etc. Each question was worth 20 points. Hell, I even gave a person 5 points for honestly answering "I don't know.". High score: 65 points.

    The final test. I gave each a basic visual site layout on paper which included a small table, unordered list, basic headers, basic paragraph, etc.. (No dynamic elemnets or db connections) They were seated at a Windows computer with a copy of notepad and IE. They were given the address of the graphic to include. All they had to do was type, save, change to browser, reload, check their progress and move on. Each correct element (tag) was awarded 5 points for a total of 100 (20 correct elements). I had another 25 bonus points I would give if any used basic CSS. They had 1 hour to hand code as close as they could get to what had been laid out on paper.

    High Score: 60, none used CSS, but I did see lots of font tags! Total High Score: 178 (The Guy with the BS in CS above) out of a possible 300 ... 59.3 % (Johnny can't read or write code either :^] )

    I didn't hire him...I went to have a beer. Myself and a couple of other app devs were sitting ROFLOAO about the whole thing. I guess the beer increased our volume level, because a guy came up and said he heard what we were saying and that he was a web guy looking for a steady gig. I started interviewing him right there. No certs, no degree. Went to the office, looked at sites he had a hand in. He described not only basic HTML stuff, but CSS, ASP, JavaScript, PHP, a smattering of SQL (in which he clames to be weak), and a couple of other things. He took the 20 question multiple (remember, we had had a few ;^] ) and he got a 95. Missed the question about which tag is absolutely required in an HTML page. He hand coded the example while drinking a Bud Lite, completed it in 15 minutes, missed a couple of completion tags (like </li>) and used CSS.

    Hired him. Took him back to the bar. Happy ever since.

    Moral of story? Learn to write code and listen to loud guys in bars. It may pay someday.

    Jay

    "Football incorporates the two worst elements of American society: violence punctuated by committee meetings." -George Will

    ************************************* * Want to meet other PHP developers * * in your area? Check out: * * http://php.meetup.com/ * * No developer is an island ... * *************************************

    attached mail follows:


    Jay Blanchard wrote:

    > >+1 Miguel > +2 Chris

    I found when hiring people in the electronics industry that those who were genuinely interested in the subject (as a hobby) and then did a course were much better for the company than those that just had lots of pieces of paper.

    <opinion> I find that it is the non-technical managers who like the pieces of paper, as they are not technical enough to evaluate on anything else. </opinion>

    Chris

    attached mail follows:


    Has anyone had experience with imap_mail_move or imap_mail_copy?

    Can they copy or move a message from one mail server to another or only into a subfolder on the same server?

    Jeff

    __________________________________________________ Do You Yahoo!? Yahoo! Autos - Get free new car price quotes http://autos.yahoo.com

    attached mail follows:


    % man crontab

    -----Original Message----- From: MAAS To: php-generallists.php.net; php-windowslists.php.net Sent: 2002-07-17 14:51 Subject: [PHP-WIN] CRON JOB

    What do I have to do before I can run my file.php as a cron job in Linux?

    -- 
    PHP Windows Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    

    attached mail follows:


    After I read this file into an array (small sample of file below) I need to sorted it by the name at the end of each line and then echo out only the ones that the name equals the name in a search variable.

    Also could somebody recommend a PHP book that covers a lot of info on working with text files. It seams to be very little info in any of the boos I have now. It is sort of skipped over a lot

    mrgouldianwww.mrgouldian.com mrgouldian webmasterwww.mydomain.com myname infowww.mrgouldian.com mrgouldian webmasterwww.mrgouldian.com mrgouldian suportwww.mydomain.com myname fredwww.mrgouldian.com mrgouldian saleswww.mydomain.com myname infowww.mydomain.com myname garywww.mrgouldian.com mrgouldian mynamewww.mydomain.com myname

    attached mail follows:


    Unless I'm missing something, why put it in an array. Why not just just select the data from the data base that matches your search_name and list it. Something like:

    SELECT e_mail, name FROM e_mail_file WHERE name = '$search_name' ORDER by name

    HTH. Dan.

    rdkurthstarband.net wrote: > After I read this file into an array (small sample of file below) I need to sorted it by the name at > the end of each line and then echo out only the ones that the name > equals the name in a search variable. > > Also could somebody recommend a PHP book that covers a lot of info on > working with text files. It seams to be very little info in any of the > boos I have now. It is sort of skipped over a lot > > mrgouldianwww.mrgouldian.com mrgouldian > webmasterwww.mydomain.com myname > infowww.mrgouldian.com mrgouldian > webmasterwww.mrgouldian.com mrgouldian > suportwww.mydomain.com myname > fredwww.mrgouldian.com mrgouldian > saleswww.mydomain.com myname > infowww.mydomain.com myname > garywww.mrgouldian.com mrgouldian > mynamewww.mydomain.com myname >

    attached mail follows:


    Instead of an indexed array build an associative array and sort with one of the built-in PHP functions..

    $myary = array ( 'mrgouldian' => 'mrgouldianwww.mrgouldian.com', 'myname'=> 'mynamewww.mydomain.com'); ksort($myary);

    -Kevin

    ----- Original Message ----- From: <rdkurthstarband.net> To: "php-general" <php-generallists.php.net> Sent: Wednesday, July 17, 2002 1:52 PM Subject: [PHP] sorting and searching an Array

    > After I read this file into an array (small sample of file below) I need to sorted it by the name at > the end of each line and then echo out only the ones that the name > equals the name in a search variable. > > Also could somebody recommend a PHP book that covers a lot of info on > working with text files. It seams to be very little info in any of the > boos I have now. It is sort of skipped over a lot > > mrgouldianwww.mrgouldian.com mrgouldian > webmasterwww.mydomain.com myname > infowww.mrgouldian.com mrgouldian > webmasterwww.mrgouldian.com mrgouldian > suportwww.mydomain.com myname > fredwww.mrgouldian.com mrgouldian > saleswww.mydomain.com myname > infowww.mydomain.com myname > garywww.mrgouldian.com mrgouldian > mynamewww.mydomain.com myname > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    This would be MUCH MUCH easier to do if this data were in a database instead of a flat file. But, to accomplish this you need to write some code using the various array functions in PHP, such as asort() and explode(), and structures such as for() and each() to eliminate the array rows that don't match your criteria.

    "PHP and MySQL Web Development" by Luke Welling and Laura Thomson is a great book for learning PHP (it's what I used). There's not a whole chapter on file functions in PHP, but, there is enough info in there to do all the basic functions you would need to accomplish this task.

    Monty

    > From: rdkurthstarband.net > Reply-To: Richard Kurth <rdkurthstarband.net> > Newsgroups: php.general > Date: Wed, 17 Jul 2002 12:52:00 -0700 > To: php-general <php-generallists.php.net> > Subject: sorting and searching an Array > > After I read this file into an array (small sample of file below) I need to > sorted it by the name at > the end of each line and then echo out only the ones that the name > equals the name in a search variable. > > Also could somebody recommend a PHP book that covers a lot of info on > working with text files. It seams to be very little info in any of the > boos I have now. It is sort of skipped over a lot > > mrgouldianwww.mrgouldian.com mrgouldian > webmasterwww.mydomain.com myname > infowww.mrgouldian.com mrgouldian > webmasterwww.mrgouldian.com mrgouldian > suportwww.mydomain.com myname > fredwww.mrgouldian.com mrgouldian > saleswww.mydomain.com myname > infowww.mydomain.com myname > garywww.mrgouldian.com mrgouldian > mynamewww.mydomain.com myname >

    attached mail follows:


    have a look at the page spec in the css docs at w3c.org

    I use this for A4 paper, you can set the margins as well:

    page{ size : "21.0cm 29.7cm "; }

    Paul Roberts roberts_paulbigfoot.com ++++++++++++++++++++++++ ----- Original Message ----- From: "Martin Towell" <martin.towellworld.net> To: "'Manuel'" <manuelochoa-usa.com>; "PHP General" <php-generallists.php.net> Sent: Wednesday, July 17, 2002 1:57 AM Subject: RE: [PHP] Printer margins

    You can't change this type of setting on a client's browser The only way you'd be able to do this is to tell the user that the page prints best when margins are set to 0.25"

    -----Original Message----- From: Manuel [mailto:manuelochoa-usa.com] Sent: Wednesday, July 17, 2002 10:52 AM To: PHP General Subject: [PHP] Printer margins

    I'm creating an HTML file that will be printed by my website users. I've notices that most browser have the default print margins set to 0.75". Is there any way to change the print margins to 0.25"?

    --------------------------------- Do You Yahoo!? Yahoo! Autos - Get free new car price quotes

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php
    

    attached mail follows:


    First, sorry for my elementary english... I need a function made for PHP3 that works like preg_replace_callback... Sugestions???

    -- 
    Rafael Fernandes
    WebDeveloper - Aleph TI Ltda. / Matrix Internet Provider
    E-Mail: rafaelaleph.com.br
    Uin: 5551571
    

    attached mail follows:


    I am getting random Segmentation faults when I use the following script. This does not happen when I run scripts that do not include the xslt_process() So I am assuming it has something to do with Sablotron and xslt. Below is also the back trace with the problem. Can anyone suggest a solution or next step?

    <?php $xml = "./file.xml"; $xsl = "./file.xsl"; ob_start();

    $_parser = xslt_create();

    if( !$result = xslt_process( $_parser, // resource xh $xml, // string xml $xsl // string xsl ) ) { printf( "Sablotron Error (%s): <br /><strong>%s</strong>", xslt_errno($_parser), xslt_error($_parser) ); } ob_end_clean(); xslt_free($_parser); echo $result; ?>

    Starting program: /usr/sbin/httpd -X

    Program received signal SIGSEGV, Segmentation fault. __libc_free (mem=0x2) at malloc.c:3135 3135 malloc.c: No such file or directory. in malloc.c (gdb) bt #0 __libc_free (mem=0x2) at malloc.c:3135 #1 0x0808a177 in hashTableDestroy () #2 0x080890c2 in XML_ErrorString () #3 0x080833ea in XML_ParserFree () #4 0x4040fd29 in TreeConstructer::parseDataLineUsingExpat (this=0xbfffdcc4, S=0x81202d0, t=0x8132990, d=0x8131fc0, base_=0x0) at parser.cpp:149 #5 0x40432767 in Tree::parse (this=0x8132990, S=0x81202d0, d=0x8131fc0) at tree.cpp:1373 #6 0x40416328 in Processor::addLineParse (this=0x8120348, S=0x81202d0, newTree=0x8120348, absolute=0xbfffdda0, isXSL=0, ignoreErr=0) at proc.cpp:573 #7 0x404168d2 in Processor::readTreeFromURI (this=0x8120348, S=0x81202d0, newTree=0x8120348, location=0xbfffde40, base=0xbfffde28, isXSL=0, ignoreErr=0) at proc.cpp:621 #8 0x4041482d in Processor::open (this=0x8120348, S=0x81202d0, sheetURI=0x810ba6c "./aaindex.xsl", inputURI=0x810b994 "./aanews.xml") at proc.cpp:303 #9 0x4041e5d7 in SablotRunProcessor (processor_=0x8120348, sheetURI=0x810ba6c "./aaindex.xsl", inputURI=0x810b994 "./aanews.xml", resultURI=0x40374da3 "arg:/_result", params=0x0, arguments=0x0) at sablot.cpp:450 #10 0x4034813b in zif_xslt_process (ht=3, return_value=0x81207ec, this_ptr=0x0, return_value_used=1) at sablot.c:512 #11 0x4026e047 in execute (op_array=0x81121dc) at ./zend_execute.c:1598 #12 0x4027f994 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:810 #13 0x40292f35 in php_execute_script (primary_file=0xbffff4e8) at main.c:1381 #14 0x4028d600 in apache_php_module_main (r=0x8109544, display_source_mode=0) at sapi_apache.c:90 #15 0x4028e538 in send_php (r=0x8109544, display_source_mode=0, filename=0x8109c4c "/var/www/htdocs/index.php") at mod_php4.c:575 #16 0x4028e5bb in send_parsed_php (r=0x8109544) at mod_php4.c:590 #17 0x08055439 in ap_invoke_handler () #18 0x0806b0cf in ap_some_auth_required () #19 0x0806b536 in ap_internal_redirect () #20 0x401d1daa in handle_dir () from /usr/libexec/mod_dir.so #21 0x08055439 in ap_invoke_handler () #22 0x0806b0cf in ap_some_auth_required () #23 0x0806b136 in ap_process_request () #24 0x08061ae6 in ap_child_terminate () #25 0x08061cc5 in ap_child_terminate () #26 0x08061e3c in ap_child_terminate () #27 0x080624cd in ap_child_terminate () #28 0x08062d5c in main () #29 0x4009217d in __libc_start_main (main=0x8062998 <main>, argc=2, ubp_av=0xbffffa04, init=0x804f348 <_init>, fini=0x809adc0 <_fini>, rtld_fini=0x4000a534 <_dl_fini>, stack_end=0xbffff9fc) at ../sysdeps/generic/libc-start.c:129 (gdb)

    -- 
    Bill
    Amsterdam, NL
    

    attached mail follows:


    I generally prefer to include various blocks of code in templates using include_once() rather than load a functions library and make calls to those functions within the script.

    Is there a big difference in efficiency and speed of includes vs. custom functions? I like includes because it's easier to drop blocks of code in a page design without disrupting the design of the page very much.

    Thanks,

    Monty

    attached mail follows:


    The only difference I can think of is that if you included everything at once, in function or whatever, then that's only 1 file open and read. if you're doing a bunch of includes all over the place, then your doing more file open and reads. Not sure if it really affects your script in the grand scheme of things. the actually processing of the code should outway most of it, anyhow...

    ---John Holmes...

    ----- Original Message ----- From: "Monty" <monty3hotmail.com> To: <php-generallists.php.net> Sent: Wednesday, July 17, 2002 4:32 PM Subject: [PHP] Includes vs. Functions

    > I generally prefer to include various blocks of code in templates using > include_once() rather than load a functions library and make calls to those > functions within the script. > > Is there a big difference in efficiency and speed of includes vs. custom > functions? I like includes because it's easier to drop blocks of code in a > page design without disrupting the design of the page very much. > > Thanks, > > Monty > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I am not sure about efficiency, myself and I often ask this without much if anything at all for a response. However, I am the opposite of you, in that I prefer to create a library file containing all the functions. To make developing the page in something like Dreamweaver or Frontpage easier, I global all the variables of a given function, like say Function StockQuote($sym) { }. They I include the library file in my PHP webpage.Something like this...

    <html> <head> ~blah </head> <body> <?PHP include("filepath/filename"); StockQuote($sym); ?>

    various html ~blah ~blah <?PHP print $Stock_LastPrice; ?>

    ~blah ~blah </body> </html>

    In the library file, I global the variables;

    function StockQuote($sym) {

    global $Stock_LastPrice, $Stock_Position; get the data... do something with the data... $Stock_LastPrice = This minus that blah blah; }

    I can use this variable anywhere I would like and it is very WYSIWYG friendly.

    I am not sure how efficient it is though as I mentioned above.

    "Monty" <monty3hotmail.com> wrote in message news:B95B4CA8.11721%monty3hotmail.com... > I generally prefer to include various blocks of code in templates using > include_once() rather than load a functions library and make calls to those > functions within the script. > > Is there a big difference in efficiency and speed of includes vs. custom > functions? I like includes because it's easier to drop blocks of code in a > page design without disrupting the design of the page very much. > > Thanks, > > Monty >

    attached mail follows:


    Chris, thanks for describing your method. The reason I really dislike Functions in PHP is because you have to pass every variable needed by a function, even if that variable is global in the main script, which is a pain in the ass when a function needs a long string of variables. It makes it easier to forget a variable in the list and can make the code look messy.

    So, that's why I prefer includes, because the code is operating on the same level as the main script and can easily use variables set locally without making them global.

    I'll use a function if it only needs one or two variables passed to it, but, I find myself using more Includes than Functions because of the variable passing necessary.

    Tom

    > From: ccraneinxdesign.com (Chris Crane) > Organization: Inxdesign.com > Reply-To: "Chris Crane" <ccraneinxdesign.com> > Newsgroups: php.general > Date: Wed, 17 Jul 2002 17:05:59 -0400 > To: php-generallists.php.net > Subject: Re: Includes vs. Functions > > I am not sure about efficiency, myself and I often ask this without much if > anything at all for a response. However, I am the opposite of you, in that I > prefer to create a library file containing all the functions. To make > developing the page in something like Dreamweaver or Frontpage easier, I > global all the variables of a given function, like say Function > StockQuote($sym) { }. They I include the library file in my PHP > webpage.Something like this... > > <html> > <head> > ~blah > </head> > <body> > <?PHP include("filepath/filename"); StockQuote($sym); ?> > > various html > ~blah > ~blah > <?PHP print $Stock_LastPrice; ?> > > ~blah > ~blah > </body> > </html> > > In the library file, I global the variables; > > function StockQuote($sym) { > > global $Stock_LastPrice, $Stock_Position; > get the data... > do something with the data... > $Stock_LastPrice = This minus that blah blah; > } > > I can use this variable anywhere I would like and it is very WYSIWYG > friendly. > > I am not sure how efficient it is though as I mentioned above. >

    attached mail follows:


    Can anybody help?

    I have javascript code to find out browsers width and height, but they are stored in javascript variables. How can I access them from PHP? Or is there a method to do same in PHP straightly?

    Thanks, Seppo

    attached mail follows:


    You have to submit the variables back to PHP by refreshing/requesting another page. Once javascript finds the values..PHP is done executing.

    So have the values put into hidden elements of a form that's submitted, or tacked on to the end of a URL and redirected to another page...

    ---John Holmes...

    ----- Original Message ----- From: "Seppo Laukkanen" <seppo.laukkanenwintec.fi> To: <php-generallists.php.net> Sent: Wednesday, July 17, 2002 3:06 PM Subject: [PHP] how to access javascipt variables in PHP

    > Can anybody help? > > I have javascript code to find out browsers width and height, but they > are stored in javascript variables. How can I access them from PHP? Or > is there a method to do same in PHP straightly? > > Thanks, > Seppo > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    You can blend the two... sort of.

    <script language="javascript"> <!-- hide me

    function checkWidth() { var width = screen.width; var height = screen.height; document.location = "filename.php?width=" + width + "&height=" + height; }

    //--> </script>

    <body onload="checkWidth();">

    I'm not aware of any PHP vars that hold screen information.

    HTH

    Martin

    >>> "Seppo Laukkanen" <seppo.laukkanenwintec.fi> 07/17/02 03:06PM >>> Can anybody help?

    I have javascript code to find out browsers width and height, but they are stored in javascript variables. How can I access them from PHP? Or is there a method to do same in PHP straightly?

    Thanks, Seppo

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php