Re: [PHP] Pre-printed forms

2006-09-15 Thread Google Kreme

On 14 Sep 2006, at 05:35 , Man-wai Chang wrote:

How do you guys and gals use PHP+HTML+CSS to print a report to
preprinted forms with precision?


PDF.  Printing support in HTML, even with CSS2 and 3, is primitive  
(and not well supported).


Generating a PDF is pretty straight forward though.

--


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Question on explode and join.

2006-09-15 Thread Google Kreme


On 13 Sep 2006, at 11:02 , Dave Goodchild wrote:


$_SESSION['profane'] = false;

   foreach ($_POST as $value) {
   foreach ($swearbox as $profanity) {
   if (preg_match("/$profanity/i", $value)) {
   $errors = true;
   $_SESSION['profane'] = true;
   mail(TECHEMAIL, 'profane content attack attempt on  
DJST', "From:
{$_SERVER['REMOTE_ADDRESS']} Time: " . date('d F Y G:i:s', time()- 
TIMEDIFF),

'[EMAIL PROTECTED]');
   }
   }
   }


wouldn't that trigger on "assassination"<1> is "ass" was in $swearbox?

<1> twice

--
Do not meddle in the affairs of Dragons for you are crunchy and taste  
good with ketchup


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] getting base domain and sub domains from url?

2006-09-16 Thread Google Kreme

On 16 Sep 2006, at 16:26 , Kenneth Andresen wrote:

It gives the top level ones, but I can't seem to find the lower
specifications covering such as .co.uk  .com.mx  etc.


There is no lower 'specification' because each one is unique.

.mx is administered, for example, by www.nic.mx (I believe), so it is  
their option to subdivide the .mx tld however they see fit.  Each tld  
gets to do this however it wants.  Mexico chose .com.mx and .gob.mx  
(the latter for government sites), for example, while the UK  
chose .co.uk and .me.uk (the latter for personal pages), etc.  Since  
each one of these tlds is managed independently, it would be nearly  
impossible to construct a list of the possible second level domains  
for al the tlds.  Sure, you might be able to get .mx and .uk info  
fairly easily, but what about .cc or .cx or .fj?  And as soon as you  
do construct such a list, it will be out of date.


If you are trying to verify a valid email address or a valid domain,  
there are better ways.


--
Why can't you be in a good mood? How hard is it to decide to be in a  
good mood and be in a good mood once in a while?"


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Resource problem affecting Curl functions

2006-09-19 Thread Google Kreme

On 19 Sep 2006, at 12:12 , Mark Krenz wrote:

  I run a shared webserver with a few hundred vhost containers in
Apache's config.


Are these vhosts all contained in httpd.conf, or are they separate  
files?


Does it make a difference?

--
...when you're no longer searching for beauty or love, just some kind  
of life with the edges taken off.  When you can't even define what it  
is that you're frightened of; this song will be here.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Resource problem affecting Curl functions

2006-09-20 Thread Google Kreme

On 20 Sep 2006, at 06:09 , Mark Krenz wrote:
On Wed, Sep 20, 2006 at 06:34:32AM GMT, Google Kreme  
[EMAIL PROTECTED] said the following:

On 19 Sep 2006, at 12:12 , Mark Krenz wrote:

 I run a shared webserver with a few hundred vhost containers in
Apache's config.


Are these vhosts all contained in httpd.conf, or are they separate
files?

Does it make a difference?



  I doubt this makes a difference, but its all in one vhost.conf file.
The httpd.conf file includes that file.

  So does anyone have any ideas about my problem with curl functions?


Not as such, but I would try a couple of things.

First, does it matter which of the vhost you remove/comment out  
before you get functionality back?


Second, if you split the vhost.conf file into, say, two files, does  
it make a difference?


