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: Sun Aug 11 2002 - 03:51:29 CDT

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

    php-general Digest 11 Aug 2002 08:51:29 -0000 Issue 1518

    Topics (messages 111971 through 112000):

    Re: Win PHP Editor...
            111971 by: Glenn Sieb
            111993 by: Liam MacKenzie

    Random mirrors and download quota
            111972 by: Andrew Conner

    PHPS on apache2
            111973 by: FileCop
            111974 by: FileCop
            111980 by: Analysis & Solutions
            112000 by: Alawi

    Cookie array
            111975 by: Jan - CWIZO
            111976 by: Lee Doolan
            111988 by: Bob Lockie

    Re: Save ability... Duplicate DB entries
            111977 by: Analysis & Solutions
            111986 by: JJ Harrison

    Re: PHP form port
            111978 by: Analysis & Solutions

    Re: Newbie question about UNIX command-line directives
            111979 by: Analysis & Solutions

    Re: records in db
            111981 by: Analysis & Solutions
            111983 by: DL Neil
            111995 by: Justin French

    Re: PHP Errors - someone please take a look
            111982 by: Joni Järvinen
            111998 by: Christopher J. Crane

    limit the number of users: query syntax?
            111984 by: Øystein Håland

    Re: show_source()
            111985 by: Øystein Håland

    Re: cgi error
            111987 by: Bob Lockie

    Converting datestamp to text?
            111989 by: Kristoffer Strom
            111990 by: David Freeman

    Tried that..
            111991 by: Kristoffer Strom
            111992 by: Rasmus Lerdorf
            111994 by: David Freeman

    Re: is this possible ...
            111996 by: Justin French

    Access Violations with PHP Please Help Please
            111997 by: Christopher J. Crane

    Re: Can't find my font file - Please help
            111999 by: Rasmus Lerdorf

    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:


    My favorite win-editor is UltraEdit (http://www.idmcomp.com)

    Also does nice color-tagging, and is very user-customizable that way!

    Glenn

    At 03:02 PM 8/10/2002 -0400, Randy Johnson posted the following...
    >I noticed they have not come out with a new version in quite a long time and
    >do not answer their emails? anybody else heard about any future releases
    >of editplus?

    ---
    The original portions of this message are the copyright of the author
    (c)1998-2002 Glenn E. Sieb.    ICQ UIN: 300395    IRC Nick: Rainbear
    "All acts of Love and Pleasure are Her rituals"-Charge of the Goddess
    

    attached mail follows:


    No, sorry. I will try to contact them soon about that. But there's no bugs that I've come across in Editplus. Full of features too, but there's always room for imporvement.

    Cheers, Liam

    -----Original Message----- From: Randy Johnson [mailto:icgphpicecoldgold.com] Sent: Sunday, 11 August 2002 5:03 AM To: Liam MacKenzie; Dave at Sinewaves.net; PHPlist Subject: Re: [PHP] Win PHP Editor...

    I noticed they have not come out with a new version in quite a long time and do not answer their emails? anybody else heard about any future releases of editplus?

    Randy ----- Original Message ----- From: "Liam MacKenzie" <phplistoperationenigma.com> To: "Dave at Sinewaves.net" <eightrackearthlink.net>; "PHPlist" <php-generallists.php.net> Sent: Friday, August 09, 2002 9:38 PM Subject: Re: [PHP] Win PHP Editor...

    > Well, I still believe the best editor for windows is Editplus > (www.editplus.com) > > Small, fast, stable, tonnes of features and it supports a lot of file type. > If it doesn't give you colour coding for a particular language, say > Cold Fusion, go to the homepage and download the plugin. > > It's only 800K to download, give it a shot. It's uninstall program actually > gets rid of it aswell, completely. so if you don't like it, no sweat

    > :-P > > Just my 2 cents... > > Liam > > > > ----- Original Message ----- > From: "Dave at Sinewaves.net" <eightrackearthlink.net> > To: "PHPlist" <php-generallists.php.net> > Sent: Saturday, August 10, 2002 3:42 AM > Subject: [PHP] Win PHP Editor... > > > > Just have to add one little fine piece of free software that > > nobody's mentioned yet, Crimson Editor (http://www.crimsoneditor.com

    > > ) > > > > No code completion, but it's got every other feature of the big commercial > > beasts... definitely check it out - I just switched over, and it's great. > > > > > > From the site: > > ---------- > > Edit multiple documents > > - switch between documents using file selection tab > > - pressing Ctrl+Tab brings the last accessed document to top > > > > Syntax highlighting > > - configurable via custom syntax files > > - preconfigured for more than 50 computer languages > > > > Multi-level undo / redo > > - all editing actions are recorded from the opening of a file > > - unlimited undo and redo buffers > > > > Find & Replace > > - replace specified text one by one, or as a whole > > - support regular expression > > > > Natural word wrapping > > - word wrapping does not affect syntax highlighting > > - configurable wrapping indentation (easer to understand the > > syntax) > > > > Spell checker > > - around 100000 words were added in the dictionary > > - users can register new words in their own dictionary > > (InstallDir/user.dic) > > > > User tools and macros > > - execute external programs with proper arguments > > - compile, execute and test your code > > - ease your fingers with key stroke recording (record & replay) > > > > Directory tree view window > > - click to open documents > > - filter to display only selected file class > > > > Edit remote files directly using built-in FTP client > > - open, edit, and save documents in remote FTP servers > > - save account information (encoded) for automatic logon > > > > Print & Print preview > > - configurable page header and footer > > - print with line numbers > > - print with syntax highlighting (used in color printer) > > - true type font selection for printer > > > > Other useful features > > single instance / multiple instances, ability to detect changed files, > > bookmark & go to, highlight active line, highlight matching pairs, > > multi-byte support with integrated IME (for eastern languages), > > auto indent, wheel mouse support, copy & paste, line numbers, > > configurable line spacing, option to save files in Unix format, > > option to set working directory > > > > > > > > > > Very nice little IDE, and the price is right! Nothing! > > > > Dave > > > > > > -- > > 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 > ----- Original Message ----- From: "Liam MacKenzie" <phplistoperationenigma.com> To: "Dave at Sinewaves.net" <eightrackearthlink.net>; "PHPlist" <php-generallists.php.net> Sent: Friday, August 09, 2002 9:38 PM Subject: Re: [PHP] Win PHP Editor...

    > Well, I still believe the best editor for windows is Editplus > (www.editplus.com) > > Small, fast, stable, tonnes of features and it supports a lot of file type. > If it doesn't give you colour coding for a particular language, say > Cold Fusion, go to the homepage and download the plugin. > > It's only 800K to download, give it a shot. It's uninstall program actually > gets rid of it aswell, completely. so if you don't like it, no sweat

    > :-P > > Just my 2 cents... > > Liam > > > > ----- Original Message ----- > From: "Dave at Sinewaves.net" <eightrackearthlink.net> > To: "PHPlist" <php-generallists.php.net> > Sent: Saturday, August 10, 2002 3:42 AM > Subject: [PHP] Win PHP Editor... > > > > Just have to add one little fine piece of free software that > > nobody's mentioned yet, Crimson Editor (http://www.crimsoneditor.com

    > > ) > > > > No code completion, but it's got every other feature of the big commercial > > beasts... definitely check it out - I just switched over, and it's great. > > > > > > From the site: > > ---------- > > Edit multiple documents > > - switch between documents using file selection tab > > - pressing Ctrl+Tab brings the last accessed document to top > > > > Syntax highlighting > > - configurable via custom syntax files > > - preconfigured for more than 50 computer languages > > > > Multi-level undo / redo > > - all editing actions are recorded from the opening of a file > > - unlimited undo and redo buffers > > > > Find & Replace > > - replace specified text one by one, or as a whole > > - support regular expression > > > > Natural word wrapping > > - word wrapping does not affect syntax highlighting > > - configurable wrapping indentation (easer to understand the > > syntax) > > > > Spell checker > > - around 100000 words were added in the dictionary > > - users can register new words in their own dictionary > > (InstallDir/user.dic) > > > > User tools and macros > > - execute external programs with proper arguments > > - compile, execute and test your code > > - ease your fingers with key stroke recording (record & replay) > > > > Directory tree view window > > - click to open documents > > - filter to display only selected file class > > > > Edit remote files directly using built-in FTP client > > - open, edit, and save documents in remote FTP servers > > - save account information (encoded) for automatic logon > > > > Print & Print preview > > - configurable page header and footer > > - print with line numbers > > - print with syntax highlighting (used in color printer) > > - true type font selection for printer > > > > Other useful features > > single instance / multiple instances, ability to detect changed files, > > bookmark & go to, highlight active line, highlight matching pairs, > > multi-byte support with integrated IME (for eastern languages), > > auto indent, wheel mouse support, copy & paste, line numbers, > > configurable line spacing, option to save files in Unix format, > > option to set working directory > > > > > > > > > > Very nice little IDE, and the price is right! Nothing! > > > > Dave > > > > > > -- > > 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:


    Hello, I have a script (at bottom) that, upon loading, will randomly select a mirror or primary server (on average, the primary servers will be selected twice as much). It all works good, but now, I have to add a "quota manager" that will, for both mirrors, limit the times the file can be downloaded to 1200 times (there is only one file being downloaded). I have thought about storing a text file for each of the two mirrors that shows the current count of downloads, and it will be checked if the mirror is randomly selected and if it is above 1200, will randomly select another server, and if it isn't, will just add one to it and update the file. How would I go about this, or is there a better way to do this? Thanks in advance. Andrew Conner

    The script (I know it doesn't use the best design, but it works, any better ways of doing this?): ---------------- <?

    // This array holds the servers, and has a double entry for the primary servers

    $adArr = array("http://www.someprimaryserver.com/file.exe",

    "http://www.someprimaryserver.com/file.exe",

    "http://www.someprimaryserver2.com/file.exe",

    "http://www.someprimaryserver2.com/file.exe",

    "http://www.someprimaryserver3.com/file.exe",

    "http://www.someprimaryserver3.com/file.exe",

    "http://www.someprimaryserver4.com/file.exe",

    "http://www.someprimaryserver4.com/file.exe",

    "http://www.somemirror.com/file.exe",

    "http://www.somemirror2.com/file.exe");

    // This randomly gets a server...

    srand((double)microtime()*1000000);

    $wOne = rand(0, 9);

    $choice = $adArr[$wOne];

    // This fwds the user to the server picked.

    // Somewhere in here needs to be the mirror stuff...

    header("Location: $choice");

    ?>

    attached mail follows:


    Hi!

    I have installed apache 2.0.39 and php 4.2.2 on a windows maschine (yes I know that sucks). I have added the "AddType application/x-httpd-php-source .phps" line to my httpd.conf file, but .phps does not work. I just attempts to download the file. phps was working when I used apache 1.3.24 and php 4.2.0/1, so I guess its a problem with apache2. Has anyone encountered the same problem or does anyone have a solution?

    Regards FileCop

    attached mail follows:


    Hi!

    I have installed apache 2.0.39 and php 4.2.2 on a windows maschine (yes I know that sucks). I have added the "AddType application/x-httpd-php-source .phps" line to my httpd.conf file, but .phps does not work. I just attempts to download the file. phps was working when I used apache 1.3.24 and php 4.2.0/1, so I guess its a problem with apache2. Has anyone encountered the same problem or does anyone have a solution?

    Regards FileCop

    attached mail follows:


    On Sat, Aug 10, 2002 at 07:38:05PM +0200, FileCop wrote: > > I have installed apache 2.0.39 and php 4.2.2 on a windows maschine (yes I > know that sucks). I have added the "AddType application/x-httpd-php-source > .phps" line to my httpd.conf file, but .phps does not work.

    Did you add the corresponding "Action" and "ScriptAlias" lines to the configuration file as well? If so, what do you have in there for them?

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


    on the way how can I make phps on IIS WHERE CAN I read ABOUT THIS ON MANUAL?

    ----- Original Message ----- From: "FileCop" <filecopfilecop.dk> To: <php-generallists.php.net> Sent: Friday, August 09, 2002 11:25 PM Subject: [PHP] PHPS on apache2

    > Hi! > > I have installed apache 2.0.39 and php 4.2.2 on a windows maschine (yes I > know that sucks). I have added the "AddType application/x-httpd-php-source > .phps" line to my httpd.conf file, but .phps does not work. I just attempts > to download the file. phps was working when I used apache 1.3.24 and php > 4.2.0/1, so I guess its a problem with apache2. Has anyone encountered the > same problem or does anyone have a solution? > > Regards FileCop > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    Hi !

    How can I stoor array in to a cookie ?

    Do I just define an array and stoore it in a cookie ? How do I access the data in the array then ?

    -- 
    LP
    CWIZO
    www.3delavnica.com
    www.ks-con.si
    www.WetSoftware.com
    

    attached mail follows:


    >>>>> "Jan" == Jan <cwizo3delavnica.com> writes:

    Jan> Hi ! How can I stoor array in to a cookie ?

    Jan> Do I just define an array and stoore it in a cookie ? How do Jan> I access the data in the array then ?

    you can use serialize() / unserialize() but be careful because the amount of storage allowed in a cookie is limited. what i do is to store thing like serialized arrays and serialized objects in a database table indexed by the session id.

    -- 
    Flowers of morning glory.      +-----------------------------------------+
    The sky above this street      |donate to causes I care about:           |
    Begins to overcast.            |  http://svcs.affero.net/rm.php?r=leed_25|
                       --Sugita    +-----------------------------------------+
    

    attached mail follows:


    >How can I stoor array in to a cookie ? > >Do I just define an array and stoore it in a cookie ?

    Yes.

    >How do I access the data in the array then ?

    $_COOKIE['array element'];

    attached mail follows:


    Hi JJ:

    On Sun, Aug 11, 2002 at 01:44:53AM +1000, JJ Harrison wrote: > > Which has a save or a publish option. I only want to keep one copy of each > article in the DB. This adds a new one each time. I know about updates in > SQL but the file may or may not already be in the db. Does anyone have a > good way to go about this?

    Here's a quick outline of what I do. I have a form for entering in articles. If the form is opened without an ArticleID, the ArticleID (a hidden form field) becomes 0. But, if the form is opened with an ArticleID, the given ArticleID is put in the hidden field.

    Now, when I make my changes and hit the Save (submit) button, the script checks the ArticleID. If it's 0, do an insert. If it's non-zero, do an update.

    --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'll do that. When I load an article I supply the article's id.

    --
    JJ Harrison
    webmastertececo.com
    www.tececo.com
    

    -- Please reply on the list/newsgroup unless the reply it OT.

    "Analysis & Solutions" <danielcanalysisandsolutions.com> wrote in message news:20020810203159.GA16811panix.com... > Hi JJ: > > On Sun, Aug 11, 2002 at 01:44:53AM +1000, JJ Harrison wrote: > > > > Which has a save or a publish option. I only want to keep one copy of each > > article in the DB. This adds a new one each time. I know about updates in > > SQL but the file may or may not already be in the db. Does anyone have a > > good way to go about this? > > Here's a quick outline of what I do. I have a form for entering in > articles. If the form is opened without an ArticleID, the ArticleID (a > hidden form field) becomes 0. But, if the form is opened with an > ArticleID, the given ArticleID is put in the hidden field. > > Now, when I make my changes and hit the Save (submit) button, the script > checks the ArticleID. If it's 0, do an insert. If it's non-zero, do an > update. > > --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:


    On Sat, Aug 10, 2002 at 09:14:03AM -0700, Daniel Guerrier wrote: > How do i execute a form post with php? > I want to validate CCard info etc.. then perform the > post with no furtheraction from the user. > > Basically If not valid stay here and show whats wrong > ELSE post form to process.php

    Don't. Put the whole procedure into one script. In the first step, do the validation, if it's bad, tell the people so and exit. If it's okay, continue the processing.

    This will make things easier to control and work reliably. Forwarding post information can lead to a variety of difficulties such as strange behavior when people hit the back button, odd timeouts, let alone, people could play games and go directly to process.php without doing the validation step... among other things.

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


    On Sat, Aug 10, 2002 at 01:12:38PM -0400, Al wrote: > I'm on a virtual host without a shell account and need execute a UNIX > command. > > ln -s ../afile.php index.php

    In a PHP script, you can do this -- if permissions are favorable:

    exec('ln -s ../afile.php index.php');

    > Is there some way to do this [e.g., with a htaccess file]?

    In an .htaccess file, you can put this

    DirectoryIndex afile.php

    > What happens when you execute UNIX commands like the one above? Does it > make a file, change the config?

    It makes a link in the file system. -s makes the link symbolic. http://www.tac.eu.org/cgi-bin/man-cgi?ln++NetBSD-current

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


    On Sat, Aug 10, 2002 at 05:52:42PM +0000, Tyler Durdin wrote:

    > If I have a field in my DB that can have 4 different answers, lets say > a,b,c and d. How can I count the number of each in that field. So if there > are 4 a's 1 b 0 c's and 12 d's how can I get php to count this?

    Us the database to do that:

    SELECT FieldName, count(*) FROM TableName GROUP BY FieldName

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


    Tyler,

    > If I have a field in my DB that can have 4 different answers, lets say a,b,c > and d. How can I count the number of each in that field. So if there are 4 > a's 1 b 0 c's and 12 d's how can I get php to count this?

    You must combine IF() with SUM().

    Break it down into smaller problems: 1 getting the data out of the tbl and grab all of the answer rows 2 'count' the number of "a"s 3 do the same for the number of "b"s

    The first is trivial, but let's limit our attention to question 1 until we figure out how to word the query:

    SELECT questionNr FROM tblNm WHERE questionNr = 1 AND answer = 'a'

    Obviously this won't satisfy you - you don't want line after line of data, and it only works if the chosen answer is "a" and you read off the number of rows affected. What happens if the answer is "b". We'd have to execute the query all over again, but substituting "b" for "a".

    Is there another way? Yes, there is an IF() in SQL (manual: 6.3 Functions for Use in SELECT and WHERE Clauses). Let's try listing the question number and noting if the answer is "a" or "b" or...:

    SELECT questionNr, IF( answer = 'a', TRUE, FALSE ) AS Answer-A, IF( answer = 'b', TRUE, FALSE ) AS Answer-B, ... FROM tblNm WHERE questionNr = 1

    Now we have a list of all of the answers to question 1, but instead of only "a" answers, we have a column of TRUEs and FALSEs for the "a" answers, and beside that a column of TRUEs and FALSEs for the "b"s, through "c" and "d". So beside the questionNr we have four columns telling us which data is relevant to count - if we simply count the TRUEs. So we've saved the repetitious executions, but the machine no longer does any useful counting for us.

    Substitute 1 for TRUE and 0 for FALSE, and we can have SQL do that last calc for us, ie SUM all of those "TRUE" values:

    SELECT questionNr, SUM( IF( answer = 'a', 1, 0 ) ) AS Answer-A, SUM( IF( answer = 'b', 1, 0 ) ) AS Answer-B, ... FROM tblNm WHERE questionNr = 1

    Finally, if you get rid of the WHERE clause, and replace it with GROUP BY questionNr, it should work for every question in the test/survey.

    Regards, =dn

    attached mail follows:


    on 11/08/02 3:52 AM, Tyler Durdin (linuxgeek23hotmail.com) wrote:

    > If I have a field in my DB that can have 4 different answers, lets say a,b,c > and d. How can I count the number of each in that field. So if there are 4 > a's 1 b 0 c's and 12 d's how can I get php to count this?

    I'm pretty certain there's a way to do this with just one MySQL query, but here's a PHP version that does 4 queries:

    <? // UNTESTED CODE $answers = array('a','b','c','d'); foreach($answers as $key => $answer) { $sql = "SELECT * FROM answers_table WHERE answer_col='{$answer}'"; $result = mysql_query($sql); if($result) { $count = mysql_num_rows($result); } else { $count = "0"; } echo "{$count} people selected answer {$answer}<br />"; } ?>

    Should print out something like:

    4 people selected answer a 1 people selected answer b 0 people selected answer c 12 people selected answer d

    hack it to suit your needs,

    Justin

    attached mail follows:


    Hi.

    This isn't the most helpful comment but it seems your working on a windows-platform. Have you tried to use your script in a *nix platform?

    -- Joni

    --
    // Joni Järvinen
    // joni.jarvinenkolumbus.fi
    // http://www.reactorbox.org/~wandu
    

    "Christopher J. Crane" <ccraneinxdesign.com> wrote in message news:20020810133924.55650.qmailpb1.pair.com... > I get the following errors when I run my script. It works fine with only 20 > records, but at 100 I get errors. > > "PHP has encountered an Access Violation at 00DA088E Warning: Unknown list > entry type in request shutdown (2) in > c:\www\htdocs\demos\ct.org\directory.php on line 0" > > or > > "PHP has encountered an Access Violation at 00DA088E " > > Basically, I have a CSV file with about 3500 records (lines). I have a while > statement that goes through the file line by line. I am using fgetcsv(). > While on a line I also open another file and search for a matching field > (CustomerID) and if it matches print the information on that line unless a > field in that file is set to "1". > > This was initially tried using a query since this data is in a database. > That did not work. I exported the data into csv files. It worked in testing > limiting the amount of records to be displayed to less than 30. I just tried > it with limit set to 100 and that's when I got the problem. > > Here is the code; > <?PHP > /* INFORMATION: > __ __ > __/_/________________________________________\_\__ > __|_ _|__ > (___O) (O___) > (_____O) Christopher J. Crane (O_____) > (_____O) Web Designer (O_____) > (__O) I N X D E S I G N (O__) > | http://inxdesign.com | > | ccraneinxdesign.com | > | | > |__________________________________________________| > This script was created to help prepare the directory information, for the > Connecticut Technical Council for the Year 2002. > > My Material - Please do not copy or modify it with checking with me first. > (ccraneinxdesign.com) > Please leave the INFORMATION banner in place. > */ > > > file://==Global Definitions > file://==================== > define('SCRIPT_NAME', 'Connecticut Technology Council Directory Maker'); > define('SCRIPT_VERSION', 'v1.0'); > define('SCRIPT_CREATOR', '<a href="mailto:ccraneinxdesign.com">Christopher > J. Crane</a>'); > define('CREATE_DATE', '08/06/02'); > define('REVISED_DATE', '08/06/02'); > > > $TestingMode = "On"; file://On or Off > $ShowCount = "10"; > > $row = 0; > print "<a name\"Top\"></a><b>Company Directory 2002</b><br>"; > print "T e s t i n g&nbsp;&nbsp;&nbsp;&nbsp;M o d e - "; > if($TestingMode == "On") { print "On<br>Only Showing The First $ShowCount > Records.\n"; } > else { print "Off\n"; } > print "<a href=\"#end\">End</a>"; > print "<hr align=\"left\" width=\"400\" hieght=1 noborder>\n"; > > > file://==C o m p a n y D a t a O u t p u t > file://======================================= > $Data1 = fopen("Final.csv","r"); > while ($Line1 = fgetcsv($Data1, 1000, ",")) { > $CompanyID = $Line1[0]; $CompanyName = $Line1[1]; $MemberTypeID = > $Line1[2]; > $RevenueID = $Line1[3]; $Ownership = $Line1[4]; $NoPubRevenue = > $Line1[5]; > $YearEstablished = $Line1[6]; $Exchange = $Line1[7]; $TotalEmployees = > $Line1[8]; > $ConnEmployees = $Line1[9]; $Ticker = $Line1[10]; $Email = $Line1[11]; > $Website = $Line1[12]; $IndustryID = $Line1[13]; $AddressTypeID = > $Line1[14]; > $AddressLine1 = $Line1[15]; $AddressLine2 = $Line1[16]; $City = > $Line1[17]; > $State = $Line1[18]; $Zip = $Line1[19]; $CountyName = $Line1[20]; > $Profile = $Line1[21]; > > if($row != 0) { > print " <font size=4><b>$CompanyName</b></font><br>\n"; > if($AddressLine1 != "") { print "$AddressLine1<br>\n"; } > if($AddressLine2 != "") { print "$AddressLine2<br>\n"; } > print "$City, $State $Zip<br>\n"; > > > file://==P h o n e D a t a O u t p u t > file://=================================== > $Data2 = fopen("PhoneTable.csv","r"); > while ($Line2 = fgetcsv ($Data2, 1000, ",")) { > $CompanyID2 = $Line2[0]; $PhoneType = $Line2[1]; $AreaCode = $Line2[2]; > $Prefix = $Line2[3]; $Suffix = $Line2[4]; > > if($CompanyID2 == $CompanyID) { > if($PhoneType == "Office") { > print "<b>Phone: > </b>($AreaCode)$Prefix-$Suffix&nbsp;&nbsp;&nbsp;&nbsp;"; } > } > } > fclose($Data2); > > > file://==F a x D a t a O u t p u t > file://=================================== > $Data3 = fopen("PhoneTable.csv","r"); > while ($Line3 = fgetcsv ($Data3, 1000, ",")) { > $CompanyID3 = $Line3[0]; $PhoneType = $Line3[1]; $AreaCode = $Line3[2]; > $Prefix = $Line3[3]; $Suffix = $Line3[4]; > > if($CompanyID3 == $CompanyID) { > if($PhoneType == "FAX") { > print "<b>Fax: > </b>($AreaCode)$Prefix-$Suffix&nbsp;&nbsp;&nbsp;&nbsp;"; } > } > } > fclose($Data3); > print "<br>"; > > > file://==W e b s i t e / E m a i l D a t a O u t p u t > file://================================================== > if(($Website != "") || ($Email != "nonenone.com")) { > if($Website != "") { print "<b>Website: </b>$Website<br>\n"; } > if($Email != "nonenone.com") { print "<b>E-Mail: </b>$Email<br>\n"; } > } > > > file://==O w n e r s h i p D a t a O u t p u t > file://=========================================== > print "<b>Ownership: </b>"; > if($Ownership == "1") { print "Private&nbsp;&nbsp;"; } > if($Ownership == "2") { > print "Public&nbsp;&nbsp;"; > if(!($Exchange == "OTHER" or $Exchange == "")) { print "($Exchange: > $Ticker)&nbsp;&nbsp;"; } > } > if($YearEstablished != "0") { print "<b>Est. </b>$YearEstablished"; } > print "<br>"; > > > file://==E m p l o y e e D a t a O u t p u t > file://========================================= > print "<b>CT Emp: </b>"; > if(($ConnEmployees >= 1) && ($ConnEmployees <= 9)) { print > "1-9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } > elseif(($ConnEmployees >= 10) && ($ConnEmployees <= 50)) { print > "10-50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } > elseif(($ConnEmployees >= 51) && ($ConnEmployees <= 100)) { print > "51-100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } > elseif(($ConnEmployees >= 101) && ($ConnEmployees <= 250)) { print > "101-250&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } > elseif(($ConnEmployees >= 251) && ($ConnEmployees <= 500)) { print > "251-500&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } > elseif($ConnEmployees >= 501) { print > "500+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } > > if(($TotalEmployees >= 1) && ($TotalEmployees <= 50)) { print "<b>Tot Emp: > </b>1-50"; } > elseif(($TotalEmployees >= 51) && ($TotalEmployees <= 100)) { print "<b>Tot > Emp: </b>51-100"; } > elseif(($TotalEmployees >= 101) && ($TotalEmployees <= 500)) { print > "<b>Tot Emp: </b>101-500"; } > elseif($TotalEmployees >= 501) { print > "500+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } > print "<br>"; > > > file://==R e v e n u e D a t a O u t p u t > file://======================================= > if($NoPubRevenue == 0) { > print "<b>Annual Revenue: </b>"; > if($RevenueID == 1) { print "under 1 Million"; } > elseif($RevenueID == 2) { print "under 1 Million"; } > elseif($RevenueID == 3) { print "1-10 Million"; } > elseif($RevenueID == 4) { print "10-50 Million"; } > elseif($RevenueID == 5) { print "50-100 Million"; } > elseif($RevenueID == 6) { print "100-500 Million"; } > elseif($RevenueID == 7) { print "500 Million - 1 Billion"; } > elseif($RevenueID == 8) { print "1+ Billion"; } > else { print "NotAvailable"; } > print "<br>\n"; > } > > > file://==I n d u s t r y D a t a O u t p u t > file://======================================= > print "<b>Industry: </b>"; > if($IndustryID == 1) { print "Aircraft and Parts"; } > elseif($IndustryID == 1) { print "Aircraft and Parts"; } > elseif($IndustryID == 3) { print "Electronics and Components"; } > elseif($IndustryID == 4) { print "Electrical Equipment"; } > elseif($IndustryID == 5) { print "Other"; } > elseif($IndustryID == 6) { print "Measuring & Control Devices"; } > elseif($IndustryID == 7) { print "Medical Instruments"; } > elseif($IndustryID == 11) { print "Photonics/Optics/Imaging"; } > elseif($IndustryID == 12) { print "Advanced Materials and Chemicals"; } > elseif($IndustryID == 13) { print "Industrial Machinery and Appliances"; } > elseif($IndustryID == 14) { print "Application Integration & Middleware"; } > elseif($IndustryID == 15) { print "Application Software Development"; } > elseif($IndustryID == 16) { print "Application Service Provider"; } > elseif($IndustryID == 17) { print "Collaborative Commerce/Market Places"; } > elseif($IndustryID == 18) { print "IT Hosting/Infrastructure Mgmt"; } > elseif($IndustryID == 19) { print "Computer Office & Equipment"; } > elseif($IndustryID == 20) { print "Programming, Custom Dev., Professional > Services"; } > elseif($IndustryID == 22) { print "Multi-media, Online Marketing"; } > elseif($IndustryID == 23) { print "Customer Relationship Management"; } > elseif($IndustryID == 25) { print "Hardware and Devices"; } > elseif($IndustryID == 26) { print "Information Storage, Retrieval, > Security"; } > elseif($IndustryID == 28) { print "Prepackaged Software"; } > elseif($IndustryID == 29) { print "Retail and Information Services"; } > elseif($IndustryID == 30) { print "IT Consulting and Systems Design"; } > elseif($IndustryID == 31) { print "Safety Products"; } > elseif($IndustryID == 32) { print "Web Site Design"; } > elseif($IndustryID == 33) { print "Biotechnology"; } > elseif($IndustryID == 34) { print "Drugs/Pharmaceutical"; } > elseif($IndustryID == 35) { print "Research and Testing"; } > elseif($IndustryID == 36) { print "Cable, Communications Equip, Phone > Systems"; } > elseif($IndustryID == 37) { print "HR, Search, Training"; } > elseif($IndustryID == 38) { print "Internet Service Provider"; } > elseif($IndustryID == 39) { print "Wireless and Mobile"; } > elseif($IndustryID == 40) { print "Communications Services"; } > elseif($IndustryID == 41) { print "Business/Strategy Consulting"; } > elseif($IndustryID == 42) { print "Legal"; } > elseif($IndustryID == 43) { print "PR/Marketing"; } > elseif($IndustryID == 44) { print "Finance and Accounting"; } > elseif($IndustryID == 45) { print "Financial Services"; } > elseif($IndustryID == 46) { print "NFP, Association, State Agency"; } > elseif($IndustryID == 47) { print "Engineering Services"; } > elseif($IndustryID == 48) { print "Academic"; } > elseif($IndustryID == 49) { print "Energy"; } > print "<br>\n"; > > > file://==C o n t a c t D a t a O u t p u t > file://======================================= > print "<b>Management:</b><br>\n"; > $Data4 = fopen("CompleteContact.csv","r"); > while ($Line4 = fgetcsv ($Data4, 1000, ",")) { > $CompanyID4 = $Line4[0]; $FirstName = $Line4[1]; $LastName = $Line4[2]; > $DisplayTitle = $Line4[3]; $NoPubcontact = $Line4[4]; > > if($CompanyID4 == $CompanyID) { > if($NoPubcontact == "0") { print "$FirstName $LastName, > <i>$DisplayTitle</i><br>\n"; } > } > } > fclose($Data4); > > > file://==P r o f i l e D a t a O u t p u t > file://======================================= > if($row != 0) { > if($Profile != "") { print "<b>Profile:</b><br>$Profile<br>\n"; } > } > > > file://==End of Loop! > file://======================================= > } > > > $row++; > print "<br>\n"; > if($TestingMode == "On") { if($row == $ShowCount) { break; } } > > } > fclose($Data1); > > print "<pre> > =============== > ---- Done! ---- > =============== > </pre> > <b>Script Name:</b> " . SCRIPT_NAME . "&nbsp;" . SCRIPT_VERSION . "<br>\n > <b>Script Created By:</b> " . SCRIPT_CREATOR . "<br>\n > <b>Created On:</b> " . CREATE_DATE . "<br>\n > <b>Revised On:</b> " . REVISED_DATE . "\n"; > > print "<pre> > __ __ > __/_/________________________________________\_\__ > __|_ _|__ > (___O) (O___) > (_____O) Christopher J. Crane (O_____) > (_____O) Web Designer (O_____) > (__O) I N X D E S I G N (O__) > | http://inxdesign.com | > | ccraneinxdesign.com | > | | > |__________________________________________________| > </pre><a name=\"End\"></a><a href=\"#Top\">Top</a>\n\n"; > > > > > > > > > > > > > >

    attached mail follows:


    I did and got the same error.

    "Joni JäRvinen" <joni.jarvinenkolumbus.fi> wrote in message news:20020810213339.71176.qmailpb1.pair.com... > Hi. > > This isn't the most helpful comment but it seems your working on a > windows-platform. > Have you tried to use your script in a *nix platform? > > -- Joni > -- > // Joni Järvinen > // joni.jarvinenkolumbus.fi > // http://www.reactorbox.org/~wandu > > "Christopher J. Crane" <ccraneinxdesign.com> wrote in message > news:20020810133924.55650.qmailpb1.pair.com... > > I get the following errors when I run my script. It works fine with only > 20 > > records, but at 100 I get errors. > > > > "PHP has encountered an Access Violation at 00DA088E Warning: Unknown list > > entry type in request shutdown (2) in > > c:\www\htdocs\demos\ct.org\directory.php on line 0" > > > > or > > > > "PHP has encountered an Access Violation at 00DA088E " > > > > Basically, I have a CSV file with about 3500 records (lines). I have a > while > > statement that goes through the file line by line. I am using fgetcsv(). > > While on a line I also open another file and search for a matching field > > (CustomerID) and if it matches print the information on that line unless a > > field in that file is set to "1". > > > > This was initially tried using a query since this data is in a database. > > That did not work. I exported the data into csv files. It worked in > testing > > limiting the amount of records to be displayed to less than 30. I just > tried > > it with limit set to 100 and that's when I got the problem. > > > > Here is the code; > > <?PHP > > /* INFORMATION: > > __ __ > > __/_/________________________________________\_\__ > > __|_ _|__ > > (___O) (O___) > > (_____O) Christopher J. Crane (O_____) > > (_____O) Web Designer (O_____) > > (__O) I N X D E S I G N (O__) > > | http://inxdesign.com | > > | ccraneinxdesign.com | > > | | > > |__________________________________________________| > > This script was created to help prepare the directory information, for the > > Connecticut Technical Council for the Year 2002. > > > > My Material - Please do not copy or modify it with checking with me first. > > (ccraneinxdesign.com) > > Please leave the INFORMATION banner in place. > > */ > > > > > > file://==Global Definitions > > file://==================== > > define('SCRIPT_NAME', 'Connecticut Technology Council Directory Maker'); > > define('SCRIPT_VERSION', 'v1.0'); > > define('SCRIPT_CREATOR', '<a > href="mailto:ccraneinxdesign.com">Christopher > > J. Crane</a>'); > > define('CREATE_DATE', '08/06/02'); > > define('REVISED_DATE', '08/06/02'); > > > > > > $TestingMode = "On"; file://On or Off > > $ShowCount = "10"; > > > > $row = 0; > > print "<a name\"Top\"></a><b>Company Directory 2002</b><br>"; > > print "T e s t i n g&nbsp;&nbsp;&nbsp;&nbsp;M o d e - "; > > if($TestingMode == "On") { print "On<br>Only Showing The First $ShowCount > > Records.\n"; } > > else { print "Off\n"; } > > print "<a href=\"#end\">End</a>"; > > print "<hr align=\"left\" width=\"400\" hieght=1 noborder>\n"; > > > > > > file://==C o m p a n y D a t a O u t p u t > > file://======================================= > > $Data1 = fopen("Final.csv","r"); > > while ($Line1 = fgetcsv($Data1, 1000, ",")) { > > $CompanyID = $Line1[0]; $CompanyName = $Line1[1]; $MemberTypeID = > > $Line1[2]; > > $RevenueID = $Line1[3]; $Ownership = $Line1[4]; $NoPubRevenue = > > $Line1[5]; > > $YearEstablished = $Line1[6]; $Exchange = $Line1[7]; $TotalEmployees = > > $Line1[8]; > > $ConnEmployees = $Line1[9]; $Ticker = $Line1[10]; $Email = $Line1[11]; > > $Website = $Line1[12]; $IndustryID = $Line1[13]; $AddressTypeID = > > $Line1[14]; > > $AddressLine1 = $Line1[15]; $AddressLine2 = $Line1[16]; $City = > > $Line1[17]; > > $State = $Line1[18]; $Zip = $Line1[19]; $CountyName = $Line1[20]; > > $Profile = $Line1[21]; > > > > if($row != 0) { > > print " <font size=4><b>$CompanyName</b></font><br>\n"; > > if($AddressLine1 != "") { print "$AddressLine1<br>\n"; } > > if($AddressLine2 != "") { print "$AddressLine2<br>\n"; } > > print "$City, $State $Zip<br>\n"; > > > > > > file://==P h o n e D a t a O u t p u t > > file://=================================== > > $Data2 = fopen("PhoneTable.csv","r"); > > while ($Line2 = fgetcsv ($Data2, 1000, ",")) { > > $CompanyID2 = $Line2[0]; $PhoneType = $Line2[1]; $AreaCode = $Line2[2]; > > $Prefix = $Line2[3]; $Suffix = $Line2[4]; > > > > if($CompanyID2 == $CompanyID) { > > if($PhoneType == "Office") { > > print "<b>Phone: > > </b>($AreaCode)$Prefix-$Suffix&nbsp;&nbsp;&nbsp;&nbsp;"; } > > } > > } > > fclose($Data2); > > > > > > file://==F a x D a t a O u t p u t > > file://=================================== > > $Data3 = fopen("PhoneTable.csv","r"); > > while ($Line3 = fgetcsv ($Data3, 1000, ",")) { > > $CompanyID3 = $Line3[0]; $PhoneType = $Line3[1]; $AreaCode = $Line3[2]; > > $Prefix = $Line3[3]; $Suffix = $Line3[4]; > > > > if($CompanyID3 == $CompanyID) { > > if($PhoneType == "FAX") { > > print "<b>Fax: > > </b>($AreaCode)$Prefix-$Suffix&nbsp;&nbsp;&nbsp;&nbsp;"; } > > } > > } > > fclose($Data3); > > print "<br>"; > > > > > > file://==W e b s i t e / E m a i l D a t a O u t p u t > > file://================================================== > > if(($Website != "") || ($Email != "nonenone.com")) { > > if($Website != "") { print "<b>Website: </b>$Website<br>\n"; } > > if($Email != "nonenone.com") { print "<b>E-Mail: </b>$Email<br>\n"; } > > } > > > > > > file://==O w n e r s h i p D a t a O u t p u t > > file://=========================================== > > print "<b>Ownership: </b>"; > > if($Ownership == "1") { print "Private&nbsp;&nbsp;"; } > > if($Ownership == "2") { > > print "Public&nbsp;&nbsp;"; > > if(!($Exchange == "OTHER" or $Exchange == "")) { print "($Exchange: > > $Ticker)&nbsp;&nbsp;"; } > > } > > if($YearEstablished != "0") { print "<b>Est. </b>$YearEstablished"; } > > print "<br>"; > > > > > > file://==E m p l o y e e D a t a O u t p u t > > file://========================================= > > print "<b>CT Emp: </b>"; > > if(($ConnEmployees >= 1) && ($ConnEmployees <= 9)) { print > > "1-9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } > > elseif(($ConnEmployees >= 10) && ($ConnEmployees <= 50)) { print > > "10-50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } > > elseif(($ConnEmployees >= 51) && ($ConnEmployees <= 100)) { print > > "51-100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } > > elseif(($ConnEmployees >= 101) && ($ConnEmployees <= 250)) { print > > "101-250&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } > > elseif(($ConnEmployees >= 251) && ($ConnEmployees <= 500)) { print > > "251-500&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } > > elseif($ConnEmployees >= 501) { print > > "500+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } > > > > if(($TotalEmployees >= 1) && ($TotalEmployees <= 50)) { print "<b>Tot > Emp: > > </b>1-50"; } > > elseif(($TotalEmployees >= 51) && ($TotalEmployees <= 100)) { print > "<b>Tot > > Emp: </b>51-100"; } > > elseif(($TotalEmployees >= 101) && ($TotalEmployees <= 500)) { print > > "<b>Tot Emp: </b>101-500"; } > > elseif($TotalEmployees >= 501) { print > > "500+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } > > print "<br>"; > > > > > > file://==R e v e n u e D a t a O u t p u t > > file://======================================= > > if($NoPubRevenue == 0) { > > print "<b>Annual Revenue: </b>"; > > if($RevenueID == 1) { print "under 1 Million"; } > > elseif($RevenueID == 2) { print "under 1 Million"; } > > elseif($RevenueID == 3) { print "1-10 Million"; } > > elseif($RevenueID == 4) { print "10-50 Million"; } > > elseif($RevenueID == 5) { print "50-100 Million"; } > > elseif($RevenueID == 6) { print "100-500 Million"; } > > elseif($RevenueID == 7) { print "500 Million - 1 Billion"; } > > elseif($RevenueID == 8) { print "1+ Billion"; } > > else { print "NotAvailable"; } > > print "<br>\n"; > > } > > > > > > file://==I n d u s t r y D a t a O u t p u t > > file://======================================= > > print "<b>Industry: </b>"; > > if($IndustryID == 1) { print "Aircraft and Parts"; } > > elseif($IndustryID == 1) { print "Aircraft and Parts"; } > > elseif($IndustryID == 3) { print "Electronics and Components"; } > > elseif($IndustryID == 4) { print "Electrical Equipment"; } > > elseif($IndustryID == 5) { print "Other"; } > > elseif($IndustryID == 6) { print "Measuring & Control Devices"; } > > elseif($IndustryID == 7) { print "Medical Instruments"; } > > elseif($IndustryID == 11) { print "Photonics/Optics/Imaging"; } > > elseif($IndustryID == 12) { print "Advanced Materials and Chemicals"; } > > elseif($IndustryID == 13) { print "Industrial Machinery and > Appliances"; } > > elseif($IndustryID == 14) { print "Application Integration & > Middleware"; } > > elseif($IndustryID == 15) { print "Application Software Development"; } > > elseif($IndustryID == 16) { print "Application Service Provider"; } > > elseif($IndustryID == 17) { print "Collaborative Commerce/Market > Places"; } > > elseif($IndustryID == 18) { print "IT Hosting/Infrastructure Mgmt"; } > > elseif($IndustryID == 19) { print "Computer Office & Equipment"; } > > elseif($IndustryID == 20) { print "Programming, Custom Dev., Professional > > Services"; } > > elseif($IndustryID == 22) { print "Multi-media, Online Marketing"; } > > elseif($IndustryID == 23) { print "Customer Relationship Management"; } > > elseif($IndustryID == 25) { print "Hardware and Devices"; } > > elseif($IndustryID == 26) { print "Information Storage, Retrieval, > > Security"; } > > elseif($IndustryID == 28) { print "Prepackaged Software"; } > > elseif($IndustryID == 29) { print "Retail and Information Services"; } > > elseif($IndustryID == 30) { print "IT Consulting and Systems Design"; } > > elseif($IndustryID == 31) { print "Safety Products"; } > > elseif($IndustryID == 32) { print "Web Site Design"; } > > elseif($IndustryID == 33) { print "Biotechnology"; } > > elseif($IndustryID == 34) { print "Drugs/Pharmaceutical"; } > > elseif($IndustryID == 35) { print "Research and Testing"; } > > elseif($IndustryID == 36) { print "Cable, Communications Equip, Phone > > Systems"; } > > elseif($IndustryID == 37) { print "HR, Search, Training"; } > > elseif($IndustryID == 38) { print "Internet Service Provider"; } > > elseif($IndustryID == 39) { print "Wireless and Mobile"; } > > elseif($IndustryID == 40) { print "Communications Services"; } > > elseif($IndustryID == 41) { print "Business/Strategy Consulting"; } > > elseif($IndustryID == 42) { print "Legal"; } > > elseif($IndustryID == 43) { print "PR/Marketing"; } > > elseif($IndustryID == 44) { print "Finance and Accounting"; } > > elseif($IndustryID == 45) { print "Financial Services"; } > > elseif($IndustryID == 46) { print "NFP, Association, State Agency"; } > > elseif($IndustryID == 47) { print "Engineering Services"; } > > elseif($IndustryID == 48) { print "Academic"; } > > elseif($IndustryID == 49) { print "Energy"; } > > print "<br>\n"; > > > > > > file://==C o n t a c t D a t a O u t p u t > > file://======================================= > > print "<b>Management:</b><br>\n"; > > $Data4 = fopen("CompleteContact.csv","r"); > > while ($Line4 = fgetcsv ($Data4, 1000, ",")) { > > $CompanyID4 = $Line4[0]; $FirstName = $Line4[1]; $LastName = $Line4[2]; > > $DisplayTitle = $Line4[3]; $NoPubcontact = $Line4[4]; > > > > if($CompanyID4 == $CompanyID) { > > if($NoPubcontact == "0") { print "$FirstName $LastName, > > <i>$DisplayTitle</i><br>\n"; } > > } > > } > > fclose($Data4); > > > > > > file://==P r o f i l e D a t a O u t p u t > > file://======================================= > > if($row != 0) { > > if($Profile != "") { print "<b>Profile:</b><br>$Profile<br>\n"; } > > } > > > > > > file://==End of Loop! > > file://======================================= > > } > > > > > > $row++; > > print "<br>\n"; > > if($TestingMode == "On") { if($row == $ShowCount) { break; } } > > > > } > > fclose($Data1); > > > > print "<pre> > > =============== > > ---- Done! ---- > > =============== > > </pre> > > <b>Script Name:</b> " . SCRIPT_NAME . "&nbsp;" . SCRIPT_VERSION . "<br>\n > > <b>Script Created By:</b> " . SCRIPT_CREATOR . "<br>\n > > <b>Created On:</b> " . CREATE_DATE . "<br>\n > > <b>Revised On:</b> " . REVISED_DATE . "\n"; > > > > print "<pre> > > __ __ > > __/_/________________________________________\_\__ > > __|_ _|__ > > (___O) (O___) > > (_____O) Christopher J. Crane (O_____) > > (_____O) Web Designer (O_____) > > (__O) I N X D E S I G N (O__) > > | http://inxdesign.com | > > | ccraneinxdesign.com | > > | | > > |__________________________________________________| > > </pre><a name=\"End\"></a><a href=\"#Top\">Top</a>\n\n"; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >

    attached mail follows:


    I want to limit the number of users from different groups allowed to create a user account on a website. I belive that can be done using two tables in a DB, one for the user accounts and one for the group information (with one field 'maxusers'). I even want to limit the time for the account to be valid. This can't be too hard to accomplish, but I'm new to mysql, so help would be appreciated. (Yes, I have tried to read the mysql-manual, but when you don't know what to look for that can be really hard)

    attached mail follows:


    This helped on my laptop (win2000, Apache 1.3.26, php 4.2.1, but when I uploaded to my webserver (SunOS (sparc), Apache 1.3.xx, php 4.0.6) only the first row was numbered (yes, I even tried \n instead). Is there another solution that could work?

    "Rasmus Lerdorf" <rasmusphp.net> skrev i meddelandet news:Pine.LNX.4.44.0208081204560.11226-100000www.lerdorf.com... > So just replace \r then. And use str_replace() instead of ereg_replace(). > > -Rasmus > > On Thu, 8 Aug 2002, Øystein Håland wrote: > > > I use the following script found at php.net: > > <html><body><ol><li> > > > > <? > > ob_start(); > > show_source( "THE_FILE!" ); > > $t = ob_get_contents(); > > ob_end_clean(); > > echo ereg_replace( "<br />" , "</li><li>" , $t ); > > ?> > > </li></ol></body></html> > > > > Since the ereg_replace don't work with my php-code i just do > > echo $t; > > instead. > > What I want is to do something like this: > > echo ereg_replace( "\r\n" , "</li><li>" , $t ); > > (my files are created in a win2000-environment), but this gives the > > linenumber only for the first line. Anyone see a solution to this?

    attached mail follows:


    >I receive this when I try to send an e-mail. >All works fine until yesterday and my script is the same. >Could u tell what is the problem? >CGI Error >The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

    What does your httpd log say?

    attached mail follows:


    In my MySQL db I have a date-field on every entry looking like this : 2002-08-10 When presented on a PHP page, I want it converted to "Saturday, Augusth 10th, 2002".

    How do I achieve that? I've been playing around with the date-command and strtotime-command but haven't achieved it.

    Help please.

    /Kris

    attached mail follows:


    > In my MySQL db I have a date-field on every entry looking like this : > 2002-08-10 > When presented on a PHP page, I want it converted to > "Saturday, Augusth > 10th, 2002". > > How do I achieve that? I've been playing around with the > date-command and > strtotime-command but haven't achieved it.

    Do it in your mysql query instead. Have a look at DATE_FORMAT() in your friendly local neighbourhood mysql manual. Chapter 6.3.4 or thereabouts.

    CYA, Dave

    attached mail follows:


    I've tried that, but as usual rtfm doesn't help me. I need concise examples :(

    How would I write this basic select query to get the date in my format (Saturday, August 10th, 2002)? SELECT datum FROM news_items (where "datum" is the date-stamp in "YYYY-MM-DD" format)

    I've tried the combo's I can think of and still get nothing on the other side...

    /Kris

    attached mail follows:


    This isn't really a PHP question, is it? This is a function of your database, and since you don't mention which database you are using it is a bit hard to answer. Assuming MySQL, there is an entire chapter in the MySQL docs on exactly how to do this:

    http://www.mysql.com/doc/en/Date_and_time_functions.html

    If it is another database, go read the appropriate docs, or ask on a mailing list related to that database.

    -Rasmus

    On Sun, 11 Aug 2002, Kristoffer Strom wrote:

    > I've tried that, but as usual rtfm doesn't help me. I need concise examples > :( > > How would I write this basic select query to get the date in my format > (Saturday, August 10th, 2002)? > SELECT datum FROM news_items > (where "datum" is the date-stamp in "YYYY-MM-DD" format) > > I've tried the combo's I can think of and still get nothing on the other > side... > > /Kris > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    > I've tried that, but as usual rtfm doesn't help me. I need > concise examples > :( > > How would I write this basic select query to get the date in > my format > (Saturday, August 10th, 2002)? > SELECT datum FROM news_items > (where "datum" is the date-stamp in "YYYY-MM-DD" format)

    Rasmus is right, this is a database question...

    Anyway... Something like this should get you close...

    SELECT DATE_FORMAT(datum, '%e %b %y') AS my_formatted_date FROM news_items WHERE whatever = something_else

    The key here is DATE_FORMAT(column, 'format') AS whatever

    You'll need to insert your own column name and get the format stuff from the mysql manual (as previously noted, chapter 6.4.something will do that).

    CYA, Dave

    attached mail follows:


    Yes attaching files to email is possible. There's such a class available at phpclasses.org by Manuel

    Justin French

    on 11/08/02 3:53 AM, M.E. Suliman (essanetactive.co.za) wrote:

    > Hi > > I need the contents of a form to be emailed as an attached Excel file or > html file. Is this possible using PHP. I think comma delimited files open > in Excel. Can anyone advise. > > Thanks in advance > > Mohamed >

    attached mail follows:


    I get the following errors when I run my script. It works fine with only 20 records, but at 100 I get errors.

    "PHP has encountered an Access Violation at 00DA088E Warning: Unknown list entry type in request shutdown (2) in c:\www\htdocs\demos\ct.org\directory.php on line 0"

    or

    "PHP has encountered an Access Violation at 00DA088E "

    Basically, I have a CSV file with about 3500 records (lines). I have a while statement that goes through the file line by line. I am using fgetcsv(). While on a line I also open another file and search for a matching field (CustomerID) and if it matches print the information on that line unless a field in that file is set to "1".

    This was initially tried using a query since this data is in a database. That did not work. I exported the data into csv files. It worked in testing limiting the amount of records to be displayed to less than 30. I just tried it with limit set to 100 and that's when I got the problem.

    Here is the code; <?PHP /* INFORMATION: __ __ __/_/________________________________________\_\__ __|_ _|__ (___O) (O___) (_____O) Christopher J. Crane (O_____) (_____O) Web Designer (O_____) (__O) I N X D E S I G N (O__) | http://inxdesign.com | | ccraneinxdesign.com | | | |__________________________________________________| This script was created to help prepare the directory information, for the Connecticut Technical Council for the Year 2002.

    My Material - Please do not copy or modify it with checking with me first. (ccraneinxdesign.com) Please leave the INFORMATION banner in place. */

    file://==Global Definitions file://==================== define('SCRIPT_NAME', 'Connecticut Technology Council Directory Maker'); define('SCRIPT_VERSION', 'v1.0'); define('SCRIPT_CREATOR', '<a href="mailto:ccraneinxdesign.com">Christopher J. Crane</a>'); define('CREATE_DATE', '08/06/02'); define('REVISED_DATE', '08/06/02');

    $TestingMode = "On"; file://On or Off $ShowCount = "10";

    $row = 0; print "<a name\"Top\"></a><b>Company Directory 2002</b><br>"; print "T e s t i n g&nbsp;&nbsp;&nbsp;&nbsp;M o d e - "; if($TestingMode == "On") { print "On<br>Only Showing The First $ShowCount Records.\n"; } else { print "Off\n"; } print "<a href=\"#end\">End</a>"; print "<hr align=\"left\" width=\"400\" hieght=1 noborder>\n";

    file://==C o m p a n y D a t a O u t p u t file://======================================= $Data1 = fopen("Final.csv","r"); while ($Line1 = fgetcsv($Data1, 1000, ",")) { $CompanyID = $Line1[0]; $CompanyName = $Line1[1]; $MemberTypeID = $Line1[2]; $RevenueID = $Line1[3]; $Ownership = $Line1[4]; $NoPubRevenue = $Line1[5]; $YearEstablished = $Line1[6]; $Exchange = $Line1[7]; $TotalEmployees = $Line1[8]; $ConnEmployees = $Line1[9]; $Ticker = $Line1[10]; $Email = $Line1[11]; $Website = $Line1[12]; $IndustryID = $Line1[13]; $AddressTypeID = $Line1[14]; $AddressLine1 = $Line1[15]; $AddressLine2 = $Line1[16]; $City = $Line1[17]; $State = $Line1[18]; $Zip = $Line1[19]; $CountyName = $Line1[20]; $Profile = $Line1[21];

    if($row != 0) { print " <font size=4><b>$CompanyName</b></font><br>\n"; if($AddressLine1 != "") { print "$AddressLine1<br>\n"; } if($AddressLine2 != "") { print "$AddressLine2<br>\n"; } print "$City, $State $Zip<br>\n";

    file://==P h o n e D a t a O u t p u t file://=================================== $Data2 = fopen("PhoneTable.csv","r"); while ($Line2 = fgetcsv ($Data2, 1000, ",")) { $CompanyID2 = $Line2[0]; $PhoneType = $Line2[1]; $AreaCode = $Line2[2]; $Prefix = $Line2[3]; $Suffix = $Line2[4];

    if($CompanyID2 == $CompanyID) { if($PhoneType == "Office") { print "<b>Phone: </b>($AreaCode)$Prefix-$Suffix&nbsp;&nbsp;&nbsp;&nbsp;"; } } } fclose($Data2);

    file://==F a x D a t a O u t p u t file://=================================== $Data3 = fopen("PhoneTable.csv","r"); while ($Line3 = fgetcsv ($Data3, 1000, ",")) { $CompanyID3 = $Line3[0]; $PhoneType = $Line3[1]; $AreaCode = $Line3[2]; $Prefix = $Line3[3]; $Suffix = $Line3[4];

    if($CompanyID3 == $CompanyID) { if($PhoneType == "FAX") { print "<b>Fax: </b>($AreaCode)$Prefix-$Suffix&nbsp;&nbsp;&nbsp;&nbsp;"; } } } fclose($Data3); print "<br>";

    file://==W e b s i t e / E m a i l D a t a O u t p u t file://================================================== if(($Website != "") || ($Email != "nonenone.com")) { if($Website != "") { print "<b>Website: </b>$Website<br>\n"; } if($Email != "nonenone.com") { print "<b>E-Mail: </b>$Email<br>\n"; } }

    file://==O w n e r s h i p D a t a O u t p u t file://=========================================== print "<b>Ownership: </b>"; if($Ownership == "1") { print "Private&nbsp;&nbsp;"; } if($Ownership == "2") { print "Public&nbsp;&nbsp;"; if(!($Exchange == "OTHER" or $Exchange == "")) { print "($Exchange: $Ticker)&nbsp;&nbsp;"; } } if($YearEstablished != "0") { print "<b>Est. </b>$YearEstablished"; } print "<br>";

    file://==E m p l o y e e D a t a O u t p u t file://========================================= print "<b>CT Emp: </b>"; if(($ConnEmployees >= 1) && ($ConnEmployees <= 9)) { print "1-9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } elseif(($ConnEmployees >= 10) && ($ConnEmployees <= 50)) { print "10-50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } elseif(($ConnEmployees >= 51) && ($ConnEmployees <= 100)) { print "51-100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } elseif(($ConnEmployees >= 101) && ($ConnEmployees <= 250)) { print "101-250&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } elseif(($ConnEmployees >= 251) && ($ConnEmployees <= 500)) { print "251-500&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } elseif($ConnEmployees >= 501) { print "500+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; }

    if(($TotalEmployees >= 1) && ($TotalEmployees <= 50)) { print "<b>Tot Emp: </b>1-50"; } elseif(($TotalEmployees >= 51) && ($TotalEmployees <= 100)) { print "<b>Tot Emp: </b>51-100"; } elseif(($TotalEmployees >= 101) && ($TotalEmployees <= 500)) { print "<b>Tot Emp: </b>101-500"; } elseif($TotalEmployees >= 501) { print "500+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; } print "<br>";

    file://==R e v e n u e D a t a O u t p u t file://======================================= if($NoPubRevenue == 0) { print "<b>Annual Revenue: </b>"; if($RevenueID == 1) { print "under 1 Million"; } elseif($RevenueID == 2) { print "under 1 Million"; } elseif($RevenueID == 3) { print "1-10 Million"; } elseif($RevenueID == 4) { print "10-50 Million"; } elseif($RevenueID == 5) { print "50-100 Million"; } elseif($RevenueID == 6) { print "100-500 Million"; } elseif($RevenueID == 7) { print "500 Million - 1 Billion"; } elseif($RevenueID == 8) { print "1+ Billion"; } else { print "NotAvailable"; } print "<br>\n"; }

    file://==I n d u s t r y D a t a O u t p u t file://======================================= print "<b>Industry: </b>"; if($IndustryID == 1) { print "Aircraft and Parts"; } elseif($IndustryID == 1) { print "Aircraft and Parts"; } elseif($IndustryID == 3) { print "Electronics and Components"; } elseif($IndustryID == 4) { print "Electrical Equipment"; } elseif($IndustryID == 5) { print "Other"; } elseif($IndustryID == 6) { print "Measuring & Control Devices"; } elseif($IndustryID == 7) { print "Medical Instruments"; } elseif($IndustryID == 11) { print "Photonics/Optics/Imaging"; } elseif($IndustryID == 12) { print "Advanced Materials and Chemicals"; } elseif($IndustryID == 13) { print "Industrial Machinery and Appliances"; } elseif($IndustryID == 14) { print "Application Integration & Middleware"; } elseif($IndustryID == 15) { print "Application Software Development"; } elseif($IndustryID == 16) { print "Application Service Provider"; } elseif($IndustryID == 17) { print "Collaborative Commerce/Market Places"; } elseif($IndustryID == 18) { print "IT Hosting/Infrastructure Mgmt"; } elseif($IndustryID == 19) { print "Computer Office & Equipment"; } elseif($IndustryID == 20) { print "Programming, Custom Dev., Professional Services"; } elseif($IndustryID == 22) { print "Multi-media, Online Marketing"; } elseif($IndustryID == 23) { print "Customer Relationship Management"; } elseif($IndustryID == 25) { print "Hardware and Devices"; } elseif($IndustryID == 26) { print "Information Storage, Retrieval, Security"; } elseif($IndustryID == 28) { print "Prepackaged Software"; } elseif($IndustryID == 29) { print "Retail and Information Services"; } elseif($IndustryID == 30) { print "IT Consulting and Systems Design"; } elseif($IndustryID == 31) { print "Safety Products"; } elseif($IndustryID == 32) { print "Web Site Design"; } elseif($IndustryID == 33) { print "Biotechnology"; } elseif($IndustryID == 34) { print "Drugs/Pharmaceutical"; } elseif($IndustryID == 35) { print "Research and Testing"; } elseif($IndustryID == 36) { print "Cable, Communications Equip, Phone Systems"; } elseif($IndustryID == 37) { print "HR, Search, Training"; } elseif($IndustryID == 38) { print "Internet Service Provider"; } elseif($IndustryID == 39) { print "Wireless and Mobile"; } elseif($IndustryID == 40) { print "Communications Services"; } elseif($IndustryID == 41) { print "Business/Strategy Consulting"; } elseif($IndustryID == 42) { print "Legal"; } elseif($IndustryID == 43) { print "PR/Marketing"; } elseif($IndustryID == 44) { print "Finance and Accounting"; } elseif($IndustryID == 45) { print "Financial Services"; } elseif($IndustryID == 46) { print "NFP, Association, State Agency"; } elseif($IndustryID == 47) { print "Engineering Services"; } elseif($IndustryID == 48) { print "Academic"; } elseif($IndustryID == 49) { print "Energy"; } print "<br>\n";

    file://==C o n t a c t D a t a O u t p u t file://======================================= print "<b>Management:</b><br>\n"; $Data4 = fopen("CompleteContact.csv","r"); while ($Line4 = fgetcsv ($Data4, 1000, ",")) { $CompanyID4 = $Line4[0]; $FirstName = $Line4[1]; $LastName = $Line4[2]; $DisplayTitle = $Line4[3]; $NoPubcontact = $Line4[4];

    if($CompanyID4 == $CompanyID) { if($NoPubcontact == "0") { print "$FirstName $LastName, <i>$DisplayTitle</i><br>\n"; } } } fclose($Data4);

    file://==P r o f i l e D a t a O u t p u t file://======================================= if($row != 0) { if($Profile != "") { print "<b>Profile:</b><br>$Profile<br>\n"; } }

    file://==End of Loop! file://======================================= }

    $row++; print "<br>\n"; if($TestingMode == "On") { if($row == $ShowCount) { break; } }

    } fclose($Data1);

    print "<pre> =============== ---- Done! ---- =============== </pre> <b>Script Name:</b> " . SCRIPT_NAME . "&nbsp;" . SCRIPT_VERSION . "<br>\n <b>Script Created By:</b> " . SCRIPT_CREATOR . "<br>\n <b>Created On:</b> " . CREATE_DATE . "<br>\n <b>Revised On:</b> " . REVISED_DATE . "\n";

    print "<pre> __ __ __/_/________________________________________\_\__ __|_ _|__ (___O) (O___) (_____O) Christopher J. Crane (O_____) (_____O) Web Designer (O_____) (__O) I N X D E S I G N (O__) | http://inxdesign.com | | ccraneinxdesign.com | | | |__________________________________________________| </pre><a name=\"End\"></a><a href=\"#Top\">Top</a>\n\n";

    attached mail follows:


    Try leaving off the .ttf

    On Fri, 9 Aug 2002, JR wrote:

    > I am trying to use the "imagettfbbox" function. Am testing the script on my > local network > running W2K. Have defined : > $fontfile = "arial.tff"; // this file is in the same directory > with my script > The instruction that fails: > $thetextbox = ImageTTFBBox ($fontsize, 0, $fontfile, "My Button"); > The error message is: > Warning: Could not find/open font in > c:\phpdev\www\public\kazaam\rendertext.php on line 9 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >