Re: [PHP] PHP equivalent to Perl $0

2007-01-31 Thread Mark Charette

Richard Luckhurst wrote:

Hi Richard,


RL And, frankly, why would you want to do that?  It only sows confusion
RL in ps output. :-)


Unless you're talking about apps spawned by inetd and its cousins. ps 
shows the name as specified in arguments in the inetd.conf file, not the 
name of the executable, which often prefixed by in. , to indicate it's 
supposed to be spawned by inetd.



It seems to me that whoever wrote the specification had this thing about ps
showing a nice string instead of the program name actually running. Of course I
know that this is what ps is supposed to do and Perl allows you to tell nice
lies to ps :-)


As does C, C++, and a host of other languages. PHP does not - even 
though there's no error when you stuff a CLI php's $argv[0] with a 
different name:

#!/usr/local/bin/php
?php
$argv[0]=whatever;
sleep(20);
?

./qq.php 

ps

20232 pts/000:00:00 qq.php

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



Re: [PHP] if statement with or comparison (newbie)

2006-09-09 Thread Mark Charette

Robert Cummings wrote:

On Fri, 2006-09-08 at 18:38 -0400, tedd wrote:
  

At 5:03 PM -0400 9/8/06, JD wrote:

In all of the answers given thus far, no one mentioned that the use 
of $_REQUEST has a security issue with regard to where the $_REQUEST 
originated.


$_REQUEST is an array consisting of $_GET, $_POST and $_COOKIE values 
and as such, you don't know where the data came from and that might 
be important.


So, wouldn't it be better to recommend that the poster use $_GET, 
$_POST, or $_COOKIE instead of $_REQUEST?



Nope, not inherently less secure. If you are properly cleaning and
validating your data (as every good program should) then it doesn't
matter whether you pull from $_GET, $_POST, or $_REQUEST. The only time
it's bad is if you make assumptions about the value received -- AND YOU
SHOULD NEVER ASSUME YOU HAVE CLEAN DATA FROM AN OUTSIDE SOURCE!!
  
However, looking at it from a 'knowing early the data is tainted' 
perspective, not from a 'validating and cleaning perspective', if you 
have coded that (for instance) a variable is set via COOKIE, then only 
looking for that variable set via COOKIE will eliminate its being 
tainted by being set via GET or REQUEST. It doesn't eliminate any need 
for validation or cleaning, but reduces (naive) attempts to set via 
incorrect means. That is not possible via REQUEST. Personally, I like to 
toss out possibilities of bad data via simple means as early in the 
chain as possible.


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



Re: [PHP] if statement with or comparison (newbie)

2006-09-09 Thread Mark Charette

Stut wrote:

Mark Charette wrote:
However, looking at it from a 'knowing early the data is tainted' 
perspective, not from a 'validating and cleaning perspective', if you 
have coded that (for instance) a variable is set via COOKIE, then 
only looking for that variable set via COOKIE will eliminate its 
being tainted by being set via GET or REQUEST. It doesn't eliminate 
any need for validation or cleaning, but reduces (naive) attempts to 
set via incorrect means. That is not possible via REQUEST. 
Personally, I like to toss out possibilities of bad data via simple 
means as early in the chain as possible.


If I understood that right it's a shocking naive statement for any 
developer to make. While I agree with what you're saying, you're 
implying a bad attitude to handling data from untrusted sources.
I am being neither shocking or naive. Why is early discarding of data 
because it comes in the wrong area shocking? If I were looking for a 
variable set via a COOKIE, why would I look for the variable set via 
GET? As I so explicitly said above It doesn't eliminate any need for 
validation or cleaning, but reduces (naive) attempts to set via 
incorrect means. My CPU resources are valuable; writing code that 
checks whether a variable is set via the correct method is no harder 
($_COOKIE vs. $_REQUEST) and throws out trivially spurious data. No 
more, no less. The same checks still need apply after that, but my CPU 
won't be burdened by the script kiddies. No more, no less. The data just 
won't appear.


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



Re: [PHP] if statement with or comparison (newbie)

2006-09-09 Thread Mark Charette

Robert Cummings wrote:

On Sat, 2006-09-09 at 11:30 -0400, Mark Charette wrote:
  

Stut wrote:


Mark Charette wrote:
  
However, looking at it from a 'knowing early the data is tainted' 
perspective, not from a 'validating and cleaning perspective', if you 
have coded that (for instance) a variable is set via COOKIE, then 
only looking for that variable set via COOKIE will eliminate its 
being tainted by being set via GET or REQUEST. It doesn't eliminate 
any need for validation or cleaning, but reduces (naive) attempts to 
set via incorrect means. That is not possible via REQUEST. 
Personally, I like to toss out possibilities of bad data via simple 
means as early in the chain as possible.

If I understood that right it's a shocking naive statement for any 
developer to make. While I agree with what you're saying, you're 
implying a bad attitude to handling data from untrusted sources.
  


  
I am being neither shocking or naive. Why is early discarding of data 
because it comes in the wrong area shocking?



That's your last line, I think he's commenting on the rest of your
comment. Questionable data is questionable data, it doesn't matter from
whence you clean it. If you haven't cleaned it your still going to get
screwed no matter how much you rely on it being difficult to manipulate
by a site visitor.
  
Where am I being unclear, then? reduces (naive) attempts to set via 
incorrect means. doesn't say 'eliminate serious attempts'. I would 
think my statement It doesn't eliminate any need for validation or 
cleaning,  covers the remaining scenarios. Indeed, determining the 
source of data is one of the essential steps in validation. The one of 
the rules is 'discard even valid data if it comes from an untrusted 
source - and data coming from an _incorrect_ source is, by definition, 
untrusted even if if you wish to expend the effort to prove it valid.


And I'll wager a brew no one here has ever done a formal, mathematically 
rigorous proof of a validation routine except as a class project. As a 
senior member of the software QC department in a major industrial 
company, I generally find more errors and omissions in validation 
routines during code reviews and ethical hacks than anywhere else.


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



Re: [PHP] GET, POST, REQUEST

2006-06-17 Thread Mark Charette

Satyam wrote:
In general, user input should never be trusted.  Someone once told me 
that if you ask for yes or no, you should always validate for yes, no 
and don't know (of course, this was before windowed environments where 
the users can only click what you offer them).
Users can submit whatever they please; they are not limited by click 
what you offer them via web input.

Always: user input can never be trusted.

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



Re: [PHP] What means Fatal error: pcntl_fork(): Error 11?

2006-05-04 Thread Mark Charette

Oz wrote:


First I wanted to create a queue for tasks; instead of forking 
directly only a limited number of processes should be run from the 
queue, when one finishes another should start. But I decided not to do 
this, because the queue can easily grow to reach the memory limit.
If the queue of processes can grow to any reasonable memory limit (lets 
say 100 bytes/entry, 32 Mb memory limit) that means that you've got 
320,000 processes to run? If each one takes a minute to run that's 9 
months worth of running ... if 1 a second it's almost 4 days... if you 
launch PROCESS_MAX processes your system will page and you'll be running 
VERY slowly ...


Perhaps  it's time to examine the problem and think about a different 
solution.


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



Re: [PHP] Creating an OO Shopping Cart

2006-05-03 Thread Mark Charette

Chris W. Parker wrote:


I'm definitely open to suggestions on how we can minimize our customers'
risk
At least run GPG on the data immediately, keep the private key somewhere 
other than on the server, and decrypt only for the moment its needed.


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



Re: [PHP] Include Problem

2006-04-15 Thread Mark Charette

Shaun wrote:

Warning: main(/cms/templates/footer.php): failed to open stream: No such
file or directory in /home/m/y/mysite/public_html/cms/news/index.php on line
38
  
Most assuredly the file isn't there (do you have the include path set?) 
or the permissions are not sufficient to open the file.


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



Re: [PHP] email to db

2006-02-25 Thread Mark Charette

chris smith wrote:

On 2/25/06, Mark [EMAIL PROTECTED] wrote:
 
Does anyone know if its possible or how difficult it would be to have 
a user
send an email from outlook express to a websites mysql database and 
update

records.



You could write a script to parse the email and do the update. It
would come in on 'stdin'.
  
Essentially how I do it for customers that want to update content on 
their website and how I add messages from a few mailing lists (Klarinet, 
Doublereed, Clair) I run into a database so they can be browsed and 
later indexed by swish-e.


I use qmail  add aliases; [EMAIL PROTECTED] executes backup 
page and parse email/update page, [EMAIL PROTECTED] 
restores to the previous page. Similar thing for the lists - sanitize 
From: address, insert into database with From, Date, Subject, Body.


Mark C.
Woodwind.Org, Inc.

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



Re: [PHP] Re: Clone of the concurrent users limit of Zend Encoder 4.0 ?

2006-02-12 Thread Mark Charette




Let me give an example:

on fileplanet.com, they have something so called download slot and 
lines. They limit the number of concurrent downloads. If there are 
too many users, they will disallow new user to download their files. 
As I know, they do it with custom HTTP server.
Not so custom ... Apache has quite a few bandwidth limiting modules. I 
use mod_bandwidth to accomplish this.


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




Re: [PHP] help register domain name

2006-01-05 Thread Mark Charette

Al wrote:


John Nichel wrote:


n.g. wrote:


hi,
i want to register a domain name through NetworkSolutions.com,
but it require a credit card which i dont have to pay the bill.

if you have a credit card, i can transfer to your account, and then
you please regiter the domain using my info.