I don't have thousands of vhosts anymore, but we used to.  They were  
all in separate files though, by domain, an included with a include / 
etc/httpd/vhosts/*.conf in the httpd.conf file.



--
You know, Calculus is sort of like measles. Once you've had it, you  
probably won't get it again, and you're glad of it. -- W. Carr


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Is there a list of all Timezones as an array or someting?

2006-09-20 Thread Google Kreme

On 20 Sep 2006, at 06:15 , Chris Boget wrote:
 $timeZonesArray = array( 'GMT'=> array( 'GMT'   =>  
+0 // GMT


Er... ok, but that seems to be missing quite a lot.  For example, I  
notice that India Standard Time (IST; UTC +5:30) is missing from your  
array.  Granted, it's only 1.1 Billion people and the largest English  
speaking population in the world... (or second most, depending on  
whom you ask).


Or did you just forget to paste the Asia portion of the array?

--
Two, Four, Six, Eight! Time to Transubstantiate!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php/css and .htaccess

2006-09-20 Thread Google Kreme

On 20 Sep 2006, at 16:18 , tedd wrote:
However, FireFox / Mozillia won't accept a css file if a .htaccess  
file reads as indicated above.


Any ideas as to how to get FireFox to play nice?


Yep, you need to specify header('Content-Type: text/css')

This is because Mozilla/Firefox is, as far as I know, the only  
browser to insist on the content type for css files.  Albeit it,  
mozilla.org is RIGHT on this one.



--
How you have felt, o men of Athens, at hearing the speeches of my  
accusers, I cannot tell; but I know that their persuasive words  
almost made me forget who I was, such was the effect of the,; and yet  
they have hardly spoken a word of truth.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Grrrrr... Re: Returned mail: User unknown

2006-09-21 Thread Google Kreme

On 20 Sep 2006, at 22:47 , [EMAIL PROTECTED] wrote:

   - The following addresses had permanent fatal errors -
<[EMAIL PROTECTED]>

   -Transcript of session follows -
... while talking to postoffice.local.:

RCPT To:<[EMAIL PROTECTED]>

<<< 550 5.1.1 unknown or illegal alias: [EMAIL PROTECTED]


I can't be the only person getting these in response to every message  
I sent the list, can I?


Can someone unsub this person?

--
"I hope someday you know the indescribable joy of having children,  
and of paying someone else to raise them."


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] [OFF] PHP/MySQL contractor needed

2006-09-22 Thread Google Kreme

On 22 Sep 2006, at 11:14 , Robert Cummings wrote:
Geee, way to fight back against the shrinking distance of the  
global

community brought to you by the Internet. I'm just curious why so many
posters for jobs feel the need to force a local boundary. Is the  
quality

of work somehow better because you can knock on their door?


Hah!  I'd say its worse, on average.


--
I gotta straighten my face
this mellow thighed chick just put my spine out of place

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] array_sum($result)=100

2006-09-24 Thread Google Kreme

On 24 Sep 2006, at 10:41 , Penthexquadium wrote:
On Sun, 24 Sep 2006 19:06:11 +0300, "Ahmad Al-Twaijiry"  
<[EMAIL PROTECTED]> wrote:

I have array of numbers and I want to get out of it a list of numbers
that if I sum them it will be 100, here is my list (for example ) :


I think you can try to sort the array in reverse order, and then
calculate the sum of numbers in loops (end loop when the sum is larger
than target sum).


That seems like a very slow way to do it, I think.

First thing, sort the array, then scan the array backwards for the  
first number under the target sum (in this case, 50).  Then look for  
another number that will add to make the target sum.  So, if you find  
a 90, look for a 10.  If you find it, you're done.  If you don't find  
it, then search for the next smallest number (33) and add it.  Then  
repeat.  If you don't find a match at 83, then add the next smallest  
number, 20.  But that puts you over your target, so you discard 33  
and start over with 50 and the next lowest number, 20.  Now you are  
only looking for numbers <=20.


This might be the perfect place to use a recursive function, as long  
as you are careful to limit it's iteration cycles.


No way is this going to be done quickly.

--
And, while it was regarded as pretty good evidence of criminality to  
be living in a slum, for some reason owning a whole street of them  
merely got you invited to the very best social occasions.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Print or Echo takes lots of time

2006-09-25 Thread Google Kreme

On 25 Sep 2006, at 06:11 , Sancar Saran wrote:

$strPage = " yada dayda";
...
$strPage.= " another html tags";
...
$strPage.= getSqlDataAndCreateSomeHtmlCOde();


If this is generating hundred of K of HTML, use ' instead of "

(yes, it's faster).

--  
I'm sitting here with 4 Megs of RAM trying to figure out how to use  
it all... :-)  (Me, in 1990)
I'm sitting here with 4 Gigs of RAM trying to figure out how to use  
it all... :-)  (Me, in 2005)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Changing values in .htaccess

2006-09-28 Thread Google Kreme

On 28 Sep 2006, at 14:30 , Curt Zirzow wrote:

If you can, set this on a per directory setting in your virtualhost
setting within a  or , instead of turning on
.htaccess.


Er... why?  So you have to get root privs to edit your virtual conf?

there's nothing wrong with .htaccess, just a lot of people get  
confused and screw things up.


.htacess is very useful.

--
Look, that's why there's rules, understand? So that you *think*  
before you break 'em.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Changing values in .htaccess

2006-09-29 Thread Google Kreme

On 28 Sep 2006, at 22:23 , Curt Zirzow wrote:

As i mentioned using .htaccess should be your last resort; there is a
big performance hit


big?  You're joking.  It's a miniscule hit in all but the most  
contrived of circumstances.  Even the most complex websites are  
rarely more than 4 or 5 levels below DOcumentRoot.


with using .htaccess and if you have the ability dont use it and  
turn it off if you arn't using it.


I have to disagree.  I thin the convenience of it is well worth the  
effort.  I can edit my htaccess via a webdav mount, for example.   
That's rather harder to do to /etc/httpd/vhosts/domain.tld.conf


I also prefer to put custom php directives into htaccess, but that's  
probably just my personal preference.  It's nice to know that if I  
backup a site though, I have ALL of the site and don't have to go  
check what the virtualhost configuration says.


--
Hi, I'm Gary Cooper, but not the Gary Cooper that's dead.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Changing values in .htaccess

2006-09-29 Thread Google Kreme

On 29 Sep 2006, at 08:24 , tedd wrote:

At 2:53 AM -0600 9/29/06, Google Kreme wrote:
I also prefer to put custom php directives into htaccess, but  
that's probably just my personal preference.


I agree, I just found several uses for .htaccess that I can not  
live without -- it's great.


What references would you recommend?


Well, I've really just used the apache docs, myself.

I've had quite a lot of fun getting pages looking a certain way with  
no html code (using htaccess to customize the index page).


For example, on my intranet web server I have some episode summaries  
for a few TV shows, and the .htacess for the root folder of those  
summaries is:


Options All MultiViews
IndexOptions +IconsAreLinks +IconHeight=12 +IconWidth=12 +NameWidth=*  
+ScanHTMLTitles +SuppressLastModified +SuppressSize

IndexOrderDefault  Descending Name
HeaderName header.html
IndexIgnore header.html

The combination of the custom header and having just a name and  
description means most people don't even realize it's an index page.   
+ScanHTMLTitles means that each episode's title shows up in the index  
page automatically without my having to AddDescription manually for  
each one.


And that's all before even thinking about adding php code to the  
htaccess file.


But, this is OT to the list.

--
A: You can never go too far. B: If I'm gonna get busted, it is *not*  
gonna be by a guy like *that*.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] moving file from one server to another

2006-09-30 Thread Google Kreme

On 30 Sep 2006, at 03:29 , Nick Wilson wrote:

I need to let users upload to the regular LAMP box, but then copy the
image over to the custom image server (which does not have php or any
kind of cgi capability).

I was considering using exec() and scp to do this, but thought i'd ask
and see if anyone had any better suggestions?


Ah... well, does the copy need to be interactive, or does it need to  
be automatic?


I'd probably use rsync to copy the upload tree to the image server  
myself, without involving php at all.


--
Three tomatoes are walking down the street- a poppa tomato, a momma  
tomato, and a little baby tomato. Baby tomato starts lagging behind.  
Poppa tomato gets angry, goes over to the baby tomato, and smooshes  
him, "Catch up."


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] WebMail client

2006-10-02 Thread Google Kreme

On 02 Oct 2006, at 02:57 , Jyrki Laurila wrote:

http://www.roundcube.net/


That's pretty nice.  Is there a mailing list for it?

--  
You know, in a world in which Bush and Blair can be nominated for the  
Nobel Peace Prize, "for having dared to take the necessary decision  
to launch a war on Iraq without having the support of the UN" I find  
myself agreeing with Tom Lehrer: satire is dead. - Neil Gaiman


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how do I get this line to work inside double quotes

2006-10-02 Thread Google Kreme

On 02 Oct 2006, at 14:56 , Richard Lynch wrote:

$mail_body .= "" . stripslashes($mail_text) . "";


Can we also comment on the horror that is the  tag?

I thought I was gonna puke...

No?  OK, moving along, nothing to see.

--
The Piper's calling you to join him

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Client Computer Registration

2006-10-02 Thread Google Kreme

On 02 Oct 2006, at 15:11 , Richard Lynch wrote:

And they'd have to be complete and total idiots to use the IP address
for authentication/identification.


This is Key Bank.  Morons goes without saying.


Though, honestly, if this is your BANK, they've really got no business
allowing you to "register" your computer like this...


Ibid.

--
"Real stupidity beats artificial intelligence every time."

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how do I get this line to work inside double quotes

2006-10-02 Thread Google Kreme

On 02 Oct 2006, at 17:13 , tedd wrote:

At 4:59 PM -0600 10/2/06, Google Kreme wrote:

On 02 Oct 2006, at 14:56 , Richard Lynch wrote:

$mail_body .= "" . stripslashes($mail_text) . "";


Can we also comment on the horror that is the  tag?


I saw that as well, and had a similar response -- but I'm not sure  
how one can use a style sheet with/within an email.


well, if you want to  send HTML email, you can just put the  
styles in the header, or have it link to a style sheet on your  
server.  It's HTML, you'd do it like any other HTML.


On the other hand, I'd rather send a link to an HTML page than a  
bunch of HTML email, but that's me.



--
Naked blonde walks into a bar with a poodle under one arm, and a two- 
foot salami under the other. The bartender says, I guess you won't be  
needing a drink. Naked lady says…


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Breaking lines

2006-10-03 Thread Google Kreme

On 03 Oct 2006, at 12:40 , Deckard wrote:

Richard Lynch wrote:
First, you're scaring the [bleep] out of me from a security  
standpoint

writing mysql passwords into files...

It's not that unusual.


It might not be unusual, but it's not that bright.


It's a matter of securing the web server.


There are better ways to go.  My solution (which is not a great one,  
but better, at least) is to put the database login info into a  
separate file named something like .htdbpass.


require('.htdbpass');

This way, at least, apache is pre-build to never allow access to the  
file, since it blocks all accesses to .ht*


And yeah, a key is better, but I've not gotten that far.

--
Critics look at actresses one of two ways: you're either bankable or  
boinkable.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Breaking lines

2006-10-03 Thread Google Kreme

On 03 Oct 2006, at 14:16 , Richard Lynch wrote:

On Tue, October 3, 2006 1:51 pm, Google Kreme wrote:

And yeah, a key is better, but I've not gotten that far.


See, whatever you do in that general vein of thought, your PHP script
ends up needing to get the file.


Well, yes, but at least with a .ht* file apache will never expose the  
contents of that file. This is WHY I do it as a separate file with a  
require() pointing to it.



A php-readable file outside the webtree at least limits risk to users
on the same machine -- and so machine access provides an
authentication barrier.  Not claiming that's insurmountable, mind you,
but it's a real actual barrier of a significantly different nature
than just reading yet another PHP/text file to find the key that reads
the other-other php/text file.


As I understand it then, the .ht* is no less secure because, for all  
intents and purposes, it is 'outside' the webtree since Apache will  
never display it, and you need some other sort of access to the  
machine (ftp, ssh, etc) to access it.  As I understand it, you can't  
even access .ht* files via webDAV.


Course, I'm still rather new to all of this, so if I'm wrong, flame  
away.


--
But just because you've seen me on your TV
Doesn't mean I'm any more enlightened than you

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] WebMail client

2006-10-04 Thread Google Kreme

On 04 Oct 2006, at 19:28 , Glenn Richmond wrote:

http://www.roundcube.net/

I can't say enough good things about the roundcube project. Ajax- 
based,
like a desktop email client in a browser. Still got some minor  
bugs, but

works pretty well. Note that it's still a Beta at this point.


Despite it being beta, and rather an early beta at that, I've found  
roundcube to work amazingly well. less features than Squirrelmail,  
but sooo much faster.


I'm super impressed.

--
My little brother got his arm stuck in the microwave. So my mom had  
to take him to the hospital. My grandma dropped acid this morning,  
and she freaked out. She hijacked a busload of penguins. So it's sort  
of a family crisis. Bye!


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Miserable escape string problem

2006-10-05 Thread Google Kreme

On 05 Oct 2006, at 10:50 , [EMAIL PROTECTED] wrote:

So, yes, there is no escaping for { in PHP and that would be it.


So what is "{{$var1} : {$var2}}" ??


--
MEGAHAL: within my penguin lies a torrid story of hate and love.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Miserable escape string problem

2006-10-05 Thread Google Kreme

On 05 Oct 2006, at 11:37 , Chris Shiflett wrote:

Google Kreme wrote:

So what is "{{$var1} : {$var2}}"


Within a quoted string, you can surround variable names with braces  
for
clarity. This is especially helpful for situations like this, where  
the

rest of the string interferes with syntax.


Heh.  It was a rhetorical question.  He said there was no way to  
escape the {'s


Of course there is... that was my point.

--
No man is free who is not master of himself

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Mailer and SMTP = SPAM?

2006-10-11 Thread Google Kreme

On 10 Oct 2006, at 12:37 , Richard Lynch wrote:

Very simple to code/implement/maintain.


Oh?  How simple is it?

(yes, this is an oblique request for code :)

--  
Nothing like grilling a kosher dog over human hair to bring out the  
subtle flavors.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Working with overly aggressive anti-spam measures [SOLVED]

2006-10-11 Thread Google Kreme

On 10 Oct 2006, at 19:57 , Dave M G wrote:
It took me a little while to realize that the Spamassassin always  
says that an email is possible scam if it has any score above zero,  
but it takes a score of 5.0 to actually be deleted as spam.


No no no, this is not at all true.

First off, Spamassassin does not delete mail. It, in point of fact,  
CANNOT delete mail as it has no mechanism to do so.


Anyone who is automatically deleting mail on their own with a score  
of 5.0 or higher _will_ miss some legitimate email.  Not might,  
WILL.  Even at a score of 10.0 (where I auto-delete my mail) you will  
miss as much as 0.004% legitimate mail, iirc. (so, 4 messages in  
100,000)


most good email will score between -3 and +1 in Spamassassin if  
you've been running it for any length of time.  Your message scored


X-Spam-Status: No, score=-2.4 required=5.0  
tests=BAYES_00,DNS_FROM_RFC_ABUSE,

SPF_PASS autolearn=no version=3.1.0

So, a -2.4 which, last I checked was something like 99.97% likely to  
be ham.


--
Well I've seen the Heart of Darkness/Read the writing on the wall/and  
the voice out in the desert/Was the voice out in the hall


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Understanding persistent connections with oci8

2006-10-12 Thread Google Kreme

On 12 Oct 2006, at 11:10 , Bauer, Jay W wrote:

 Again if someone is using this oci8.persistent_timeout they are using
it because they want a way of controlling how long these connections
stay around.


Well, are they really?

I would think they are using it to free up idle connections for use  
with new connections.  That seems reasonable.  And they are saying,  
"Even if a connection appears to be idle right now, I only want it  
considered idle if there's been no activity in x seconds".


I can see how it's not what you expected, but it still seems reasonable.

Look at it this way, there's no point checking if an idle connection  
needs to be closed unless the idle connection is needed elsewhere.


--
Bishops move diagonally. That's why they often turn up where the  
kings don't expect them to be.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Understanding persistent connections...

2006-10-13 Thread Google Kreme

On 13 Oct 2006, at 06:35 , [EMAIL PROTECTED] wrote:

ATTENTION!

A message you recently sent to a 0Spam.com user with the subject  
"Re: [PHP] Re: Understanding persistent connections..." was not  
delivered because they are using the 0Spam.com anti-spam service.   
Please click the link below to confirm that this is not spam. When  
you confirm, this message and all future messages you send will  
automatically be accepted.


So nice to have Prove You Love Me schemes on a mailing list.

Needless to say, I did not (and will not) click the stupid link.


--
I know that you believe you understand what you think I said but I am  
not sure you realize that what you heard is not what I meant.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] corrupt image when viewed using PHP

2006-10-18 Thread Google Kreme

On 18 Oct 2006, at 05:44 , Angelo Zanetti wrote:
We also found another possible solution being that we use  
ImageMagick to convert the jpeg to a  jpeg, then it will load  
properly. But now we would have to convert each image that comes in  
and maybe only 10% of the images come from a Nokia  VGA camera,  
ImageMagick also has to be run from the command line (would this  
affect the  performance of the site?).  Would you suggest  using  
ImageMagick to convert the images each time a new one is uploaded?  
Or does anyone have a better solution for this?


Is there a way to test that the image is corrupt or not?  If so, then  
simply test each image, then ImageMagick those that fail.  If not,  
ImageMagick them all, it's pretty cheap and quick



--
Hey, how come Andrew gets to get up? If he gets up, we'll all get up,  
it'll be anarchy.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP 5.16 and Sihuson

2006-10-18 Thread Google Kreme

php -v
PHP 5.1.6 with Suhosin-Patch 0.9.5 (cli) (built: Oct 18 2006 08:36:59)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

This configuration cause no end of problems, and I finally compiled  
php without the Suhosin-Patch.  Everything is back to normal and  
working.


with the patch, there were numerous errors and problems:

[Wed Oct 18 09:58:05 2006] [error] ALERT - canary mismatch on efree()  
- heap overflow or double efree detected (attacker 'my.dot.ip.adr',  
file '/usr/local/www/wordpress/wp-admin/edit.php')
[Wed Oct 18 10:26:06 2006] [error] ALERT - canary mismatch on efree()  
- heap overflow or double efree detected (attacker 'my.dot.ip.adr',  
file '/usr/local/www/data/phpMyAdmin/index.php')


etc.

Is it possible to have Suhosin-Patch enabled and somehow avoid these  
heap overflows, or is Suhosin still not ready for a production  
environment?


--
The Germans wore gray, you wore blue.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] corrupt image when viewed using PHP

2006-10-18 Thread Google Kreme

On 18 Oct 2006, at 09:56 , Richard Lynch wrote:

Kind of a hack, but think of it as an "import filter" and maybe even
program it generically enough that you *CAN* do more "import filters"
and then you open up a world of possbilities for other image formats
to be supported some day in the future.


Like convert them to png and overlay an alphachannel 'mydomain.tld'  
bug on the image, just as an example...


--
...in the long run there's still time to change the road you're on

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP 5.16 and Sihuson

2006-10-19 Thread Google Kreme

On 19 Oct 2006, at 02:30 , Roman Neuhauser wrote:

# [EMAIL PROTECTED] / 2006-10-18 10:57:52 -0600:

php -v
PHP 5.1.6 with Suhosin-Patch 0.9.5 (cli) (built: Oct 18 2006  
08:36:59)

Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies


The Suhosin patch only reports the double free() in PHP so if
anything it's PHP that's not ready for production. You can disable
the patch but that won't fix the bug in PHP.


I've been told the problem is the Zend Engine.


--
No one ever thinks of themselves as one of Them. We're always one of  
Us. It's Them that do the bad things.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] What is the smallest, fastest web server to run PHP and SSL (on a soekris box)

2006-10-19 Thread Google Kreme

On 18 Oct 2006, at 17:25 , Daevid Vincent wrote:
I need to run a httpd server that can serve up PHP, SQL Lite, and  
SSL on a

little Soekris box (ie. a 486 with 32MB RAM and 32MB CF storage).


There's thttp which is really really small.  However, keep in mind,  
Apache has been around for long enugh that at one time a 486 with  
32MB of RAm was state of the art.



How small can Apache get?


Pretty darn small.  You might find SSL is larger, and certainly SQL  
Lite will have more of an impact.


I'd try it with apache with as much disabled as possible.  You're  
going to find better support tools for apache anyway.  However, the  
'throttling' aspect of thttp might be useful in a low-resource setting.



Related, does anyone know of a tutorial or something that will help to
reduce Apache to only the things really needed for PHP, mySQL, SSL?  
Right

now, our Apache memory footprint is an astounding 120MB !!


How are you counting that?  If you've only got 32MB it CAN'T be using  
120MB.  Unless you are counting VRAM, which is a mistake.



--
We will fight for Bovine Freedom and hold our large heads high
We will run free with the Buffalo or die

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] regex

2006-10-19 Thread Google Kreme

On 19 Oct 2006, at 07:49 , Bagus Nugroho wrote:


Hi All,

If we have variable like :

$var1 = 'abcde 12';
$var2 = 'abcdefghi 34';
$var3 = 'abc 20 def';

Then we want output like :
$var1 = 'abcde';
$var2 = 'abcdefghi';
$var3 = 'abc def';

How regex can help us?.


Well, stripping the digits is easy

s/ \d+//

(have that space before the number if there will ALWAYS be a space  
before the nu,bers you want to remove.



--
You try to shape the world to what you want the world to be. Carving  
your name a thousand times won't bring you back to me. Oh no, no I  
might as well go and tell it to the trees. Go and tell it to the  
trees, yeah.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] regex

2006-10-19 Thread Google Kreme

On 19 Oct 2006, at 07:56 , John Nichel wrote:

$var3 = 'abc 20 def';
Then we want output like :
$var3 = 'abc def';
How regex can help us?.


Use preg_replace to replace all numbers with nothing.

$var = preg_replace ( "/\d+/", "", $var );


Nope, that will leave

$var3 = 'abc  def';

(note the double space)

it will also leave $var1 = 'abcdef ';


--
The trouble with being a god is that you've got no one to pray to.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Ensuring all links go to index.php

2006-10-20 Thread Google Kreme

On 20 Oct 2006, at 02:00 , Dave M G wrote:
So... my question is, why is the /user portion of my URL being  
retained as a directory?


You need RewriteEngine On and RewriteBase and RewriteCond and  
RewriteRule, it sounds like.


Not really a php issue per se.

--
I wrote this song two hours before we met.  I didn't know your name,  
or what you looked like yet


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Comment management

2006-10-23 Thread Google Kreme

On 23 Oct 2006, at 09:12 , tedd wrote:
Does anyone have any recommendations or can point me to a simple  
content manager for such a purpose?


Do you need a content manager?  Sounds like you want a blog like  
setup where you post a entry (code) and people can comment.   
Wordpress is nice.


Or am I missing something?


--
"But you read a lot of books, I'm thinking. Hard to have faith, ain't  
it, when you've read too many books?"


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Screen Shots

2006-10-23 Thread Google Kreme

On 23 Oct 2006, at 08:32 , Dotan Cohen wrote:
I give this information to spread awareness, not to spread  
malicious code, FUD, exploits, or anything else.


On he other hand, IE related malicious code and exploits should be  
distributed as widely as possible as it is the only way MSFT will fix  
anything.


I love how the new improved windows vista already has viruses and  
exploits.  Tee Hee.



--
"Real stupidity beats artificial intelligence every time."

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] strtotime

2006-10-25 Thread Google Kreme

On 24 Oct 2006, at 19:07 , Brad Chow wrote:

$date=("2006-10-26");
$date=strtotime($date);
$date=date('Y-m-1',$date);
$now=strtotime("+3 month", strtotime($date));
$lastday=strtotime("-1 day", $now);
echo date('Y-m-d',$lastday);
//2006-12-31


Yep, that's pretty much exactly what I do.  I suspect there is a much  
shorter, and more opaque but elegantly clever way of doing it, but  
that basic methodology has been with me since the mid 80's :)



--
One by one the bulbs burned out, like long lives come to their  
expected ends.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Stupid question of the day (Editing text file in $HOME via web)

2006-10-30 Thread Google Kreme
I have a text file on a server that I want someone to be able to edit  
via the web.  I need it to have some modicum of security, but it's  
nothing particularly important and security is not the main concern.   
I am perfectly willing to simply http-auth it, if need be.


But it need to be easily editable using some sort of simple web form.

The file is unlikely to be much more than 20-100 lines of simple  
text, but there are a couple of things that are important.


1) it has to preserve spacing and 'extended' characters
2) it has to be kept readable to the uid of the directory it is in,  
and not just the webserver, however it can't be world readable  
without some authentication via the web.
3) the file is in $HOME and not in DocumentRoot, though it _could_ be  
moved.


I don't want to install some fancy word-processing sort of engine  
just to give a user access to this file, nor does the file need to be  
html-ized or anything.  It is a very simple file:


(AAA) XXX-NNN, some descriptive text
(AAA) XXX-NNN, some other descriptive text
(AAA) XXX-NNN, some different descriptive text
(AAA) XXX-NNN, John Smith

etc.

So, do I whack up something where I just load the file into a HTML  
Textarea and then write it back (simple enough, though possibly  
rather dangerous), or is there something straightforward I should go  
ahead and use that might find use elsewhere on the server?


--
"Oh damn", said Maladict.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Stupid question of the day (Editing text file in $HOME via web)

2006-10-31 Thread Google Kreme

On 31 Oct 2006, at 09:20 , Ed Lazor wrote:

On Oct 30, 2006, at 11:34 PM, Google Kreme wrote:
So, do I whack up something where I just load the file into a HTML  
Textarea and then write it back (simple enough, though possibly  
rather dangerous), or is there something straightforward I should  
go ahead and use that might find use elsewhere on the server?


Playing Devils Advocate here, but why not store the text in a  
database?


Because the text file is used by egrep/procmail.

The text file should be somewhat secure if you're manually reading  
and writing to it in PHP, making sure that you're the one  
controlling the file name, the file extension (file type), the file  
permissions, and the file size.


Yeah, so just dump it into a textarea and go?

On 31 Oct 2006, at 10:32 , Richard Lynch wrote:

On Tue, October 31, 2006 1:34 am, Google Kreme wrote:

So, do I whack up something where I just load the file into a HTML
Textarea and then write it back (simple enough, though possibly
rather dangerous), or is there something straightforward I should go
ahead and use that might find use elsewhere on the server?


The unanswered question is:

How many people might try to edit it at once, and what will you do to
resolve race conditions?


There will be only one person able to access the file, but I will  
need to somehow 'time-out' a edit if it doesn't get committed.



1. Put the "file" in a database as individual (AAA) XXX- records,
and the "file" can be generated from the DB every time it changes with
a trigger, or every day or something reasonable.  Having individual
records for each line reduces the damage of the race condition to a
single entry needing to be re-done.  You can also more easily find
code to handle the race condition for the DB in a web environment.


That's not a bad idea.  It might be worth the effort to setup the  
database and then simply have a php scriptlette generate the actual  
plaintext.  Hmm.  Worth considering, at least.  Some way of  
generating the plain text only when the file changes would be needed  
though,a s I don't expect it to change all that often.




2. Put the file into subversion or CVS, if all editors are developers.


Nope, it needs to be luser friendly.


3. Forget the web interface, because the file won't really change that
often anyway, and just use 'vi' to make the rare change. :-)


See above.


There likely *IS* a web tool "out there" just like you want...


Yeah, that's what I was thinking.


My first guess would be to check out the various "panel" solutions for
having a web interface that webhosts provide to edit what is
essentially a simple text file, which configures the web server, mail
server, ftp server, etc.  These all have all the exact same issues you
will face, so there might be one that fits your needs.


Any specific recommendations?  The only one of these I am familiar  
with is the absurdly expensive cpanel.


--
"You can think and you can fight, but the world's always movin', and  
if you wanna stay ahead you gotta dance."


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] preg_split

2006-11-03 Thread Google Kreme

OK, I have this file:


 $cid=preg_split('^([^,]+),\s?(.*)', $line, -1,  
PREG_SPLIT_DELIM_CAPTURE);


  }
 ?>


the trouble is, $cid is empty.  The actual file has lots of print  
lines, so I know that $lines is an array with each line for $CID_FILE  
as one element of the array and that $line gets the data from a  
single array element correctly.


What I want is for each line to be an array, split at the first  
comma.  The regex works in BBEdit, where I can search for


^([^,]+),\s?(.*)

and replace with

\2 \1

and it does the right thing, over and over, so the regex is not the  
issue.  It's something that I am not doing right/understanding in  
preg_split.  I've also tried:


 $cid=preg_split('^([^,]+),', $line);
 $cid=preg_split('^([^,]+),\s?(.*)', $line, PREG_SPLIT_DELIM_CAPTURE);
 $cid=preg_split('^[^,]+,', $line, -1);
 $cid=preg_split('^[^,]+,', $line);

The actual code with the extra printing is here:




and the sample data is




--
No one ever thinks of themselves as one of Them. We're always one of  
Us. It's Them that do the bad things.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: preg_split

2006-11-03 Thread Google Kreme

On 03 Nov 2006, at 12:32 , Myron Turner wrote:


1. A preg_ expression has to have the delimeters '/^([^,]+),\s?(.*)/'.


Ah, well, that would make a difference.




 $cid[$i]=preg_split('/^([^,]+),\s?(.*)/', $line, -1,  
PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);


Now it has an extra field in the array, but at least it is splitting  
the line.


[6] => Array
(
[0] => (555) 555-5556
[1] => Maggie, Fred, and George Cell
[2] =>

)


2. Why do you need this complex expression to split at a comma?  
This '/,/' would do the trick.  And even simpler

explode(',', $line);


Because I need to split only at the FIRST comma.



Also your regex ^([^,]+) asks the perl regex parser to find the  
beginning of a line at which there is one or more instances of NO  
Comma.  That is, [^ ] is a negation, so that [^0-9] means do not  
match any numbers.


Yes, and ^([^,]+) means, From the start of the line, get 1 or more  
characters that are not a comma and put them in \01.


So that any possible split would gobble up everything after the  
first instance in which the beginning of a line did not start with  
a comma, which would mean that you would get null results.


No, that's not right at all.  As I said, the regex works (and has  
been tested in other ways).




3. Is there a reason why you are using the flag  
PREG_SPLIT_DELIM_CAPTURE?


I tried many different variations.


--
It's better to burn out than it is to rust
  -- Neil Young as quoted by Kurt Cobain

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: preg_split

2006-11-03 Thread Google Kreme

On 03 Nov 2006, at 15:56 , Stut wrote:

Google Kreme wrote:

On 03 Nov 2006, at 12:32 , Myron Turner wrote:

2. Why do you need this complex expression to split at a comma? This
'/,/' would do the trick.  And even simpler
explode(',', $line);


Because I need to split only at the FIRST comma.


explode(',', $line, 2);

http://php.net/explode


Heh.  This is why I post here.  Last time I posted I was told to use  
preg_split.  Explode is simpler.


BTW, preg_split works it I change $line to trim($line), which is  
needed for explode too, else the 'name' part ends up with a return  
embedded.


Code as it stands now:
  echo ' PHP Caller ID Info for procmail ('.$CID_FILE.') h1>';

  $lines=file($CID_FILE);
  $i=0;
  foreach ($lines as $line) {
 $cid[$i] = explode(',',trim($line),2);
 // This line works too
 // $cid[$i]=preg_split('/^([^,]+),\s?(.*)/', trim($line),  
-1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);

 $i=$i+1;
  }
  echo '';
  echo '';
  $i=1;
  foreach ($cid as $line) {
 $count = substr('00'.$i,-3);
 echo '
 
   
 Phone #'.$count.':
 

   
   
 Name #'.$count.':
 

 ';
 $i=$i+1;
  }
  echo '
  
  
   ';
?>

Course, there's nothing there to process the submit as yet. And yes,  
I will combine these into one for-each  and a function call.



--
A marriage is always made up of two people who are prepared to swear  
that only the other one snores.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] image commands (again)

2006-11-05 Thread Google Kreme

On 05 Nov 2006, at 15:31 , Ron Piggott (PHP) wrote:

Content-type: image/

the browser expects only the image to output to the screen and no HTML


As if should.

Save the image in a temporary location and then send html that  
include and  tag



--
Though it's cold and lonely in the deep dark night I can see paradise  
by the dashboard light.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Pulling Data From a Page

2006-11-06 Thread Google Kreme

On 06 Nov 2006, at 12:59 , Phillip Baker wrote:

So basically I want to hit a page from another site.


If you are going to be polling another site and parsing it for data  
you'd better have permission to do so.



--
I find Windows of absolutely no technical interest... Mac OS X is a  
rock-solid system that's beautifully designed. I much prefer it to  
Linux. -- Bill Joy


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] gethostbyname failing?

2006-11-09 Thread Google Kreme

On 09 Nov 2006, at 15:09 , Henrik Hudson wrote:
On Thursday 09 November 2006 15:56, Jürgen Wind <[EMAIL PROTECTED]> sent  
a missive

stating:

';
print_r( gethostbynamel('www.google.com') );
?>



Yes, I get nothing when running inside Apache.





Works fine here...

--
I want to get hurt!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Staff log-in

2006-11-09 Thread Google Kreme

On 09 Nov 2006, at 12:51 , Robert Cummings wrote:

On Thu, 2006-11-09 at 14:28 -0500, John Nichel wrote:

Brynjar Guðnason wrote:
can anyone of you do this for me? It's for a small non-profit  
orginisation.


$80.00 an hour.  8 hour minimum.  I am a *for-profit* individual.


Didn't you charge $100 an hour previously?? Slow year?  ;)


You don't have a reduced rate for non-profits?

I do...

To answer the original question though, you need a database backend.   
It can be as simple as a text file, but that would be silly.  Log  
each 'session' by login and logout times.  The trouble comes when you  
need to time-out a session because someone never logged out  
properly.  That can be hairy.



--
Otto: Apes don't read philosophy.
Wanda: Yes, they do Otto, they just don't understand it.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Staff log-in

2006-11-11 Thread Google Kreme

On 10 Nov 2006, at 19:25 , Daevid Vincent wrote:

-Original Message-
From: Google Kreme [mailto:[EMAIL PROTECTED]


Is that *really* your name?! :)


Well, I TRIED to change it, but two guys in birks, tie-dyed t-shirts,  
and macramé briefcases showed up with an injunction. :)





The trouble comes when you
need to time-out a session because someone never logged out
properly.  That can be hairy.


Yeah, it's so hard to do that subtraction...


Figuring out when and how to time out a connection and what time  
stamp to give to a timeout.  After all, if minutes count and a  
connection times out after 30 minutes do you set the logout time  
then, or 30 minutes i the past?


That's the sort of hairy I meant.  Not math.  Math is never hairy.   
Squiggly, yes, tentacle-ly, perhaps if there is calculus involved.



--
Gentlemen, you can't fight in here! This is the War Room.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Source File Encoding

2006-11-11 Thread Google Kreme

On 11 Nov 2006, at 08:45 , C Drozdowski wrote:
Gotta a question whose answer should be really obvious to me but,  
for some reason, is just eluding me.


Which encodings can PHP handle for source files? I've been using  
iso-8859-1 but what about utf-8?


Try it?

5.0.6 seems to work fine with files from BBEdit saved as utf-8, but I  
don't know that there are any non-ISO-8859-1 characters in the file,  
so it's not a fair test.



--
Because you can't cotton to evil.  No Sir.  You have to smack evil on  
the nose with the rolled-up newspaper of justice and say,'Bad evil.  
bad BAD evil'"


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] activation through email

2006-11-11 Thread Google Kreme

On 11 Nov 2006, at 12:38 , Ahmad Al-Twaijiry wrote:

I know that hotmail is filtering me as a possibly a spammer (because I
use a shared mail server) and there is nothing I can do about this.


Sure there is, move to a better neighborhood.  And hotmail will not  
block you for being on a shared server unless the others on the  
shared server are spammers.



so I want to ask you if you have any solution for this ? how can I (in
someway) make my scripts check if the email is valid and exists email
before I register him without the need to send any password or
activation link to his email ?


Well, you can do what some mail servers do, and try to connect to the  
MX for the domain and see if the username is accepted.


Or, if this is a hotmail specific issue, you can not allow hotmail  
addresses.


--
Like the moment when the brakes lock/And you slide towards the big  
truck/You stretch the frozen moments with your fear


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Tour Guide around Jordan (Middle East) OFFER

2006-11-14 Thread Google Kreme

On 14 Nov 2006, at 02:17 , Raven.Hawk wrote:
Please note >>> if you dont need it now  you may will need it  
later so please save it for the future :)

[CHOMP]


   --
   This email is send by "Demo Software"


/me wonders if "Demo Software" is at least written in php...

--
"Send beer, words simply can't adequately express your gratitude"  -  
James Sedgwick


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Scrolling text

2006-11-14 Thread Google Kreme

On 13 Nov 2006, at 12:22 , Alain Roger wrote:

I would like to have a scrolling text (as banner) on our website.


er. eww.  But OK.

so, i would like to know if there is another way how to do a  
scrolling text
without using flash, shockwave or other tool...only in php or HTML  
(in worse

case).


No.  If you need to update a page that is already displayed, you need  
javascript.


However, the marquee tag should be able to be used without displaying  
on multiple lines...


That said, it's an ugly ugly tag and support for it is sparse.  Avoid  
it.  If you really want scrolling text you'd be better off finding  
some decent javascript code.


There, those are words I never thought I'd say.

--
"Give a man a fire and he's warm for a day, but set fire to him and  
he's warm for the rest of his life."


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] taking a one off payment

2006-11-16 Thread Google Kreme

On 16 Nov 2006, at 05:20 , Ross wrote:

What is the best way to take a one off payent


Paypal.


(non-paypal)


Well then, when you eliminate the obvious choice...


I have used oscommece


Speaking of oscommerce, has that package ever been fixed to run  
without register_globals?


--
I don't want to sell anything, buy anything, or process anything as a  
career. I don't want to sell anything bought or processed, or buy  
anything sold or processed, or process anything sold, bought, or  
processed, or repair anything sold, bought, or processed. You know,  
as a career, I don't want to do that.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php