[PHP] Re: test for ascii or binary string

2002-11-30 Thread Paul Chvostek
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-

[PHP] Re: Hello ! How to write a programme in PHP which executes a routine at a given time ?

2002-11-30 Thread Paul Chvostek
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.

[PHP] Re: Multidimensional array

2002-11-30 Thread Paul Chvostek
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

[PHP] Re: Multidimensional arrays (more and more...)

2002-11-30 Thread Paul Chvostek
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

[PHP] Re: Multidimensional arrays (more and more...)

2002-11-30 Thread Paul Chvostek
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

[PHP] Re: Finding Mode

2002-12-08 Thread Paul Chvostek
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

[PHP] Re: Regex question

2002-12-12 Thread Paul Chvostek
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

[PHP] Re: fwrite and line breaks

2002-12-12 Thread Paul Chvostek
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]&

[PHP] Re: Beginner question : Removing spaces in forms

2002-12-12 Thread 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

[PHP] Re: ping...

2002-12-13 Thread Paul Chvostek
"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

[PHP] creating random strings?

2002-12-19 Thread Paul Chvostek
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. ;)

Re: [PHP] Populating a list box from a database - The code

2002-12-28 Thread Paul Chvostek
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);

[PHP] PHP vs Perl for system scripts (non-web)

2003-01-27 Thread Paul Chvostek
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

[PHP] Re: printing

2003-01-28 Thread Paul Chvostek
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

Re: [PHP] listbox problems

2003-02-02 Thread Paul Chvostek
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

[PHP] Powerpoint presentations?!?

2003-02-05 Thread 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

[PHP] Re: regex

2003-02-07 Thread Paul Chvostek
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

[PHP] Re: issues with ksort()

2003-02-07 Thread Paul Chvostek
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,

[PHP] Re: PHP-based SMS solution

2003-02-12 Thread Paul Chvostek
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

[PHP] pro-rated date

2003-02-17 Thread Paul Chvostek
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

[PHP] Re: file not opening in internet explorer

2003-02-19 Thread Paul Chvostek
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

[PHP] Re: Cron Job help Needed

2003-02-19 Thread 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

[PHP] Re: search script

2003-02-24 Thread Paul Chvostek
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 <[

[PHP] how do I strptime?

2003-02-27 Thread Paul Chvostek
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

[PHP] Re: seperate streetname from number

2003-03-11 Thread Paul Chvostek
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

Re: [PHP] Re: Enabling HTTP_REFERER

2003-03-11 Thread Paul Chvostek
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

Re: [PHP] Re: Enabling HTTP_REFERER

2003-03-11 Thread Paul Chvostek
> > ----- 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

Re: [PHP] Checking for a Valid Email String.

2003-03-11 Thread Paul Chvostek
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);

Re: [PHP] Checking for a Valid Email String.

2003-03-11 Thread Paul Chvostek
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); > >

Re: [PHP] Cannot execute... Cron jobs

2003-03-12 Thread Paul Chvostek
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

[PHP] online file management

2003-07-01 Thread Paul Chvostek
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

[PHP] safe_mode and file/directory ownership

2003-07-01 Thread Paul Chvostek
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?

Re: [PHP] online file management

2003-07-02 Thread Paul Chvostek
> - 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

Re: [PHP] safe_mode and file/directory ownership

2003-07-02 Thread 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

Re: [PHP] online file management

2003-07-02 Thread Paul Chvostek
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 &

[PHP] Re: [PHP-DB] Database question

2003-07-03 Thread Paul Chvostek
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

[PHP] security question

2003-07-04 Thread Paul Chvostek
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

[PHP] Re: script not stopping

2003-07-07 Thread Paul Chvostek
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

[PHP] Re: script not stopping

2003-07-07 Thread Paul Chvostek
> "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

[PHP] Re: what's wrong with this?????

2003-07-08 Thread Paul Chvostek
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

Re: [PHP] Regular Expression

2003-07-08 Thread Paul Chvostek
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!

[PHP] Re: Mind exploded on this one!

2003-07-11 Thread Paul Chvostek
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 $

[PHP] Re: Mailing list server with PHP frontend

2003-07-13 Thread Paul Chvostek
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

[PHP] Re: elegant way of doing something else the last time through a loop?

2003-07-15 Thread Paul Chvostek
ip = array( 'the' => 1, 'and' => 1, 'a' => 1, ); foreach (explode(' ', $string) as $val) { if (!$skip[$val]) { $sql .= $logic . " name like '%$val%'"; } } $sql .= ' ORD

[PHP] How unsafe is register_globals?

2003-07-16 Thread 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

Re: [PHP] How unsafe is register_globals?

2003-07-16 Thread 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

Re: [PHP] How unsafe is register_globals?

2003-07-17 Thread Paul Chvostek
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

Re: [PHP] How unsafe is register_globals?

2003-07-17 Thread Paul Chvostek
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

[PHP] Re: Mail From option in PHP.ini

2003-07-18 Thread 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

[PHP] Re: running SSH through a PHP script

2003-07-18 Thread Paul Chvostek
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

[PHP] Re: How to..

2003-07-21 Thread Paul Chvostek
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

[PHP] Re: Hi

2003-07-22 Thread Paul Chvostek
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

[PHP] Re: subtracting dates...

2003-08-02 Thread Paul Chvostek
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

[PHP] Re: easier than switch

2003-08-04 Thread 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

Re: [PHP] Automatic Headers and Footers

2003-06-09 Thread Paul Chvostek
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.

[PHP] Re: Another hosting question....

2003-06-19 Thread Paul Chvostek
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

[PHP] Re: sending headers

2003-06-23 Thread Paul Chvostek
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!

[PHP] Re: Performance question

2003-06-23 Thread Paul Chvostek
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/ -

[PHP] Re: WEB HOST

2003-06-24 Thread Paul Chvostek
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

Re: [PHP] Re: WEB HOST

2003-06-24 Thread Paul Chvostek
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

[PHP] wrong headers from server

2003-09-01 Thread Paul Chvostek
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

[PHP] Re: What would the best way to veladate a URL string?

2003-12-13 Thread Paul Chvostek
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

Re: [PHP] Counting back 90 days...

2004-01-05 Thread Paul Chvostek
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/

Re: [PHP] Counting back 90 days...

2004-01-05 Thread Paul Chvostek
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

[PHP] Re: detecting flash in php

2004-01-08 Thread Paul Chvostek
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&#

[PHP] Re: alternative to protecting files through http auth.

2004-01-14 Thread Paul Chvostek
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

Re: [PHP] web page thumbs

2004-01-21 Thread Paul Chvostek
* > 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

[PHP] Re: Form woes

2004-01-21 Thread Paul Chvostek
*** > 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

[PHP] Re: RewriteRule REGEX ?

2004-01-24 Thread Paul Chvostek
;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&

[PHP] Re: Challenge: Sessions & Frames

2004-01-25 Thread Paul Chvostek
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

[PHP] Re: Webcapture to PDF

2004-05-13 Thread 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

Re: [PHP] Re: strip comments from HTML?

2004-05-06 Thread Paul Chvostek
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(&

[PHP] Re: Regular Expression

2004-05-04 Thread Paul Chvostek
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:

Re: [PHP] paging methodology

2004-05-04 Thread Paul Chvostek
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[

[PHP] Re: strip comments from HTML?

2004-05-06 Thread Paul Chvostek
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

Re: [PHP] Re: strip comments from HTML?

2004-05-06 Thread Paul Chvostek
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

[PHP] Re: Compare two TXT files

2004-07-17 Thread Paul Chvostek
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