or if you have any other ways to do so.

p.s. i live in P.R.China. please make sure i can send money to you.

anybody would like to help me ?



Now this takes the prize of most off topic post of the year.


Does this mean you are not going to send him your credit card number.


Hell, for someone that ballsy, I'll register the domain name for free ...

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



Re: [PHP] What software do you use for writing PHP?

2005-12-07 Thread Mark Charette

TECO rox!

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



Re: [PHP] Re: Email Validation built-in? RFC

2005-10-24 Thread Mark Charette

Ben Litton wrote:

You could certainly write an extension to do so. That's what I did 
(mostly  I was writing one for another purpose and added a function I 
stole from  O'Reilly.


As you stated in your article, it isn't rfc822 compliant (it isn't even 
close). Richard was pretty specific in  his needs.


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



Re: [PHP] PHP vs. ColdFusion

2005-07-01 Thread Mark Charette

Stéphane Bruno wrote:


Once you get to do very advanced things, you need
to code using Object Oriented approaches, modular programming, web
services, etc. which both products allow you to do.
 

I guess those non-linear crash codes I wrote in Fortran not so many 
years ago aren't very advanced ...


:)

It is always funny to read that one needs OO approches to do anything 
useful. What one needs is a modular approach, re-factoring, and knowing 
how and why to make tradeoffs when writing code. In any programming 
language.


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



Re: [PHP] Re: Reducing size of htm output

2005-05-07 Thread Mark Charette
M. Sokolewicz wrote:
 Rory Browne wrote:

 What might be more useful is stripping out comments, If you don't use
 javascript it is simply a case of replacing all !-- anything -- with
 a blank space. If you do though it's more complicated since it is
 considered good practice to place js inside !-- .. //-- blocks,


 excuse me? since when is this considered /good/ practice???
 It's one of those things that are concidered /bad/ practice according 
to  w3...

Interesting. On a page titled W3C Recommendations I must be 
misinterpreting the W3C's examples of hiding scripts from browsers ...

http://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.3.2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP vs ASP .NET

2005-04-23 Thread Mark Charette
Reynier Perez Mira wrote:
Hi list:
I have a problem with ASP .NET community in my Universty and I need to solve it. The thing is that they say me that ASP .NET is better than PHP, so I need information to response they about this theme. Can you put me some sites, statics, intrview to big personalities, articles to response ?
Rather than get into an open ended discussion/argument, perhaps it would 
be best to ask the community why ASP.NET is better? Perhaps for the 
usage they envision is _is_ better, perhaps not.

I have found over the past 32 years that passionate 
discussions/arguments over what language is better than another to be 
less than constructive anyway. Better to just do your work and let it 
speak for itself.

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


Re: [PHP] WORK WITH PHP FILES REMOTELY WITH NotePad ? YES/NO ?

2005-03-19 Thread Mark Charette
Leonidas Savvides wrote:
 ATTENTION: I DO NOT MEAN
SAVE IT TO MY HDD FIRST AND AFTER UPLOAD IT !!! TELL ME THIS SAMELY FOR
Dreamweaver MX ?
Not in PHP. It's a client side trick (done with machine and/or OS 
specific code). Even Web-based Documentum (eRooms) uses a staging 
directory on the users HDD before invoking the correct program. Works 
well with custom COM objects on the PC side integrated with MSIE, barely 
and very error-prone with any other browser.

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


Re: [PHP] cache engine

2005-03-05 Thread Mark Charette
Evert - Rooftop Solutions wrote:
I heard that shared memory is actually slower than writing and reading a 
file and it is not available on windows systems.
Hmmm ... that's an interesting thing you heard concerning shared memory. 
Care to share _who_ told you that?

I'd like to make sure I don't hire him/her in the future.
Mark C.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] cache engine

2005-03-05 Thread Mark Charette
Evert - Rooftop Solutions wrote:
Check it out, is in old article, but it says |shm| -- The |shm| 
container stores the cached data in the shared memory. Benchmarks 
indicate that the current implementation of this container is much 
slower than the |file| container.
Which, of course, is miles away from saying that shared memory is slower 
than the file system.

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


Re: [PHP] Apache 2.0.52 / PHP 4.3.10 Integration Question...

2004-12-31 Thread Mark Charette
Robin Getz wrote:
Andrew Kreps wrote:
I had to add this line to my httpd.conf:
AddType application/x-httpd-php .php

I have this and the DirectoryIndex - the problem is that my script does 
not end in a .php extention. (GForge )

If I rename the file projects.php and point to that, it works, but that 
means an entire re-write of the existing GForge.

I guess the question is - how to make a file that does not end in .php 
or have any extension, be understood as a php file?

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


Re: [PHP] Apache 2.0.52 / PHP 4.3.10 Integration Question...

2004-12-31 Thread Mark Charette
John Holmes wrote:
Robin Getz wrote:
I have a file named /www/projects which is a php script.
When I type the url: www.site/projects/variable
I want variable passed to the script projects
I have the the http.conf set up as:
Files projects
  SetInputFilter  PHP
  SetOutputFilter PHP
  AcceptPathInfo  On
/Files
Which used to work with apache 2.0.40 and php 4.2.3 - but what happens 
now, is I actually get passed the php script back as text to the browser.

All of the methods I've seen in the past used a Forcetype directive 
and PATH_INFO.

Files projects
 ForceType application/x-httpd-php
/Files
Is this SetInputFilter and SetOutputFilter the Apache2 equivilent of the 
Forcetype or another way of doing it? Have you tried Forcetype?
I looked it up before posting ...
According to the 2.0.xx online docs, ForceType should work just fine:
http://httpd.apache.org/docs-2.0/mod/core.html#forcetype
Mark C.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Simple math failing - PHP Bug?

2004-11-01 Thread Mark Charette
From: Chris Shiflett [EMAIL PROTECTED]
To: Jason Wong [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, November 01, 2004 12:22 AM
Subject: Re: [PHP] Simple math failing - PHP Bug?

--- Jason Wong [EMAIL PROTECTED] wrote:
Most computer languages handling floating point calculations
just as poorly. If accuracy is important use the BCMath
functions.
Or use Fortran and double precision. :-)
Wouldn't help. Exact same problem.
The root cause it trying to express the number range of 0.0-1.0 in a finite 
set of bits. The more bits you use, the smaller the gaps between the numbers 
exactly represented, but there are always an infinite number of numbers in 
every gap.

It works well enough as an approximation to be useful; the Fortran 
programmers use format clauses just like any other programmer to force 
rounding to a known precision.

Mark C., who's worked on all the Fortrans up to 95. 

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


Re: [PHP] Tempnam not working??

2004-10-17 Thread Mark Charette
- Original Message - 
From: Brent Clements [EMAIL PROTECTED]

When I run the following
$fname = tempnam('mytmp/', 'PREFIX_');
and then echo $fname, it returns
/tmp/FILENAME rather than mytmp/FILENAME
--
From the manual:
Creates a file with a unique filename in the specified directory. If the 
directory does not exist, tempnam() may generate a file in the system's 
temporary directory, and return the name of that

The chances are that mytmp in the directory the script is runjning in either 
doesn't exist or is not writable by the process running on the server. 

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


RE: [PHP] Is Function Constants the Correct Term?

2004-07-18 Thread Mark Charette
The specific statements:

From http://us2.php.net/manual/en/language.constants.php

'Once a constant is defined, it can never be changed or undefined.'
'Only scalar data (boolean, integer, float and string) can be contained in
constants.'
'Constants may not be redefined or undefined once they have been set'
'Constants may only evaluate to scalar values'

Unambiguous.

To paraphrase the comments from the old ANSI C group, Any violation of the
rules may cause missles to fly from your nose.

Mark C.

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



RE: [PHP] Re: Query Query

2004-05-30 Thread Mark Charette
 From: Khan [mailto:[EMAIL PROTECTED]
 you have 'company_name' in SET and then again in WHERE. This looks fishy.

Very common, often required, and perfectly legal.

Mark C.

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



RE: [PHP] PHP5 bloats the code

2004-04-24 Thread Mark Charette

 From: Marek Kilimajer [mailto:[EMAIL PROTECTED]

 Well, what I always know about my variables is if they are arrays or
 scalar ;) And I don't consider warning to be much nicer then error

Hmmm ... my current methods and functions in PHP 4.x oftentimes adapt to the
type passed to them since PHP doesn't have method signatures, meaning I
_don't_ know a priori what will be passed to them. Currently type checking
is mandatory if you want to avail yourself of a single method name.

Mark C.

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



Re: [PHP] Threading PHP

2004-01-26 Thread Mark Charette
On Sun, 25 Jan 2004, Galen wrote:

 I'm not 100% sure what you're talking about, to be honest. I think I'm 
 in the second half of the people... :)
 
 As far as I can tell, Apache runs as many processes (httpd) as needed 
 on my local machine. As far as my server, I haven't seen this behavior, 
 but I admit I don't sit there watching top all the time unless 
 something is broken, and even then, I usually can't fix whatever is 
 broken. I don't have root or other special access to the server - it's 
 a shared machine, pretty lightly loaded most of the time. I do have SSH 
 access.

Processor affinity isn't nearly as complex as threading; it means to set
up a system whereby certain processes run on a particular processor set;
e.g., all httpd processes run on CPU set 1, all image processing tasks run
on CPU set 2.  That way CPU set 1 can continue servicing httpd requests
without being bogged down by the CPU intensive tasks running on CPU set 2.

If pset is available as a command on your multiple CPU machine then you 
can probably set up processor affinity.

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



RE: [PHP] what PHP really needs

2004-01-24 Thread Mark Charette

 -Original Message-
 From: Hamid Hossain [mailto:[EMAIL PROTECTED]
 As a ColdFusion Certified Developer I can say: You are right!

 In CF you can fire a sql statment and store its result in a
 variable which
 is not going to be removed from the server's memory after
 responding to the
 user. That variable will be available for sometime declared by
 you when you
 created the query.

Perhaps you weren't aware that every modern database does the same thing (or
can if you turn it on): the results of query sets are cached at the db
server and are available if the same query is used without involving a file
read. If any update changes any of the underlying result sets then the
corresponding cache entry is invalidated and the momeory released for
another cache entry.

Let the db server handle query/cache consistency ... why put yet another
server in the way that will have to be triggered by the underlying db to
clear ITS cache?

Mark C,

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



RE: [PHP] what PHP really needs

2004-01-24 Thread Mark Charette
On Sat, 24 Jan 2004, Marlon Moyer wrote:

 Like Hamid Said, if the ColdFusion server has the query already in memory.
 It doesn't need to send traffic to another server to get the information
 again.  Most systems I've worked on have the db and the web server on
 different areas of a firewall, so you're going through a lot of excess steps
 if you're hitting the db every time for something that won't change.

You missed the point. If you have to connect to a server anyway, whjat's 
the difference between going to a cached queryset on a CF server or going 
to a cached queryset on a db server? It's a wire transaction in any case.
 
 Plus, you have a granular control on what is being cached.  The sql server
 will only cache what it has room for.  So if enough queries are run against
 it, the original query won't be cached anymore regardless.

And this won;t happen on the CF server when you run out of memory to cache
a transaction? Yeah, right.

Does CF have to query the db server to stay in sync? Of course it does. 
Now there's multiple transactions to coordinate  synchronize.
 
 But I think the original question was about a tree that took a long time to
 create, and application variables would be a plus in this situation.

That remains to be seen. Getting the data in an optimal way can be a 
non-trivial operation.
 
-- 
Half the people know what they're talking about, and the 
other half are writing code.

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



Re: [PHP] Can we make .exe programs with php?

2004-01-24 Thread Mark Charette
On Sat, 24 Jan 2004, pehepe php wrote:

 Can we make .exe programs with php? for example we can do it with delphi, 
 vbasic.but can we do with php?

No (and .exe is a convention that isn't universal, btw). PHP is an
interpreted language, not a compiled one.

-- 
Half the people know what they're talking about, and the 
other half are writing code.

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



Re: [PHP] Threading PHP

2004-01-24 Thread Mark Charette

On Sat, 24 Jan 2004, Galen wrote:

 Hi,
 
 This may be completely crazy, but let me tell you what I want to do: 
 thread PHP.

Can you set processor affinity on your system? If so, you can pseudo 
thread by assigning processes to different CPUs; e.g., run your main 
Webserver on one processor and a slave Web server or helper processes 
assigned to the other processor. This is a very common way of dividing 
tasks on multi-processor systems where code-rewrites to make things 
thread-safe are not cost effective.
 -- 
Half the people know what they're talking about, and the 
other half are writing code.

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



RE: [PHP] what PHP really needs

2004-01-24 Thread Mark Charette
f stock, etc.

 [Marlon Moyer]
 This isn't a situation that you would use a cached query. You
 would only use
 it when something doesn't change that often, or you have control
 of when it
 changes.

Hell, I have stuff like that - it's called generate an include file with a
cron job. Trivial. All my web pages include it. The variables are all set by
an outside process.

Re CF server  Web server. It's on the wire (using sockets). You're going
up  down the stacks just as if you're using a wire except for the last 2
levels (ip  above stacks are used).

And only the smallest shops would consider having a web server and CF (or
db) server on the same box. No scalability or easy recovery from failure.
Heck, I run a tiny little ISP out of my basement, and have all major
services segregated onto different machinery with 1000baseT private net
between the different boxes (db  search services, DNS resolvers, web
servers, mail server, and backup array).

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



RE: [PHP] Re: Ver 5.0 Questions ...

2004-01-14 Thread Mark Charette
If you read through the archives you'll find it isn't so much that PHP is
the problem per se, but many of the PHP modules. If you use the
multi-threading model of Apache 2 (the raison d'etre for using Apache 2 for
most people) then all the modules have to be thread-safe, and that's a
non-trivial matter for many of the module authors and maintainers. If you
use the pre-fork model of Apache 2 then you essentially have the regular
version of Apache.

 Don't expect it to be solved next few days.. There are some wierd
 problems I
 think... Kinda like you don't really know what could cause them or
 something...

 --
 // DvDmanDT
 MSN: dvdmandt¤hotmail.com
 Mail: dvdmandt¤telia.com
 Thomas Svenson [EMAIL PROTECTED] skrev i meddelandet
 news:[EMAIL PROTECTED]
  Hi Chris,
 
  Chris TenHarmsel wrote:
   Well, we're interested in stability.  I figured since php4 had
   been out for a while in stable form, it would be more stable
   than php5.  Is this the case, or is there a good feeling that
   php5 will be considered stable in the next couple months?
 
  I've been playing around with PHP5 since before beta 2 and haven't
 stumbled
  on any problems so far when coding using the new features
 (mainly the new
  oop model).
 
  However, I tried running a few PHP applications but they simply did not
 work
  properly in PHP5. It's not a big problem for me since I'm going to build
 my
  new project from scratch and have decided that, even if it
 isn't released
  yet, I'm going for PHP5 due to the new features in it.
 
  One thing that does disturb me a bit though is that very little is to be
  found about if the recommendation not to use Apache2 with PHP4
 still seems
  to apply for PHP5 as well. It's a bit  confusing since Apache2
 been stable
  for a long time. I am expecting that the issues not recommending it for
 PHP4
  will be solved for PHP5.
 
  /Thomas

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



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



RE: [PHP] PHP Session Variables Not Being Set For Certain Browsers

2003-12-27 Thread Mark Charette
 -Original Message-
 From: Andy Higgins [mailto:[EMAIL PROTECTED]
 Can anyone confirm whether
 AOL (or any
 other ISPs for that matter) change a user's IP address as seen by the web
 server (for eample through a proxy) within the same session?

It's been pointed out and confirmed many, many times here. An IP is not
useful for authentication in the general case (you may have a specific case
on an intranet, but major players like AOL put everything through load
balancing proxies that change from request to request).

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



Re: [PHP] strpos() act funny when searching for ]]....

2003-11-21 Thread Mark Charette
On Fri, 21 Nov 2003, Scott Fletcher wrote:

 Well, I seem to have problem understanding the word, 'offset' to the
 strpos() function because it is a bad choice of word

strpos() and the word offset used with it is probably older than you ...  
:)

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



Re: [PHP] null character - file related function

2003-10-06 Thread Mark Charette
On Mon, 6 Oct 2003, Martin Straka wrote:

 Is somewhere documented that everything after NULL (0x00 %00) character
 is ignored for example in functions include, fopen etc?

Interestingly, no, it's not documented in the manual (at least I couldn't
find any official documentation on NULL terminated strings as a definition
when I searched through the official docs). However, strings in PHP follow
the C convention of being NULL terminated.

Mark C.

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



Re: [PHP] null character - file related function

2003-10-06 Thread Mark Charette
On 6 Oct 2003, Robert Cummings wrote:

 Strings in PHP are binary safe and thus do not rely on null temrination.

You are, of course, right (just a brainfart on my part ...).

There are a number of functions that depend on null termination of 
strings; handing a string with embedded nulls in it to those functions may 
result in interesting things happening 

Mark C.

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



RE: [PHP] Too Advanced? Re: Cookies Hidden Image

2003-09-05 Thread Mark Charette
 From: Nicole [mailto:[EMAIL PROTECTED]

 Thanks. The cookie sets fine using the redirect. The problem is accessing
 the cookie when the script is called via the image tag. If the script is
 called directly, the cookie is accessible.

Images have their own connection (which is why you can see a page before an
image is downloaded, and why pages resize if width  height are not set on
the image). Cookie values via images are not passed to parent, though
judicious use of javascript _may_ be able to retrieve the value - I've not
seen it done, but it _might_ be possible, though I doubt it.

It's not a PHP thing, it's an HTML protocol thing ...

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



RE: [PHP] Help with Apache

2003-07-26 Thread Mark Charette
 -Original Message-
 From: Corey Edwards @ Dreamstar Computer Software

 I finally set up an Apache Web Server. I didn't realize you needed that to
 run php until now.

That's only true if you need to serve Web pages; php runs fine from the
command line ...




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



RE: [PHP] I'm really getting annoyed with PHP

2003-07-23 Thread Mark Charette

 From: Beauford.2005 [mailto:[EMAIL PROTECTED]

 It's obvious though that PHP can not handle it.

Since thousands of people and websites use the header() function without
your problems ...

It's obvious at this point you've got a bug and can't figure out how to fix
it, even though you've been given more than enough clues. Not a PHP problem.

Enough with the whiny Subject: already.



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



Re: [PHP] Re: Red Hat 9, Apache 2, and PHP

2003-07-03 Thread Mark Charette
Apache 2.x.x IS a production quality server, just not with PHP. Works great
with Tomcat, mod_jk2, Struts, etc.

- Original Message - 
From: Shena Delian O'Brien [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 03, 2003 8:04 PM
Subject: Re: [PHP] Re: Red Hat 9, Apache 2, and PHP


 Does anyone know why Red Hat would switch to Apache 2.x.x when it is
 well known that 2.x.x is NOT a production version?

 Brad Pauly wrote:
  Just thought I would share my experience with RH9. I have been running
  Apache 1.3.27 and PHP 4.3.2 on RH9 for a couple weeks (since 4.3.2 came
  out anyway, and 4.3.1 prior to that) on a test server. All are compiled
  from source. The only problem I have had was a bug with the version of
  mogrify that is bundled with RH9. That was fixed by 'upgrading' to an
  older version. Other than that it has been fine.
 
  Brad
 
 
 
 


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





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



RE: [PHP] How do I replace browser history using Header()?

2003-06-14 Thread Mark Charette


 -Original Message-
 From: Neil Freeman [mailto:[EMAIL PROTECTED]
 Is there any way that I can do a PHP Header() statement that does the 
 equivalent of JavaScript's 
 window.self.location.replace(http://www.mysite.com/mypage.php;)?

No. JavaScript (if turned on) is your only choice.


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



RE: [PHP] $_SERVER[REMOTE_ADDR]

2003-04-02 Thread Mark Charette
 -Original Message-
 From: thomas [mailto:[EMAIL PROTECTED]

 $_SERVER[REMOTE_ADDR]

 If the user have a proxy the real IP is:
 $_SERVER[HTTP_X_FORWARDED_FOR]

Maybe. If it's set and is set correctly. Even then:

How are 127.0.0.1 or 192.168.1.1 going to help you, supposing that those
values or other address are returned?

Mark C.



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



RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Mark Charette
Check the manual:

switch($foo)
{
case fee:
case fie:
...
break;
case fo:
...
case fum:
...
break;
}

fee  fie are tied together, fie will also run the code presented by fum ...

Even more flexible than comma delimited values ...

 -Original Message-
 From: CF High [mailto:[EMAIL PROTECTED]
 Sent: Sunday, March 02, 2003 9:41 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Switch Statement || Case with multiple values?


 Hey all.

 In Cold Fusion I was able to do the following:

 CFSWITCH expression = #action#

 CFCASE value = getUpdate,getDelete
 Do Stuff
 /CFCASE

 /CFSWITCH



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



RE: [PHP] Switch Statement || Case with multiple values?

2003-03-02 Thread Mark Charette
Duh. make that
fo will also run the code presented by fum ...

 -Original Message-
 From: Mark Charette [mailto:[EMAIL PROTECTED]
 
 switch($foo)
 {
   case fee:
   case fie:
   ...
   break;
   case fo:
   ...
   case fum:
   ...
   break;
 }
 
 fee  fie are tied together, fie will also run the code presented 
 by fum ...
 
 Even more flexible than comma delimited values ...


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



Re: [PHP] mysql query manipulation vs php results manipulation

2003-02-19 Thread Mark Charette

On Wed, 19 Feb 2003, Larry Brown wrote:

 How do you determine whether or not it is faster/more efficient to run a
 complicated query or to run multiple simple queries and join / manipulate
 the results with PHP?

By empirical methods ...


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




RE: [PHP] URGENT HELP NEEDED - After Upgrade to MySQL 4.0.1.2

2003-02-13 Thread Mark Charette
 -Original Message-
  If it worked before then obviously the path is fine,
 unless something has changed.

Obviously something changed if it worked on 2 other servers. Check all your
logs.


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




RE: [PHP] Re: Associative vs normal arrays

2003-02-02 Thread Mark Charette
All arrays in PHP are associative; we sometimes use integers to refer to
them, but the order of the array internally is not necessarily the same as
the integers; indeed, any array can have holes in them. So the question is
moot.

There are no different indexed and associative array types in PHP, there is
only one array type, which can both contain integer and string indices. -
http://www.php.net/manual/en/language.types.array.php

Mark C.

  Is there a way to determine if an array is associative or not?  Maybe =
  something similar to the is_array() function ??



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




RE: [PHP] Using MySQL user variables in PHP

2003-01-26 Thread Mark Charette

 -Original Message-
 From: Jason Wong [mailto:[EMAIL PROTECTED]]

  2.  $tempQuery1 = 
  SELECT @most_recent:=MAX(date) from presenters;
  $tempQuery2 = 
  SELECT @recent_presenter:=presenter FROM presenters WHERE
  date=@most_recent;
  $presenterQuery = 
  SELECT date_format(p.date, '%d/%m/%y') AS
 readable_date, p.theme,
  p.presenter,
  c.itemNo, c.composer, c.composition, c.note
  FROM presenters p, compositions c
  WHERE p.date = c.date AND p.presenter = @recent_presenter
  ORDER BY p.date DESC;

 You're not doing anything with $tempQuery1  $tempQuery2 this is complete
 nonsense ;-)

Not true - this is using MySQL's variable approach. The '@' represents a
user variable per connection in MySQL. See
http://www.mysql.com/doc/en/Variables.html for more information.

mark C.


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




RE: [PHP] Re: Masive mail Advice

2003-01-26 Thread Mark Charette
 -Original Message-
 From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
 That number of messages is small and with today's servers you can queue
 that volume of personalized is less than a minute. Your problems will
 start as you enter in the tens of thousands of recipients, not because
 qmail won't handle it but because that many message in the queue will
 prevent the incoming messages to arrive in time.

???

There are two separate processes here - the outgoing connections to the
remote SMTP servers and the incoming connections to your own SMTP servers.
Tuning qmail involves setting the number of outgoing queues so as not to
overload your communications line.

I _personally_ have sent more than 300,000 messages with no resting
mechanism - doing that means you haven't tuned your qmail system for the
load.

Mark C.



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




RE: [PHP] Re: Masive mail Advice

2003-01-26 Thread Mark Charette


 -Original Message-
 From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
 On 01/26/2003 08:22 PM, Mark Charette wrote:
 -Original Message-
 From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
 That number of messages is small and with today's servers you can queue
 that volume of personalized is less than a minute. Your problems will
 start as you enter in the tens of thousands of recipients, not because
 qmail won't handle it but because that many message in the queue will
 prevent the incoming messages to arrive in time.
  ???
 
  There are two separate processes here - the outgoing connections to the
  remote SMTP servers and the incoming connections to your own
 SMTP servers.
  Tuning qmail involves setting the number of outgoing queues so as not to
  overload your communications line.
 
  I _personally_ have sent more than 300,000 messages with no resting
  mechanism - doing that means you haven't tuned your qmail system for the
  load.

 The problem does not have to do with SMTP but with qmail local queue
 handling. If you send messages to many users and the bounce address is
 set to some address handled by the same server, you will be starting to
 get bounces to the same machine and thus the same qmail server. The way
 to solve this is to put the bounce address point to some address that is
 handled by a different server or even to nowhere. Using a spare server
 for the actual delivery reduces that problem too.

It has everything to do with qmail local queue handling.

I have had no problems when both the VERP address and sending machine are
the same, providing I tune the qmail queues to a reasonable number. VERP is
very useful to handle bounces, no separate machines are required, you just
have to think about your bandwidth.

The way to solve this is use your intelligence. A stop/start sceme as you
originally proposed is a kludge at best to an easily managable problem.

Mark C.





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




RE: [PHP] GD jpg thumbnail - ugly discollored

2003-01-25 Thread Mark Charette
make sure you use:

ImageCreateTrueColor()

to create the thumbnail image and

ImageCopyResampled()

when you copy the image.

Mark C.

 -Original Message-
 From: Victor [mailto:[EMAIL PROTECTED]]
 I have a script that takes uploaded images (jpeg only) and makes
 proportionate thumbnails etc, and saves them in jpeg (.jpg) format again
 (default compression of %75 I think) anyway, the thumbnails are UGLY.
 

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




RE: [PHP] Masive mail Advice

2003-01-25 Thread Mark Charette
It is incredibly easy to write a short little php script that edits a
template and submits it directly to qmail-inject; if you're using qmail
already php mail()/sendmail is just a wrapper to qmail-inject. I use
qmail-inject directly because it allows me to write my own VERP and process
bounces against the database.

A little Pentium 200 running Linux, MySQL, php4, and qmail with 100 queues
can more than saturate a T1 line when used for mailing that way! 800
messages isn't close to being massive - that many can be sent in way less
than a minute (depending on size, of course - a T1 isn't that big anymore
...).

 -Original Message-
 From: Maciek Ruckgaber Bielecki [mailto:[EMAIL PROTECTED]]
 I'll start to write an application which will be used to send large
 amounts of mail to users in a DB. All these mails to be sent shoul be
 personalized. Since i understand, and please correct me if im wrong, the
 mail() function is not a good option for this purpose. (the amount of mail
 to be sent may vary from 50 to 800 messages).


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




RE: [PHP] sending array

2003-01-15 Thread Mark Charette
You know, if you actually looked at the link you've created you'd find your
answer ...

 -Original Message-
 From: D.M. van Gladbach [mailto:[EMAIL PROTECTED]]

 There not much in there because I strip it for testing.

 test1.php
 ?
 $org[index-A]=1701;
 $org[index-B]=1209;

 print a href=\test2.php?org=.$org.\test2/aBR\n;
 ?

 test2.php
 ?
 while (list ($key, $val) = each($org))
  {
  print key=.$key.val.$val.br\n;
  }
 ?




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




RE: [PHP] mysql_num_rows() error

2003-01-09 Thread Mark Charette
And which database are you using?? (hint - mysql_select_db() might be a good
idea ...)

 -Original Message-
 From: Phil Powell [mailto:[EMAIL PROTECTED]]
  Anyone know why this is happening? I have mySQL on Win2000
 Server with IIS
  and PHP:



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




RE: [PHP] Perl PHP

2003-01-05 Thread Mark Charette
The first line of the script had the magic incantation:

#!/usr/local/bin/perl

(or something very similar) which makes the leading 'perl' superfluous.

PHP scripts can be made into self executing scripts in a similar fashion
if the 1st line looks like:

#!/path/to/the/php/command/line/executable

This only applies to Unix and the executable bit must be set.

Mark C.

 -Original Message-
 From: Jurre Thiel [mailto:[EMAIL PROTECTED]]
 Sorry, i didn't think of that. I still think exec('perl
 perl.pl'); does the
 job, not exec('perl.pl');



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




RE: [PHP] Sessions and AOL

2003-01-03 Thread Mark Charette
 From: Gerard Samuel [mailto:[EMAIL PROTECTED]
 
 I was wondering, if for example, an AOL user browses your site that uses 
 php sessions,
 do the session ids change when they hop ip addresses?

No. Sessions are not (or should not be!) tied to IP numbers.

 Im looking for a better way to counteract AOL's ip jumping.

Why? It's not just AOL!

Mark C.

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




Re: [PHP] case statement?

2002-12-19 Thread Mark Charette

On Thu, 19 Dec 2002, Max Clark wrote:

 Hi-
 
 I was wondering if php had a case function?
 
 Instead of building a large if/elseif/else block I would like to do a case
 $page in (list).

The documentation and search capabilities at http://www.php.net are your 
frientd. It would behhove you to at least read the basic language 
statemants.

mark C.


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




RE: [PHP] About Speech

2002-11-30 Thread Mark Charette
 -Original Message-
 From: Ing. Raúl González Rodríguez [mailto:[EMAIL PROTECTED]]

 I need to know if it's possible generate a wav, mid or mp3 file
 from php.

You could write a custom interface to _generate_ the file (MIDI is _very_
different than the other two types; are you sure you understand exactly what
you intend to do?), but where is the input coming from to begin with? The
currently available tools to make audio files are already pretty
sophisticated, and trying to replicate them in PHP would probably not be the
best use of your time.

Sending the files doesn't require any changes to anything. Just create an
ANCHOR link to the file and it'll be sent on its merry way when the user
clicks on the link.

Mark C.


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




RE: [PHP] Ip address as 32bit int?

2002-11-22 Thread Mark Charette
 From: Noodle Snacks [mailto:[EMAIL PROTECTED]]

 the reason I ask is because it is alot more efficient space wise
 in a db to
 be storing a 32bit number rather that a char or varchar field.

While it is more efficient space-wise (4 bytes vs. 12 bytes), the price of
the additional disk storage needed for storing them is trivial (unless you
have a billions). Make sure you consider the addtional costs of maintenance,
too, when you store data in a non-human format.


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




Re: [PHP] Unlink

2002-11-20 Thread Mark Charette
On Wed, 20 Nov 2002, JohnMeyer wrote:

 Does unlink work with wildcards e.g unlink(somefile*.*);

No.

unlink() is a thin veneer on the system unlink() call.

Wildcard expansion like you have it is done by a shell glob function. You
would need to replicate what the shell does - use it as a regular
expression in an opendir()/readdir()/delete file on regexp
match/closedir() set of operations.

Or, preferably, look up the glob() function in PHP and use the return 
values in an unlink() call. Much better than spawning a shell process  
;^)

--
... but while you're marching in the rain, doesn't the *bell* on the sax
fill with water? - jerry
Yes, Jerry ... the bell would fill with water. (un)Fortunately, this does
not affect the way a sax sounds. - Fred (postings on the Clarinet BBoard)


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




RE: [PHP] Fractions

2002-11-16 Thread Mark Charette
You gotta be kidding me, no? When did you learn decimals? I think I started
by 3rd or 4th grade ...
  -Original Message-
  From: Stephen [mailto:[EMAIL PROTECTED]]
  Sent: Saturday, November 16, 2002 1:36 PM
  To: PHP List
  Subject: [PHP] Fractions


  I'm wanting to make a simple PHP script that converts Celsius to
Farenheit, Farenheit to Celsius, Farenheit to Kelvin, and Celsius to Kelvin.
I have the formula but it requires fractions. How can I use frations in PHP
to multiply or divide? If you can't, how could I substitute doing so? 5/9
(F - 32) is the forumla to get Celsius to Farenheit if you need it.

  Thanks,
  Stephen Craton
  http://www.melchior.us

  Life is a gift from God. Wasting it is like destroying a gift you got
from the person you love most. -- http://www.melchior.us



RE: [PHP] Fractions

2002-11-16 Thread Mark Charette
Well, seeing as you're in the 7th or 8th grade (at least according to your
Website) - my sincere apologies ...

Just use 5.0/9.0 in your formula.

Mark C.
  -Original Message-
  From: Stephen [mailto:[EMAIL PROTECTED]]
  Sent: Saturday, November 16, 2002 1:36 PM
  To: PHP List
  Subject: [PHP] Fractions


  I'm wanting to make a simple PHP script that converts Celsius to
Farenheit, Farenheit to Celsius, Farenheit to Kelvin, and Celsius to Kelvin.
I have the formula but it requires fractions. How can I use frations in PHP
to multiply or divide? If you can't, how could I substitute doing so? 5/9
(F - 32) is the forumla to get Celsius to Farenheit if you need it.

  Thanks,
  Stephen Craton
  http://www.melchior.us

  Life is a gift from God. Wasting it is like destroying a gift you got
from the person you love most. -- http://www.melchior.us



RE: [PHP] Wildcard search

2002-11-08 Thread Mark Charette
 -Original Message-
 From: Mako Shark [mailto:phpman2000;yahoo.com]
 do I have to do a
 readdir() and read the filename of every file until I find an
 HTML or until all files have been read.

This is what the shell expression supplied by Marco Tabini actually does;
doing it in PHP (readdir(), etc.) eliminates the exec of the shell process
and is faster (readdir() is a thin veneer on the readdir system call) and
the problem of portability if you want to use this on both Unix and Windows.


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




RE: [PHP] Re: XSLT Sablotron output

2002-11-03 Thread Mark Charette
There's nothing to solve; without the complete XML doc  the XSL
stylesheet, there's no way to know if in fact everything is being parsed as
expected. I don't know if it's CDATA, xsl:text, a strip-spaces directive,
etc. And ... I'd expect anyone using XML  XSL to double check and
re-reference all their books before posting a problem (Sablotron is pretty
well tested; I don't think it's the problem ...)

Then, after exhausting my brain and building the smallest possible set of
code that reproduces my problem ...

I'd submit it to a XML list.

Of couse, the sample script to me looks perfectly valid, since HTML isn't
required to have newlines and of course newlines within text blocks aren't
preserved anyway ...

Mark C.
-Original Message-
From: Daniele Baroncelli [mailto:ubimmc93;libero.it]
Sent: Sunday, November 03, 2002 2:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: XSLT Sablotron output


No one replied yet, so I suppose no one was able to solve this.

By the way, is there anyone that actually experienced the same situation?

Daniele Baroncelli [EMAIL PROTECTED] wrote in message
news:20021102212518.34728.qmail;pb1.pair.com...
 Hi guys,

 I have typed a simple script to test the Sablotron module recently
 installed.
 I found out that the HTML is output all in one line, without newlines,
which
 is very annoying.
 Anyone can tell me if this is a bug of the module, or I have to specify
 something somewhere?

 Here is the script on the server, where you can watch the result:
 http://www.rockit.it/redazione/sixth/prova.php

 Below you can find my PHP, XML and XSL files.


 Cheers

 Daniele


 ==

 PHP file
 --


 ?php

 // Allocate a new XSLT processor
 $xh = xslt_create();

 // call the XSLT processor directly
 xslt_process($xh, 'prova.xml', 'prova.xsl', 'prova.html');

 // output the result
 readfile('prova.html');

 xslt_free($xh);

 ?

 ==

 XML file
 ---

 ?xml version=1.0?
 me
  nameJohn Doe/name
  address94, Main Street, Nowheresville 16463, XY/address
  tel738 2838/tel
  email[EMAIL PROTECTED]/email
  urlhttp://www.unknown_and_unsung.com//url
 /me

 ===

 XSL file
 -

 ?xml version=1.0?

 xsl:stylesheet version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;

 xsl:template match=/

  html
  head
  /head
  body
  h1Contact information for bxsl:value-of select=me/name //b/h1

  h2Mailing address:/h2
  xsl:value-of select=me/address /

  h2Phone:/h2
  xsl:value-of select=me/tel /

  h2Email address:/h2
  xsl:value-of select=me/email /

  h2Web site URL:/h2
  xsl:value-of select=me/url /

  /body
  /html

 /xsl:template

 /xsl:stylesheet

 ==





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



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




RE: [PHP] Re: File Random Access

2002-10-30 Thread Mark Charette
-Original Message-
From: David Robley [mailto:robleyd;paradise.net.nz]
I'm going to stick my neck out here - as I understand it, this is not an
omission in php, rather it is a restriction of the underlying OS/file
system. Extends neck more To the best of my knowledge, neither the FAT
based system of M$DOS or e2fs under *nix will allow random access _to the
contents of a specific file_ without the need to read/rewrite the
entire file. Is there in fact any file system that allows this?

All of the file systems I have ever worked with over the last 25 years allow
random read/writes (via calls similar to fseek() ); however, random writes
involve fixed-length blocks if you want to re-write in place. PHPs fseek()
will allow you to do random read/writes on fixed length blocks just like the
underlying C call.

Variable length blocks (say, those ending in random new lines) are by
definition non-deterministic; therefore re-writes in place are impossible
without OS help in inter-block jumps/relinks and the subsequent waste of
file space. The Pick O/S from a long time back allowed something like this
if I remember right (Pick Systems is now RainingData markets a high-end
database)  .

Mark C.


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




RE: [PHP] MySQL and images

2002-10-29 Thread Mark Charette
There are times, especially in highly dynamic situations, where backing up
and restoring of images and metadata from a database or for security
reasons, where storing the images within a database makes real sense.
Separating the physical storage areas for the two types of data (metadata 
images) and keeping the image data from being buffered into the database
server's memory space can make storage within the database almost as
efficient as file storage.

Mark C.

Mark C.

-Original Message-
From: Rick Emery [mailto:remery;emeryloftus.com]

In order to speed-up queries, it is suggested that you DO NOT store images
in the
database.  Rather, store the images in files and store file names in the
database.
- Original Message -
From: John Meyer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, October 29, 2002 9:32 PM
Subject: [PHP] MySQL and images


Assuming that I have to for some unknown reason, are there any articles on
storing images in the database and retrieving them?


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




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



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




RE: [PHP] How many is too many?

2002-10-25 Thread Mark Charette
I'm storing somewhere over 100,000 separate articles on my site, using
ht://dig to index them. They're organized as //MM/nn. No performance
problems to speak of on a pretty popular non-commercial site (2-3
pageviews/sec, 24x7) whether they just browse through the directories or or
use ht://dig to retrieve the text.

-Original Message-
From: Monty [mailto:monty3;hotmail.com]
Sent: Friday, October 25, 2002 12:40 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How many is too many?


This is a more general server question: I know that having a large number of
files in one folder can slow down a web server, but, how many would it take
for this to be a problem? Wondering if I should store all articles for a
content site in one big 'articles' folder with each article having it's own
folder within (/articles/article_id/), or if I should organize them by year
then article name (/articles/2002/article_id). The site will only produce a
few hundred articles a year. I'd like the keep the file structure shallow
and simple if possible, but, if it could potentially slow the server down by
putting so many folder in one I'll split them up more.

Thanks!


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



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




RE: [PHP] Predefined variables not set?

2002-10-13 Thread Mark Charette

In this context it makes no difference whether or not  or ' is used (
allows variable substitution within the quoted string, ' does not) since
there's no substitution taking place.

Insert a phpinfo() in the top of your code to see all the variables that
_are_ being set.

-Original Message-
From: Oscar F [mailto:[EMAIL PROTECTED]]

I'm pretty sure it's not $_SERVER[QUERY_STRING], it's
$_SERVER['QUERY_STRING'] (note the ' instead of ).

HTH.

  Oscar F.-

Miles wrote:

 When trying to get $_SERVER[QUERY_STRING] I am getting 'Undefined index
QUERY_STRING' error

 If there is a query string, e.g.  www.site.com/index.php?hello_world then
it IS defined.  So it seems that PHP is complaining about undefined
variables, rather than just outputting nothing.

 How can I fix this?  I've had no problems until i reinstalled php today...


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




RE: [PHP] getting ip address of the user.

2002-09-24 Thread Mark Charette

This comes up so very often ...

The answer is - you may be able to get _an_ IP number for a machine that
accesssed your site. It is meaningless as a means of identification:

Proxies use 1 IP for a number of users.

-Original Message-
From: Anil Garg [mailto:[EMAIL PROTECTED]]

hi,

Can i get the ip-address of the machines who accessed my website??
Plz give the pointer that on what lines shall i start for doing so.


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




RE: [PHP] Mail problem with more than 1k users

2002-09-23 Thread Mark Charette

I've had no problems using qmail-inject and MySQL to send over 100K emails
in a day. I doubt it's an MySQL problem unless you've done something
drastically wrong; perhaps you're bandwidth limited?

-Original Message-
From: Research and Development [mailto:[EMAIL PROTECTED]]

Hello. I wrote a PHP script that will pull records from a database
(emails) and then mail something to the emails in the result set.
Pretty simple and it worked.

Now that the database has over 1 thousand records I began to experience
performance problems. I figured that my problem was that Sendmail does
not process emails that have more than x number of emails.

So I re-designed the script to send emails in parts. 500 emails per
header. But after the database reached more than 3,000 records the
emailing did not work at all. Sendmail refused to send to any of the
emails in the database result set.

Any thoughts?


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



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




RE: [PHP] Encryption Question

2002-09-23 Thread Mark Charette

Just how are you going to decrypt it? Password encryption is ordinarily
one-way - you have no choice. You have to compare encrypted passwords.

-Original Message-
From: Tom Ray [mailto:[EMAIL PROTECTED]]
SI want to compare a password to a encrypted password stored in my mySQL
database using password('password'), what's the best way to compare the two?

Encrypted the password sent by the user and compare or pull the password
from the database based on username, decrypt it and then compare?


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




RE: [PHP] return the amount of records in a mysql databace

2002-09-22 Thread Mark Charette

select count(*) as n from ... where ...

-Original Message-
From: Philip J. Newman [mailto:[EMAIL PROTECTED]]

Can someone point me in the right direction to find out how i can return the
amount of records in a mysql databace ?


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




RE: [PHP] Re: Image resolution and php

2002-09-18 Thread Mark Charette

Images don't have a resolution per se; display devices have a resolution.
Images (the formats you're talking about, anyway) are measured in pixel
width and height. The height and width in any units other than pixels of
course necessitates conversion - for an easy example, a 300x300 image on a
1200x1200dpi printer will be exactly one quarter the size of the same image
printed on a 300x300 dpi printer.

-Original Message-
From: Jome [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 18, 2002 8:11 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Image resolution and php


 I need to get resolution information (dpi) from any
 image of jpg, gif or png formats.

 It would be sufficient to obtain pixel and inches
 dimension of such images and calculate resolution by
 simply dividing but I haven't found any function that
 gets effective dimensions in inches.

http://www.php.net/manual/en/function.getimagesize.php

I'm sligthly confused about what you're looking for, but the above URL
*could* be something.

Jome



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



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




RE: [PHP] REGISTER_SHUTDOWN_FUNCTION() BUG -- Please Fix.

2002-09-17 Thread Mark Charette

Hey, Jason, since you really need this BUG fixed, and the PHP developers
would welcome good, well-documented, and tested code ...

Why not devote some of your precious time to helping them along? If _you_
write, document, and test the code, and then pass the code to the
development team you'll stand a much better chance of getting it included in
a future version - along with solving your current problem _and_ getting
your name in the list of contributors.

Mark C.
-Original Message-
From: John Holmes [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 17, 2002 8:12 AM
To: 'Jason Caldwell'; [EMAIL PROTECTED]
Subject: RE: [PHP] REGISTER_SHUTDOWN_FUNCTION() BUG -- Please Fix.


I'm not sure if that's a bug, it's more of a feature request.

---John Holmes...

 -Original Message-
 From: Jason Caldwell [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, September 17, 2002 3:24 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] REGISTER_SHUTDOWN_FUNCTION() BUG -- Please Fix.

 I'm posting this here to give this BUG attention.  It's a pretty
serious
 one
 for Win32 users, and it would be great if it could be fixed *very
 quickly* -- I posted this in the Bug Reports on PHP.net on May 27th,
2002.

 Here's the link: http://bugs.php.net/bug.php?id=17461

 I need to use this function to perform certain *required* tasks on a
 Timeout -- however (and please read the Bug Report, before replying)
the
 Timeout functionality of this function DOES NOT work on Win32 builds.

 If your a C/C++ / PHP contributor and have a moment to look into this
--
 it
 would be great -- I would love to see this fixed in release 4.2.4 !!!

 Thanks
 Jason



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



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



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




RE: [PHP] why do i get this error please tell me?

2002-08-31 Thread Mark Charette

Ahem. Why not check out the MySQL docs for reserved words (they _are_ right
there ...):

http://www.mysql.com/doc/en/Reserved_words.html

PHP Docs are for PHP. MySQL Docs are for MySQL. PHP != MySQL.

-Original Message-
From: victor [mailto:[EMAIL PROTECTED]]
Sent: Saturday, August 31, 2002 1:35 PM
To: 'Chris Knipe'; [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: [PHP] why do i get this error please tell me?


Yep, figured it just now, thanks anyway, ahhh.. You'd thing they put
reserved names right besides the damn mysql command in the manual. Alas
it shall not be so.


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




RE: [PHP] RE: [PHP-DB] RE: [PHP] why do i get this error please tell me?

2002-08-31 Thread Mark Charette

Then check the MySQL manual using the URL I posted!

PHP doesn't care about the hundred or so reserved MySQL words. MySQL does.
Perhaps you're confusing the two. Please check what I said:

PHP != MySQL

The documentation for each is separate. PHP has convenience functions for
talking to a MySQL database. It does not parse or check your SQL statements
for correctness - it just passes them along and lets the MySQL library do
its work. PHP does this for a great number of products: cURL, GD functions,
various ODBC interfaces, etc. It's up to you to read the support docs for
those products to use them fully. The docs for PHP don't need to be
cluttered with deep and detailed explanations of every supported interface,
not would I expect them to.

-Original Message-
From: victor [mailto:[EMAIL PROTECTED]]

I meant besides the UPDATE or SELECT or any filed that those words might
interfere with...

- Victor  www.argilent.com

-Original Message-
From: Mark Charette [mailto:[EMAIL PROTECTED]]

hem. Why not check out the MySQL docs for reserved words (they _are_
right
there ...):

http://www.mysql.com/doc/en/Reserved_words.html

PHP Docs are for PHP. MySQL Docs are for MySQL. PHP != MySQL.

-Original Message-
From: victor [mailto:[EMAIL PROTECTED]]
Sent: Saturday, August 31, 2002 1:35 PM
To: 'Chris Knipe'; [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: [PHP] why do i get this error please tell me?


Yep, figured it just now, thanks anyway, ahhh.. You'd thing they put
reserved names right besides the damn mysql command in the manual. Alas
it shall not be so.


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




RE: [PHP] UPDATE Query

2002-08-31 Thread Mark Charette

No, only one db at a time may be updated. The where clauses can contain
multiple db.

-Original Message-
From: Sascha Braun [mailto:[EMAIL PROTECTED]]
Sent: Saturday, August 31, 2002 7:04 PM
To: PHP Mailingliste
Subject: [PHP] UPDATE Query


I want to know if its possible to update two databases with one query?

Please look at this example:

UPDATE news_db, newsreferenz_db SET news_db.head = 'DFB Pokalasfasf',
news_db.text = 'alkfhaslk fl akshf lakshf lkahs lfk aslf yxvyxvyxvyxv',
newsreferenz_db.kat_id = '3' WHERE news_db.id = '6' AND
newsreferenz_db.news_id = '6'

it doesn't work.


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




RE: [PHP] Save ability... Duplicate DB entries

2002-08-10 Thread Mark Charette

Or, of course, a selection of fields as a unique key. The insert will fail
if there is an exisiting record with that key; you can interrogate the error
and report on the exisitence of a duplicate record.

The select/lock method is used for update purposes ('select for update' et
al.), not to keep duplicate records out of the DB.


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




RE: [PHP] RTRIM() - Won't accept 2nd Param

2002-07-27 Thread Mark Charette

From the man page:

Note: The second parameter was added in PHP 4.1.0 

-Original Message-
From: Monty [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 27, 2002 7:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP] RTRIM() - Won't accept 2nd Param


When I issue this command to remove any commas at end of string:

$query = rtrim($query, ,);

PHP give me an error saying Wrong parameter count for rtrim(). How can
this be? The online manual shows rtrim can accept two parameters. Shouldn't
this work? I have PHP 4.0.6 installed on the server.


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




RE: [PHP]Erik Hegreberg (Moderator)

2002-07-10 Thread Mark Charette

Of course not on an open list that's crossed to the newsgroups ...

However, there's a deny list on ezmlm that the moderator can add addresses
to. As a manager of a number of ezmlm mailing lists I've done that - which
really infuriates the spammers - they still get the posts until they
unsubscribe (or ask me to help them) but they can't post in the meantime.

There are times, especially when someone's changed email addresses but has
forwarding, or whose mail system doesn't believe that any email address
should be longer than (some number of characters), when it is difficult or
impossible for someone to unsubscribe. In that case the list owner gets
involved.

  Isn't every e-mail address
 verified anywayz before it goes to the mailing list?



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




RE: [PHP] Problem with SQL query

2002-07-07 Thread Mark Charette

LIMIT was not included in the SQL92 SQL standards and very few vendors
implement all of SQL99; the use of ANSI standards to promote portable
programs has always been beset by this kind of problems.

Mark Charette
Former ANSI X3H3.1 member

-Original Message-
From: Alberto Serra [mailto:[EMAIL PROTECTED]]
SELECT
extract('year', time),
extract('month', time)
count(*) as monthly_views
FROM
visitors
group by
   extract('year', time),
   extract('month', time)
order by
   monthly_view desc
limit 1


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




RE: [PHP] HTTPS vs. HTTP ?

2002-07-07 Thread Mark Charette

Or, even easier and no tech, I get a low-paying job in some convenience
store, and make copies of the credit card receipts.

Game Over.

Using a credit card anywhere involves trust. Period. End of story.

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]]

How about an even *easier* scenario:

I find a web-site that is storing the credit-card numbers in their database,
and rip them off.

Game Over.


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




RE: [PHP] Javascript to PHP?

2002-06-29 Thread Mark Charette

Or setting a cookie in JavaScript. It will be transmitted on the next page
request.

-Original Message-
From: John Holmes [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 29, 2002 3:30 PM
To: 'Jed Verity'; [EMAIL PROTECTED]
Subject: RE: [PHP] Javascript to PHP?


Not possible. You must refresh the page to send something back to PHP.
Only workaround is using a hidden frame or layer and refreshing that...



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




RE: [PHP] output_buffering

2002-06-23 Thread Mark Charette

What exactly are you measuring and how?

-Original Message-
From: James Drabb [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 23, 2002 9:09 AM
To: php-general
Subject: [PHP] output_buffering


I was running some speed tests on a page that returns 1000 records from
a db and spits them into a table.  I have output_buffering Off in my
php.ini file because of the statement below:

; Output buffering allows you to send header lines (including cookies) even
; after you send body content, at the price of slowing PHP's output layer a
; bit.  You can enable output buffering during runtime by calling the output
; buffering functions.  You can also enable output buffering for all files
by
; setting this directive to On.  If you wish to limit the size of the buffer
; to a certain size - you can use a maximum number of bytes instead of 'On',
as
; a value for this directive (ex., output_buffering=4096).
output_buffering = Off

However the page takes 7 seconds to load with output_buffering = Off
and 1 second with output_buffering = On!  What is up with that?  Have most
of you found output buffering faster?


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




RE: [PHP] is there a function like javascript's window.open in PHP

2002-06-23 Thread Mark Charette

This is a common question, related to the lack of understanding of
client/server architectures I believe.

PHP is all server side - a browser is all client side.

Servers can send data only to the browser, nothing else. The server can
inquire and gather data from text files and databases, but it will format
the data into a particular protocol (HTTP most often) and send it to the
browser. The data may even include lines of text from a language that the
browser understands, like JavaScript. Or it might be XML data and the
corresponding XSLT instructions. But ... it can't affect the browser
directly. Only the embedded instructions that the browser understands can
actually affect anything on the browser.

The browser looks at the stream of data provided by the server and decides
on-the-fly what to do with it. If it sees JavaScript instructions, it may
decide to interpret them and do some particular action. Or it may decide
that it doesn't want to play with JavaScript today and just ignore them. It
may see the XML/XSLT and decide to do something - but it doesn't have to.
This, of couse, is the bane of Web programmers everywhere. What does the
browser understand, and what does it do with the data.

PHP allows us to write programs eaisy on the server to make some decisions
on what to send a browser, but it cannot act directly on the browser. We
must depend (somehow) on the browser interpreting what we tell it and then
acting in a particular way.

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 23, 2002 12:17 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] is there a function like javascript's window.open in
PHP


On Sunday 23 June 2002 07:21, Burak Delice wrote:
 hi,

 I wonder that is there a PHP function like window.open() into Javascript?

No.

--
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
One thought driven home is better than three left on base.
*/


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



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




RE: [PHP] Speed comparison of PHP vs. PERL (not conclusive)

2002-06-01 Thread Mark Charette

From: Jason Wong [mailto:[EMAIL PROTECTED]]
Try comparing reading 10K rows from a DB using Perl and PHP would be a more
useful benchmark.
---
When's the last time you wrote a Web page that needed 10K rows displayed?

Writing good _and relevant_ benchmarks is one of the more difficult things
to do in CS. Personally, I look at the time it takes me to code and debug
things since that's the most expensive part of the cost equation to my
customers - hardware's cheap compared to me. I can get something of
production quality up and running on PHP much faster than I can in Perl -
probably due to 20 years of programming in C - so my customers are happy.
Considering that 95% of the time the bottleneck is the bandwidth, not the
application code, and the other 5% of the bottleneck is in the database
application section, my customers don't demand any artificial language
benchmarks.

Mark C.



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




RE: [PHP] Sessions Without Cookies or SID Passing...

2002-05-14 Thread Mark Charette

If it ain't foolproof then only a fool would use it ...

IP addresses are just about the worst way to identify anyone.

-Original Message-
From: Martin Towell [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 8:17 PM
To: 'Rasmus Lerdorf'; Matthew Walker
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Sessions Without Cookies or SID Passing...


You're missing one method - using the user's IP address
It's not a guaranteed fool-proof method, but if you don't want to use
cookies or the URL, then this sorta works.



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




RE: [PHP] Re: Is This Possible? (Database - PHP)

2002-05-13 Thread Mark Charette

Or read the man page on mysql_pconnect/mysql_connect ?

-Original Message-
From: Jochem [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 9:25 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Is This Possible? (Database - PHP)


Why don't you install Mysql on your local machine and do your testing ?

Jochem
R [EMAIL PROTECTED] schreef in bericht
000501c1fa4c$8fca8fc0$0a6da8c0@lgwezec83s94bn">news:000501c1fa4c$8fca8fc0$0a6da8c0@lgwezec83s94bn...
 Hey there guys,
 I have a slight problem which i could not solve via Java servlets and now
 that I am migrating to PHP I was wondering if its possible...

 I am hosting with a company that has given me a database (MySql) I am
using
 the database for all my apps which are only being accessed via my
 servlets... I want to change that and convert all my servlets to PHP.
 Being new to PHP i am sure to make a lot of mistakes and instead of
 uploading my PHP page, getting errors/ redoing it, uploading etc I was
kinda
 hoping i could connect to the remote database via my local machine?
 I already have PHP installed on my machine. on the remote host the
 details are

 Localhost
 jimmy*** (Username)
 gunsand* (Password)
 umace_com (Database name)

 Is this possible?
 Any help and comments appreciated.
 Cheers,
 -Ryan

 /* Whats the difference between the pope and your boss? The pope only
wants
 you to kiss his ring! */





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




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




RE: [PHP] setcookie()

2002-05-11 Thread Mark Charette

You've just pointed out that you're a clueless newbie, that's' all, and
can't read a spec worth a whit.

-Original Message-
From: jtjohnston [mailto:[EMAIL PROTECTED]]
Sent: Saturday, May 11, 2002 4:50 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] setcookie()


Rasmus
server-side / client-side, that's not the point.

My point is PHP can, could and should be able to set a cookie after HTML is
set.
But of course, Jan has already closed the issue, as usual.
http://bugs.php.net/bug.php?id=17158




 PHP is a server-side language and as such it deals with server-side
 issues.  If you want to write javascript that sets a client-side
 Javascript cookie, go ahead.  It has nothing to do with PHP and PHP will
 certainly not get in your way.

 -Rasmus

 On Sat, 11 May 2002, jtjohnston wrote:

  This is a bug Feature/Change Request I made to:
  http://bugs.php.net/bug.php?id=17158
 
  setcookie() states cookies must be sent before any other headers
  are sent (this is a restriction of cookies, not PHP).
 
  I argue this is a restriction of PHP, not cookies.
 
  Here is my proof:
 
  http://www.collegeSherbrooke.qc.ca/languesmodernes/cookie.htm
 
  I can do this any time in body :
 
  script
 setCookie(TestCookie,first time,expdate);
 var DisplayData = getCookie(TestCookie);
 document.write(DisplayData);
 setCookie(TestCookie,second time,expdate);
 var DisplayData = getCookie(TestCookie);
 document.write(DisplayData);
   /script
 
  I want to be able to setcookie() anytime I want, before and after I
  declare any HTML.
  This will never get changed, unless we ask for it.
 
  I would appreciate your vote of support at:
 
  http://bugs.php.net/bug.php?id=17158
 
  before the bug people close this thread.
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 

--
John Taylor-Johnston

-

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   - Université de Sherbrooke:
  http://compcanlit.ca/
  819-569-2064



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




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




RE: [PHP] phpLISTMAN

2002-04-21 Thread Mark Charette


 From: Randum Ian [mailto:[EMAIL PROTECTED]]


 Control Panel
 -Add User
 -Delete User
 -Validate Email
 -Send Mail (HTML/Text)
 -Archive Mail

 HTML Generator
 -Subscription Box
 -Unsubscribe Box
 -Statistics

Let's see. Double opt-in with cryptographic/time security, automatic bounce
message processing, programmable and scalable message handling, automated
relay centers for very large lists, both digest  regular versions, deny
processing, multiple posting addresses, management functions available via
email processining, moderation, etc. ...

In other words, you might want to look through all the man pages and code
for something like ezmlm and figure out if you want to duplicate all that
work. Mailing lists are non-trivial pieces of code, and one little mistake
can affect thousands of people (and your bandwidth).

Mark C.



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




RE: [PHP] phpLISTMAN

2002-04-21 Thread Mark Charette

Just about all of them can have/do have simple HTML interfaces that can send
data to them. I built one for ezmlm in about 20 minutes ... and then found a
number of them already available.

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


 On Sun, 21 Apr 2002 20:52:17 +0100, you wrote:

 Is that a nice way of saying that I am wasting my time in doing such a
 project? I just get frustrated at not having a Mailing List
 Manager that I
 can use to manage large lists of users.
 
 Is it more bother than it is worth?

 Probably is.

 What would be useful is a set of PHP programmatical interfaces to
 other list managers (eg, Mailman), let them do what they do well, and
 have PHP talk to them to add/subscribe/etc.  It's a real pity that
 they don't have XML-RPC interface (that I know of).





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




RE: [PHP] Better standards in PHP-coding

2002-04-20 Thread Mark Charette

Hehehe. And I thought the OTBSW (One True Brace Style Wars) had passed into
memory back some 10 or 15 years ago! Lo! They resurface yet again! 30 years
in this business and still I hear them argue.

Perhaps a cb style program for PHP so people can write any blasted style
they feel like and then have another programmer transform it into _their_
OTB style.

_My_ coding standards may not be _your_ coding standards, but mechanical
transformations can pretty much make it all moot.

Mark C.

 -Original Message-
 From: Frank [mailto:[EMAIL PROTECTED]]

 The nice thing about standards is that there are so many to
 choose between.

 Subject: Uses of block markers in coding

 GNU recommends a standard with block-markers aligned under each
 other and a
 number of people - including myself - find it senseless and
 counter-progressive to keep up an older standard resting from old
 days and
 doing the programmer a disfavor.
 



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




RE: [PHP] Convert

2002-04-18 Thread Mark Charette


 How to convert string in windows-1250 to asci, I need convert special
 national characters
 to standard english characters.

Discard all characters with a value over 127 (high bit set). ASCII is only
defined for 7 bit encoding.

Mark Charette



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




RE: [PHP] IMAGING WITH PHP

2002-04-13 Thread Mark Charette

Since you get width  height the ratio is trivial.

mark C.

 -Original Message-
 From: Vins [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, April 13, 2002 3:02 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] IMAGING WITH PHP
 
 
 There is nothing in there about image ratios
 but let me double check again.
 maybe it was my error and if so... forgive me I'm from South Africa
 LOL
 
 
 Jason Wong [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]...
  On Sunday 14 April 2002 02:08, Vins wrote:
   How would I find out the image size ratio so that I could resize and
 image
   without the image pixelating ?
 
  Manual  Image functions
 
  --
  Jason Wong - Gremlins Associates - www.gremlins.com.hk
  Open Source Software Systems Integrators
  * Web Design  Hosting * Internet  Intranet Applications Development *
 
  /*
  QOTD:
  If you're looking for trouble, I can offer you a wide selection.
  */
 
 


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




Re: [PHP] Re: Only one value.

2002-01-27 Thread Mark Charette

From: Michael Kimsal [EMAIL PROTECTED]

 Philip J. Newman wrote:

  Don't know is this is a Mysql problem or PHP, but I have a table with
100 records in it.  One of the field names is $iName.
 
  When listing all the records I want only the 1st Uneak value to be
displayed.
 
  For excample
 
  if values where, Bob, Jan, Mike, James, Bob, James, James, Mike ...
 
  I would like to call: Bob, Jan, Mike, James ... Any Idenas
 


 I suspect you mean the mysql field name is 'iName', not '$iname' ($iName
 being the PHP variable name).

 try

 select distinct(iName) from tablename

 and loop through those result sets.

Almost right. DISTINCT is not a SQL function:

select distinct iName from tablename

would be the correct syntax.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: [PHP-DEV] Re: strtok bug

2002-01-13 Thread Mark Charette

 -Original Message-
 From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
 Before somebody decides to repress my opinion again,

Hah! That's got to be one of the funniest things I've ever read!

Downloads do not imply usage, only curiosity. I've downloaded a large number
of PHP class libraries from different places. The only one I've ever used is
a CC validation one ...

mark C.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: PEAR vs PHPLIB

2001-12-28 Thread Mark Charette



 From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
 Unlike PEAR-DB and PHPlib, Metabase provides true database independence
 to your applications.

Actually - no. Querys/conformance to specs/sequences/stored procs and more
are different from DB to DB. While the abstration layers help a little, they
really don't help a lot.

Mark C.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Mailling Lists

2001-12-26 Thread Mark Charette



 -Original Message-
 From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, December 26, 2001 11:16 PM
 To: Ben Clumeck
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] Mailling Lists


 I'm really unable to discuss the mailing-list topic because I
 have nil expertise
 in this field (apart from using them, that is). However, I'd
 strongly advise you
 to use something based on some kind of database system, because alternate
 methods of storing data (i.e. plain text files) are crippled from
 the start in
 the speed department -- and if you hope the list to grow, this
 will become a
 major issue.

Interestingly enough, the largest mailing list systems do not use databases
to store their addresses. The likely limit will be bandwidth, not anything
else.

Look into qmail/ezmlm for a good combination, along with the tied  true
majordomo list manager. I've been running some large mailing lists using the
ezmlm/qmail combo - which easily saturates a T1 connection running just a
350 MHz PII.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] printf()?

2001-12-16 Thread Mark Charette

 -Original Message-
 From: Ray Gaylog [mailto:[EMAIL PROTECTED]]
 I've been using PHP for just a little while, however I have
 noticed somthing.

 In the doc's I've noticed you can do this:
 printf(line1 \n line2 \n);

 Now..this should (like C) print two seperate lines..however It
 doesn't. To print this on seperate lines I must put a BR in there.

 Any ideas?

Yes, and not facetiously - read the HTML specs.

If you look at the PHP output, you'll see separate lines. If you read the
HTML spec, you'll find out how HTML is supposed to handle whitespace, and
you'll discover a whole lot more, too.

Mark C.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   >