s,
you could load the files into arrays with the file() function, then use
the array_diff() function to spit out a list of lines in one file but
not the other.
Or, you could tell us more about what you're actually trying to do. :)
p
--
Paul Chvostek
ool is based on standards rather than a
browser's idea of what carbon-based lifeforms think is pretty.
If your goal is to take browser snapshots, then look at one of first two
tools mentioned. If your goal is simply to convert HTML to ps/pdf, then
html2ps i
On Thu, May 06, 2004 at 07:11:55PM +, Curt Zirzow wrote:
> >
> > $text="one ", "",$text);
>
> Because your missing a -
> $text="one two\n";
/me applies mallet to head
% php -r '$text="one two\n"; print
ereg_replace(&
On Thu, May 06, 2004 at 11:26:34AM -0400, Rob Ellis wrote:
> >
> > $text = ereg_replace("","",$text);
>
> you can make the .* less greedy...
>
> $text = preg_replace('//', '', $text);
Interesting to know. My preg-foo is limited; I came at PHP from a
background of awk and sed, so when I
icky
though. The only thing you can really *negate* in an ereg is a range,
not an atom. And the close of the comment can't be prepresented as a
range, since it's multiple characters.
Not to say it can't be done. I just can't think of how at
don't need to store the
result of a COUNT() in a session variable, so the "count" remains
valid even if the number of records changes while someone's browsing.
Note that this is not safe code as is. :) At the very least, you
should format-check $_GET[
but, in addition, this matches if
> the string end is ",}". Any ideas?
Why not just strip out the braces and explode on commas? That'll be
lighter than regexps any day. If the input is guaranteed to be
formatted the way you describe, you could do something like:
p.net/session_write_close for some discussion on this.
> I don't understand what's happening here. Any thoughts?
If none of the above suggestions help, then I have no clue. :-)
p
--
Paul Chvostek <[EMAIL PROTECTED]>
it.canada
;t change page content, it'll only
rewrite the *requests* that come in.
Of course, if you know all this already, and really are trying to point
requests for /articles.php?id=123 to a file named "123" in the directory
"articles", then you&
***
> The contents of this e-mail and any files transmitted with it are
> confidential and intended solely for the use of the individual or
> entity to whom it is addressed. The views stated herein do not
> necessarily represent the view of the company. If you
*
> The contents of this e-mail and any files transmitted with it are
> confidential and intended solely for the use of the individual or
> entity to whom it is addressed. The views stated herein do not
> necessarily represent the view of the company. If you
es or access files
outside the DocumentRoot for your site, you can create an unbrowsable
storage directory protected with a .htaccess file. If the filesystem
permissions are correct, your PHP script will be able to read content
from that directory, because PHP code isn't
a.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"">http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"</a>;
type="application/x-shockwave-flash"></embed>\n');
document.write('</object>\n
e difficult?
Unix timestamps have been around since unix began, and strtotime
supports arbitrary human-readable formats. PHP supports both of these.
How does PHP make dates more difficult?
--
Paul Chvostek <[EMAIL PR
ion appears to support negative timestamps ... which means you
can't skimp on your testing if you decide to go this route. ;-)
--
Paul Chvostek <[EMAIL PROTECTED]>
it.canadahttp://www.it.ca/
st the "get" part to suit...
--
Paul Chvostek <[EMAIL PROTECTED]>
it.canadahttp://www.it.ca/
Free PHP web hosting!http://www.it.ca/web/
--
PHP General M
erent
results depending on how it's called:
> curl -D- http://hostname/test.jpg | grep Content-
Content-Type: text/html
> curl -I http://hostname/test.jpg | grep Content-
Content-Type: image/jpeg
What's going on here?
--
Paul Chvostek
x27;func'], like this:
$typelist=array(
'thisone' => "This is one",
'thatone' => "That is one too",
'another' => "Another one here",
);
$type=$typelist[$_POST['func']];
Is that long the lin
ime will give NEGATIVE TIMESTAMPS for dates earlier than
Jan 1st 1970 at midnight GMT, so this still works for folks over 33. ;)
--
Paul Chvostek <[EMAIL PROTECTED]>
it.canadahttp://www.it.ca/
Free P
club66.ro ).
> What do u think?
I think this doesn't sound like a problem with "Hi", as your subject
line indicated.
--
Paul Chvostek <[EMAIL PROTECTED]>
it.canadahttp://www.it.c
27;re basing your include on something that you're already
managing, perhaps as a form or session variable. YMMV. Don't forget to
do your sanity checking. This method may be prone to security problems.
--
Paul Chvostek <[EMAIL PROTEC
extensive format checks on them. Usernames should
always match ^[a-z0-9]+$ . Nothing being used in the ssh command should
be allowed to have [;&|] in it. Be so anal and paranoid that you risk
compromising functionality, and you're less likely to screw yourself.
--
Paul Chvostek
rocesse launched would have the username in the envelope-from.
You also might get a performance gain by doing things through FastCGI,
though you'd lose some of the module-specific features like persistent
database connections.
Worth testing, anyway. Let us know how it goes. :)
--
Paul
quot;
> > allowed the user to turn off safe_mode and open_basedir. I don't
> > have a
> > non-production machine to test it on at the moment.
> >
> > Any idea how I give the user local register_globals control without
> > also
> > letting them alter the other php.ini options?
--
Paul Chvostek <[EMAIL PROTECTED]>
Operations / Abuse / Whatever
it.canada, hosting and development http://www.it.ca/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ser to turn off safe_mode and open_basedir. I don't have a
non-production machine to test it on at the moment.
Any idea how I give the user local register_globals control without also
letting them alter the other php.ini options?
--
Paul Chvostek
that function ... but is it possible to have fine-grained enough an
AllowOverride statement that only register_globals can be changed?
I wouldn't want a user to use his .htaccess file to turn off safe_mode
or open_basedir.
--
Paul Chvostek
ikely is php-nuke to get fixed?)
Thoughts?
--
Paul Chvostek <[EMAIL PROTECTED]>
Operations / Abuse / Whatever
it.canada, hosting and development http://www.it.ca/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ip = array(
'the' => 1,
'and' => 1,
'a' => 1,
);
foreach (explode(' ', $string) as $val) {
if (!$skip[$val]) {
$sql .= $logic . " name like '%$val%'";
}
}
$sql .= ' ORD
the envelope sender) to be the
authoritative address of the sender, superceding the From and Reply-To
headers. The only way around it is to "spoof" the envelope sender,
thereby falsifying your headers. Gahgh.
Now ... if you were to write a class to manage Mailman configs ... that
wo
each ($booleanVarsas $key => $value) ${$key} = $value;
foreach ($profileVarArrayas $key => $value) ${$key} = $value;
etc.
Alternately, if $booleanNonFormVars are things for which you're just
trying to test existence, you could:
foreach ($booleanNonFormVars as $
e brackets. In fact, the regexp you've
built will also match an $address of "p\o box".
--
Paul Chvostek <[EMAIL PROTECTED]>
it.canadahttp://www.it.ca/
Free PHP web hosting!
x27;last_login DATETIME NULL)';
$result = mysql_query($q) or die("Create table Error: ".mysql_error());
It's a heck of alot easier to see errors when you space things out a
bit. The investment of the extra CPU time for PHP to glue the pieces
together probably makes sense in th
> "Paul Chvostek" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> > On Mon, Jul 07, 2003 at 03:28:27PM -0600, Micah Montoy wrote:
> > >
> > > if ($_POST["imgList"] = ""){
> >
> > You're *assigning* a var
On Mon, Jul 07, 2003 at 03:28:27PM -0600, Micah Montoy wrote:
>
> if ($_POST["imgList"] = ""){
You're *assigning* a variable in this condition.
--
Paul Chvostek <[EMAIL PROTECTED]>
it.canada
Can anyone think of any security caveats with regard to turning
output_buffering on?
I can't, but it's too hot to think straight these days
Tnx.
--
Paul Chvostek <[EMAIL PROTECTED]>
it.canada
tabase link identifier cannot be stored in a session variable
and then re-used by another session. Check out
http://www.php.net/features.persistent-connections for details.
--
Paul Chvostek <[EMAIL PROTECTED]>
it.canada
es in blobs in db table. I
wouldn't do it for anything high traffic, but for cases where a file
will be uploaded once and downloaded once or twice then deleted, I won't
have to deal with ongoing performance issues.
--
Paul Chvostek &
king upon file access.
>
> http://www.php.net/manual/en/features.safe-mode.php
>
> Other than that consider turning off safe mode if you have access to it,
> or turn it off for your virtual host.
>
> Paul Chvostek wrote:
> >I've got a script whose configuration creates a
> - Original Message -
> From: "Paul Chvostek" <[EMAIL PROTECTED]>
> >
> > I'm looking for a tool that will allow online file management, with a UI
> > something like that of a traditional FTP client.
> >
> > The ideal candidate w
process running as uid 80 won't be able to suid to another
user. If I make the directory owned by the user, the files will be
inaccessible, but if I make the directory uid 80, then *it* will be
inaccessible.
Is there some other solution to storing (and then retrieving) files with
safe_mode on?
PHP-based FTP client, but I'm open to that if nothing
else is available.
Before I write one myself, is there a package that has already been
built that any one can recommend (or recommend against)?
Thanks. :-)
--
Paul Chvostek <[EMAIL PROTE
ncel
I *did* say it was under construction. I haven't yet written the
scripts to cancel or do automatic software installation yet. They're on
the menus so folks can see what's coming. You should be able to get
into phpMyAdmin, but it can take a minute for your password to be
updated after
der development, so this
package will work better if you have enough technical ability to install
your own software.
--
Paul Chvostek <[EMAIL PROTECTED]>
it.canadahttp://www.it.ca/
Free PHP web host
Unless you own
shares in Intel and Cisco, of course.
--
Paul Chvostek <[EMAIL PROTECTED]>
it.canadahttp://www.it.ca/
Free PHP web hosting!http://www.it.ca/web/
-
course. If not, try looking at your
script output through http://samspade.org/t/safe .
--
Paul Chvostek <[EMAIL PROTECTED]>
it.canadahttp://www.it.ca/
Free PHP web hosting!
151 Front, just down the hall
from mine.
--
Paul Chvostek <[EMAIL PROTECTED]>
it.canadahttp://www.it.ca/
Free PHP web hosting!http://www.it.ca/web/
--
PHP General Mailing Li
ither solution has a performance edge over the other.
In both cases, each of the HTML and PHP file get loaded once per page
view, and whether the translation happens in PHP's output buffering or
via mod_rewrite is probably insignificant.
As always, multiple solutions to every problem.
he can run a separate instance of his web server that binds
only to 127.0.0.1, but even if the script is publically runable, it can
check HTTP_HOST and REMOTE_ADDR before doing anything critical. Scott
never mentioned the rest of his setup; judging its security is premature.
--
Paul Chvoste
t;
> > function isvalidemail($what) {
> > if
> (!eregi('[a-z0-9][a-z0-9._=+-]*@([a-z0-9][a-z0-9-]*\.)+[a-z][a-z]+$',$what))
> return(false);
> > list($user,$domain) = explode("@",$what);
> > if (!getmxrr($domain,$mxhosts)) return(false);
> >
idemail($what) {
if
(!eregi('[a-z0-9][a-z0-9._=+-]*@([a-z0-9][a-z0-9-]*\.)+[a-z][a-z]+$',$what))
return(false);
list($user,$domain) = explode("@",$what);
if (!getmxrr($domain,$mxhosts)) return(false);
if (!count($mxhosts) > 0) return(false);
>
> ----- Original Message -
> From: "Paul Chvostek" <[EMAIL PROTECTED]>
> To: "Stephen" <[EMAIL PROTECTED]>
> Cc: "Niels Andersen" <[EMAIL PROTECTED]>; "PHP List" <[EMAIL PROTECTED]>
> Sent: Tuesday, March 11, 200
a print_r($HTTP_SERVER_VARS); and there
> wasn't a variable called HTTP_REFERER. I've heard that some servers disable
> it. Since I have a dedicated server, how can I enable this variable again?
--
Paul Chvostek <[EMAIL PRO
f (ereg('^[0-9]+', $what)) {
$temp = ereg_replace('^([0-9]+)(.*)','\\1__\\2', $what);
list($number, $name)=explode('__', $temp);
} else {
$name=$what;
$number=""
}
$retval[0]=trim($name);
$retval[1]=trim($numb
ourse a non-existent function in PHP. I'd like to stop
calling a subshell every time I process a date, but I'd also like to
avoid jumping through hoops with mktime.
Is there a better way?
Tnx.
--
Paul Chvostek <[EMAIL PR
ase insensitive, wrap the options in LCASE or UCASE.
This sort of thing might be more likely to get a quick response on the
php-db list, and a more concise response if you include the type of
database you're using.
--
Paul Chvostek <[
interface, in case you need details which are operating
system specific. (And if you don't know, you probably don't need 'em.)
Most likely you will need unix shell access to set up and maintain your
cron jobs. Your local unix system administrator (or consultan
x27;s
happening, and where the system is looking for files.
> the file permissions are "rw-r-r"
No they're not. They might be "rw-r--r--", but not what you put. When
you talk about file modes, it's safer to refer to them in octal. So
"rw-r--r--" would
e that flexible.
Any advice? Is there an *elegant* way of doing this?
--
Paul Chvostek <[EMAIL PROTECTED]>
Operations / Abuse / Whatever
it.canada, hosting and development http://www.it.ca/
--
PHP General Maili
ports&query=qpage
(2) http://www.freebsd.org/cgi/man.cgi?manpath=ports&query=sendpage
--
Paul Chvostek <[EMAIL PROTECTED]>
Operations / Abuse / Whatever
it.canada, hosting and development http://www.it.ca/
--
PHP
ells you the problem, as does
a closer look at http://www.php.net/ksort .
You're assuming ksort()'s return value is the sorted array. It is not.
Try something more along the lines of:
$testarray=array(
"[three]" => 3,
any of those characters.
And to match any *except* those characters, use [^][.^$()|*+?-].
Check the re_format(7) man page for details. If you don't have a unix
box handy, check http://www.freebsd.org/cgi/man.cgi?query=re_format .
--
Paul Chvostek
's Flash or PDF or find
another developer? I'd *much* rather do this in pdflib or ming, but
that may just not be possible
--
Paul Chvostek <[EMAIL PROTECTED]>
Operations / Abuse / Whatever
it.canada, hosting and development
d;
> echo ">{$account['username']}";
>
> > }
> > ?>
> >
> >
This is good. I've always liked things like this:
$query="SELECT ...";
if ($result=mysql_query($q)) {
$sel[$user]=" selected";
print "\n&quo
to a fax server elsewhere on the network.
If you're doing this in a Microsoft environment, I have no clue how
you'd even approach the problem, let alone solve it.
--
Paul Chvostek <[EMAIL PROTECTED]>
Operations / Abuse
QL servers (I'm using
MySQL at the moment), are there any compelling reasons I should write
system stuff in Perl rather than PHP?
Thanks.
--
Paul Chvostek <[EMAIL PROTECTED]>
Operations / Abuse / Whatever
it.canada, hosting and devel
uot;;
>}
>if (!mysql_select_db("catapult_com")){
> Print "Couldn't connect database";
> } else {
> Print ""."\n";
> }
>
> $sql="SELECT OrgName From TableResults ORDER BY OrgName";
> $result=mysql_query($sql);
y thoughts?
Incidentally, I'm guaranteeing uniqueness of usernames with a unique
index in the MySQL table that stores this stuff. Including the INSERT,
I can create about 10 of these in 60 seconds. So this is more a
question of style than of practical limitations. ;)
"man ping" from a shell to see what you need to do to
duplicate this functionality, or check out various OS man pages at
http://www.freebsd.org/docs.html#man . If you're running a Microsoft
operating system, you're most likely out of luck.
--
Paul Chvostek
ers will hit their space bar a number of
times after entering a numeric value into a text box? If so, then
http://www.php.net/trim may be what you want. If not, you'll need
to explain it more concisely.
--
Paul Chvostek <[EMAIL PROTECTED]&g
our $target somewhere (maybe by parsing HTTP_USER_AGENT), and you
can stick with consistent use of UNIX-style text in your PHP.
There's probably a more elegant way to do this, but I don't know it.
--
Paul Chvostek <[EMAIL PROTECTED]&
ould just be typed out
> normally.
How about:
$href="(https?://([a-z0-9]+\.)+[a-z][a-z]+/[a-z0-9_./~%-]*)";
$repl="\\1";
$line=eregi_replace($href, $repl, $line);
You can of course make $href less restrictive if you're liberal minde
roughly the same way the median() function works ...
but I don't recommend using this for bandwidth calculations for co-lo
customers because of the hassle of pulling all that data into an array.
95th percentile is more easily calculated in the SQL ser
ort something other than the
number of elements in $issue. I never count my multidimensional arrays
so it's never come up for me. :-/
--
Paul Chvostek <[EMAIL PROTECTED]>
Operations / Abuse / Whatever +1 4
quot;;
> $issue[]["month"] = "05";
> $issue[]["year"] = "2003";
> $issue[]["description"] = "description";
>
> What I need to do now is count(), sort() by number,
> and loop through this array.
>
> I read that PHP i
you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Paul Chvostek <[EMAIL PROT
ment producer 3. Do you mind to tell me how to make a PHP programme
> to execute a centian routine at a given time ? Thank you !
--
Paul Chvostek <[EMAIL PROTECTED]>
Operations / Abuse / Whatever +1 416 598-
it.
e represented as "IBM Extended ASCII" or whatever you want to
call it. But the string is just a string of bits.
--
Paul Chvostek <[EMAIL PROTECTED]>
Operations / Abuse / Whatever +1 416 598-
77 matches
Mail list logo