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: Fri Oct 18 2002 - 20:53:16 CDT

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

    php-general Digest 19 Oct 2002 01:53:16 -0000 Issue 1652

    Topics (messages 120498 through 120574):

    Re: Read a Excel File
            120498 by: Jon Haworth
            120511 by: dwalker
            120517 by: Boris Chartrins
            120519 by: Boris Chartrins

    transferring mysql database
            120499 by: Doug Parker
            120501 by: Jonathan Sharp
            120502 by: Rick Emery
            120503 by: Jon Haworth
            120536 by: Doug Parker

    Re: Explicit Variable Declaration?
            120500 by: Jon Haworth

    Array_splice vs. array_slice
            120504 by: Liam.Gibbs.dfait-maeci.gc.ca
            120505 by: Jon Haworth

    File Upload & spaces in filenames
            120506 by: ed.home.homes2see.com
            120508 by: Tom Rogers

    Making an array of files
            120507 by: Todd Cary
            120518 by: Jason Wong

    sending to local printer
            120509 by: Jason Vincent
            120510 by: Liam.Gibbs.dfait-maeci.gc.ca
            120531 by: Justin French

    Removing a string (located within one field) from the contents of another string within another field
            120512 by: dwalker
            120515 by: Rick Emery
            120521 by: Jon Haworth

    Strange variable compariso result
            120513 by: Marcello Lupo
            120520 by: Christopher G.Morlier

    real-time finger-pointing
            120514 by: Anders Henke
            120516 by: bbonkosk.tampabay.rr.com
            120522 by: Jon Haworth

    Re: browser back-button problem
            120523 by: Jason Wong

    Re: Accented characters appearing as question marks in a unicoded mail
            120524 by: nicolas

    Max and min values in array
            120525 by: Liam.Gibbs.dfait-maeci.gc.ca
            120526 by: Liam.Gibbs.dfait-maeci.gc.ca
            120537 by: Jason Wong
            120568 by: Luke Welling

    Execution time problem
            120527 by: Michael Hazelden

    Session registration.
            120528 by: Renato Lopes
            120529 by: John Nichel
            120530 by: Justin French

    filemtime problem
            120532 by: Todd Cary
            120533 by: Rasmus Lerdorf
            120534 by: Marek Kilimajer

    get_cfg_var()
            120535 by: Chris Boget
            120538 by: .: B i g D o g :.

    Get and object reference??
            120539 by: Matthew Hagerty

    [è à ì ò ù] related problem
            120540 by: FM Future Media Informatica
            120542 by: Zoltan Konyves

    Interactive Step Through Debugger
            120541 by: Tyler BIRD
            120544 by: .: B i g D o g :.
            120546 by: Tyler BIRD

    translating special characters when storing to a database
            120543 by: DonPro

    Random Array Sort?
            120545 by: Steve Keller
            120547 by: Tyler BIRD
            120552 by: Jason Wong
            120557 by: Steve Keller

    Carriage returns
            120548 by: Stephen
            120549 by: Tyler BIRD
            120550 by: Stuart
            120551 by: Brent Baisley
            120553 by: Stephen
            120554 by: Tyler BIRD
            120559 by: 1LT John W. Holmes
            120560 by: 1LT John W. Holmes

    Re: CREATING A FILE with a TEMPLATE
            120555 by: ppf
            120558 by: Jason Wong

    Newbie NN4 help...
            120556 by: Stephanie Sullivan
            120561 by: Kevin Stone
            120563 by: John Nichel
            120566 by: Stephanie Sullivan
            120570 by: Kevin Stone
            120571 by: Kevin Stone
            120572 by: Stephanie Sullivan
            120574 by: Chase Urich

    | | dbase_numfields issue ... | |
            120562 by: Edmond Chiu
            120565 by: 1LT John W. Holmes

    Re: PHP & XML
            120564 by: Joshua Alexander

    Re: Progress bar for uploading files
            120567 by: Rodolfo Gonzalez

    File system & ftp_get/ftp_fget issues
            120569 by: Jaime Kikpole

    Form to Goldmine
            120573 by: Chris Rehm

    Administrivia:

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

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

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

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

    attached mail follows:


    Hi Barakk,

    > I need to import data from an Excel (.xls) file.
    > Not a CSV file a real xls file.

    How about setting up a DSN for Excel and connecting via ODBC?
    http://php.net/manual/en/ref.odbc.php

    Don't know if it would work, but it's worth a shot.

    Cheers
    Jon

    attached mail follows:


    Will the import be a one time deal or will you have a need to import from
    excel often?

    If you don't find a really handy tool to do the import or conversion for
    you, you could create a macro with excel that automatically exports space
    delimited or comma delimited 'stuff' (with only 2 keystrokes). Which
    version of Excel?

    -----Original Message-----
    From: barakk <barakkfree.fr>
    To: php-generallists.php.net <php-generallists.php.net>
    Date: Friday, October 18, 2002 8:25 AM
    Subject: [PHP] Read a Excel File

    >Hi,
    >
    >I need to import data from an Excel (.xls) file. Not a CSV file a real
    >xls file.
    >I found classes to produce such file (BiffWriter, for exemple) but none
    >to read.
    >
    >Do you any idea, link ?
    >
    >Thx
    >Barakk
    >
    >
    >--
    >PHP General Mailing List (http://www.php.net/)
    >To unsubscribe, visit: http://www.php.net/unsub.php
    >
    >
    >

    attached mail follows:


    >> I need to import data from an Excel (.xls) file.
    >> Not a CSV file a real xls file.
    >
    > How about setting up a DSN for Excel and connecting via ODBC?
    > http://php.net/manual/en/ref.odbc.php
    >
    > Don't know if it would work, but it's worth a shot.
    Hi Jon,

    I will try, but i'm not sure my hosting company provide ODBC

    attached mail follows:


    dwalker <dwalkerhealthyproductsplus.com> wrote:
    > Will the import be a one time deal or will you have a need to import
    > from excel often?
    Each day.

    > If you don't find a really handy tool to do the import or conversion
    > for you, you could create a macro with excel that automatically
    > exports space delimited or comma delimited 'stuff' (with only 2
    > keystrokes). Which version of Excel?
    Excel 97 and 2000

    attached mail follows:


    was wondering if it were possible to transfer a mysql database setup on
    one server to another without having to re-setup all the entire
    database. if so, how?

    attached mail follows:


    Shutdown the mysql server, tar the database files, sftp/scp/etc them to
    the new server, untar them, start the server. (Make sure both servers
    are the same platform)

    -js

    Doug Parker wrote:
    > was wondering if it were possible to transfer a mysql database setup on
    > one server to another without having to re-setup all the entire
    > database. if so, how?
    >
    >

    attached mail follows:


    Quick method is: mysqldump DATABASE > db.txt

    Copy db.txt to new server. Then: mysql <db.txt
    Then grant the permissions to the users.

    ----- Original Message -----
    From: "Doug Parker" <drparkerclam.rutgers.edu>
    To: <php-generallists.php.net>
    Sent: Friday, October 18, 2002 8:11 AM
    Subject: [PHP] transferring mysql database


    was wondering if it were possible to transfer a mysql database setup on
    one server to another without having to re-setup all the entire
    database. if so, how?


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


    attached mail follows:


    Hi Doug,

    > was wondering if it were possible to transfer a
    > mysql database setup on one server to another
    > without having to re-setup all the entire
    > database. if so, how?

    Dump the schema of the database to a file, and then import it on the new
    server.

    If you use phpMyAdmin, there are built-in features for doing this. I can't
    remember offhand what the actual query is to get MySQL to show the schema,
    but I'm sure someone on the MySQL list would know (hint, hint)

    Cheers
    Jon

    attached mail follows:


    Thanks for all the replies, I didn't realize that it was this easy.
    Sorry, I also didn't realize that there was a mysql list - I'll be sure
    to post there next time.

    Thanks again!
    -Doug

    Jon Haworth wrote:

    > Hi Doug,
    >
    >
    >>was wondering if it were possible to transfer a
    >>mysql database setup on one server to another
    >>without having to re-setup all the entire
    >>database. if so, how?
    >>
    >
    > Dump the schema of the database to a file, and then import it on the new
    > server.
    >
    > If you use phpMyAdmin, there are built-in features for doing this. I can't
    > remember offhand what the actual query is to get MySQL to show the schema,
    > but I'm sure someone on the MySQL list would know (hint, hint)
    >
    > Cheers
    > Jon
    >

    attached mail follows:


    Hi Gregory,

    > Is there a way to force variable declaration

    Not really, but if you set your error reporting to E_ALL, you'll get error
    messages. It still doesn't *force* declaration, but it makes it a lot easier
    to find out what you got wrong :-)

    Cheers
    Jon

    attached mail follows:


    I'm getting confused between these two functions. Maybe I'm not using it
    right but, despite the descriptions, they both only really return the one
    value I'm specifying in the range (offset to length).

    If I have:

    $arrayvalues = { "1", "2", "3", "4", "5" };

    Both array_spilce($arrayvalues, 2, 1) and array_slice($arrayvalues, 2, 1)
    seem to return only 3.

    attached mail follows:


    Hi Liam,

    > If I have:
    > $arrayvalues = { "1", "2", "3", "4", "5" };
    > Both array_spilce($arrayvalues, 2, 1) and
    > array_slice($arrayvalues, 2, 1) seem to return only 3.

    That's right.

    array_slice($arrayvalues, 2, 1) returns 1 element starting from index 2
    (i.e. "3"). It doesn't remove the element, just return it.

    array_splice($arrayvalues, 2, 1) removes this element and replaces it with
    nothing (you didn't specify a replacement array). As per the manual
    description, it returns the elements it has removed (i.e. "3").

    If you try array_splice($arrayvalues, 2, 1, array("6")), then you should see
    a difference to $arrayvalues, but your array_splice call will still return
    3.

    Cheers
    Jon

    attached mail follows:


     I have a page where I have someone uploading a file select the file using
    a simple form and submit the form using multipart form data. Everything
    works the way it should until someone selects a file that contains a space
    in the username. What do I need to do to handle this? No-space filenames
    work just fine.

    Thanks,

    Ed

    attached mail follows:


    Hi,

    Saturday, October 19, 2002, 12:12:39 AM, you wrote:

    ehhc> I have a page where I have someone uploading a file select the file using
    ehhc> a simple form and submit the form using multipart form data. Everything
    ehhc> works the way it should until someone selects a file that contains a space
    ehhc> in the username. What do I need to do to handle this? No-space filenames
    ehhc> work just fine.

    ehhc> Thanks,

    ehhc> Ed

    I do this with uploaded files

    $file = trim($_FILES["userfile"]["name"]);
          if($file != ""):
                   $file = ereg_replace("'","",$file); //no pesky quotes
                   $file = ereg_replace("%20","_",$file); //no spaces
                   $file = ereg_replace(" ","_",$file); //no spaces
                   .
                   .
                   .
                   .

    -- 
    regards,
    Tom
    

    attached mail follows:


    I need to make an array filled with the full path/file and sorted by file date/time e.g. MyFiles=array(). I am not sure how to do that.

    Todd

    -- 
    Ariste Software, Petaluma, CA 94952
    

    attached mail follows:


    On Friday 18 October 2002 22:26, Todd Cary wrote: > I need to make an array filled with the full path/file and sorted by > file date/time e.g. MyFiles=array(). I am not sure how to do that.

    The manual entry for readdir() shows an example for displaying the files in a directory. Use that as a basis for your code.

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

    /* We should have a Vollyballocracy. We elect a six-pack of presidents. Each one serves until they screw up, at which point they rotate. -- Dennis Miller */

    attached mail follows:


    Hey,

    All these "printer" functions seem to refer to the printer attached to the server. I am looking for a way to send a print job to the client's printer (without having to display the page they want to print out first). Is this possible? Any help would be appreciated. I am actually looking to print to a COD form, so any tips on how to format the printing for a COD form would be appreciated too. Thanks in advance,

    J

    attached mail follows:


    << All these "printer" functions seem to refer to the printer attached to the server. I am looking for a way to send a print job to the client's printer (without having to display the page they want to print out first). Is this possible? Any help would be appreciated. I am actually looking to print to a COD form, so any tips on how to format the printing for a COD form would be appreciated too. Thanks in advance,>>

    As far as I know, I don't think you can because PHP works solely on the server. It can't force the client to do anything but display a page. But I think there's a JavaScript way to invoke the printer dialog. You could have PHP spit out some JavaScript, but that's supposing the client computer has JS enabled.

    attached mail follows:


    PHP = server side Printing = client side

    So no, PHP can't print stuff.

    Perhaps client side scripting (like javascript) can, but if any site did that to me (forced stuff to be printed without my ok), i'd be pretty pissed off.

    I'd consider it a security problem -- what happens if some shitty site start printing 1000 pages of some guys hairy arse???? No thanks!!

    I know YOUR intentions are good, but not everyone's are...

    Justin French

    on 19/10/02 12:24 AM, Jason Vincent (jayvnortelnetworks.com) wrote:

    > Hey, > > All these "printer" functions seem to refer to the printer attached > to the server. I am looking for a way to send a print job to the client's > printer (without having to display the page they want to print out first). > Is this possible? Any help would be appreciated. I am actually looking to > print to a COD form, so any tips on how to format the printing for a COD > form would be appreciated too. Thanks in advance, > > J > >

    attached mail follows:


    What is the most straight forward method of removing a string (located within one field) from the contents of another string within another field??

    Example:

    [FIELD1] ="klmnop"

    [FIELD2]="blah blah blah klmnop blah blah blah"

    End result for FIELD2 should be: "blah blah blah blah blah blah"

    This email message and all attachments transmitted herewith are trade secret and/or confidential information intended only for the viewing and use of addressee. If the reader of this message is not the intended recipient, you are hereby notified that any review, use, communication, dissemination, distribution or copying of this communication is prohibited. If you have received this communication is error, please notify the sender immediately by telephone or electronic mail, and delete this message and all copies and backups thereof.

    Thank you for your cooperation.

    attached mail follows:


    look at ereg_replace() $newstr = ereg_replace($field1, NULL, $field2); ----- Original Message ----- From: dwalker To: PHP Sent: Friday, October 18, 2002 9:32 AM Subject: [PHP] Removing a string (located within one field) from the contents of another string within another field What is the most straight forward method of removing a string (located within one field) from the contents of another string within another field?? Example: [FIELD1] ="klmnop" [FIELD2]="blah blah blah klmnop blah blah blah" End result for FIELD2 should be: "blah blah blah blah blah blah" This email message and all attachments transmitted herewith are trade secret and/or confidential information intended only for the viewing and use of addressee. If the reader of this message is not the intended recipient, you are hereby notified that any review, use, communication, dissemination, distribution or copying of this communication is prohibited. If you have received this communication is error, please notify the sender immediately by telephone or electronic mail, and delete this message and all copies and backups thereof. Thank you for your cooperation. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Hi,

    > > What is the most straight forward method of removing a > > string (located within one field) from the contents of > > another string within another field?? > > Example: > > [FIELD1] ="klmnop" > > [FIELD2]="blah blah blah klmnop blah blah blah" > > End result for FIELD2 should be: "blah blah blah blah blah blah" > > look at ereg_replace() > $newstr = ereg_replace($field1, NULL, $field2);

    Invoking the regex parser to do a simple string substitution is complete overkill.

    Look into str_replace() instead, it's a lot cheaper: http://www.php.net/manual/en/function.str-replace.php

    Cheers Jon

    attached mail follows:


    Hi to all. I have a very strange result from this code: I have a query that get a "select sum(columnname) as checksum from table" and a $total variable passed by a Form in post method . I manage both variables as string. After i make

    $tot=mysql_fetch_object($query_check_ordine);

    if(($tot->checksum-$total)!=0) { echo " There is a problem"; exit; } else { echo "OK"; }

    After this i tried to print the 2 values and both are, for example, 9.3 . But if i sottract the 2 variables i obtain 3.5527136766005E-15 instead of 0 . I think that PHP automatically try to evaluate the strings as floats (this is i want too).

    I tried to compare with != the two variables to see if them are equals and PHP say that the are not equal, but if i print them, them are equals. I tried to settype to floats directly the variables and the result is the same. After all if i settype to string directly the variables the comparison occur correctly.

    Have you any idea of this behaviour?? Thanks in advice, Bye Marcello

    attached mail follows:


    Hi Marcello,

    When dealing with floating point numbers in just about any language, there is a potential for round of errors. If you use the identical algorithm on the same machine to calculate the values, then it "should" not be a problem, but good programming style is to assume that it will be a problem.

    Typically, you should decide on the precision level that you care about. For example, if I were comparing prices in dollars, then my precision would probably be 0.005 (half a cent), because the numbers will round off to the same value. Therefore, you if statement should look like:

    if(abs($tot->checksum-$total)<$precision) {

    Hope this helps.

    -Chris

    At 03:27 PM 10/18/2002 -0100, you wrote: >>Hi to all. >>I have a very strange result from this code: >>I have a query that get a "select sum(columnname) as checksum from table" >>and >>a $total variable passed by a Form in post method . >>I manage both variables as string. >>After i make >> >>$tot=mysql_fetch_object($query_check_ordine); >> >> >> if(($tot->checksum-$total)!=0) { >> echo " There is a problem"; >> exit; >> } else { >> echo "OK"; >> } >> >> >>After this i tried to print the 2 values and both are, for example, 9.3 . >>But if i sottract the 2 variables i obtain 3.5527136766005E-15 instead of 0 . >>I think that PHP automatically try to evaluate the strings as floats >>(this is >>i want too). >> >>I tried to compare with != the two variables to see if them are equals and >>PHP say that the are not equal, but if i print them, them are equals. >>I tried to settype to floats directly the variables and the result is the >>same. >>After all if i settype to string directly the variables the comparison occur >>correctly. >> >>Have you any idea of this behaviour?? >>Thanks in advice, >>Bye Marcello >> >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    I was just wondering how to build a real-time chat with one-to-one communication. No delay and no database involved. I believe i should be something about sockets, but I can't really find any documentation about it. Can someone please point out a tutorial or site concerning this!?

    Thanks!

    Anders Henke

    attached mail follows:


    I would say a java applet would be more suitable for this situation. PHP does have socket support, but I really don't see how you could do this unless you were having two servers talk to each other?? Otherwise with PHP only running on the server side you would have to store the info somewhere, be it a database or a text file. -Brad

    > I was just wondering how to build a real-time chat with one-to-one > communication. > No delay and no database involved. > I believe i should be something about sockets, but I can't really find any > documentation about it. > Can someone please point out a tutorial or site concerning this!? > > Thanks! > > Anders Henke > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hi Anders,

    > I was just wondering how to build a real-time > chat with one-to-one communication. No delay > and no database involved.

    Put down the PHP manual, back away slowly, and learn Java :-)

    Cheers Jon

    attached mail follows:


    On Friday 18 October 2002 16:07, Krzysztof Dziekiewicz wrote:

    > Unfortunately, Mozilla, Netscape, Konqueror, and Opera all > share a common defect. When you use the back button, cache > rules are ignored, and it uses a cached copy regardless.

    RFC 2616 Section 13.13 stipulates that the BACK button show "exactly what the user saw at the time when the resource was retrieved". So in fact the above browsers ARE doing the right, which leaves only IE doing the wrong thing (as usual!).

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

    /* The most dangerous organization in America today is: (a) The KKK (b) The American Nazi Party (c) The Delta Frequent Flyer Club */

    attached mail follows:


    Thks, I'll try those :) And as for the &eacute, I would have preferred an easier way to provide accented characters, since, when using dreamweaver, I can use "é" character when creating unicoded html files. Or is dreamweaver coding the "é" correctly for me?

    Erwin wrote: >>$headers .= "Content-type: text/html; charset=utf-8\r\n"; > > >>everything works fine EXCEPT the "é" from "demandé" that is displayed >>as a "?" in the output mail. > > > Since you're using text/html as content-type, you should try using &eacute; > instead of é. > > Use something like this on the test: > > $trans = get_html_translation_table (HTML_ENTITIES); > $data = strtr($data,$trans); > > or > > $data = htmlentities( $data ); > > Maybe that'll help? > > Grtz Erwin >

    attached mail follows:


    Is there a way of finding out the max and min values in an array without resorting it?

    attached mail follows:


    <<Is there a way of finding out the max and min values in an array without resorting it?>>

    I should say is there a function. I don't want to have to loop through each element in the array and compare it to current values.

    attached mail follows:


    On Friday 18 October 2002 23:45, Liam.Gibbsdfait-maeci.gc.ca wrote: > <<Is there a way of finding out the max and min values in an array without > resorting it?>> > > I should say is there a function. I don't want to have to loop through each > element in the array and compare it to current values.

    Well, all array functions are in the "Array Functions" section of the manual. If there is such a function it should be listed there.

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

    /* Lord, what fools these mortals be! -- William Shakespeare, "A Midsummer-Night's Dream" */

    attached mail follows:


    "Liam Gibbs" <Liam.Gibbsdfait-maeci.gc.ca> wrote in message news:D64360C926B9F34F8B35F78D07B8E7A2716C47postman.dfait-maeci.gc.ca... > Is there a way of finding out the max and min values in an array without > resorting it?

    How about Min() and max().

    Luke Welling

    --
    PHP and MySQL Web Development
    Luke Welling and Laura Thomson
    http://www.amazon.com/exec/obidos/ASIN/0672317842
    

    attached mail follows:


    All, I posted about this earlier ... but I've just discovered a second method of doing it ... I'm wondering if I've discovered a bug here or not. Basically - my suspicion is this: If you include a file and then include it a second time - the max_execution_time directive will not apply during that second include. I've seen this on both command line PHP and now running via the apache web server. However, it can be got around by using the set_time_limit before the second include. Has anyone else seen this? Am I doing something wrong? Or am I missing the point? Cheers, Michael.


    • application/x-pkcs7-signature attachment: smime.p7s

    attached mail follows:


    Hi!

    Can anyone help?

    I am running PHP 4.2.3 and have set the following:

    session_start();

    $_SESSION['Requested_url']=getenv("SERVER_NAME").getenv("REQUEST_URI");

    How do I go about accessing this variable on a different page, with register_globals disabled?

    Thanks

    Renato

    attached mail follows:


    You'll have to start the session on ever page ( unless you set sessions to automatically start in the php.ini file ), then you can just call $_SESSION['Requested_url']. The value will still be there.

    Renato Lopes wrote: > Hi! > > Can anyone help? > > I am running PHP 4.2.3 and have set the following: > > session_start(); > > $_SESSION['Requested_url']=getenv("SERVER_NAME").getenv("REQUEST_URI"); > > How do I go about accessing this variable on a different page, with > register_globals disabled? > > Thanks > > Renato > >

    attached mail follows:


    On the page you want to access the variable:

    <? session_start(); echo $_SESSION['Requested_url']; ?>

    Note: any pages in between the page you SET the session var and the page you want to ACCESS the var need to also maintain session (session_start()) and you need to pass the session around with cookies and/or the url and/or trans-sid.

    Justin

    on 19/10/02 9:54 AM, Renato Lopes (renatolopesmac.com) wrote:

    > Hi! > > Can anyone help? > > I am running PHP 4.2.3 and have set the following: > > session_start(); > > $_SESSION['Requested_url']=getenv("SERVER_NAME").getenv("REQUEST_URI"); > > How do I go about accessing this variable on a different page, with > register_globals disabled? > > Thanks > > Renato >

    attached mail follows:


    In the "test script" below, $unixtime is false. What am I missing?

    <?php include "test.inc"; if ($handle = opendir($fullpath . 'files')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { //echo "$file" . " "; echo ($fullpath . $file . "<br>"); // An example of a file name is "/var/www/html/aralbum/php/artscard_dump.txt" $unixtime = filemtime($fullpath . $file); if ($unixtime) echo (date("Y m d", $unixtime) . "<br>"); } } closedir($handle); } ?>

    -- 
    Ariste Software, Petaluma, CA 94952
    

    attached mail follows:


    I don't understand the opendir($fullpath . 'files') line. Your example filename as not 'files' in it, so how could it come from a directory that ends in 'files' ?

    On Fri, 18 Oct 2002, Todd Cary wrote:

    > In the "test script" below, $unixtime is false. What am I missing? > > <?php > include "test.inc"; > if ($handle = opendir($fullpath . 'files')) { > while (false !== ($file = readdir($handle))) { > if ($file != "." && $file != "..") { > //echo "$file" . " "; > echo ($fullpath . $file . "<br>"); > // An example of a file name is > "/var/www/html/aralbum/php/artscard_dump.txt" > $unixtime = filemtime($fullpath . $file); > if ($unixtime) echo (date("Y m d", $unixtime) . "<br>"); > } > } > closedir($handle); > } > ?> > > -- > Ariste Software, Petaluma, CA 94952 >

    attached mail follows:


    You open directory $fullpath .'files', but test $fullpath . $file, should be $fullpath .'files/' . $file

    Todd Cary wrote:

    > In the "test script" below, $unixtime is false. What am I missing? > > <?php > include "test.inc"; > if ($handle = opendir($fullpath . 'files')) { > while (false !== ($file = readdir($handle))) { > if ($file != "." && $file != "..") { > //echo "$file" . " "; > echo ($fullpath . $file . "<br>"); > // An example of a file name is > "/var/www/html/aralbum/php/artscard_dump.txt" > $unixtime = filemtime($fullpath . $file); > if ($unixtime) echo (date("Y m d", $unixtime) . "<br>"); > } > } > closedir($handle); > } > ?> >

    attached mail follows:


    Though we didn't change anything on our server, for some reason, the above function is no longer working. I can try to get the value of any of the configuration variables and nothing is getting returned. I can run phpinfo() and see that the configuration vars are set but get_cfg_var() just won't return them. Has anyone experienced anything like this? Again, we did not change anything on our server. It's just that one minute it's working and the next it's not.

    Any insight would be greatly appreciated!!

    Chris

    attached mail follows:


    Things to try:

    1. Has anyone turned this function off in php. You can do it in the php.ini script. 2. Do a var_dump on the returned result for get_cfg_var. 3. Have all debugging turned on in php and have it go to stdout. (Especially the start up one.) Verify the warning and such.

    On Fri, 2002-10-18 at 10:59, Chris Boget wrote: > Though we didn't change anything on our server, for some > reason, the above function is no longer working. I can try > to get the value of any of the configuration variables and > nothing is getting returned. I can run phpinfo() and see that > the configuration vars are set but get_cfg_var() just won't > return them. > Has anyone experienced anything like this? Again, we did > not change anything on our server. It's just that one minute > it's working and the next it's not. > > Any insight would be greatly appreciated!! > > Chris > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    -- 
    .: B i g D o g :.
    

    attached mail follows:


    Greetings,

    Can anyone tell me why the following still creates a *copy* of the object??

    Thanks, Matthew

    <?php

    $aFunctions = array();

    $oTest = new test; $oTest->sText = "The original object.";

    print "<pre>";

    foreach ( array_keys($aFunctions) as $iKey ) call_user_func($aFunctions[$iKey]);

    $oTest->callme();

    print "</pre>";

    class test {

    var $sText;

    function test() { GLOBAL $aFunctions;

    $this->sText = "A copy of the object!";

    /* This make a COPY of the Object, not a Reference! */ $aFunctions[] = array(&$this, 'callme'); }

    function callme() { print $this->sText . "\n"; return; } }

    ?>

    attached mail follows:


    Hy guys, I'm new, and I immediately start to place a problem....

    I hope you apologize me if I've not understood anything of this mailing list philosophy, but I suppose that it should be a comunity where developer and programmer help each other in php related problem.

    In this cotest, I want to ask you this:

    If I have a var, for example $body which comes from a form, and i pass the content of $body to the mail(....) function, all the email I send, if $body contains the word "egualitè" char as à, ì, ò, ù, what I receive by email is a string like this, "egualit_(I__$B!J_(B"

    can someone help me? thanks, MAX

    Massimiliano Di Tanno

    ________________________________________________________________________ FM FUTURE MEDIA INFORMATICA Web Hosting - Web Design - Sviluppo software personalizzato Gestionali aziendali - Elaborazioni Grafiche - System Integration

    67, Via Milano 20024 Garbagnate Mil.se (MI) ITALY TEL. +39 - 02 - 995.89.18 FAX +39 - 02 - 995.60.77 - http://www.fminfo.com

    Cell. 335-5601928

    *©*´¯`·.¸¸.·´¯`·.¸¸.·´¯`·- *©*´¯`·.¸¸.·´¯`·.¸¸.·´¯`·- *©*

    attached mail follows:


    Hello FM,

    Friday, October 18, 2002, 8:11:52 PM, you wrote:

    FFMI> Hy guys, I'm new, FFMI> and I immediately start to place a problem....

    FFMI> I hope you apologize me if I've not understood anything of this mailing FFMI> list philosophy, but I suppose that it should be a comunity where developer FFMI> and programmer help each other in php related problem.

    FFMI> In this cotest, I want to ask you this:

    FFMI> If I have a var, for example $body which comes from a form, and i pass the FFMI> content of $body to the mail(....) function, all the email I send, FFMI> if $body contains the word "egualitè" char as à, ì, ò, ù, what I receive by FFMI> email is a string like this, "egualit_(I__$B!J_(B"

    FFMI> can someone help me? FFMI> thanks, FFMI> MAX

    FFMI> Massimiliano Di Tanno

    FFMI> ________________________________________________________________________ FFMI> FM FUTURE MEDIA INFORMATICA FFMI> Web Hosting - Web Design - Sviluppo software personalizzato FFMI> Gestionali aziendali - Elaborazioni Grafiche - System Integration

    FFMI> 67, Via Milano 20024 Garbagnate Mil.se (MI) ITALY FFMI> TEL. +39 - 02 - 995.89.18 FAX +39 - 02 - 995.60.77 FFMI> - http://www.fminfo.com

    FFMI> Cell. 335-5601928

    FFMI> *©*´¯`·.¸¸.·´¯`·.¸¸.·´¯`·- *©*´¯`·.¸¸.·´¯`·.¸¸.·´¯`·- *©*

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

    Try to send HTML e-mail (not simple text) with the correct charset settings.

    -- 
    Best regards,
     Zoltan                            mailto:zolikonyveshome.ro
    

    attached mail follows:


    I was looking for a interactive step through command line debugger for php. The php command installed wiht php 4.2.2 doen't seem to do this with the -r interactive flag does anybody have any debugger suggestions??

    attached mail follows:


    When debugging i like to use "exit;" to stop where i am at...similar to a break;

    but that is a simple method to not move in the code...

    U can also set user define triggers that cause warnings and/or errors when something happens...

    On Fri, 2002-10-18 at 12:09, Tyler BIRD wrote: > I was looking for a interactive step through command line debugger > for php. The php command installed wiht php 4.2.2 > doen't seem to do this with the -r interactive flag > does anybody have any debugger suggestions?? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    -- 
    .: B i g D o g :.
    

    attached mail follows:


    Well I'm coming from the perl world where I can literally trace and step through my source code and optionally skip tracing into a subroutine call and even breaking on a certain condition.

    I'm heard of dbg which supports interactive debugging, but only if you have the php source available know anything else about it anyone?

    >>> ".: B i g D o g :." <bigdogventicon.com> 10/18/02 12:37PM >>> When debugging i like to use "exit;" to stop where i am at...similar to a break;

    but that is a simple method to not move in the code...

    U can also set user define triggers that cause warnings and/or errors when something happens...

    On Fri, 2002-10-18 at 12:09, Tyler BIRD wrote: > I was looking for a interactive step through command line debugger > for php. The php command installed wiht php 4.2.2 > doen't seem to do this with the -r interactive flag > does anybody have any debugger suggestions?? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    -- 
    .: B i g D o g :.
    

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

    attached mail follows:


    Hi,

    I have a variable called '$myvar' containing the text: "this & that"

    I store it into a MySQL table using stripslashes($myvar).

    When I later retrieve the field, it looks like: "this &amp that"

    How can I keep it in it's original form when storing it?

    Thanks, Don

    attached mail follows:


    I looked in the guide and couldn't find an easy way to do this, like a multisort, so I thought I'd ask here and see if anyone can point me to the command or share code if they've done something like this.

    I have an array with numbers in the fields, say 1, 2, 3, 4 and 5 in the first 5 slots. Now I want to sort them, but randomly.

    The only way I could think to do this is to create a loop, run it a random number of times, and in the loop, swap two random elements.

    Can anyone think of an easier/more logical way?

    --
    S. Keller
    UI Engineer
    The Health TV Channel, Inc.
    (a non - profit organization)
    3820 Lake Otis Pkwy.
    Anchorage, AK 99508
    907.770.6200 ext.220
    907.336.6205 (fax)
    Email: skellerhealthtvchannel.org
    Web: www.healthtvchannel.org
    

    attached mail follows:


    How about the fibanachi sequence. The value in array elem x is the value in array elemet with index -> x-1 + x-2 % ( rand() )

    >>> Steve Keller <skellerhealthtvchannel.org> 10/18/02 12:43PM >>> I looked in the guide and couldn't find an easy way to do this, like a

    multisort, so I thought I'd ask here and see if anyone can point me to the command or share code if they've done something like this.

    I have an array with numbers in the fields, say 1, 2, 3, 4 and 5 in the

    first 5 slots. Now I want to sort them, but randomly.

    The only way I could think to do this is to create a loop, run it a random number of times, and in the loop, swap two random elements.

    Can anyone think of an easier/more logical way?

    --
    S. Keller
    UI Engineer
    The Health TV Channel, Inc.
    (a non - profit organization)
    3820 Lake Otis Pkwy.
    Anchorage, AK 99508
    907.770.6200 ext.220
    907.336.6205 (fax)
    Email: skellerhealthtvchannel.org 
    Web: www.healthtvchannel.org 
    

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

    attached mail follows:


    On Saturday 19 October 2002 02:43, Steve Keller wrote: > I looked in the guide and couldn't find an easy way to do this, like a > multisort, so I thought I'd ask here and see if anyone can point me to the > command or share code if they've done something like this. > > I have an array with numbers in the fields, say 1, 2, 3, 4 and 5 in the > first 5 slots. Now I want to sort them, but randomly. > > The only way I could think to do this is to create a loop, run it a random > number of times, and in the loop, swap two random elements. > > Can anyone think of an easier/more logical way?

    shuffle() ?

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

    /* Lack of money is the root of all evil. -- George Bernard Shaw */

    attached mail follows:


    At 10/19/2002 03:30 AM, Jason Wong wrote:

    > > Can anyone think of an easier/more logical way? > >shuffle() ?

    Doink!

    That's it Jason. Thanks mucho. I knew there had to be a function for it, I just couldn't find it in the array functions section of the manual.

    --
    S. Keller
    UI Engineer
    The Health TV Channel, Inc.
    (a non - profit organization)
    3820 Lake Otis Pkwy.
    Anchorage, AK 99508
    907.770.6200 ext.220
    907.336.6205 (fax)
    Email: skellerhealthtvchannel.org
    Web: www.healthtvchannel.org
    

    attached mail follows:


    Hello,

    How can I make it so when a user types something in to a textarea, when they push enter, it stays as an enter? I've tried using a replace function that replaces the ASCII code for enter to \n but that didn't work.

    Thanks, Stephen Craton http://www.melchior.us http://php.melchior.us

    attached mail follows:


    Message-Id: <sdb0080a.071mail-out.uvsc.edu> Date: Fri, 18 Oct 2002 13:09:23 -0600 From: "Tyler BIRD" <BIRDTYuvsc.edu> To: <php-generallists.php.net>,<webmastermelchior.us> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [PHP] Carriage returns

    The code for enter can be many things \r\n \r \n Wintel Macintosh Unices

    if your displaying the data you collect in html \n|\r\n|\r = <br>

    what was the ascii code for enter you had

    >>> "Stephen" <webmastermelchior.us> 10/18/02 01:02PM >>> Hello,

    How can I make it so when a user types something in to a textarea, when they push enter, it stays as an enter? I've tried using a replace function that replaces the ASCII code for enter to \n but that didn't work.

    Thanks, Stephen Craton http://www.melchior.us http://php.melchior.us

    attached mail follows:


    On Friday, Oct 18, 2002, at 20:02 Europe/London, Stephen wrote: > How can I make it so when a user types something in to a textarea, > when they push enter, it stays as an enter? I've tried using a replace > function that replaces the ASCII code for enter to \n but that didn't > work.

    http://www.php.net/nl2br

    -- 
    Stuart
    

    attached mail follows:


    You want to use addslashes before you store it in the database. When you retrieve the data, you want to use removeslashes to convert things back. If you are just going to display the submitted text as regular text on a page, you want to use nl2br to convert the returns (new lines) to and html <br />.

    On Friday, October 18, 2002, at 03:02 PM, Stephen wrote:

    > Hello, > > How can I make it so when a user types something in to a textarea, when > they push enter, it stays as an enter? I've tried using a replace > function that replaces the ASCII code for enter to \n but that didn't > work. > > Thanks, > Stephen Craton > http://www.melchior.us > http://php.melchior.us >

    --
    Brent Baisley
    Systems Architect
    Landover Associates, Inc.
    Search & Advisory Services for Advanced Technology Environments
    p: 212.759.6400/800.759.0577
    

    attached mail follows:


    Actually, what the user types in then goes out into an email. I'd have to switch the enters into \n but I'm not sure how...

    ----- Original Message ----- From: "Brent Baisley" <brentlandover.com.> To: "Stephen" <webmastermelchior.us> Cc: "PHP List" <php-generallists.php.net> Sent: Friday, October 18, 2002 2:24 PM Subject: Re: [PHP] Carriage returns

    > You want to use addslashes before you store it in the database. When you > retrieve the data, you want to use removeslashes to convert things back. > If you are just going to display the submitted text as regular text on a > page, you want to use nl2br to convert the returns (new lines) to and > html <br />. > > On Friday, October 18, 2002, at 03:02 PM, Stephen wrote: > > > Hello, > > > > How can I make it so when a user types something in to a textarea, when > > they push enter, it stays as an enter? I've tried using a replace > > function that replaces the ASCII code for enter to \n but that didn't > > work. > > > > Thanks, > > Stephen Craton > > http://www.melchior.us > > http://php.melchior.us > > > -- > Brent Baisley > Systems Architect > Landover Associates, Inc. > Search & Advisory Services for Advanced Technology Environments > p: 212.759.6400/800.759.0577 > >

    attached mail follows:


    Lets say your textarea has a name of comments then:

    preg_replace("/(\r\n)/", "\n", $comments); # replaces all \r\n ( wintel ) to \n only preg_replace("/\r/", "\n", $comments); # replaces all \r ( macintosh ) to \n only

    Tyler

    >>> "Stephen" <webmastermelchior.us> 10/18/02 01:35PM >>> Actually, what the user types in then goes out into an email. I'd have to switch the enters into \n but I'm not sure how...

    ----- Original Message ----- From: "Brent Baisley" <brentlandover.com.> To: "Stephen" <webmastermelchior.us> Cc: "PHP List" <php-generallists.php.net> Sent: Friday, October 18, 2002 2:24 PM Subject: Re: [PHP] Carriage returns

    > You want to use addslashes before you store it in the database. When you > retrieve the data, you want to use removeslashes to convert things back. > If you are just going to display the submitted text as regular text on a > page, you want to use nl2br to convert the returns (new lines) to and > html <br />. > > On Friday, October 18, 2002, at 03:02 PM, Stephen wrote: > > > Hello, > > > > How can I make it so when a user types something in to a textarea, when > > they push enter, it stays as an enter? I've tried using a replace > > function that replaces the ASCII code for enter to \n but that didn't > > work. > > > > Thanks, > > Stephen Craton > > http://www.melchior.us > > http://php.melchior.us > > > -- > Brent Baisley > Systems Architect > Landover Associates, Inc. > Search & Advisory Services for Advanced Technology Environments > p: 212.759.6400/800.759.0577 > >

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

    attached mail follows:


    > Actually, what the user types in then goes out into an email. I'd have to > switch the enters into \n but I'm not sure how...

    The "enters" _are_ \n. Or \r\n (windows) or \r (mac). Basically, they are already there, so you don't need to do anything. If you're trying to view the string in the browser and you're not seeing the returns, that's because HTML does not recognize linefeeds. HTML requires a <br> for a new line. If you look at the source code of the page, you'll see the new lines are still there.

    You may want to play with the WRAP attribute of the TEXTAREA. I think some options are PHYSICAL, VIRTUAL, NONE, etc... look it up.

    ---John Holmes...

    attached mail follows:


    > You want to use addslashes before you store it in the database. When you > retrieve the data, you want to use removeslashes to convert things back.

    I remember getting corrected on this a long time ago. You do _not_ need to use stripslashes() on data that's coming back out of the database. If you have a string such as "that's it" and you escape the single quote, you'll have "that\'s it". When that string is inserted into the database, the \ is only there to tell the database that the next character is escaped and it's not the end of the string. So what's actually stored in the database is "that's it". You don't need to stripslash() that.

    Now, if for some reason you're pulling data out of the database and it comes out as "that\'s it", then one of two things is happening. You are running addslashes() twice on the data, possibly once with magic_quotes_gpc and the other with addslashes() in your code. Or, you have magic_quotes_runtime ON, which will automatically addslash() quotes when you pull data out of the database.

    Hope that helps.

    ---John Holmes...

    attached mail follows:


    Hi: Thanks for u r help, I tried the header function it works fine if i tried to redirect before page header generated, other wise it always generate error says that ******************************************** Warning: Cannot add header information - headers already sent by (output started at c:\projects\test\include\functionGen.php:55) in c:\projects\test\login.php on line 21

    ****************

    Thanks in advance Prad

    .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 >

    __________________________________________________ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos & More http://faith.yahoo.com

    attached mail follows:


    On Saturday 19 October 2002 03:46, ppf wrote: > Hi: > Thanks for u r help, I tried the header function it > works fine if i tried to redirect before page header > generated, other wise it always generate error says > that > ******************************************** > Warning: Cannot add header information - headers > already sent by (output started at > c:\projects\test\include\functionGen.php:55) in > c:\projects\test\login.php on line 21

    Try searching the archives or google for:

    - cannot add header information headers already sent by -

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

    /* interest, n.: What borrowers pay, lenders receive, stockholders own, and burned out employees must feign. */

    attached mail follows:


    Hi people... I've just used PHP for the first time... It's being used as a CSS-style switcher (my client didn't want to use a javascript client-side solution)... I have it all working well in most browsers I've tried it in... EXCEPT the dreaded NN4* ... This script uses a cookie... And then switches the styles... Is there something I don't know about that would cause NN4 to be unable to use this?

    I'm rather at a loss and my site is two days over deadline... :( If anyone could point me in the right direction I'd be VERY appreciative...

    The page I'm playing with is here: http://www.kspope.com/phpswitch/test6.php

    The switcher is at the bottom of the page... And it reloads the NN page, but doesn't change it. (Don't mind the NN "mess" I"m working on the styling for that browser right now)...

    Thank in advance for any input... :)

    Stephanie Sullivan VioletSky Design http://www.violetsky.net

    ³I am always doing that which I can not do, in order that I may learn how to do it." -Picasso

    attached mail follows:


    Well one option is obvious.. stop coding for legacy browsers. The company I work for recently decided to stop developing for anything older than NN6 and IE5. It is no longer cost effective for us to spend time developing for the other browsers. Okay so this may not be an option for you but it is something that I highly recommend you consider.

    Fortunately there is a fix to your problem and that is not to rely on Cookies. Many programmers have noted a number of incompatibilities and bugs with Cookies and legacy browsers which seem to change on a per-installation basis. You can instead use the $HTTP_USER_AGENT environment variable to cloak the style sheet.

    For example here's the $HTTP_USER_AGENT for Netscape 7.0 on Windows.. Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0

    And for Internet Explorer 6.0 on Windows... Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

    You can preg_match() for the indicators and write a function that cloaks your CSS file. Something like this..

    ----------------- <? function css_cloak ($useragent) { if (preg_match("/Netscape\/4/i", $useragent)) return "legacy.css"; else return "modern.css"; }

    echo "<link href=\"".css_cloak($HTTP_USER_AGENT)."\" rel=\"stylesheet\" type=\"text/css\">"; ?> ------------------

    Note I really don't know exactly what indicators are in the $HTTP_USER_AGENT for Netscape 4.0 but this should do the trick. Good luck!

    -Kevin

    ----- Original Message ----- From: "Stephanie Sullivan" <designvioletsky.net> To: <php-generallists.php.net> Sent: Friday, October 18, 2002 1:49 PM Subject: [PHP] Newbie NN4 help...

    > Hi people... I've just used PHP for the first time... It's being used as a > CSS-style switcher (my client didn't want to use a javascript client-side > solution)... I have it all working well in most browsers I've tried it in... > EXCEPT the dreaded NN4* ... This script uses a cookie... And then switches > the styles... Is there something I don't know about that would cause NN4 to > be unable to use this? > > I'm rather at a loss and my site is two days over deadline... :( If anyone > could point me in the right direction I'd be VERY appreciative... > > The page I'm playing with is here: > http://www.kspope.com/phpswitch/test6.php > > The switcher is at the bottom of the page... And it reloads the NN page, but > doesn't change it. (Don't mind the NN "mess" I"m working on the styling for > that browser right now)... > > Thank in advance for any input... :) > > Stephanie Sullivan > VioletSky Design > http://www.violetsky.net > > ³I am always doing that which I can not do, in order that I may learn how to > do it." -Picasso > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    The problem with that option is that most Netscape users are still using Netscape 4.x. There hasn't been a big rush to update for Netscape users. Granted this number may be anywhere from 2 - 10% of your visits, but if you're trying to sell something, that's like putting a guard out in front of your store and not letting in anyone with an income over $60k. To me, the best option is to code as much as possible w3c compliant, and if there is something that works in Netscape 6+ and IE 5+, but not in NN4, just don't make that option available for NN4 users...don't shut them out entirely though.

    Just my $0.02

    Kevin Stone wrote: > Well one option is obvious.. stop coding for legacy browsers. The company I > work for recently decided to stop developing for anything older than NN6 and > IE5. It is no longer cost effective for us to spend time developing for the > other browsers. Okay so this may not be an option for you but it is > something that I highly recommend you consider. > > Fortunately there is a fix to your problem and that is not to rely on > Cookies. Many programmers have noted a number of incompatibilities and bugs > with Cookies and legacy browsers which seem to change on a per-installation > basis. You can instead use the $HTTP_USER_AGENT environment variable to > cloak the style sheet. > > For example here's the $HTTP_USER_AGENT for Netscape 7.0 on Windows.. > Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) > Gecko/20020823 Netscape/7.0 > > And for Internet Explorer 6.0 on Windows... > Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) > > You can preg_match() for the indicators and write a function that cloaks > your CSS file. Something like this.. > > ----------------- > <? > function css_cloak ($useragent) > { > if (preg_match("/Netscape\/4/i", $useragent)) > return "legacy.css"; > else > return "modern.css"; > } > > echo "<link href=\"".css_cloak($HTTP_USER_AGENT)."\" rel=\"stylesheet\" > type=\"text/css\">"; > ?> > ------------------ > > Note I really don't know exactly what indicators are in the $HTTP_USER_AGENT > for Netscape 4.0 but this should do the trick. Good luck! > > -Kevin > > ----- Original Message ----- > From: "Stephanie Sullivan" <designvioletsky.net> > To: <php-generallists.php.net> > Sent: Friday, October 18, 2002 1:49 PM > Subject: [PHP] Newbie NN4 help... > > > >>Hi people... I've just used PHP for the first time... It's being used as a >>CSS-style switcher (my client didn't want to use a javascript client-side >>solution)... I have it all working well in most browsers I've tried it > > in... > >>EXCEPT the dreaded NN4* ... This script uses a cookie... And then switches >>the styles... Is there something I don't know about that would cause NN4 > > to > >>be unable to use this? >> >>I'm rather at a loss and my site is two days over deadline... :( If anyone >>could point me in the right direction I'd be VERY appreciative... >> >>The page I'm playing with is here: >>http://www.kspope.com/phpswitch/test6.php >> >>The switcher is at the bottom of the page... And it reloads the NN page, > > but > >>doesn't change it. (Don't mind the NN "mess" I"m working on the styling > > for > >>that browser right now)... >> >>Thank in advance for any input... :) >> >>Stephanie Sullivan >>VioletSky Design >>http://www.violetsky.net >> >>³I am always doing that which I can not do, in order that I may learn how > > to > >>do it." -Picasso >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > > >

    attached mail follows:


    on 10/18/02 4:22 PM, Kevin Stone at kevinhelpelf.com wrote:

    > Fortunately there is a fix to your problem and that is not to rely on > Cookies. Many programmers have noted a number of incompatibilities and bugs > with Cookies and legacy browsers which seem to change on a per-installation > basis. You can instead use the $HTTP_USER_AGENT environment variable to > cloak the style sheet.

    I wish that not counting NN4 into the mix was possible for this site... But alas, this is the MOST backward-compatible-requirement client I've ever had... That said, one question about the "fix" you posted...

    Will it do the same thing as the cookie idea? In other words... When someone chooses the way they want to view the site, will it keep the same look throughout the site? And when they come back, how does it know what to "show" them?

    Stephanie Sullivan VioletSky Design http://www.violetsky.net

    "If we knew what we were doing, it wouldn't be called research , would it?"-- Albert Einstein

    attached mail follows:


    Who is shutting who out? Upgrade. That's the clients job, not ours. The idea that being 100% compatible adds value to your service is a myth.. and an expensive one at that. No software company in the world provides that level of compatibility, and yet web developers are expected to.. why? You'll see many more web dev houses making this same decision here in the next year or so. The economy isn't exactly booming, money is tight, wages are going down becuase the jobs aren't there, and the advantage of full compatibility is no longer cost effective.

    -Kevin

    ----- Original Message ----- From: "John Nichel" <jnichelby-tor.com> To: "Kevin Stone" <kevinhelpelf.com> Cc: "Stephanie Sullivan" <designvioletsky.net>; <php-generallists.php.net> Sent: Friday, October 18, 2002 2:51 PM Subject: Re: [PHP] Newbie NN4 help...

    > The problem with that option is that most Netscape users are still using > Netscape 4.x. There hasn't been a big rush to update for Netscape > users. Granted this number may be anywhere from 2 - 10% of your visits, > but if you're trying to sell something, that's like putting a guard out > in front of your store and not letting in anyone with an income over > $60k. To me, the best option is to code as much as possible w3c > compliant, and if there is something that works in Netscape 6+ and IE > 5+, but not in NN4, just don't make that option available for NN4 > users...don't shut them out entirely though. > > Just my $0.02 > > Kevin Stone wrote: > > Well one option is obvious.. stop coding for legacy browsers. The company I > > work for recently decided to stop developing for anything older than NN6 and > > IE5. It is no longer cost effective for us to spend time developing for the > > other browsers. Okay so this may not be an option for you but it is > > something that I highly recommend you consider. > > > > Fortunately there is a fix to your problem and that is not to rely on > > Cookies. Many programmers have noted a number of incompatibilities and bugs > > with Cookies and legacy browsers which seem to change on a per-installation > > basis. You can instead use the $HTTP_USER_AGENT environment variable to > > cloak the style sheet. > > > > For example here's the $HTTP_USER_AGENT for Netscape 7.0 on Windows.. > > Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) > > Gecko/20020823 Netscape/7.0 > > > > And for Internet Explorer 6.0 on Windows... > > Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) > > > > You can preg_match() for the indicators and write a function that cloaks > > your CSS file. Something like this.. > > > > ----------------- > > <? > > function css_cloak ($useragent) > > { > > if (preg_match("/Netscape\/4/i", $useragent)) > > return "legacy.css"; > > else > > return "modern.css"; > > } > > > > echo "<link href=\"".css_cloak($HTTP_USER_AGENT)."\" rel=\"stylesheet\" > > type=\"text/css\">"; > > ?> > > ------------------ > > > > Note I really don't know exactly what indicators are in the $HTTP_USER_AGENT > > for Netscape 4.0 but this should do the trick. Good luck! > > > > -Kevin > > > > ----- Original Message ----- > > From: "Stephanie Sullivan" <designvioletsky.net> > > To: <php-generallists.php.net> > > Sent: Friday, October 18, 2002 1:49 PM > > Subject: [PHP] Newbie NN4 help... > > > > > > > >>Hi people... I've just used PHP for the first time... It's being used as a > >>CSS-style switcher (my client didn't want to use a javascript client-side > >>solution)... I have it all working well in most browsers I've tried it > > > > in... > > > >>EXCEPT the dreaded NN4* ... This script uses a cookie... And then switches > >>the styles... Is there something I don't know about that would cause NN4 > > > > to > > > >>be unable to use this? > >> > >>I'm rather at a loss and my site is two days over deadline... :( If anyone > >>could point me in the right direction I'd be VERY appreciative... > >> > >>The page I'm playing with is here: > >>http://www.kspope.com/phpswitch/test6.php > >> > >>The switcher is at the bottom of the page... And it reloads the NN page, > > > > but > > > >>doesn't change it. (Don't mind the NN "mess" I"m working on the styling > > > > for > > > >>that browser right now)... > >> > >>Thank in advance for any input... :) > >> > >>Stephanie Sullivan > >>VioletSky Design > >>http://www.violetsky.net > >> > >>³I am always doing that which I can not do, in order that I may learn how > > > > to > > > >>do it." -Picasso > >> > >> > >>-- > >>PHP General Mailing List (http://www.php.net/) > >>To unsubscribe, visit: http://www.php.net/unsub.php > >> > >> > > > > > > > > > >

    attached mail follows:


    No this method is automatic. It will not give the user a choice. It will simply display the page one way for Netscape and another way for other browsers. -Kevin

    > ----- Original Message ----- > From: "Stephanie Sullivan" <designvioletsky.net> > To: "Kevin Stone" <kevinhelpelf.com> > Sent: Friday, October 18, 2002 2:54 PM > Subject: Re: [PHP] Newbie NN4 help... > > > > on 10/18/02 4:22 PM, Kevin Stone at kevinhelpelf.com wrote: > > > > > Fortunately there is a fix to your problem and that is not to rely on > > > Cookies. Many programmers have noted a number of incompatibilities and > bugs > > > with Cookies and legacy browsers which seem to change on a > per-installation > > > basis. You can instead use the $HTTP_USER_AGENT environment variable to > > > cloak the style sheet. > > > > I wish that not counting NN4 into the mix was possible for this site... > But > > alas, this is the MOST backward-compatible-requirement client I've ever > > had... That said, one question about the "fix" you posted... > > > > Will it do the same thing as the cookie idea? In other words... When > someone > > chooses the way they want to view the site, will it keep the same look > > throughout the site? And when they come back, how does it know what to > > "show" them? > > > > Stephanie Sullivan > > VioletSky Design > > http://www.violetsky.net > > > > "If we knew what we were doing, it wouldn't be called research , would > > it?"-- Albert Einstein > > > > >

    attached mail follows:


    on 10/18/02 6:06 PM, Kevin Stone at kevinhelpelf.com wrote:

    > No this method is automatic. It will not give the user a choice. It will > simply display the page one way for Netscape and another way for other > browsers. > -Kevin

    Oh, ok... That won't work for me then... What I'm "fighting" with is a PHP style switcher... I have six different CSS sheets and NN4 doesn't want to play nice... I already know how to serve one stylesheet to NN and another to newer browsers...

    Thanks...

    Stephanie Sullivan VioletSky Design http://www.violetsky.net

    "When one door of happiness closes, another opens; but often we look so long at the closed door that we do not see the one which has been opened for us." -- Helen Keller

    attached mail follows:


    Why not simply specify them as alternate style sheets as per W3C recommendations? Check out http://www.alistapart.com/stories/alternate/ for some great help.

    Chase

    On Fri, 2002-10-18 at 18:14, Stephanie Sullivan wrote: > on 10/18/02 6:06 PM, Kevin Stone at kevinhelpelf.com wrote: > > > No this method is automatic. It will not give the user a choice. It will > > simply display the page one way for Netscape and another way for other > > browsers. > > -Kevin > > Oh, ok... That won't work for me then... What I'm "fighting" with is a PHP > style switcher... I have six different CSS sheets and NN4 doesn't want to > play nice... I already know how to serve one stylesheet to NN and another to > newer browsers... > > Thanks... > > Stephanie Sullivan > VioletSky Design > http://www.violetsky.net > > "When one door of happiness closes, another opens; but often we look so long > at the closed door that we do not see the one which has been opened for us." > -- Helen Keller > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    -- 
    Linux: Because rebooting is for adding hardware.
    Fingerprint = CE24 057D 1E88 A253 3196 89DB 9FF0 9EF0 2F70 8BE8 BE8
    

    -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org

    iD8DBQA9sLtFn/Ce8C9wi+gRAs3wAJ9JpG9Gk9eEis8iJAb/73d6fS20UACbBQY6 gZ7h1KVYhTZU7E84jyEZbkE= =iuGW -----END PGP SIGNATURE-----

    attached mail follows:


    Hello,

    I have a .DBF file (600,000 records and 346 columns).

    Using dbase_numfields function, I can retreive only 254 columns.

    Pls suggest a workaround ASAP.

    Thanks

    -Edmond Chiu, Broker we sell lovely houses http://www.house.ws

    attached mail follows:


    Message-ID: <007401c276e9$522af640$a629089bTBHHCCDR> Reply-To: "1LT John W. Holmes" <holmes072000charter.net> From: "1LT John W. Holmes" <holmes072000charter.net> To: "Edmond Chiu" <infohouse.ws>, <php-generallists.php.net> Date: Fri, 18 Oct 2002 16:59:51 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: [PHP] | | dbase_numfields issue ... | |

    You can probably only have 254 columns in the database. Divide it up!

    ---John Holmes...

    ----- Original Message ----- From: "Edmond Chiu" <infohouse.ws> To: <php-generallists.php.net> Sent: Friday, October 18, 2002 4:19 PM Subject: [PHP] | | dbase_numfields issue ... | |

    Hello,

    I have a .DBF file (600,000 records and 346 columns).

    Using dbase_numfields function, I can retreive only 254 columns.

    Pls suggest a workaround ASAP.

    Thanks

    -Edmond Chiu, Broker we sell lovely houses http://www.house.ws

    attached mail follows:


    Hi everyone,

    > And if you have the same application logic for both formats, a >nd you discover a bug in it (or decide to change the order of the records) >, what would you do? mirror the same implementation in n places.

    XML is not the only solution to this problem.

    > I was also a big anti XML fan

    I don't consider myself anti-xml... I see some very good uses for it. Some of the folks here have added to that list of uses (finally!) However, I don't know that it's a compelling solution for the problem you mention above. Yeah, if you already have a compelling reason to use XML, fine, but if separation of application logic and display is the ONLY reason, I'd say you don't have much of a reason at all.

    > So, whether if you need only one output format, you might consid >er the XML/XSL approach interesting, as it's much more maintanable and e >asy to understand.

    I have on doubt that THAT point is debatable, although I am not equipped to debate it. I'm willing to try Krysalis or something else sometime... maybe I'll be pleasantly surprised.

    -Josh

    attached mail follows:


    On Wed, 16 Oct 2002, Oscar F wrote: > I'm working on a file uploading script, but I need to know if there is a > way to know what's the progress of the file, so I can make la a progress > bar?.. Any ideas? Please?.

    An animated GIF.

    attached mail follows:


    Running PHP 4.2.3 with FTP compiled into the interpreter. I have some code that uses ftp_get that doesn't work correctly. The FTP daemon actually hands off the text file, but the PHP script doesn't write it to disk (/tmp/pmrc.$username) for some unknown reason. If I su to the user that runs httpd (apache), it is able to manually run FTP and download the file to that same path. So its probably not file privileges.

    I changed the code to use fopen() and ftp_fget() and now it mostly works. It gives the following message at the top of the page:

    Warning: ftp_fget(): in /usr/local/squirrelmail/plugins/procfilter/procfilter_options.php on line 178.

    Then it proceeds to do everything correctly. According to the syslog output, the FTP server received the connection, login, and get command and completed processing them in about 1 or 2 seconds, but it takes 1 to 3 minutes for the page to appear in my browser. I can deal with the delay, although I bet its a symptom of the problem and therefore a clue. The error message at the top of the screen is just silly, though. Why is it giving me an uninformative error message and then doing things correctly anyway?

    Any suggestions are appreciated.

    Thanks, Jaime

    --
    Network Administrator
    Cairo-Durham Central School District
    

    attached mail follows:


    I'm working on a project for someone where I'm processing a form to email. For that I'm using formmail.php. Now, she is going to want to import the data into Goldmine, the contact manager, so I'll need to reconfigure the outbound email, I suppose.

    Has anyone here done that? Formatted an email out for Goldmine? If someone is familiar with this process, I'm sure my customer would be happy to pay you for your time. I have a lot of stuff I already know how to do that I could stay busy with. ;-)

    -- 
    Chris Rehm
    chrisjavadisciple.com
    

    And he answering said, Thou shalt love the Lord thy God with all thy heart, and with all thy soul, and with all thy strength, and with all thy mind; and thy neighbour as thyself. Luke 10: 27