Re: [PHP] Read Last Lines of a Text File

2004-06-16 Thread Matt Grimm
[EMAIL PROTECTED] (Scott Miller) wrote in news:[EMAIL PROTECTED]: I have a text file (log file) that I want to be able to read the last 30 or 40 lines of. I've created the code below, but since this file is so large (currently 8 MB) it won't work. The code works on smaller files, but not

[PHP] Resequencing logic

2004-05-07 Thread Matt Grimm
I apologize if this message is a repeat; I've had trouble posting with Thunderbird. I'm interested in how you folks would approach the following issue: You have a list of data, in a user-defined sequence. For instance, a list of song titles that can be rearranged on a web page in any order. I

Re: [PHP] Trying again: Random(?) blank pages when using sessions

2004-01-19 Thread Matt Grimm
No, it's running on a FreeBSD server. I don't suppose it could have to do with the firewall or browser security settings on my machine, though ... could it? I can verify that the session file is being written to the server's tmp directory... I'm stumped. -- Matt Grimm Web Developer The Health

[PHP] Trying again: Random(?) blank pages when using sessions

2004-01-16 Thread Matt Grimm
refresh the page, it loads correctly. What is going on? Thank you, -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web

[PHP] Random(?) blank pages when using sessions

2004-01-15 Thread Matt Grimm
, but that's it -- it's a blank white page otherwise. The apache error log is silent, and the access log is normal. No php errors are displayed or written to the log. Here's the real kicker -- if I refresh the page, it loads correctly. What is going on? Thank you, -- Matt Grimm Web Developer The Health

[PHP] Re: credit card acceptance recommendations?

2004-01-14 Thread Matt Grimm
://www.sitepoint.com/article/728 -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Matt Hedges [EMAIL PROTECTED] wrote in message news

[PHP] Form validation: client- or server-side?

2004-01-09 Thread Matt Grimm
? I'm just talking about the basics, like empty required fields, illegal characters, string lengths, etc. What are your preferred methods? I do an awful lot of content management with HTML forms, so it's not an entirely spurious question. -- Matt Grimm Web Developer The Health TV Channel, Inc

[PHP] Re: Form validation: client- or server-side?

2004-01-09 Thread Matt Grimm
relied upon for more serious validation. -- Matt Grimm Matt Grimm [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is there a distinct advantage to doing form validation / error checking on the server side using PHP? That's how I've always done it because I know PHP better than

[PHP] Re: getenv of document_name in php

2004-01-08 Thread Matt Grimm
$_SERVER['SCRIPT_NAME'] or $_SERVER['PHP_SELF'] -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Louie Miranda [EMAIL

[PHP] Re: Not working?

2004-01-08 Thread Matt Grimm
You can't use variables inside single quotes, either. This: '/path/to/old.$today' ought to be: /path/to/old.$today -- Matt Grimm Jas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I think I must be missing something but this command isn't renaming the file specified... Pointers

[PHP] open_basedir clarification

2004-01-08 Thread Matt Grimm
If my server has an open_basedir restriction in place for my home directory, I understand that to mean I can only open files in the same directory as whatever script is currently running. Is that correct? -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820

Re: [PHP] open_basedir clarification

2004-01-08 Thread Matt Grimm
Can anyone clarify this for me? Is open_basedir recursive or restricted to the exact paths specified? -- Matt Grimm Matt Grimm [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If my server has an open_basedir restriction in place for my home directory, I understand that to mean I

[PHP] Re: Sorting data into columns vertically

2004-01-07 Thread Matt Grimm
- $l_iMod : $l_iHigh); $l_iThird = $l_iLow; echo pstrongYour columns are: $l_iFirst, $l_iSecond, $l_iThird/strong/p; -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail

[PHP] Re: Sorting data into columns vertically

2004-01-07 Thread Matt Grimm
$l_iSecond = ($l_iMod 2 ? $l_iHigh - $l_iMod : $l_iHigh); This should actually be: $l_iSecond = ($l_iMod == 1 ? $l_iHigh - $l_iMod : $l_iHigh); but it works both ways. -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK

[PHP] Re: Sorting data into columns vertically

2004-01-07 Thread Matt Grimm
the code will give you. If you want, echo the other variables and it will make more sense. -- Matt Grimm Dareal Hamsta [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I get: Your columns are: 102, 101, 101 ??? The other problem with this solution is that it's for a static number

[PHP] Re: Sorting data into columns vertically

2004-01-07 Thread Matt Grimm
columns first for ($i = 0; $i $l_iMod; $i++) { $l_aTable[column$i] = $l_iHigh; } // Do the rest for ($i = count($l_aTable); $i $l_iColumnWidth; $i++) { $l_aTable[column$i] = $l_iLow; } echo 'preResult:br /'; print_r($l_aTable); -- Matt Grimm Dareal Hamsta [EMAIL PROTECTED] wrote

[PHP] Re: Remove quotes from form field

2004-01-05 Thread Matt Grimm
In the very simplest way? Just use a str_replace on the quotes: $words=explode( , str_replace('', '', strtolower($keywords))); -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax

[PHP] Re: readfile from startpos to endpos

2004-01-05 Thread Matt Grimm
Close. You need to adjust for the length of your pattern. So if you're matching against !- start -, then your actual start position (minus the start comment) is the strpos plus strlen($pattern), or 14 in this case. $startPos = strpos($file, '!- start -') + 14; -- Matt Grimm Web Developer

[PHP] Re: Question about an array

2004-01-03 Thread Matt Grimm
string); -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Vernon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I

Re: [PHP] No cookie is being set?

2004-01-02 Thread Matt Grimm
not indicate whether the user accepted the cookie. http://us2.php.net/manual/en/function.setcookie.php -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED

[PHP] Re: PHP and SSL Path Reference

2003-12-29 Thread Matt Grimm
://us3.php.net/manual/en/features.remote-files.php -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org D.H. [EMAIL PROTECTED

[PHP] Re: array data to XML

2003-12-24 Thread Matt Grimm
script that you can find here, although it may be more than you are looking for: http://www.devdump.com/phpxml.php I've written a DOMXML-based PHP - XML function that takes Kris' structure as input, if you're interested. -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit

[PHP] Re: Removing/unsetting session variables.

2003-12-24 Thread Matt Grimm
PHP manual recommends this, which works for me: // Unset all of the session variables $_SESSION = array(); // Destroy the session session_destroy(); -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext

[PHP] Re: apache/web site question...

2003-12-24 Thread Matt Grimm
-files.php -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Bruce [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED

[PHP] Re: Assist with session persistance

2003-12-23 Thread Matt Grimm
The directive session.cookie_lifetime in your php.ini is what a session cookie timeout defaults to. You can manually set the lifetime when you create it using session_set_cookie_params(). http://us3.php.net/manual/en/function.session-set-cookie-params.php -- Matt Grimm Web Developer The Health

[PHP] Re: sorting a mulit-dimensional array

2003-12-22 Thread Matt Grimm
Your subject line raises a completely different question than your message. Are you looking to sort a multi-dimensional array or select distinct values from one? -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508

[PHP] Refreshing in forms using post

2003-12-01 Thread Matt Grimm
-parse that post data and create a duplicate record. How can I prevent this? Cache control? Thanks, -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED

[PHP] Re: Using DOMXML with homogenous elements

2003-07-11 Thread Matt Grimm
And nevermind, problem solved in another thread. -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Matt Grimm [EMAIL

Re: Re[2]: [PHP] Object assignment

2003-07-10 Thread Matt Grimm
source is here: http://www.healthtvchannel.org/test/php2xml.phps -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Tom Rogers

Re: Re[2]: [PHP] Object assignment

2003-07-10 Thread Matt Grimm
Interesting -- the clone_node() function does make certain that each element gets its own representation in the output, for any XML I tested. I guess then my problem lies with how I'm looping through the aforementioned array structure to get the values themselves. Thanks, -- Matt Grimm Web

Re: Re[2]: [PHP] Object assignment

2003-07-10 Thread Matt Grimm
and distinguishing them with attributes. I'd still like the code to work with XML that did have similarly named elements in the same node level.. can you see anything in my DOMXML calls that might indicate the problem? Source: http://www.healthtvchannel.org/test/php2xml.phps -- Matt Grimm Web Developer

[PHP] Using DOMXML with homogenous elements

2003-07-10 Thread Matt Grimm
] = Value 2 ) ) ) ) ) [/array] Source: http://www.healthtvchannel.org/test/php2xml.phps Thanks, -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK

[PHP] Re: Using DOMXML with homogenous elements

2003-07-10 Thread Matt Grimm
I failed to show the output XML in my last message. It's outputting like so: [xml] rootElement record id=2Value1Value2/record /rootElement [/xml] -- Matt Grimm Matt Grimm [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a final kink to work out of an array to XML parser

Re: [PHP] Object assignment

2003-07-09 Thread Matt Grimm
is outputting this: rootElement record id=2Value 1Value 2/record /rootElement Any ideas? -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web

[PHP] Object assignment

2003-07-08 Thread Matt Grimm
level, I'm overwriting the $thisChild object that I just created. How can I dynamically name these objects so that I can have an indeterminate number of elements by the same name, in the same level? Source: http://www.healthtvchannel.org/test/php2xml.phps Thanks, -- Matt Grimm Web Developer

[PHP] DOMXML usage

2003-07-03 Thread Matt Grimm
to a member function on a non-object How can I reference that ancestor object when I come back into the function? (PHP version is 4.3.2, Apache 2.0.44 on Win2k) Thanks, -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508

Re: [PHP] CleanUp!!

2003-05-29 Thread Matt Grimm
First, make sure to use str_replace whenever possible instead of ereg_replace. It's faster: $out_file = str_replace(http://;, , $in_file); etc... -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext

[PHP] Appending to the REQUEST_URI

2003-05-29 Thread Matt Grimm
']) { echo ?newVar=1; } ? link description text/a Please tell me there is some way to just append to the query string without checking it first... -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686

Re: [PHP] Appending to the REQUEST_URI

2003-05-29 Thread Matt Grimm
'] . '?' . @$_SERVER['QUERY_STRING'] . 'amp;newVar=1'; Now I can just throw in a conditional like below to make sure I'm not duplicating the newVar in my query string. Thanks! -- Matt Grimm - Original Message - From: CPT John W. Holmes [EMAIL PROTECTED] To: Matt Grimm [EMAIL PROTECTED]; [EMAIL

[PHP] Does array_rand need to be seeded?

2003-05-29 Thread Matt Grimm
PHP random functions? So I'm *not* required to seed any of them? Thanks, -- Matt Grimm

Fw: [PHP] greater than question

2003-05-27 Thread Matt Grimm
You could put the vars into an array, and use the max fcn: $limit = max($varArray); foreach($varArray as $value) { if ($value == $limit) { // run something } } -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage