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 no

[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

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

2004-01-16 Thread Matt Grimm
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 TV Channel, Inc. > (a non

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

2004-01-15 Thread Matt Grimm
the resulting page, they are echoed, 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

[PHP] Re: credit card acceptance recommendations?

2004-01-14 Thread Matt Grimm
int: http://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]

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

2004-01-09 Thread Matt Grimm
being 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 don

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

2004-01-09 Thread Matt Grimm
was ever posted? 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 H

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

[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

[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

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

[PHP] Re: Sorting data into columns vertically

2004-01-07 Thread Matt Grimm
th: '.count($l_aTest); } // Do high 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 'Result:'; prin

[PHP] Re: Sorting data into columns vertically

2004-01-07 Thread Matt Grimm
s 3, 2, 2, which 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 o

[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 Anchora

[PHP] Re: Sorting data into columns vertically

2004-01-07 Thread Matt Grimm
($l_iMod < 2 ? $l_iHigh - $l_iMod : $l_iHigh); $l_iThird = $l_iLow; echo "Your columns are: $l_iFirst, $l_iSecond, $l_iThird"; -- 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

[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 "", then your actual start position (minus the start comment) is the strpos plus strlen($pattern), or 14 in this case. $startPos = strpos($file, '') + 14; -- Matt Grimm Web Develo

[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

[PHP] Re: Question about an array

2004-01-03 Thread Matt Grimm
; ", "your long 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" <[EMA

Re: [PHP] No cookie is being set?

2004-01-02 Thread Matt Grimm
ll return TRUE. This does 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

[PHP] Re: PHP and SSL Path Reference

2003-12-29 Thread Matt Grimm
uot; http://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.&quo

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

2003-12-24 Thread Matt Grimm
res.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 "Bruce" <[EMAIL PROTECTED]> wr

[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: array data to XML

2003-12-24 Thread Matt Grimm
> PHP 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 Cha

[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

[PHP] Refreshing in forms using post

2003-12-01 Thread Matt Grimm
ll re-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 PROT

[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&quo

[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] Value1Value2 [/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 I'

[PHP] Using DOMXML with homogenous elements

2003-07-10 Thread Matt Grimm
[VALUE] => 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 995

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

2003-07-10 Thread Matt Grimm
names 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 We

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 Grim

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

2003-07-10 Thread Matt Grimm
[VALUE] => Value 2 ) ) ) ) ) And my 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

Re: [PHP] Object assignment

2003-07-09 Thread Matt Grimm
ple I used below is outputting this: Value 1Value 2 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: www.healthtvchannel.org &

[PHP] Object assignment

2003-07-08 Thread Matt Grimm
x27;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 The Health

[PHP] DOMXML usage

2003-07-03 Thread Matt Grimm
nd_child($thisChild); The error is: "...Call 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 -

[PHP] Does array_rand need to be seeded?

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

Re: [PHP] Appending to the REQUEST_URI

2003-05-29 Thread Matt Grimm
7;PHP_SELF'] . '?' . @$_SERVER['QUERY_STRING'] . '&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. Hol

[PHP] Appending to the REQUEST_URI

2003-05-29 Thread Matt Grimm
o the REQUEST_URI -- I need to detect whether a QUERY_STRING has already been passed, so I won't use "?" when I need "&" in the URI. Here's my clunky attempt: ">link description text Please tell me there is some way to just append to the query string wi

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 Anchora

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