[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
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
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
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
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
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]
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
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
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,
>
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
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
$_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.
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
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
> $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
($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
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
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
; ", "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
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
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
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 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 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
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
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
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
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
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'
[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
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
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
[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
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
&
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
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 -
dom number generator' identical for all PHP random functions? So I'm *not*
required to seed any of them?
Thanks,
--
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
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
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
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
41 matches
Mail list logo