|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 25 Oct 2005 02:57:30 -0000 Issue 3756
php-general-digest-help
lists.php.net
Date: Mon Oct 24 2005 - 21:57:30 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 25 Oct 2005 02:57:30 -0000 Issue 3756
Topics (messages 224548 through 224607):
Re: Php, Rails and ajax
224548 by: Phillip Oertel
224549 by: Phillip Oertel
224573 by: Paul Waring
Re: cleanly written shop-system (php5, object-oriented)?
224550 by: James Benson
224551 by: Jochem Maas
224555 by: Phillip Oertel
224588 by: James Benson
Re: Output files encoding
224552 by: Richard Lynch
Re: Problem reading SimpleXML array
224553 by: Richard Lynch
224582 by: Jochem Maas
Re: Ugh, w32 anything is making me want to drink!
224554 by: Jay Blanchard
224606 by: Richard Lynch
Re: Email Validation built-in? RFC
224556 by: Ben Litton
224558 by: Manuel Lemos
224602 by: Mark Charette
Re: php Slow with Mac OS X 10.4
224557 by: Nicolas Ross
224577 by: Brent Baisley
224580 by: Atelier Fabien
224584 by: Nicolas Ross
224585 by: Nicolas Ross
224591 by: Brent Baisley
224605 by: Richard Lynch
moving website from windows to linux hosting
224559 by: pedro mpa
224569 by: Ben
224578 by: Brent Baisley
Why this doesn't work ?
224560 by: Mário Gamito
224561 by: Colin Shreffler
224562 by: Mário Gamito
224563 by: Jay Blanchard
224564 by: Jim Moseby
224565 by: Scott Noyes
224566 by: Jay Blanchard
224567 by: Mário Gamito
224568 by: Phillip Oertel
224570 by: Jordan Miller
224571 by: Jim Moseby
224572 by: Phillip Oertel
224604 by: Richard Lynch
Re: Temp table doesn't seem to work
224574 by: Brian Dunning
Re: Ugh, w32 anything is making me want to drink! - SOLVED
224575 by: Jay Blanchard
PDF printing under windows.
224576 by: Dave Lists
224587 by: Dan Baker
224603 by: Richard Lynch
How to protect a php script that sends variables to itself
224579 by: Graham Anderson
224581 by: Jochem Maas
224586 by: Graham Anderson
224600 by: Richard Lynch
224601 by: Richard Lynch
Re: Abstract Classes?
224583 by: Jochem Maas
224592 by: GamblerZG
Re: Calling PostgreSQL & MySQL Stored Procedures - SOLVED
224589 by: Colin Shreffler
Help with a regular expression for 0,1 or 2 decimal places
224590 by: Shaun
224594 by: Al
224599 by: Richard Lynch
how to display GD graphic in web page
224593 by: Chris
224596 by: Jasper Bryant-Greene
224598 by: Richard Lynch
function 'another_mail' with authentication
224595 by: Etienne Finet
224597 by: Manuel Lemos
Re: JPG Slide show
224607 by: John Taylor-Johnston
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
hi,
"rails" is written in the ruby programming language. which has nothing
to do with php. ruby and php are different programming languages, that
are used on the server-side of the web. normally you decide on one of them!
ajax in contrast is a way of updating the web browser content without
reloading the currently displayed page; to acheive that, both a client
side and a server-side language are involved.
the client side will be written in javascript (using the xmlhttprequest
object), on the server-side you are free to use any language you want,
php, ruby, java, python, perl, asp, ...
if you want to use php and ajax, maybe check out phpontrax or cakephp.
they are clones of ruby on rails.
phil
---
Jacob Friis Saxberg schrieb:
> Hello again.
>
> Is it possible to use Php, Rails and ajax via some open source system?
> How do you do it?
>
> The most important for me is to use Php and ajax.
>
> Thanks,
> Jacob
attached mail follows:
hi,
"rails" is written in the ruby programming language. which has nothing
to do with php. ruby and php are different programming languages that
are used on the server-side of the web. normally you decide on one of them!
ajax in contrast is a way of updating the web browser content without
reloading the currently displayed page; to acheive that, both a client
side and a server-side language are involved.
the client side will be written in javascript (using the xmlhttprequest
object), on the server-side you are free to use any language you want,
php, ruby, java, python, perl, asp, ...
if you want to use php and ajax, maybe check out phpontrax or cakephp.
they are clones of ruby on rails.
phil
---
Jacob Friis Saxberg schrieb:
> Hello again.
>
> Is it possible to use Php, Rails and ajax via some open source system?
> How do you do it?
>
> The most important for me is to use Php and ajax.
>
> Thanks,
> Jacob
attached mail follows:
On Mon, Oct 24, 2005 at 03:34:23PM +0200, Jacob Friis Saxberg wrote:
> Is it possible to use Php, Rails and ajax via some open source system?
> How do you do it?
I don't know what exactly you mean by "rails", as it seems to be a
buzzword for half a dozen different things at the moment. However, I did
come across this site in one of the RSS feeds that I subscribe to:
http://www.phpontrax.com
PHPonTrax claims to be "a web-application and persistance framework that
is based on Ruby on Rails", though having not used it myself I can't
speak for how accurate that claim is.
Paul
--
Rogue Tory
http://www.roguetory.org.uk
attached mail follows:
PHP5 has yet to see the maturity and stability PHP4 offers which is why
most applications use it.
Worst thing you can do is design a website in entirely flash :)
Phillip Oertel wrote:
> hi,
>
> i want to create a "shop server" application. the shop client interface
> will be in flash (communication with php over xml, soap or amfphp), the
> administration interface will be html. most likely it will probably be a
> long-running application that will be extended in several steps, so we
> need a solid foundation. we also need to get started quickly (who
> doesn't), otherwise i would consider starting from scratch.
>
> i have already looked around quite a lot for a nicely adaptable
> shop/ecommerce implementation, but haven't been very successful so far.
> everything i found was conceived in php4 times, where OO wasn't as
> wide-spread in the php community as it is today. some of the packages
> are poorly documented (both in-code and separate documentation), have an
> inconsistent coding style, are dead, are copies of oscommerce with a
> worse interface, ...
>
> feature-wise the best i found was xtcommerce (oscommerce fork)
> admin interface wise: zencart (oscommerce fork)
> code-wise: randshop
> non of them use php5's features, though, none are written object-oriented.
>
> i have no info on the performance of these shops, although that
> shouldn't be a prob as long as it's not desastrous (to some extend, you
> can always scale hardware-wise).
>
> so i am looking for a cleanly layered application where i could swap out
> the presentation layer. and all important shop data (products, product
> categories, cart, etc.) should be represented as objects, so i could
> extend them to implement required customizations.
> it would be a big plus if the admin interface was well thought-out.
>
> we need quite some features like multiple languages, multiple
> categories, discounts on certain products, payment provider integration,
> customer newsletters, possibly administration of several slightly
> different shops in one installation, etc.
>
> is there such an application or am i stuck with oscommerce and its forks?
> i don't need it to be feature complete, as long as there is a way to
> adapt the code without hacking the whole thing (and loosing the
> possibility of upgrading).
>
> as long as the code was open, i would be happy to pay a certain amount
> for the application.
>
> anyone?
>
> phil
attached mail follows:
James Benson wrote:
> PHP5 has yet to see the maturity and stability PHP4 offers which is why
> most applications use it.
>
> Worst thing you can do is design a website in entirely flash :)
no the worst thing you can do is spread FUD.
which you have just done, unless you are capable of backing up your off the cuff
remarks (about the stability of php5) with hard imperical data, which I doubt.
actually 'the worst thing you can do' is more likely to be something like
'invading a sovereign state in order to be able to subsidise your own oil-addicted,
brainwashed, selfrighteous society' than something that's anything to do with
php or the web. but then again maybe not ;-)
>
>
>
>
>
>
> Phillip Oertel wrote:
>
>> hi,
>>
>> i want to create a "shop server" application. the shop client interface
>> will be in flash (communication with php over xml, soap or amfphp), the
>> administration interface will be html. most likely it will probably be a
>> long-running application that will be extended in several steps, so we
>> need a solid foundation. we also need to get started quickly (who
>> doesn't), otherwise i would consider starting from scratch.
>>
>> i have already looked around quite a lot for a nicely adaptable
>> shop/ecommerce implementation, but haven't been very successful so far.
>> everything i found was conceived in php4 times, where OO wasn't as
>> wide-spread in the php community as it is today. some of the packages
>> are poorly documented (both in-code and separate documentation), have an
>> inconsistent coding style, are dead, are copies of oscommerce with a
>> worse interface, ...
>>
>> feature-wise the best i found was xtcommerce (oscommerce fork)
>> admin interface wise: zencart (oscommerce fork)
>> code-wise: randshop
>> non of them use php5's features, though, none are written
>> object-oriented.
>>
>> i have no info on the performance of these shops, although that
>> shouldn't be a prob as long as it's not desastrous (to some extend, you
>> can always scale hardware-wise).
>>
>> so i am looking for a cleanly layered application where i could swap out
>> the presentation layer. and all important shop data (products, product
>> categories, cart, etc.) should be represented as objects, so i could
>> extend them to implement required customizations.
>> it would be a big plus if the admin interface was well thought-out.
>>
>> we need quite some features like multiple languages, multiple
>> categories, discounts on certain products, payment provider integration,
>> customer newsletters, possibly administration of several slightly
>> different shops in one installation, etc.
>>
>> is there such an application or am i stuck with oscommerce and its forks?
>> i don't need it to be feature complete, as long as there is a way to
>> adapt the code without hacking the whole thing (and loosing the
>> possibility of upgrading).
>>
>> as long as the code was open, i would be happy to pay a certain amount
>> for the application.
>>
>> anyone?
>>
>> phil
>
>
attached mail follows:
hello james,
1) i have been working with php5 for almost a year now, and the biggest
project i have yet worked on (a complex intranet banking application) is
running perfectly on it; no problems. on the contrary, since the zend
engine has been rewritten to properly handle objects (as references not
copies), a huge source of confusion/errors/odd behaviour has been
removed. we have not had one "stability" or "scaling" problem with php5.
(what i *would* worry about is having to develop oo-software in php4.)
2) "Worst thing you can do is design a website in entirely flash" ->
depends on the kind of site. you certainly wouldn't do a news site 100%
flash, but for certain *application* is can make perfect sense. what we
will do is build a product configuratorin flash, not the whole site.
regards,
phillip
---
running perfectly clean James Benson schrieb:
> PHP5 has yet to see the maturity and stability PHP4 offers which is why
> most applications use it.
>
> Worst thing you can do is design a website in entirely flash :)
>
>
>
>
>
>
> Phillip Oertel wrote:
>
>> hi,
>>
>> i want to create a "shop server" application. the shop client interface
>> will be in flash (communication with php over xml, soap or amfphp), the
>> administration interface will be html. most likely it will probably be a
>> long-running application that will be extended in several steps, so we
>> need a solid foundation. we also need to get started quickly (who
>> doesn't), otherwise i would consider starting from scratch.
>>
>> i have already looked around quite a lot for a nicely adaptable
>> shop/ecommerce implementation, but haven't been very successful so far.
>> everything i found was conceived in php4 times, where OO wasn't as
>> wide-spread in the php community as it is today. some of the packages
>> are poorly documented (both in-code and separate documentation), have an
>> inconsistent coding style, are dead, are copies of oscommerce with a
>> worse interface, ...
>>
>> feature-wise the best i found was xtcommerce (oscommerce fork)
>> admin interface wise: zencart (oscommerce fork)
>> code-wise: randshop
>> non of them use php5's features, though, none are written
>> object-oriented.
>>
>> i have no info on the performance of these shops, although that
>> shouldn't be a prob as long as it's not desastrous (to some extend, you
>> can always scale hardware-wise).
>>
>> so i am looking for a cleanly layered application where i could swap out
>> the presentation layer. and all important shop data (products, product
>> categories, cart, etc.) should be represented as objects, so i could
>> extend them to implement required customizations.
>> it would be a big plus if the admin interface was well thought-out.
>>
>> we need quite some features like multiple languages, multiple
>> categories, discounts on certain products, payment provider integration,
>> customer newsletters, possibly administration of several slightly
>> different shops in one installation, etc.
>>
>> is there such an application or am i stuck with oscommerce and its forks?
>> i don't need it to be feature complete, as long as there is a way to
>> adapt the code without hacking the whole thing (and loosing the
>> possibility of upgrading).
>>
>> as long as the code was open, i would be happy to pay a certain amount
>> for the application.
>>
>> anyone?
>>
>> phil
attached mail follows:
Bad choice of words.
I was comparing PHP4 to PHP5 and how long PHP4 has been around compared
to PHP5, it's bound to be more stable aint it?
I was not trying to say PHP5 is not stable because im sure it is very
much so.
Or am I not allowed to say anything like that in this forum?
Ill just silently exit through the back door then :)
Jochem Maas wrote:
> James Benson wrote:
>
>> PHP5 has yet to see the maturity and stability PHP4 offers which is
>> why most applications use it.
>>
>> Worst thing you can do is design a website in entirely flash :)
>
>
> no the worst thing you can do is spread FUD.
> which you have just done, unless you are capable of backing up your off
> the cuff
> remarks (about the stability of php5) with hard imperical data, which I
> doubt.
>
> actually 'the worst thing you can do' is more likely to be something like
> 'invading a sovereign state in order to be able to subsidise your own
> oil-addicted,
> brainwashed, selfrighteous society' than something that's anything to do
> with
> php or the web. but then again maybe not ;-)
>
>>
>>
>>
>>
>>
>>
>> Phillip Oertel wrote:
>>
>>> hi,
>>>
>>> i want to create a "shop server" application. the shop client interface
>>> will be in flash (communication with php over xml, soap or amfphp), the
>>> administration interface will be html. most likely it will probably be a
>>> long-running application that will be extended in several steps, so we
>>> need a solid foundation. we also need to get started quickly (who
>>> doesn't), otherwise i would consider starting from scratch.
>>>
>>> i have already looked around quite a lot for a nicely adaptable
>>> shop/ecommerce implementation, but haven't been very successful so far.
>>> everything i found was conceived in php4 times, where OO wasn't as
>>> wide-spread in the php community as it is today. some of the packages
>>> are poorly documented (both in-code and separate documentation), have an
>>> inconsistent coding style, are dead, are copies of oscommerce with a
>>> worse interface, ...
>>>
>>> feature-wise the best i found was xtcommerce (oscommerce fork)
>>> admin interface wise: zencart (oscommerce fork)
>>> code-wise: randshop
>>> non of them use php5's features, though, none are written
>>> object-oriented.
>>>
>>> i have no info on the performance of these shops, although that
>>> shouldn't be a prob as long as it's not desastrous (to some extend, you
>>> can always scale hardware-wise).
>>>
>>> so i am looking for a cleanly layered application where i could swap out
>>> the presentation layer. and all important shop data (products, product
>>> categories, cart, etc.) should be represented as objects, so i could
>>> extend them to implement required customizations.
>>> it would be a big plus if the admin interface was well thought-out.
>>>
>>> we need quite some features like multiple languages, multiple
>>> categories, discounts on certain products, payment provider integration,
>>> customer newsletters, possibly administration of several slightly
>>> different shops in one installation, etc.
>>>
>>> is there such an application or am i stuck with oscommerce and its
>>> forks?
>>> i don't need it to be feature complete, as long as there is a way to
>>> adapt the code without hacking the whole thing (and loosing the
>>> possibility of upgrading).
>>>
>>> as long as the code was open, i would be happy to pay a certain amount
>>> for the application.
>>>
>>> anyone?
>>>
>>> phil
>>
>>
>>
attached mail follows:
On Mon, October 24, 2005 9:16 am, Yannick Warnier wrote:
> Le lundi 24 octobre 2005 à 14:37 +0100, Yannick Warnier a écrit :
>> Hi guys,
>>
>> For a reason that I don't really understand, my PHP install outputs
>> file
>> in UTF-8 by default.
>>
>> I would like to output files in ISO-8859-1 in certain cases. How do
>> I do
>> that?
>>
>> I have tried changing default_charset to iso-8859-1 with an
>> ini_set()
>> call, but it doesn't help. I also looked at the doc for fopen() and
>> fwrite() (the functions I am using to write my file) and to the
>> mbstring
>> module, but it looks like nothing is really coded to allow me to do
>> this.
>
> For some reason now I could write a fully ISO-8859-1 file, so I can
> guess I had been missing something. If someone has an explanation or a
> document on how the files created by PHP are encoded, I would be very
> glad. Thanks.
I think we went through this already...
PHP outputs a file. Period.
There is no inherent format, much less character set, to the file.
Whatever you are using to detect the character set of this file is
basically a badly-designed piece of software that is making up an
answer out of thin air. *
The only possible distinct in file types is PHP under versions of
Windows where "binary" and "text" files are different, and this is
determined by fopen()
http://php.net/fopen
* It may be looking inside the contents of the file, and searching
through all the bytes looking for what it thinks are valid character
combinations, and then "guessing" at what character set is used inside
the file... And that may not be a totally horrible thing to do, but
it's misleading to claim that the file is of a particular character
set.
The data within the file happens to fit into a particular character
set. With a small enough file, and a limited enough sample, there are
any number of character sets that *COULD* be valid. If the file is
"empty" what character set is it?
PHP isn't doing anything different to any file to make it be any
particular character set.
You get out of it what you put into it. That's pretty much PHP's
perspective on a file.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
On Mon, October 24, 2005 3:50 am, George Pitcher wrote:
> Hi,
>
> I'm having a problem reading an xml feed. This is my object:
>
> SimpleXMLElement Object (
> [Header] => SimpleXMLElement Object (
> [ID] => FX12GB
> [Test] => false
> [Name] => Foreign Exchange United Kingdom Pound Noon Rates
> [Prepared] => 2005-10-24
> [Sender] => SimpleXMLElement Object (
> [Name] => Federal Reserve Bank of New York
> [Contact] => SimpleXMLElement Object (
> [Name] => George Matthes
> [Email] => george.matthes
ny.frb.org ) )
> [ReportingBegin] => 1994-01-06 )
> [DataSet] => SimpleXMLElement Object (
> [Series] => SimpleXMLElement Object (
> [Key] => SimpleXMLElement Object (
> [FREQ] => D
> [CURR] => GBP
> [FX_TIME] => 12
> [FX_TYPE] => S )
> [Obs] => SimpleXMLElement Object (
> [TIME_PERIOD] => 2005-10-21
> [OBS_VALUE] => 1.7692 ) ) ) )
>
> I'm trying to get those last two lines: TIME_PERIOD and OBS_VALUE.
>
> I can get the ID (third line) using $s->Header->ID (where $s is my
> object).
> $s->DataSet->Series->Obs->TIME_PERIOD; // 'Trying to get property of
> non-object'
echo "<PRE>";
var_dump($s);
echo "<hr />\n";
var_dump($s->DataSet);
echo "<hr />\n";
var_dump($s->DataSet->Series);
echo "<hr />\n";
.
.
.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
Richard,
I'm guessing you haven't played with simpleXML ...
(apologies inadvance for any/all mistakes :-)
chances are the var_dump() pointer you gave (which under
normal circumstances would be spot on) will probably
lead to more confusion. to put it lightly SimpleXML
doesn't lend itself to introspection (ATM?) because of the
very #%^$ (for the totally naive: that was masking the word 'nice')
string casting magic. at least it drove me absolutely nuts.
anyway copious and experimental use of explicit casting to
strings [i.e. using '(string)'] was the order of the day for me.
as far as I understand it the problem lies in the fact that the object
you get back has properties which behave as strings and objects which
for good measure can (all) can be iterated [foreach] like arrays.
all very simple, well ... you decide. :-)
Richard Lynch wrote:
> On Mon, October 24, 2005 3:50 am, George Pitcher wrote:
>
>>Hi,
>>
>>I'm having a problem reading an xml feed. This is my object:
>>
>>SimpleXMLElement Object (
>> [Header] => SimpleXMLElement Object (
>> [ID] => FX12GB
>> [Test] => false
>> [Name] => Foreign Exchange United Kingdom Pound Noon Rates
>> [Prepared] => 2005-10-24
>> [Sender] => SimpleXMLElement Object (
>> [Name] => Federal Reserve Bank of New York
>> [Contact] => SimpleXMLElement Object (
>> [Name] => George Matthes
>> [Email] => george.matthes
ny.frb.org ) )
>> [ReportingBegin] => 1994-01-06 )
>> [DataSet] => SimpleXMLElement Object (
>> [Series] => SimpleXMLElement Object (
>> [Key] => SimpleXMLElement Object (
>> [FREQ] => D
>> [CURR] => GBP
>> [FX_TIME] => 12
>> [FX_TYPE] => S )
>> [Obs] => SimpleXMLElement Object (
>> [TIME_PERIOD] => 2005-10-21
>> [OBS_VALUE] => 1.7692 ) ) ) )
>>
>>I'm trying to get those last two lines: TIME_PERIOD and OBS_VALUE.
>>
>>I can get the ID (third line) using $s->Header->ID (where $s is my
>>object).
>>$s->DataSet->Series->Obs->TIME_PERIOD; // 'Trying to get property of
>>non-object'
>
>
>
> echo "<PRE>";
> var_dump($s);
> echo "<hr />\n";
> var_dump($s->DataSet);
> echo "<hr />\n";
> var_dump($s->DataSet->Series);
> echo "<hr />\n";
> .
> .
> .
>
attached mail follows:
[snip]
Also, lots of other good info on this topic at:
http://www.php.net/manual/en/install.windows.php
[/snip]
ACCCCCCCCCCCKKKKKKKKKKKKKKKKKKKKK!!!!!!!!
I have tried several things, now I am at my wits end. I finally rebooted the
server (as suggested by someone one the PHP Windows list) and now all of the
php pages come up with 404 not found errors. Googling has not helped so far.
Any clues?
attached mail follows:
On Mon, October 24, 2005 11:06 am, Jay Blanchard wrote:
> [snip]
> Also, lots of other good info on this topic at:
> http://www.php.net/manual/en/install.windows.php
> [/snip]
>
> ACCCCCCCCCCCKKKKKKKKKKKKKKKKKKKKK!!!!!!!!
>
> I have tried several things, now I am at my wits end. I finally
> rebooted the
> server (as suggested by someone one the PHP Windows list) and now all
> of the
> php pages come up with 404 not found errors. Googling has not helped
> so far.
> Any clues?
This before or after you switched to Apache?...
Can you surf to a static page?
Can you surf to a static page in the same directory as the PHP page?
PHP CGI or Service/Module?
Anything in the log files?
Do all browsers say 404, or is that just the badly-broken MS IE
generalized message?
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
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. You can find the C code I used here:
http://www.oreillynet.com/pub/a/network/excerpt/spcookbook_chap03/index3.html.
It's pretty clever (If you're used to doing things the PHP/regex way) and
while I haven't benchmarked it, I'd imagine it is pretty fast.
There are lots of php extension tutorials out there, but if you want me to
wrap it for you I probably could. I'm sure though that the many php regex
solutions out there are probably 'good enough' for your needs, and I
haven't tested that C code on some of the stranger e-mail addresses out
there in existance.
Ben
On Fri, 21 Oct 2005 22:58:38 -0400, "Richard Lynch" <ceo
l-i-e.com> wrote:
> Given:
>
> It is unacceptable to reject perfectly valid email addresses, no
> matter how arcane. [Like mine. :-)]
>
> The CORRECT RegEx for validating an email is 3 pages long, and
> performance in PHP would probably not be so good...
>
> In today's Security-conscious world, data validation is a requirement.
>
> The (relatively) recent changes in domain names that allow UTF
> (Unicode?) characters.
>
> Checking MX records is not reliable at all.
>
> Forcing users to respond to email is A) burdensome to real users in
> many cases, and B) no real barrier to halfway intelligent fake users.
>
> ... would it not make sense for there to be a BUILT-IN PHP function of
> a TRUE email syntactic validation?
>
> So at least one KNOWS that the email is a valid construct, before you
> even try (if you try at all) to make sure that a person actually
> checks it at least once in their life.
>
> Currently, email syntax validation is being done in very limited
> fashion, if not outright "wrong" by rejecting what actually ARE valid
> email addresses in about 10,000,000 PHP scripts by users who don't
> have any realistic options to truly "do it right" because who can
> really live with that 3-page Regex in their PHP code?
>
> Yes, in the past, I may have come down squarely on the opposite side
> of this topic, but I've changed my mind.
>
> I believe PHP needs a built-in syntactically CORRECT email validation
> function, vetted and tested by professionals, instead of the mess we
> now have.
>
> PLEASE do not point me to any existing email validation code unless
> you believe it is not only 100% correct and complete with RFC
> definitions of syntactically valid email. Not interested. I've
> already seen them, and been burned by them.
>
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
attached mail follows:
Hello,
on 10/23/2005 07:21 PM Robin Vickery said the following:
>>> Checking MX records is not reliable at all.
>> I agree that it is less useful today, but it still help catches many
>> domain name typos.
>>
>>> ... would it not make sense for there to be a BUILT-IN PHP function of
>>> a TRUE email syntactic validation?
>> I don't see that being much better than passing a good regular
>> expression to preg_match.
>
> 1. Technically you can't write a regular expression that matches
> *all* valid email addresses as part of the address specification is
> recursive.
>
> ccontent = ctext / quoted-pair / comment
> comment = "(" *([FWS] ccontent) [FWS] ")"
>
> Admittedly 99.99% of people don't even know you *can* comment email
> addresses so it's not a huge problem...
If I am not mistaken, PCRE supports recursive regular expressions.
Anyway, the way I got the RFC that is not quite the form of an address
but the way it may be presented in message header. Meaning, you can add
comments in To: or other e-mail header but in reality the comments are
not part of the address.
> 2. Very few people seem to be capable of recognising a *good* regular
> expression, let alone writing one. It seems clear that validating an
> address is a task that many people want to do, but few can do
> properly. I'd say that's a good reason for making it a built-in
> function.
Yes. What I meant is that just copying a good enough regular expression
would be sufficient to use it. There is no need to understand it.
>> For many years I use this regular expression in popular email validation
>> and forms generation and validation classes.
>>
>>
>> Rather than accepting only valid characters, it rejects all invalid
>> characters as specified in the RFC.
>>
>> ^([-!#$%&'*+./0-9=?A-Z^_`a-z{|}~])+
([-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+\\.)+[a-zA-Z]{2,6}$
>>
>
> I'm sorry, but this regular expression rejects many perfectly valid
> ASCII characters. It seems to take into account only dot-atoms, not
> quoted-strings. It also rejects valid addresses using domain-literals.
You are right of course. What I wrote is not what I meant. I fixed the
sentence later but I did not realize that the message had already been sent.
What I meant is that despite I use that regular expression for many
years without complaints, it could be improved to reject only invalid
characters, but of course that is not what that expression does.
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
attached mail follows:
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.
attached mail follows:
Just a little follow-up to my own post.
From the latest expriments I've done with a fresh install of OS X 10.4 (with
the latest 10.4.3 beta update), it seems to point to an IO problem.
My test site uses mambo as a CMS, and I've inclued collecting of
microseconds timestamps at key points of the index file, and whenever it
includes some files it slows down. It's worse when there are several nested
includes. One other point is the mysql db connection.
I must recall to all that when called from the cli, it's ok. Only when
called from apache (1 or 2), dso or static and only on Mac OS X 10.4 (it's
ok with 10.3 and 10.2) I expericed a major slowdown. For all tests, all
config is the same, libraries and binaries where all the same on all
systems.
I've tried compiling php as cgi also, it helps a little bit, but it's still
too slow...
Thanks for any hints...
Nicolas
----- Original Message -----
From: "Nicolas Ross" <rossnick-lists
cybercat.ca>
To: <php-general
lists.php.net>
Sent: Wednesday, September 14, 2005 9:00 AM
Subject: [PHP] php Slow with Mac OS X 10.4
> Hi all !
>
> Here, we've got several Mac computer acting as servers to serve many kinds
> of sites. One of wich was running, until the middle of august, Mac OS X
> 10.2. It was then with apache 1.3.x, and php 4.3.10 dso. All things were
> "normal".
>
> At the middle of august, we upgraded to Mac OS X 10.4 (re-install from
> scratch). Now, it's with apache2, php 4.4.0 dso. Now, everthing that is
> php
> is slow as hell. A page that took normally less than a second to render,
> now
> takes up to 15 ! Yes, fifteen seconds. That depends of course on the
> general
> load of the server, but it nevers goes down under 8 to 10 seconds.
>
> The machine is a dual G4, with 1.5 gigs of ram.
>
> Now, if I go to the command line, in the directory of this site and type
> "php index.php", it renders in about 1 to 1.5 seconds, wich is acceptable.
>
> I did tests with :
>
> - apache 1, php 4, php 5, all static or dso
> - apache 2, php 4, php 5, dso
> - php 4.3, php 4.4
> - Stock php that comes with Tiger
> - Stock apache that comes with Tiger
> - Different compile options with mysql as --with-mysql
> and --with-mysql=/usr/local/mysql
> - I've also tried with and without zend optimizer, turck mmcache.
>
> All with the same results.
>
> In my test case, there is mysql involved, but it's irrelevent to the
> problem, since the mysql is an another machine and is the same all trough
> my
> tests.
>
> Now, in a different server room, we have a set of 3 xserves cluster node
> dual g5 with 4 gigs of ram each. One of them was upgraded to Mac OS X 10.4
> (server) and the other 2 are still with 10.3.
>
> If I take the same setup (same compile options, same versions) on these
> machines, the exact same site is slow as hell on the 10.4, and lightning
> fast on 10.3.
>
>
> Here's my php configure command :
>
> ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-fbsql
> --with-xml --enable-ftp --with-curl=/sw --with-zlib --with-png-dir=/sw --with-jpeg-dir=/sw
> --with-gd --with-ttf=/sw --with-freetype-dir=/sw --enable-track-vars --enable-trans-id
> --disable-debug
>
>
> This is really begins to bugs me...
>
> Any hints ?
attached mail follows:
I haven't had any problems with slowdowns on 10.4. Usually when there
are slowdowns on the Mac like you indicate, it has something to do
with DNS lookups being performed. Apple seems to be having a hard
time getting this right. You could problem find a ton of posts on
very slow ssh on the Apple forums that have to do with DNS.
Have you figured out what the computer is doing when a page is taking
that long? You mention it seems to point to an IO problem, have you
used iostat (or fs_usage) to verify it's disk IO? My first guess is
something with the network and you have to wait for a lookup,
response or timeout, which is why it's taking at a minimum 10
seconds. Again, I would check DNS first, the most obvious being
Apache resolving IP addresses for the log (don't do it).
On Oct 24, 2005, at 12:44 PM, Nicolas Ross wrote:
> Just a little follow-up to my own post.
>
> From the latest expriments I've done with a fresh install of OS X
> 10.4 (with the latest 10.4.3 beta update), it seems to point to an
> IO problem.
>
> My test site uses mambo as a CMS, and I've inclued collecting of
> microseconds timestamps at key points of the index file, and
> whenever it includes some files it slows down. It's worse when
> there are several nested includes. One other point is the mysql db
> connection.
>
> I must recall to all that when called from the cli, it's ok. Only
> when called from apache (1 or 2), dso or static and only on Mac OS
> X 10.4 (it's ok with 10.3 and 10.2) I expericed a major slowdown.
> For all tests, all config is the same, libraries and binaries where
> all the same on all systems.
>
> I've tried compiling php as cgi also, it helps a little bit, but
> it's still too slow...
>
> Thanks for any hints...
>
> Nicolas
>
> ----- Original Message ----- From: "Nicolas Ross" <rossnick-
> lists
cybercat.ca>
> To: <php-general
lists.php.net>
> Sent: Wednesday, September 14, 2005 9:00 AM
> Subject: [PHP] php Slow with Mac OS X 10.4
>
>
>
>> Hi all !
>>
>> Here, we've got several Mac computer acting as servers to serve
>> many kinds
>> of sites. One of wich was running, until the middle of august, Mac
>> OS X
>> 10.2. It was then with apache 1.3.x, and php 4.3.10 dso. All
>> things were
>> "normal".
>>
>> At the middle of august, we upgraded to Mac OS X 10.4 (re-install
>> from
>> scratch). Now, it's with apache2, php 4.4.0 dso. Now, everthing
>> that is php
>> is slow as hell. A page that took normally less than a second to
>> render, now
>> takes up to 15 ! Yes, fifteen seconds. That depends of course on
>> the general
>> load of the server, but it nevers goes down under 8 to 10 seconds.
>>
>> The machine is a dual G4, with 1.5 gigs of ram.
>>
>> Now, if I go to the command line, in the directory of this site
>> and type
>> "php index.php", it renders in about 1 to 1.5 seconds, wich is
>> acceptable.
>>
>> I did tests with :
>>
>> - apache 1, php 4, php 5, all static or dso
>> - apache 2, php 4, php 5, dso
>> - php 4.3, php 4.4
>> - Stock php that comes with Tiger
>> - Stock apache that comes with Tiger
>> - Different compile options with mysql as --with-mysql
>> and --with-mysql=/usr/local/mysql
>> - I've also tried with and without zend optimizer, turck mmcache.
>>
>> All with the same results.
>>
>> In my test case, there is mysql involved, but it's irrelevent to the
>> problem, since the mysql is an another machine and is the same all
>> trough my
>> tests.
>>
>> Now, in a different server room, we have a set of 3 xserves
>> cluster node
>> dual g5 with 4 gigs of ram each. One of them was upgraded to Mac
>> OS X 10.4
>> (server) and the other 2 are still with 10.3.
>>
>> If I take the same setup (same compile options, same versions) on
>> these
>> machines, the exact same site is slow as hell on the 10.4, and
>> lightning
>> fast on 10.3.
>>
>>
>> Here's my php configure command :
>>
>> ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
>> --with-fbsql
>> --with-xml --enable-ftp --with-curl=/sw --with-zlib --with-png-
>> dir=/sw --with-jpeg-dir=/sw
>> --with-gd --with-ttf=/sw --with-freetype-dir=/sw --enable-track-
>> vars --enable-trans-id
>> --disable-debug
>>
>>
>> This is really begins to bugs me...
>>
>> Any hints ?
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
attached mail follows:
I'm no fs_usage expert, so I have no idea on how to profile IO with
it. I do know/see very high CPU usage when running PHP. The httpd
process takes up to 70% of CPU capacity. This 'peak' can take about 4
to 8 seconds for example.
So I'm tempted to rule out DNS issues. Also because static (html)
files and simple php files (without includes) are very fast.
Any tips on fs_usage etc. are still welcome though.
> I haven't had any problems with slowdowns on 10.4. Usually when
> there are slowdowns on the Mac like you indicate, it has something
> to do with DNS lookups being performed. Apple seems to be having a
> hard time getting this right. You could problem find a ton of posts
> on very slow ssh on the Apple forums that have to do with DNS.
>
> Have you figured out what the computer is doing when a page is
> taking that long? You mention it seems to point to an IO problem,
> have you used iostat (or fs_usage) to verify it's disk IO? My first
> guess is something with the network and you have to wait for a
> lookup, response or timeout, which is why it's taking at a minimum
> 10 seconds. Again, I would check DNS first, the most obvious being
> Apache resolving IP addresses for the log (don't do it).
attached mail follows:
As stated before in this thread, in my case it's nothing about dns.
On 2 machines I have, both were 10.3, one was upgraded to 10.4, the other
not. Nothing else has changed. On the 10.4, it's slow, on the 10.3, it's
fast. All dns lookup is off in all apache config...
I did an iostat when I experience the slowdown, and I get no noticable disk
activity.
With fs_usager (that I didn't know), I get in about 1 second 57k lines of
activity ! But still appears (with the timestamps I see) take only about 1
second.
With netstat -an, besides the mysql connection and the http connection, I
see nothing else waiting to return...
BTW, on my test machine, there is nothing else running or other "live"
site...
Brent, can you tell me what kind of php application you're running on os x
10.4 ? Can you share your apache config ? What king of setup do you have
(what apache, php etc.) ?
Thanks,
Nicolas
----- Original Message -----
From: "Brent Baisley" <brent
landover.com>
To: "Nicolas Ross" <rossnick-lists
cybercat.ca>
Cc: <php-general
lists.php.net>; "Shawn Moore" <shawn
heliumflash.com>;
"Atelier Fabien" <info
atelierfabien.be>
Sent: Monday, October 24, 2005 3:13 PM
Subject: Re: [PHP] php Slow with Mac OS X 10.4
>I haven't had any problems with slowdowns on 10.4. Usually when there are
>slowdowns on the Mac like you indicate, it has something to do with DNS
>lookups being performed. Apple seems to be having a hard time getting this
>right. You could problem find a ton of posts on very slow ssh on the Apple
>forums that have to do with DNS.
>
> Have you figured out what the computer is doing when a page is taking
> that long? You mention it seems to point to an IO problem, have you used
> iostat (or fs_usage) to verify it's disk IO? My first guess is something
> with the network and you have to wait for a lookup, response or timeout,
> which is why it's taking at a minimum 10 seconds. Again, I would check
> DNS first, the most obvious being Apache resolving IP addresses for the
> log (don't do it).
>
>
>
> On Oct 24, 2005, at 12:44 PM, Nicolas Ross wrote:
>
>> Just a little follow-up to my own post.
>>
>> From the latest expriments I've done with a fresh install of OS X 10.4
>> (with the latest 10.4.3 beta update), it seems to point to an IO
>> problem.
>>
>> My test site uses mambo as a CMS, and I've inclued collecting of
>> microseconds timestamps at key points of the index file, and whenever it
>> includes some files it slows down. It's worse when there are several
>> nested includes. One other point is the mysql db connection.
>>
>> I must recall to all that when called from the cli, it's ok. Only when
>> called from apache (1 or 2), dso or static and only on Mac OS X 10.4
>> (it's ok with 10.3 and 10.2) I expericed a major slowdown. For all
>> tests, all config is the same, libraries and binaries where all the same
>> on all systems.
>>
>> I've tried compiling php as cgi also, it helps a little bit, but it's
>> still too slow...
>>
>> Thanks for any hints...
>>
>> Nicolas
>>
>> ----- Original Message ----- From: "Nicolas Ross" <rossnick-
>> lists
cybercat.ca>
>> To: <php-general
lists.php.net>
>> Sent: Wednesday, September 14, 2005 9:00 AM
>> Subject: [PHP] php Slow with Mac OS X 10.4
>>
>>
>>
>>> Hi all !
>>>
>>> Here, we've got several Mac computer acting as servers to serve many
>>> kinds
>>> of sites. One of wich was running, until the middle of august, Mac OS X
>>> 10.2. It was then with apache 1.3.x, and php 4.3.10 dso. All things
>>> were
>>> "normal".
>>>
>>> At the middle of august, we upgraded to Mac OS X 10.4 (re-install from
>>> scratch). Now, it's with apache2, php 4.4.0 dso. Now, everthing that is
>>> php
>>> is slow as hell. A page that took normally less than a second to
>>> render, now
>>> takes up to 15 ! Yes, fifteen seconds. That depends of course on the
>>> general
>>> load of the server, but it nevers goes down under 8 to 10 seconds.
>>>
>>> The machine is a dual G4, with 1.5 gigs of ram.
>>>
>>> Now, if I go to the command line, in the directory of this site and
>>> type
>>> "php index.php", it renders in about 1 to 1.5 seconds, wich is
>>> acceptable.
>>>
>>> I did tests with :
>>>
>>> - apache 1, php 4, php 5, all static or dso
>>> - apache 2, php 4, php 5, dso
>>> - php 4.3, php 4.4
>>> - Stock php that comes with Tiger
>>> - Stock apache that comes with Tiger
>>> - Different compile options with mysql as --with-mysql
>>> and --with-mysql=/usr/local/mysql
>>> - I've also tried with and without zend optimizer, turck mmcache.
>>>
>>> All with the same results.
>>>
>>> In my test case, there is mysql involved, but it's irrelevent to the
>>> problem, since the mysql is an another machine and is the same all
>>> trough my
>>> tests.
>>>
>>> Now, in a different server room, we have a set of 3 xserves cluster
>>> node
>>> dual g5 with 4 gigs of ram each. One of them was upgraded to Mac OS X
>>> 10.4
>>> (server) and the other 2 are still with 10.3.
>>>
>>> If I take the same setup (same compile options, same versions) on these
>>> machines, the exact same site is slow as hell on the 10.4, and
>>> lightning
>>> fast on 10.3.
>>>
>>>
>>> Here's my php configure command :
>>>
>>>
>>> /configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-fbsql
>>> --with-xml --enable-ftp --with-curl=/sw --with-zlib --with-png-
>>> dir=/sw --with-jpeg-dir=/sw
>>> --with-gd --with-ttf=/sw --with-freetype-dir=/sw --enable-track-
>>> vars --enable-trans-id
>>> --disable-debug
>>>
>>>
>>> This is really begins to bugs me...
>>>
>>> Any hints ?
>>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
> --
> Brent Baisley
> Systems Architect
> Landover Associates, Inc.
> Search & Advisory Services for Advanced Technology Environments
> p: 212.759.6400/800.759.0577
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
I must point out also, that during this time, the httpd thread that servers
my request is taking 100% of cpu for the whole 8 or 10 seconds...
Thanks,
Nicolas
----- Original Message -----
From: "Brent Baisley" <brent
landover.com>
To: "Nicolas Ross" <rossnick-lists
cybercat.ca>
Cc: <php-general
lists.php.net>; "Shawn Moore" <shawn
heliumflash.com>;
"Atelier Fabien" <info
atelierfabien.be>
Sent: Monday, October 24, 2005 3:13 PM
Subject: Re: [PHP] php Slow with Mac OS X 10.4
>I haven't had any problems with slowdowns on 10.4. Usually when there are
>slowdowns on the Mac like you indicate, it has something to do with DNS
>lookups being performed. Apple seems to be having a hard time getting this
>right. You could problem find a ton of posts on very slow ssh on the Apple
>forums that have to do with DNS.
>
> Have you figured out what the computer is doing when a page is taking
> that long? You mention it seems to point to an IO problem, have you used
> iostat (or fs_usage) to verify it's disk IO? My first guess is something
> with the network and you have to wait for a lookup, response or timeout,
> which is why it's taking at a minimum 10 seconds. Again, I would check
> DNS first, the most obvious being Apache resolving IP addresses for the
> log (don't do it).
>
>
>
> On Oct 24, 2005, at 12:44 PM, Nicolas Ross wrote:
>
>> Just a little follow-up to my own post.
>>
>> From the latest expriments I've done with a fresh install of OS X 10.4
>> (with the latest 10.4.3 beta update), it seems to point to an IO
>> problem.
>>
>> My test site uses mambo as a CMS, and I've inclued collecting of
>> microseconds timestamps at key points of the index file, and whenever it
>> includes some files it slows down. It's worse when there are several
>> nested includes. One other point is the mysql db connection.
>>
>> I must recall to all that when called from the cli, it's ok. Only when
>> called from apache (1 or 2), dso or static and only on Mac OS X 10.4
>> (it's ok with 10.3 and 10.2) I expericed a major slowdown. For all
>> tests, all config is the same, libraries and binaries where all the same
>> on all systems.
>>
>> I've tried compiling php as cgi also, it helps a little bit, but it's
>> still too slow...
>>
>> Thanks for any hints...
>>
>> Nicolas
>>
>> ----- Original Message ----- From: "Nicolas Ross" <rossnick-
>> lists
cybercat.ca>
>> To: <php-general
lists.php.net>
>> Sent: Wednesday, September 14, 2005 9:00 AM
>> Subject: [PHP] php Slow with Mac OS X 10.4
>>
>>
>>
>>> Hi all !
>>>
>>> Here, we've got several Mac computer acting as servers to serve many
>>> kinds
>>> of sites. One of wich was running, until the middle of august, Mac OS X
>>> 10.2. It was then with apache 1.3.x, and php 4.3.10 dso. All things
>>> were
>>> "normal".
>>>
>>> At the middle of august, we upgraded to Mac OS X 10.4 (re-install from
>>> scratch). Now, it's with apache2, php 4.4.0 dso. Now, everthing that is
>>> php
>>> is slow as hell. A page that took normally less than a second to
>>> render, now
>>> takes up to 15 ! Yes, fifteen seconds. That depends of course on the
>>> general
>>> load of the server, but it nevers goes down under 8 to 10 seconds.
>>>
>>> The machine is a dual G4, with 1.5 gigs of ram.
>>>
>>> Now, if I go to the command line, in the directory of this site and
>>> type
>>> "php index.php", it renders in about 1 to 1.5 seconds, wich is
>>> acceptable.
>>>
>>> I did tests with :
>>>
>>> - apache 1, php 4, php 5, all static or dso
>>> - apache 2, php 4, php 5, dso
>>> - php 4.3, php 4.4
>>> - Stock php that comes with Tiger
>>> - Stock apache that comes with Tiger
>>> - Different compile options with mysql as --with-mysql
>>> and --with-mysql=/usr/local/mysql
>>> - I've also tried with and without zend optimizer, turck mmcache.
>>>
>>> All with the same results.
>>>
>>> In my test case, there is mysql involved, but it's irrelevent to the
>>> problem, since the mysql is an another machine and is the same all
>>> trough my
>>> tests.
>>>
>>> Now, in a different server room, we have a set of 3 xserves cluster
>>> node
>>> dual g5 with 4 gigs of ram each. One of them was upgraded to Mac OS X
>>> 10.4
>>> (server) and the other 2 are still with 10.3.
>>>
>>> If I take the same setup (same compile options, same versions) on these
>>> machines, the exact same site is slow as hell on the 10.4, and
>>> lightning
>>> fast on 10.3.
>>>
>>>
>>> Here's my php configure command :
>>>
>>>
>>> /configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-fbsql
>>> --with-xml --enable-ftp --with-curl=/sw --with-zlib --with-png-
>>> dir=/sw --with-jpeg-dir=/sw
>>> --with-gd --with-ttf=/sw --with-freetype-dir=/sw --enable-track-
>>> vars --enable-trans-id
>>> --disable-debug
>>>
>>>
>>> This is really begins to bugs me...
>>>
>>> Any hints ?
>>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
> --
> Brent Baisley
> Systems Architect
> Landover Associates, Inc.
> Search & Advisory Services for Advanced Technology Environments
> p: 212.759.6400/800.759.0577
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
You certainly wouldn't want to do just fs_usage. Typing something
like "fs_usage httpd" will show you just what the httpd process is
accessing. Read the man pages for other options that may be helpful.
I've got a few things running on OSX 10.4, although none that handle
lots of traffic. Public sites:
dutchessfootball.com - a football pool, the picks page is the slowest
to load. That's on a single cpu 1.25 G4 512MB RAM
heardthroughthegrapevine.com - wine tasting site, nothing fancy or
that complicated. That's on a 400Mhz G4 384MB RAM.
The big application is internal to my company and has about 285 "web"
files total, and about 45 mysql tables (contacts, companies, resumes
invoices, jobs, emails, journal,etc). They all have lots of includes
since I use a custom templating system to separate php from html. I
do not use PEAR or any content management system, I found them too
slow. I know a few people who have looked at Mambo and rejected it
because of it's CPU load, although they were all using Windows
servers. I've never looked into why Mambo has high CPU requirements.
Is it just the Mambo parts you are having problems with or is it php
in general?
With 100% CPU, we've narrowed it down to something there. Now we need
to figure out why the CPU is the bottleneck.
On Oct 24, 2005, at 4:21 PM, Nicolas Ross wrote:
> As stated before in this thread, in my case it's nothing about dns.
>
> On 2 machines I have, both were 10.3, one was upgraded to 10.4, the
> other not. Nothing else has changed. On the 10.4, it's slow, on the
> 10.3, it's fast. All dns lookup is off in all apache config...
>
> I did an iostat when I experience the slowdown, and I get no
> noticable disk activity.
>
> With fs_usager (that I didn't know), I get in about 1 second 57k
> lines of activity ! But still appears (with the timestamps I see)
> take only about 1 second.
>
> With netstat -an, besides the mysql connection and the http
> connection, I see nothing else waiting to return...
>
> BTW, on my test machine, there is nothing else running or other
> "live" site...
>
> Brent, can you tell me what kind of php application you're running
> on os x 10.4 ? Can you share your apache config ? What king of
> setup do you have (what apache, php etc.) ?
>
> Thanks,
>
> Nicolas
>
> ----- Original Message ----- From: "Brent Baisley"
> <brent
landover.com>
> To: "Nicolas Ross" <rossnick-lists
cybercat.ca>
> Cc: <php-general
lists.php.net>; "Shawn Moore"
> <shawn
heliumflash.com>; "Atelier Fabien" <info
atelierfabien.be>
> Sent: Monday, October 24, 2005 3:13 PM
> Subject: Re: [PHP] php Slow with Mac OS X 10.4
>
>
>
>> I haven't had any problems with slowdowns on 10.4. Usually when
>> there are slowdowns on the Mac like you indicate, it has
>> something to do with DNS lookups being performed. Apple seems to
>> be having a hard time getting this right. You could problem find
>> a ton of posts on very slow ssh on the Apple forums that have to
>> do with DNS.
>>
>> Have you figured out what the computer is doing when a page is
>> taking that long? You mention it seems to point to an IO problem,
>> have you used iostat (or fs_usage) to verify it's disk IO? My
>> first guess is something with the network and you have to wait
>> for a lookup, response or timeout, which is why it's taking at a
>> minimum 10 seconds. Again, I would check DNS first, the most
>> obvious being Apache resolving IP addresses for the log (don't do
>> it).
>>
>>
>>
>> On Oct 24, 2005, at 12:44 PM, Nicolas Ross wrote:
>>
>>
>>> Just a little follow-up to my own post.
>>>
>>> From the latest expriments I've done with a fresh install of OS
>>> X 10.4 (with the latest 10.4.3 beta update), it seems to point
>>> to an IO problem.
>>>
>>> My test site uses mambo as a CMS, and I've inclued collecting of
>>> microseconds timestamps at key points of the index file, and
>>> whenever it includes some files it slows down. It's worse when
>>> there are several nested includes. One other point is the mysql
>>> db connection.
>>>
>>> I must recall to all that when called from the cli, it's ok.
>>> Only when called from apache (1 or 2), dso or static and only on
>>> Mac OS X 10.4 (it's ok with 10.3 and 10.2) I expericed a major
>>> slowdown. For all tests, all config is the same, libraries and
>>> binaries where all the same on all systems.
>>>
>>> I've tried compiling php as cgi also, it helps a little bit, but
>>> it's still too slow...
>>>
>>> Thanks for any hints...
>>>
>>> Nicolas
>>>
>>> ----- Original Message ----- From: "Nicolas Ross" <rossnick-
>>> lists
cybercat.ca>
>>> To: <php-general
lists.php.net>
>>> Sent: Wednesday, September 14, 2005 9:00 AM
>>> Subject: [PHP] php Slow with Mac OS X 10.4
>>>
>>>
>>>
>>>
>>>> Hi all !
>>>>
>>>> Here, we've got several Mac computer acting as servers to serve
>>>> many kinds
>>>> of sites. One of wich was running, until the middle of august,
>>>> Mac OS X
>>>> 10.2. It was then with apache 1.3.x, and php 4.3.10 dso. All
>>>> things were
>>>> "normal".
>>>>
>>>> At the middle of august, we upgraded to Mac OS X 10.4 (re-
>>>> install from
>>>> scratch). Now, it's with apache2, php 4.4.0 dso. Now, everthing
>>>> that is php
>>>> is slow as hell. A page that took normally less than a second to
>>>> render, now
>>>> takes up to 15 ! Yes, fifteen seconds. That depends of course
>>>> on the general
>>>> load of the server, but it nevers goes down under 8 to 10 seconds.
>>>>
>>>> The machine is a dual G4, with 1.5 gigs of ram.
>>>>
>>>> Now, if I go to the command line, in the directory of this site
>>>> and type
>>>> "php index.php", it renders in about 1 to 1.5 seconds, wich is
>>>> acceptable.
>>>>
>>>> I did tests with :
>>>>
>>>> - apache 1, php 4, php 5, all static or dso
>>>> - apache 2, php 4, php 5, dso
>>>> - php 4.3, php 4.4
>>>> - Stock php that comes with Tiger
>>>> - Stock apache that comes with Tiger
>>>> - Different compile options with mysql as --with-mysql
>>>> and --with-mysql=/usr/local/mysql
>>>> - I've also tried with and without zend optimizer, turck mmcache.
>>>>
>>>> All with the same results.
>>>>
>>>> In my test case, there is mysql involved, but it's irrelevent to
>>>> the
>>>> problem, since the mysql is an another machine and is the same
>>>> all trough my
>>>> tests.
>>>>
>>>> Now, in a different server room, we have a set of 3 xserves
>>>> cluster node
>>>> dual g5 with 4 gigs of ram each. One of them was upgraded to
>>>> Mac OS X 10.4
>>>> (server) and the other 2 are still with 10.3.
>>>>
>>>> If I take the same setup (same compile options, same versions)
>>>> on these
>>>> machines, the exact same site is slow as hell on the 10.4, and
>>>> lightning
>>>> fast on 10.3.
>>>>
>>>>
>>>> Here's my php configure command :
>>>>
>>>> /configure --with-apxs2=/usr/local/apache2/bin/apxs --with-
>>>> mysql --with-fbsql
>>>> --with-xml --enable-ftp --with-curl=/sw --with-zlib --with-png-
>>>> dir=/sw --with-jpeg-dir=/sw
>>>> --with-gd --with-ttf=/sw --with-freetype-dir=/sw --enable-track-
>>>> vars --enable-trans-id
>>>> --disable-debug
>>>>
>>>>
>>>> This is really begins to bugs me...
>>>>
>>>> Any hints ?
>>>>
>>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>>
>>>
>>
>> --
>> Brent Baisley
>> Systems Architect
>> Landover Associates, Inc.
>> Search & Advisory Services for Advanced Technology Environments
>> p: 212.759.6400/800.759.0577
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
attached mail follows:
On Mon, October 24, 2005 3:21 pm, Nicolas Ross wrote:
> As stated before in this thread, in my case it's nothing about dns.
You've pointed to 2 potential problems so far.
1 is mysql_connect()
2 is include '';
Can you run a quick test to find out which one is WORSE, and focus on
that first?
If it's MySQL, just for fun, consider trying some of these thing:
1. mysql command line monitor.
2. Perl + MySQL (or anything not PHP, just to see)
3. mysql_pconnect
If it's "include" that is slow, check:
1. What is include_path? Does it contain non-existent directories?
2. Does include_path contain directories with a zillion things in them?
Also start running hardware component checks.
Maybe 10.4 (or whatever is the bad one) is triggering something that
never got utilized in 10.3, like maybe they just got dual CPU to
actually be used, or maybe their RAM management changed how it works,
or maybe disk drivers are now allocating hard drive chunks
"differently" or... So bad hardware could be behind it all.
I got no idea what tools are out there these to test Mac RAM / HD etc,
but I presume they are out there...
Is Dr. Norton still in the house? Man, I go back a long way with
Macs. I rembmer when Dr. Norton was new and cool. :-)
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
Hi!
I have to move my website from Windows hosting to a linux hosting machine.
Does anyone have special tips, procedures I should consider?
(Like changing directory paths from \ to / ).
It's a classifieds posting website and it's in final testing stage.
Pedro.
Apologies for my bad English.
attached mail follows:
pedro mpa said the following on 10/24/05 10:13:
> Hi!
>
> I have to move my website from Windows hosting to a linux hosting machine.
> Does anyone have special tips, procedures I should consider?
> (Like changing directory paths from \ to / ).
>
> It's a classifieds posting website and it's in final testing stage.
>
> Pedro.
> Apologies for my bad English.
Absolutely nothing wrong with your english!
Aside from the paths you will want to check any system calls that you
are doing. The only problem I have ever run into was that I had the
error reporting level set differently on one platform than the other so
I was getting errors about undeclared variables (bad habit) on one
platform that I wasn't getting on the other.
Otherwise I think you will find the move to be relatively painless.
That said, I'd start testing on the Linux server as soon as possible
just in case.
- Ben
attached mail follows:
Find out if the linux box is using a case sensitive file system. If
it is, you need to make sure all your calls to other files use the
right case. This was an extremely common problem in the beginning of
the .com boom.
On Oct 24, 2005, at 1:13 PM, pedro mpa wrote:
> Hi!
>
> I have to move my website from Windows hosting to a linux hosting
> machine.
> Does anyone have special tips, procedures I should consider?
> (Like changing directory paths from \ to / ).
>
> It's a classifieds posting website and it's in final testing stage.
>
> Pedro.
> Apologies for my bad English.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
attached mail follows:
Hi,
Why this doesn't work ?
---
$query = "SELECT COUNT (login) FROM WHERE login = '$login'";
$result = mysql_query($query);
mysql_fetch_row($result);
---
It gives me
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL
result resource in /var/www/html/registar_action.php on line 22
Any help would be apreciated.
Warm Regards,
Mário Gamito
attached mail follows:
It looks to me like you forgot to specify the table in your query:
SELECT COUNT (login) FROM <TABLENAME GOES HERE> WHERE login = '$login'
> Hi,
>
> Why this doesn't work ?
>
> ---
> $query = "SELECT COUNT (login) FROM WHERE login = '$login'";
> $result = mysql_query($query);
> mysql_fetch_row($result);
> ---
>
> It gives me
> Warning: mysql_fetch_row(): supplied argument is not a valid MySQL
> result resource in /var/www/html/registar_action.php on line 22
>
> Any help would be apreciated.
>
> Warm Regards,
> Mário Gamito
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
Thank you,
Colin Shreffler
Principal
303.349.9010 - cell
928.396.1099 - fax
colin.shreffler
warp9software.com
Warp 9 Software, LLC.
6791 Halifax Avenue
Castle Rock, CO 80104
Confidentiality Notice: The information in this e-mail may be confidential
and/or privileged. This e-mail is intended to be reviewed by only the
individual or organization named in the e-mail address. If you are not the
intended recipient, you are hereby notified that any review, dissemination
or copying of this e-mail and attachments, if any, or the information
contained herein, is strictly prohibited.
attached mail follows:
Hi,
Sorry, i do have the table name.
It just passed me while transcripting.
The code is:
---
$query = "SELECT COUNT (login) FROM formacao WHERE login = '$login'";
$result = mysql_query($query);
mysql_fetch_row($result);
---
It works perfectly on MySQL prompt.
Regards,
Mário Gamito
Colin Shreffler wrote:
> It looks to me like you forgot to specify the table in your query:
>
> SELECT COUNT (login) FROM <TABLENAME GOES HERE> WHERE login = '$login'
>
>
>>Hi,
>>
>>Why this doesn't work ?
>>
>>---
>>$query = "SELECT COUNT (login) FROM WHERE login = '$login'";
>>$result = mysql_query($query);
>>mysql_fetch_row($result);
>>---
>>
>>It gives me
>>Warning: mysql_fetch_row(): supplied argument is not a valid MySQL
>>result resource in /var/www/html/registar_action.php on line 22
>>
>>Any help would be apreciated.
>>
>>Warm Regards,
>>Mário Gamito
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
>
>
>
> Thank you,
> Colin Shreffler
> Principal
> 303.349.9010 - cell
> 928.396.1099 - fax
> colin.shreffler
warp9software.com
>
> Warp 9 Software, LLC.
> 6791 Halifax Avenue
> Castle Rock, CO 80104
>
> Confidentiality Notice: The information in this e-mail may be confidential
> and/or privileged. This e-mail is intended to be reviewed by only the
> individual or organization named in the e-mail address. If you are not the
> intended recipient, you are hereby notified that any review, dissemination
> or copying of this e-mail and attachments, if any, or the information
> contained herein, is strictly prohibited.
>
attached mail follows:
[snip]
---
$query = "SELECT COUNT (login) FROM formacao WHERE login = '$login'";
$result = mysql_query($query);
mysql_fetch_row($result);
---
[/snip]
mysql_query() requires a connections resource
$result = mysql_query($query, $myConnection);
attached mail follows:
>
> [snip]
> ---
> $query = "SELECT COUNT (login) FROM formacao WHERE login = '$login'";
> $result = mysql_query($query);
> mysql_fetch_row($result);
> ---
> [/snip]
>
> mysql_query() requires a connections resource
>
> $result = mysql_query($query, $myConnection);
The connection resource is optional. It will use the most recent connection
if not specified.
JM
attached mail follows:
> $query = "SELECT COUNT (login) FROM formacao WHERE login = '$login'";
> $result = mysql_query($query);
Make this line instead
$result = mysql_query($query) or die(mysql_error() . " with the query $query";
and you'll likely see the error.
--
Scott Noyes
snoyes
gmail.com
attached mail follows:
[snip]
> $query = "SELECT COUNT (login) FROM formacao WHERE login = '$login'";
> $result = mysql_query($query);
> mysql_fetch_row($result);
The connection resource is optional. It will use the most recent connection
if not specified.
[/snip]
Then try this....
$query = "SELECT COUNT (login) FROM formacao WHERE login = '".$login."'";
attached mail follows:
Hi,
> Make this line instead
> $result = mysql_query($query) or die(mysql_error() . " with the query $query";
> and you'll likely see the error.
Here it goes:
"You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near '(login)
FROM formacao WHERE login = 'a'' at line 1"
Regards,
Mário Gamito
attached mail follows:
hi mario,
first of all, make sure that your query works from the mysql console or
phpmyadmin or some other tool (copy-paste the query from the code and
replace $loging with something reasonable).
then try the following:
$query = "SELECT COUNT (login) FROM formacao WHERE login = '$login'";
// check to see if the $login variable has been filled in -
// maybe $login is empty?
echo $query;
$result = mysql_query($query);
if (!$result) {
// mysql will tell you what's wrong
echo mysql_error();
}
mysql_fetch_row($result);
and btw. mysql_fetch_row() doesn't require a connection resource, it
will default to the last opened when none is given.
so you only need to give the 2nd parameter if you have more than one
mysql-db connection open.
regards,
phillip
---
Mário Gamito schrieb:
> Hi,
>
> Why this doesn't work ?
>
> ---
> $query = "SELECT COUNT (login) FROM WHERE login = '$login'";
> $result = mysql_query($query);
> mysql_fetch_row($result);
> ---
>
> It gives me
> Warning: mysql_fetch_row(): supplied argument is not a valid MySQL
> result resource in /var/www/html/registar_action.php on line 22
>
> Any help would be apreciated.
>
> Warm Regards,
> Mário Gamito
attached mail follows:
why don't you just echo your $query to see if it is coming out
correctly, before even trying to mess with mysql_query()? I think you
should be able to see the problem from there.
Jordan
On Oct 24, 2005, at 12:44 PM, Mário Gamito wrote:
> Hi,
>
>
>
>> Make this line instead
>> $result = mysql_query($query) or die(mysql_error() . " with the
>> query $query";
>> and you'll likely see the error.
>>
>>
>
> Here it goes:
>
> "You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to
> use near '(login) FROM formacao WHERE login = 'a'' at line 1"
>
> Regards,
> Mário Gamito
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
attached mail follows:
>
> Hi,
>
> > Make this line instead
> > $result = mysql_query($query) or die(mysql_error() . " with
> the query $query";
> > and you'll likely see the error.
>
> Here it goes:
>
> "You have an error in your SQL syntax; check the manual that
> corresponds
> to your MySQL server version for the right syntax to use near
> '(login)
> FROM formacao WHERE login = 'a'' at line 1"
>
Apparently, $login does not contain the text you think it does. Either echo
$login to see, or echo $query to see what is actually being passed to mysql.
JM
attached mail follows:
ah!
remove the whitespace between the COUNT and () : COUNT(login) instead of
COUNT () ...
> Hi,
>
>> Make this line instead
>> $result = mysql_query($query) or die(mysql_error() . " with the query
>> $query";
>> and you'll likely see the error.
>
>
> Here it goes:
>
> "You have an error in your SQL syntax; check the manual that corresponds
> to your MySQL server version for the right syntax to use near '(login)
> FROM formacao WHERE login = 'a'' at line 1"
>
> Regards,
> Mário Gamito
attached mail follows:
On Mon, October 24, 2005 12:25 pm, Mário Gamito wrote:
> ---
> $query = "SELECT COUNT (login) FROM WHERE login = '$login'";
> $result = mysql_query($query);
> mysql_fetch_row($result);
> ---
>
> It gives me
> Warning: mysql_fetch_row(): supplied argument is not a valid MySQL
> result resource in /var/www/html/registar_action.php on line 22
First, I'm going to give you a fish:
... FROM WHERE ...
Which MySQL database TABLE is it that you think you are looking in?
You have to tell it which table to look in.
Now I'm gonna teach you to catch fish:
Change your middle line to:
$result = mysql_query($query) or die("<br />$query<br />" .
mysql_error());
That will get PHP and MySQL to TELL YOU what's wrong, instead of just
saying "Something's wrong"
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
On Oct 24, 2005, at 10:58 AM, SGreen
unimin.com wrote:
> Temp tables and user variables are connection specific. They will
> be there
> until you explicitly get rid of them OR your connection closes.
And since I'm not using mysql_pconnect in PHP, that connection is
closed at the end of each page being generated, so the temp_table
goes away.
attached mail follows:
[snip]
..a lot of good suggestions and some comedy materials...
[/snip]
Installed Apache, took 15 minutes including PHP configuration. All of the
extensions loaded. whew.
attached mail follows:
I'm generating PDFs under windows using PDFlib and all is easy. What I
am wondering though, and google reveals nothing usefull, can I print the
PDF to a network printer from windows? I'm presuming to print the file I
would ahve to use COM and open it under Acrobat? Anyone done this before
and have any pointers? I'm printing out invoices and what to automate
the task.
Dave.
attached mail follows:
"Dave Lists" <dave.lists
gmail.com> wrote in message
news:435D2C8C.4090709
gmail.com...
> I'm generating PDFs under windows using PDFlib and all is easy. What I am
> wondering though, and google reveals nothing usefull, can I print the PDF
> to a network printer from windows? I'm presuming to print the file I would
> ahve to use COM and open it under Acrobat? Anyone done this before and
> have any pointers? I'm printing out invoices and what to automate the
> task.
I print PDF files using the following code (which prints them to the default
printer):
SHELLEXECUTEINFO sei;
ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
sei.cbSize = sizeof(SHELLEXECUTEINFO);
sei.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NOCLOSEPROCESS;
sei.lpVerb = _T("print");
sei.lpFile = pFile; // -> complete path to file to print
sei.hwnd = CDLBUtils::g_Data.m_hWnd;
sei.nShow = SW_HIDE;
if (ShellExecuteEx(&sei) && sei.hInstApp > (HINSTANCE)32) {
// ok
} else {
// failed
}
Note1: You can change the default printer before calling this.
Note2: Acrobat will launch, and may stay running even after the printing
process has finished
DanB
attached mail follows:
On Mon, October 24, 2005 1:48 pm, Dave Lists wrote:
> I'm generating PDFs under windows using PDFlib and all is easy. What I
> am wondering though, and google reveals nothing usefull, can I print
> the
> PDF to a network printer from windows? I'm presuming to print the file
> I
> would ahve to use COM and open it under Acrobat? Anyone done this
> before
> and have any pointers? I'm printing out invoices and what to automate
> the task.
Slow down a sec...
Okay, is the networked printer networked to the WEB SERVER?
Or is it networked to the computer with the WEB BROWSER?
If it's the WEB BROWSER, then you can print the PDF just like you'd
print any PDF. PHP isn't in the picture at all. It's just a PDF
living in your web browser at that point.
It's not even a PHP question, just an MS/Adobe/PDF/Windows/Printer
question. Though, if you have my skill with screwing up printers,
that's a hell of a lot tougher than a PHP question. :-)
If, for some weird reason, you want to allow the user (authenticated,
logged in, trusted) to print to a networked computer on the WEB
SERVER, then your best bet is probably to figure out how to print that
PDF from MS-DOS and then to use http://php.net/exec to print it, I
would guess...
You might be able to use PHP to open up a COM object to convince
Adobe/Windows/whatever to print...
If it was a Un*x server, you'd just send the document to lpr or CUPS
or something, and be done with it, probably in a half-hour of work,
even allowing for a protracted battle with file/exec permissions.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
the below is the curl'd output of the php script:
curl -l -i "http://www.myserver/scripts/makeMoviePlaylist.php"
Content-Length: 263
Content-Type: video/quicktime
<?xml version="1.0"?>
<?quicktime type="application/x-quicktime-media-link"?>
<embed
autoplay="true"
cache="true"
kioskmode="true"
quitwhendone="true"
movieid="9d867c3b4ac7d04cb3b7bf6d99b5992b"
moviename="Commercial Reel 2005"
src="makeMoviePlaylist.php?cmd=makesmil"/>
/*
}
Problem:
if the users does this:
curl -l -i "http://www.myserver/scripts/makeMoviePlaylist.php?
cmd=makesmil"
From the above curl'd output, entering the below url into a browser
will get the movie:
http://www.myserver/scripts/makeMoviePlaylist.php?
cmd=getmovie&path=wb1v2x9hApqFwTHhG5tSJlVp9bGi8glguo+gC565a5o="
is this possible to prevent ? Or is there a better approach?
This stuff is making my head spin a bit...
I am learning aspects of security so any help is appreciated.
many thanks:)
g
This the output from:
curl -l -i "http://www.myserver/scripts/makeMoviePlaylist.php?
cmd=makesmil"
ETag: 253bd3c0260c47ad994857992e073682
Accept-Ranges: bytes
Content-Length: 5132
Content-Type: application/smil
<smil xmlns:qt="http://www.apple.com/quicktime/resources/smilextensions"
qt:time-slider="true"
qt:chapter-mode="clip"
qt:immediate-instantiation="false"
qt:autoplay="true">
<head>
<meta name="base" content="http://www.myserver/scripts/" />
<meta name="full-name" content="Commercial Reel 2005"/>
<meta name="name" content="Commercial Reel 2005"/>
<meta name="copyright" content="2005"/>
<meta name="author" content="Graham Anderson"/>
<layout>
<root-layout id="main" title="Commercial Reel 2005" left="0" top
="0" width="352" height="208" background-color="black"/>
<region id="firsttrack" z-index="1" left="0" top ="0" width = "352"
height = "208" background-color="black"
qt:attach-timebase="true" qt:immediate-instantiation="false"
qt:autoplay="true" qt:time-slider="true" qt:chapter-mode="clip" />
<region id="siren" z-index="1" left="0" top ="0" width="352"
height="208" fit ="fill" background-color="black"
qt:time-slider="true" qt:attach-timebase="true" qt:autoplay="true"
qt:chapter-mode="clip"
qt:immediate-instantiation="false" />
<region id="drm" z-index="3" left="0" top ="0" width = "352" height
= "208" background-color="black"
qt:attach-timebase="false" qt:immediate-instantiation="false"
qt:autoplay="false" qt:time-slider="false"/>
</layout>
</head>
<body>
<switch>
<par system-bitrate="768000">
<!--for T1 and faster-->
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=zSbG5zDpCJiqc2mbIunOjkw35wn2Q+saBlJZbaXmYUI="
region="drm" duration="indefinite"/>
<seq>
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=wb1v2x9hApqFwTHhG5tSJlVp9bGi8glguo+gC565a5o="
region="firsttrack" qt:chapter="levis: crazy legs"/>
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=wHvUoTrGxSW7C8uHjo7hHWLh9hJdvL0hVNx9hoUX3zM="
region="siren" qt:chapter="adidas: the game"/>
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=pGUsQZ5nfQtuysSgiTdHyvHdoY1hyA+rio/tbM9sSsA="
region="siren" qt:chapter="boeing: freedom"/>
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=saCzqVi4h08ikgSBUcLjUjwHxzh9DL5Wib0d0dKi3mo="
region="siren" qt:chapter="yamaha: mama said"/>
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=MqOqXo89l9O012WsrvZIVHLKfZx6mo4fqCcez2GvKlA="
region="siren" qt:chapter="gmc: sliding roof"/>
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=2j53xedyHmUM2uSxWlxg2LqDDk+b7/kkIDKigEdYdp0="
region="siren" qt:chapter="nokia: color adjustment"/>
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=Um2ysEtdgslrEyYZNaPU/KJD6MfTSKXH/HRRqOwj5ug="
region="siren" qt:chapter="bmw: drive"/>
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=gPx1sdVxgYRgjCmX0V6WDVqPG/crkySweYrY/tXkrU0="
region="siren" qt:chapter="guinness: taste"/>
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=MajLzma9FRxXFuxYS9YwCuJtxCRIpkaMNDx3CMrXgyA="
region="siren" qt:chapter="apple: ellen feiss"/>
<video src="makeMoviePlaylist.php?cmd=getmovie&path=LU/xHFq/
8jHGfn2gWDPDycW9CaQW55gjzP4sTXvwrAg=" region="siren"
qt:chapter="playstation: joan"/>
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=ZmT4A6kfPIg7tFc6zUVYRznT89czwdXA9hjgn3Erehg="
region="siren" qt:chapter="pentax: hey"/>
<video src="makeMoviePlaylist.php?cmd=getmovie&path=iUMIIycwZ0QzJVUtUI
+N3glwgfAXPTgFq+mbmXS5vOo=" region="siren" qt:chapter="nike: dreams"/>
</seq>
</par>
<par system-bitrate="512000">
<!--56k modems-->
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=zSbG5zDpCJiqc2mbIunOjkw35wn2Q+saBlJZbaXmYUI="
region="drm" duration="indefinite"/>
<seq>
<video src="makeMoviePlaylist.php?cmd=getmovie&path=5qRrKwWbemaOh5+
+SOgv5SRshkpGTuvW5cIyRN9EWQM=" region="firsttrack" qt:chapter="levis:
crazy legs"/>
<video src="makeMoviePlaylist.php?cmd=getmovie&path=FzWapZbGt1YkCGKiB
+fmlGftup5K8nYl6yVUTG+l+7c=" region="siren" qt:chapter="adidas: the
game"/>
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=Q3gUP0pHVYYjsmCUn2PqMPTOwsqH/x4TbPJbwmEm9yc="
region="siren" qt:chapter="boeing: freedom"/>
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=4OQkZQNgbKWnJcZKA0Dwu9blaufGr9nrMemtfykVNK8="
region="siren" qt:chapter="yamaha: mama said"/>
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=SjXVxuW7miYu0djHcpXX2xSk/hpoxPnCmFhoiGJ2Zlc="
region="siren" qt:chapter="gmc: sliding roof"/>
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=X3LbGKCtMcK5q3uhQpzEy4YNNaRwezXqS8qHx/KXC64="
region="siren" qt:chapter="nokia: color adjustment"/>
<video src="makeMoviePlaylist.php?
cmd=getmovie&path=EPCybK7ipcFMAhj7Lkejc+OWulQVwNDZlLA8sFDRFt0="
region="siren" qt:chapter="bmw: drive"/>
<video src="makeMoviePlaylist.php?cmd=getmovie&path=R9
+mtBsHiUiPvn5hw8PbcTVu9Zy5I7BnhPIeiT2wGPA=" region="siren"
qt:chapter="guinness: taste"/>
<video src="makeMoviePlaylist.php?cmd=getmovie&path=N/bnlupKzblackF
+x4ZDedx8LyOn62vjGvI8uMBR648=" region="siren" qt:chapter="apple:
ellen feiss"/>
<video src="makeMoviePlaylist.php?cmd=getmovie&path=gy8lEzyB
+hbyfZqgTEC/hwjJCuBSZObz2k1lkzl2x38=" region="siren"
qt:chapter="playstation: joan"/>
<video src="makeMoviePlaylist.php?cmd=getmovie&path=mnI7NPIv
+UUdj9bjBXskipg40IBLjRdeDYDRepdMiBQ=" region="siren"
qt:chapter="pentax: hey"/>
<video src="makeMoviePlaylist.php?cmd=getmovie&path=c9crwb4Ss
+xcups9lnvEg+TVX5Duf6+3jPNq3vciSnU=" region="siren" qt:chapter="nike:
dreams"/>
</seq>
</par>
</switch>
</body>
</smil>
attached mail follows:
...
> Problem:
> if the users does this:
> curl -l -i "http://www.myserver/scripts/makeMoviePlaylist.php?
> cmd=makesmil"
>
> From the above curl'd output, entering the below url into a browser
> will get the movie:
> http://www.myserver/scripts/makeMoviePlaylist.php?
> cmd=getmovie&path=wb1v2x9hApqFwTHhG5tSJlVp9bGi8glguo+gC565a5o="
>
thats what its supposed to do isn't it?
under what conditions is someone allowed to grab the movie?
and when are they not allowed?
why is it important that you control whether they use a browser,
a canopener or sone microsoft software to download?
>
> is this possible to prevent ? Or is there a better approach?
approach to what? what is your goal (what are the requirements)?
> This stuff is making my head spin a bit...
not to worry soon the walls will be closing in ;-)
> I am learning aspects of security so any help is appreciated.
>
> many thanks:)
> g
>
>
>
> This the output from:
> curl -l -i "http://www.myserver/scripts/makeMoviePlaylist.php?
> cmd=makesmil"
>
> ETag: 253bd3c0260c47ad994857992e073682
> Accept-Ranges: bytes
> Content-Length: 5132
> Content-Type: application/smil
>
> <smil xmlns:qt="http://www.apple.com/quicktime/resources/smilextensions"
> qt:time-slider="true"
> qt:chapter-mode="clip"
> qt:immediate-instantiation="false"
> qt:autoplay="true">
> <head>
> <meta name="base" content="http://www.myserver/scripts/" />
> <meta name="full-name" content="Commercial Reel 2005"/>
> <meta name="name" content="Commercial Reel 2005"/>
> <meta name="copyright" content="2005"/>
> <meta name="author" content="Graham Anderson"/>
> <layout>
> <root-layout id="main" title="Commercial Reel 2005" left="0" top ="0"
> width="352" height="208" background-color="black"/>
> <region id="firsttrack" z-index="1" left="0" top ="0" width = "352"
> height = "208" background-color="black"
> qt:attach-timebase="true" qt:immediate-instantiation="false"
> qt:autoplay="true" qt:time-slider="true" qt:chapter-mode="clip" />
>
> <region id="siren" z-index="1" left="0" top ="0" width="352"
> height="208" fit ="fill" background-color="black"
> qt:time-slider="true" qt:attach-timebase="true" qt:autoplay="true"
> qt:chapter-mode="clip"
> qt:immediate-instantiation="false" />
>
> <region id="drm" z-index="3" left="0" top ="0" width = "352" height =
> "208" background-color="black"
> qt:attach-timebase="false" qt:immediate-instantiation="false"
> qt:autoplay="false" qt:time-slider="false"/>
> </layout>
> </head>
> <body>
> <switch>
> <par system-bitrate="768000">
> <!--for T1 and faster-->
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=zSbG5zDpCJiqc2mbIunOjkw35wn2Q+saBlJZbaXmYUI="
> region="drm" duration="indefinite"/>
> <seq>
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=wb1v2x9hApqFwTHhG5tSJlVp9bGi8glguo+gC565a5o="
> region="firsttrack" qt:chapter="levis: crazy legs"/>
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=wHvUoTrGxSW7C8uHjo7hHWLh9hJdvL0hVNx9hoUX3zM="
> region="siren" qt:chapter="adidas: the game"/>
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=pGUsQZ5nfQtuysSgiTdHyvHdoY1hyA+rio/tbM9sSsA="
> region="siren" qt:chapter="boeing: freedom"/>
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=saCzqVi4h08ikgSBUcLjUjwHxzh9DL5Wib0d0dKi3mo="
> region="siren" qt:chapter="yamaha: mama said"/>
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=MqOqXo89l9O012WsrvZIVHLKfZx6mo4fqCcez2GvKlA="
> region="siren" qt:chapter="gmc: sliding roof"/>
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=2j53xedyHmUM2uSxWlxg2LqDDk+b7/kkIDKigEdYdp0="
> region="siren" qt:chapter="nokia: color adjustment"/>
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=Um2ysEtdgslrEyYZNaPU/KJD6MfTSKXH/HRRqOwj5ug="
> region="siren" qt:chapter="bmw: drive"/>
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=gPx1sdVxgYRgjCmX0V6WDVqPG/crkySweYrY/tXkrU0="
> region="siren" qt:chapter="guinness: taste"/>
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=MajLzma9FRxXFuxYS9YwCuJtxCRIpkaMNDx3CMrXgyA="
> region="siren" qt:chapter="apple: ellen feiss"/>
> <video src="makeMoviePlaylist.php?cmd=getmovie&path=LU/xHFq/
> 8jHGfn2gWDPDycW9CaQW55gjzP4sTXvwrAg=" region="siren"
> qt:chapter="playstation: joan"/>
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=ZmT4A6kfPIg7tFc6zUVYRznT89czwdXA9hjgn3Erehg="
> region="siren" qt:chapter="pentax: hey"/>
> <video src="makeMoviePlaylist.php?cmd=getmovie&path=iUMIIycwZ0QzJVUtUI
> +N3glwgfAXPTgFq+mbmXS5vOo=" region="siren" qt:chapter="nike: dreams"/>
>
> </seq>
> </par>
>
> <par system-bitrate="512000">
> <!--56k modems-->
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=zSbG5zDpCJiqc2mbIunOjkw35wn2Q+saBlJZbaXmYUI="
> region="drm" duration="indefinite"/>
> <seq>
> <video src="makeMoviePlaylist.php?cmd=getmovie&path=5qRrKwWbemaOh5+
> +SOgv5SRshkpGTuvW5cIyRN9EWQM=" region="firsttrack" qt:chapter="levis:
> crazy legs"/>
> <video src="makeMoviePlaylist.php?cmd=getmovie&path=FzWapZbGt1YkCGKiB
> +fmlGftup5K8nYl6yVUTG+l+7c=" region="siren" qt:chapter="adidas: the
> game"/>
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=Q3gUP0pHVYYjsmCUn2PqMPTOwsqH/x4TbPJbwmEm9yc="
> region="siren" qt:chapter="boeing: freedom"/>
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=4OQkZQNgbKWnJcZKA0Dwu9blaufGr9nrMemtfykVNK8="
> region="siren" qt:chapter="yamaha: mama said"/>
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=SjXVxuW7miYu0djHcpXX2xSk/hpoxPnCmFhoiGJ2Zlc="
> region="siren" qt:chapter="gmc: sliding roof"/>
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=X3LbGKCtMcK5q3uhQpzEy4YNNaRwezXqS8qHx/KXC64="
> region="siren" qt:chapter="nokia: color adjustment"/>
> <video src="makeMoviePlaylist.php?
> cmd=getmovie&path=EPCybK7ipcFMAhj7Lkejc+OWulQVwNDZlLA8sFDRFt0="
> region="siren" qt:chapter="bmw: drive"/>
> <video src="makeMoviePlaylist.php?cmd=getmovie&path=R9
> +mtBsHiUiPvn5hw8PbcTVu9Zy5I7BnhPIeiT2wGPA=" region="siren"
> qt:chapter="guinness: taste"/>
> <video src="makeMoviePlaylist.php?cmd=getmovie&path=N/bnlupKzblackF
> +x4ZDedx8LyOn62vjGvI8uMBR648=" region="siren" qt:chapter="apple: ellen
> feiss"/>
> <video src="makeMoviePlaylist.php?cmd=getmovie&path=gy8lEzyB
> +hbyfZqgTEC/hwjJCuBSZObz2k1lkzl2x38=" region="siren"
> qt:chapter="playstation: joan"/>
> <video src="makeMoviePlaylist.php?cmd=getmovie&path=mnI7NPIv
> +UUdj9bjBXskipg40IBLjRdeDYDRepdMiBQ=" region="siren"
> qt:chapter="pentax: hey"/>
> <video src="makeMoviePlaylist.php?cmd=getmovie&path=c9crwb4Ss
> +xcups9lnvEg+TVX5Duf6+3jPNq3vciSnU=" region="siren" qt:chapter="nike:
> dreams"/>
>
> </seq>
> </par>
> </switch>
> </body>
> </smil>
>
attached mail follows:
actually all sarcasm is appreciated ;)
at least, I got a laugh.
I am learning/experimenting with ways to add DRM to movies.
Why:
My script, makeMoviePlaylist.php, is calling the script, brain.php,
to build the movies to send to QuickTime
I wanted to prevent the user from directly accessing this 'brain' php
script [located outside the web folder] by sending variables to the
main php script, makeMoviePlaylist.php.
What happens when a movie is requested:
My movies ARE NOT accessed directly. They are located outside the web
folder.
To get each movie, the main php scrip, makeMoviePlaylist.php, is
calling another php script, brain.php, located outside the web folder.
This 'brain' script freads these movies directly into the Quicktime
Plugin/Player.
The 'theory' is:
This succeeds:
The script , makeMoviePlaylist.php, is calling itself on the server
with makeMoviePlaylist.php?cmd=getmovie&path=encrypted_path_to_the_movie
The script, makeMoviePlaylist.php, accepts the request because it
originated from ITSELF on the server...
This fails:
This request was sent from OUTSIDE the server. The main script,
makeMoviePlaylist.php, realizes the this request did not originate
from itself on the server
http://www.myserver.scripts/makeMoviePlaylist.php?
cmd=getmovie&path=encrypted_path_to_the_movie
So, if the user tried to access an individual movie by sending a
url to the browser....the whole thing would fail...because the
request was coming from the user's computer...not from the server.
Is this even possible ?
my grasp of this is a bit shaky so any help is appreciated
g
On Oct 24, 2005, at 12:39 PM, Jochem Maas wrote:
>
> ...
>
>
>> Problem:
>> if the users does this:
>> curl -l -i "http://www.myserver/scripts/makeMoviePlaylist.php?
>> cmd=makesmil"
>> From the above curl'd output, entering the below url into a
>> browser will get the movie:
>> http://www.myserver/scripts/makeMoviePlaylist.php?
>> cmd=getmovie&path=wb1v2x9hApqFwTHhG5tSJlVp9bGi8glguo+gC565a5o="
>>
>
> thats what its supposed to do isn't it?
> under what conditions is someone allowed to grab the movie?
> and when are they not allowed?
> why is it important that you control whether they use a browser,
> a canopener or sone microsoft software to download?
>
>
>> is this possible to prevent ? Or is there a better approach?
>>
>
> approach to what? what is your goal (what are the requirements)?
>
>
>
>> This stuff is making my head spin a bit...
>>
>
> not to worry soon the walls will be closing in ;-)
>
>
>> I am learning aspects of security so any help is appreciated.
>> many thanks:)
>> g
>> This the output from:
>> curl -l -i "http://www.myserver/scripts/makeMoviePlaylist.php?
>> cmd=makesmil"
>> ETag: 253bd3c0260c47ad994857992e073682
>> Accept-Ranges: bytes
>> Content-Length: 5132
>> Content-Type: application/smil
>> <smil xmlns:qt="http://www.apple.com/quicktime/resources/
>> smilextensions"
>> qt:time-slider="true"
>> qt:chapter-mode="clip"
>> qt:immediate-instantiation="false"
>> qt:autoplay="true">
>> <head>
>> <meta name="base" content="http://www.myserver/scripts/" />
>> <meta name="full-name" content="Commercial Reel 2005"/>
>> <meta name="name" content="Commercial Reel 2005"/>
>> <meta name="copyright" content="2005"/>
>> <meta name="author" content="Graham Anderson"/>
>> <layout>
>> <root-layout id="main" title="Commercial Reel 2005" left="0" top
>> ="0" width="352" height="208" background-color="black"/>
>> <region id="firsttrack" z-index="1" left="0" top ="0" width =
>> "352" height = "208" background-color="black"
>> qt:attach-timebase="true" qt:immediate-instantiation="false"
>> qt:autoplay="true" qt:time-slider="true" qt:chapter-mode="clip" />
>> <region id="siren" z-index="1" left="0" top ="0" width="352"
>> height="208" fit ="fill" background-color="black"
>> qt:time-slider="true" qt:attach-timebase="true"
>> qt:autoplay="true" qt:chapter-mode="clip"
>> qt:immediate-instantiation="false" />
>> <region id="drm" z-index="3" left="0" top ="0" width = "352"
>> height = "208" background-color="black"
>> qt:attach-timebase="false" qt:immediate-instantiation="false"
>> qt:autoplay="false" qt:time-slider="false"/>
>> </layout>
>> </head>
>> <body>
>> <switch>
>> <par system-bitrate="768000">
>> <!--for T1 and faster-->
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=zSbG5zDpCJiqc2mbIunOjkw35wn2Q+saBlJZbaXmYUI="
>> region="drm" duration="indefinite"/>
>> <seq>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=wb1v2x9hApqFwTHhG5tSJlVp9bGi8glguo+gC565a5o="
>> region="firsttrack" qt:chapter="levis: crazy legs"/>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=wHvUoTrGxSW7C8uHjo7hHWLh9hJdvL0hVNx9hoUX3zM="
>> region="siren" qt:chapter="adidas: the game"/>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=pGUsQZ5nfQtuysSgiTdHyvHdoY1hyA+rio/tbM9sSsA="
>> region="siren" qt:chapter="boeing: freedom"/>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=saCzqVi4h08ikgSBUcLjUjwHxzh9DL5Wib0d0dKi3mo="
>> region="siren" qt:chapter="yamaha: mama said"/>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=MqOqXo89l9O012WsrvZIVHLKfZx6mo4fqCcez2GvKlA="
>> region="siren" qt:chapter="gmc: sliding roof"/>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=2j53xedyHmUM2uSxWlxg2LqDDk+b7/kkIDKigEdYdp0="
>> region="siren" qt:chapter="nokia: color adjustment"/>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=Um2ysEtdgslrEyYZNaPU/KJD6MfTSKXH/HRRqOwj5ug="
>> region="siren" qt:chapter="bmw: drive"/>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=gPx1sdVxgYRgjCmX0V6WDVqPG/crkySweYrY/tXkrU0="
>> region="siren" qt:chapter="guinness: taste"/>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=MajLzma9FRxXFuxYS9YwCuJtxCRIpkaMNDx3CMrXgyA="
>> region="siren" qt:chapter="apple: ellen feiss"/>
>> <video src="makeMoviePlaylist.php?cmd=getmovie&path=LU/xHFq/
>> 8jHGfn2gWDPDycW9CaQW55gjzP4sTXvwrAg=" region="siren"
>> qt:chapter="playstation: joan"/>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=ZmT4A6kfPIg7tFc6zUVYRznT89czwdXA9hjgn3Erehg="
>> region="siren" qt:chapter="pentax: hey"/>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=iUMIIycwZ0QzJVUtUI +N3glwgfAXPTgFq+mbmXS5vOo="
>> region="siren" qt:chapter="nike: dreams"/>
>> </seq>
>> </par>
>> <par system-bitrate="512000">
>> <!--56k modems-->
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=zSbG5zDpCJiqc2mbIunOjkw35wn2Q+saBlJZbaXmYUI="
>> region="drm" duration="indefinite"/>
>> <seq>
>> <video src="makeMoviePlaylist.php?cmd=getmovie&path=5qRrKwWbemaOh5
>> + +SOgv5SRshkpGTuvW5cIyRN9EWQM=" region="firsttrack"
>> qt:chapter="levis: crazy legs"/>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=FzWapZbGt1YkCGKiB +fmlGftup5K8nYl6yVUTG+l+7c="
>> region="siren" qt:chapter="adidas: the game"/>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=Q3gUP0pHVYYjsmCUn2PqMPTOwsqH/x4TbPJbwmEm9yc="
>> region="siren" qt:chapter="boeing: freedom"/>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=4OQkZQNgbKWnJcZKA0Dwu9blaufGr9nrMemtfykVNK8="
>> region="siren" qt:chapter="yamaha: mama said"/>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=SjXVxuW7miYu0djHcpXX2xSk/hpoxPnCmFhoiGJ2Zlc="
>> region="siren" qt:chapter="gmc: sliding roof"/>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=X3LbGKCtMcK5q3uhQpzEy4YNNaRwezXqS8qHx/KXC64="
>> region="siren" qt:chapter="nokia: color adjustment"/>
>> <video src="makeMoviePlaylist.php?
>> cmd=getmovie&path=EPCybK7ipcFMAhj7Lkejc+OWulQVwNDZlLA8sFDRFt0="
>> region="siren" qt:chapter="bmw: drive"/>
>> <video src="makeMoviePlaylist.php?cmd=getmovie&path=R9
>> +mtBsHiUiPvn5hw8PbcTVu9Zy5I7BnhPIeiT2wGPA=" region="siren"
>> qt:chapter="guinness: taste"/>
>> <video src="makeMoviePlaylist.php?cmd=getmovie&path=N/
>> bnlupKzblackF +x4ZDedx8LyOn62vjGvI8uMBR648=" region="siren"
>> qt:chapter="apple: ellen feiss"/>
>> <video src="makeMoviePlaylist.php?cmd=getmovie&path=gy8lEzyB
>> +hbyfZqgTEC/hwjJCuBSZObz2k1lkzl2x38=" region="siren"
>> qt:chapter="playstation: joan"/>
>> <video src="makeMoviePlaylist.php?cmd=getmovie&path=mnI7NPIv
>> +UUdj9bjBXskipg40IBLjRdeDYDRepdMiBQ=" region="siren"
>> qt:chapter="pentax: hey"/>
>> <video src="makeMoviePlaylist.php?cmd=getmovie&path=c9crwb4Ss
>> +xcups9lnvEg+TVX5Duf6+3jPNq3vciSnU=" region="siren"
>> qt:chapter="nike: dreams"/>
>> </seq>
>> </par>
>> </switch>
>> </body>
>> </smil>
>
attached mail follows:
On Mon, October 24, 2005 2:23 pm, Graham Anderson wrote:
> is this possible to prevent ? Or is there a better approach?
> This stuff is making my head spin a bit...
> I am learning aspects of security so any help is appreciated.
You can change makeMoviePlaylist.php to do whatever you want it to.
So you can require a valid login, and if they're not logged, spit out
a login page.
Your login page could be built using examples from:
http://php.net/session_start
The check to make sure they are logged in will also be there.
Just put the same code to check their credentials right into
makeMovePlaylist.php
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
> The script , makeMoviePlaylist.php, is calling itself on the server
> with
> makeMoviePlaylist.php?cmd=getmovie&path=encrypted_path_to_the_movie
> The script, makeMoviePlaylist.php, accepts the request because it
> originated from ITSELF on the server...
How do you *KNOW* it originated from ITSELF?
Can't I just fake it out by copying the URL you are using?
> This request was sent from OUTSIDE the server. The main script,
> makeMoviePlaylist.php, realizes the this request did not originate
> from itself on the server
Again, how you do *KNOW* that to be true?
What's the big picture again?
They need to login to see the movies, right?
Or is it something else?
If just need login, use http://php.net/session_start and friends as I
just posted.
If it's something else, session_start() may not help.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
nicely put.
Oliver Grätz wrote:
> GamblerZG schrieb:
>
>>>But what benefit is there is having it as an explicitly "abstract"
>>>class? Why can't it just be a "normal" class definition which you
>>>inherit from?
>>
>>The idea is that a high-level language should prohobit you from doing
>>things that do not make sence. Why they implemented it in PHP? Because
>>it's there in Java, I guess.
>
>
> No, it's there because it makes sense.
> If you derive from an abstract class the mechanism forces you to
> implement the abstract methods. Think of this:
>
> class Super
> {
> public function check() {} //no code!
> public function huba()
> {
> /* code */
> $this->check(); // use of method
> }
> }
> class MyClass extends Super {}
>
> This is what you do without having abstract classes. You put an empty
> method into the class. You rely on remembering that test() has to be
> filled with meaning in the subclass. You are even allowed to forget
> implementing check() which might get you into trouble because the
> check() is what you meant to be called for ensuring the data integrity
> of the data you intend to use a few lines later.
>
> Or worse: You leave out the method in the superclasse and only state in
> the documentation that there has to be a check() method in subclasses.
> This is the way to forgetting to implement all kinds of stuff.
>
> So there is this mechanism called "abstract class":
>
> abstract class Super
> {
> abstract public function check();
> public function huba()
> {
> /* code */
> $this->check(); // use of method
> }
> }
> class MyClass extends Super {}
>
> Now, you enforce several things:
> - Super cannot be instantiated.
> It is not complete and PHP knows about this.
> - MyClass is not complete until you implement a check().
> This way you have to actively say "I don't need a check."
> by putting an empty check() into MyClass.
>
> Even better: You can decide to implement just some of the abstract
> methods of Super. Then PHP forces you to declare your subclass as
> abstract, too. This allows for partially complete class trees and it is
> not up to you to remember which classes are ready to use and which are not.
>
> No, abstract classes are not just there "because Java has them", they
> exits because they help you in managing your code repository and because
> they prohibit you from doing stupid things with the code.
>
> OLLi
>
attached mail follows:
Oliver Grätz wrote:
> GamblerZG schrieb:
>
>>>But what benefit is there is having it as an explicitly "abstract"
>>>class? Why can't it just be a "normal" class definition which you
>>>inherit from?
>>
>>The idea is that a high-level language should prohobit you from doing
>>things that do not make sence. Why they implemented it in PHP? Because
>>it's there in Java, I guess.
>
>
> No, it's there because it makes sense.
I did not say abstractness did not make sense. But it's not crucial.
--
Best regards,
Roman S.I.
http://sf.net/projects/naturalgine/
attached mail follows:
After further investigation I found that using the 'mysqli' object and
corresponding extension library will allow you to execute MySQL stored
procedures from PHP.
documentation can be found at:
http://www.php.net/manual/en/ref.mysqli.php
cheers
-c
> On Sat, October 22, 2005 12:55 pm, Colin Shreffler wrote:
>> Can any one please tell me how you call a stored procedure in either
>> PostgreSQL or MySQL from php?
>
> WILD GUESS:
>
> $query = "call silly_sproc()";
> mysql_query($query, $connection) or die(mysql_error($connection));
> pg_exec($connection, $query) or die(pg_last_error($connection));
>
> With an argument is left as an exercise to the reader.
>
> HINT: Stuff whatever you would type in the mysql/psql monitor into $query
>
> No promise this works, as I've only done user-defiend functions rather
> than stored procedures (unless those are the same...) in PostgreSQL,
> and my webhost's MySQL probably ain't up to stored procedures yet.
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
>
>
>
Thank you,
Colin Shreffler
Principal
303.349.9010 - cell
928.396.1099 - fax
colin.shreffler
warp9software.com
Warp 9 Software, LLC.
6791 Halifax Avenue
Castle Rock, CO 80104
Confidentiality Notice: The information in this e-mail may be confidential
and/or privileged. This e-mail is intended to be reviewed by only the
individual or organization named in the e-mail address. If you are not the
intended recipient, you are hereby notified that any review, dissemination
or copying of this e-mail and attachments, if any, or the information
contained herein, is strictly prohibited.
attached mail follows:
Hi,
I am trying to create a regular expression for a width of a room, the value
can be a whole integer (up to 999) with up to 2 decimal places -when it is
stored in the database mysql will pad the value accordingly.
/^[0-9]{1,3}.?[0-9]{0,2}?$/
The only problem I have found with above is that I can enter 1.
Is it possible to modify it so that I can only enter the decimal point if I
enter at least digit after it?
Also is there any difference between [0-9] and \d
Thanks for your help
attached mail follows:
Shaun wrote:
> Hi,
>
> I am trying to create a regular expression for a width of a room, the value
> can be a whole integer (up to 999) with up to 2 decimal places -when it is
> stored in the database mysql will pad the value accordingly.
>
> /^[0-9]{1,3}.?[0-9]{0,2}?$/
>
> The only problem I have found with above is that I can enter 1.
>
> Is it possible to modify it so that I can only enter the decimal point if I
> enter at least digit after it?
>
> Also is there any difference between [0-9] and \d
>
> Thanks for your help
Try this..
^\d{1,3}($|\.\d{1,2}$)
1,2 or 3 digits followed by end OR decimal point and 1 or 2 digits and end of line.
attached mail follows:
On Mon, October 24, 2005 3:59 pm, Shaun wrote:
> I am trying to create a regular expression for a width of a room, the
> value
> can be a whole integer (up to 999) with up to 2 decimal places -when
> it is
> stored in the database mysql will pad the value accordingly.
>
> /^[0-9]{1,3}.?[0-9]{0,2}?$/
Because '.' is special to preg, this expression ALSO matches:
12a25
5z43
7a
[aside]
Engineer: 7A, please.
Davey: What number, please?
Band: 7A!
Davey: All right, okay, just cuz I'm short
[/aside]
This might (or might not) do it:
/^[0-9]{1,3}(\\.[0-9]{1,2})?$/
The \\ is there so that PHP will turn it into \, and then you have \.
in the regular expression which the PRCE will interpret as "the
literal character known as 'dot'" instead of "any old character at
all"
> Also is there any difference between [0-9] and \d
Try it and see.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
I don't understand what is going on with a simple example I created to
understand how GD graphics are presented in a web page.
First I created the following simple script (in a file named graphic.php):
// file: graphic.php
<?php
$image = imagecreatefrompng("my_graphic.png");
imagepng($image);
?>
I load that script with my web browser, the image is displayed as expected.
Now if I treat graphic.php as an image, and reference in another page using
the <img src=graphic.php> tag as in the following:
// my_page.php
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<img src=graphic.php>
</body>
</html>
The page again displays my_graphic.png.
However if I replace:
<img src=graphic.php>
with
<img src=<?php
$image = imagecreatefrompng("my_graphic.png");
imagepng($image);
?> >
my_graphic.png is no longer displayed and the web page gets filled with
random characters.
Why is this happening or what am I missing.
Thanks for any insight.
Chris
attached mail follows:
On Mon, 2005-10-24 at 20:14 -0400, Chris wrote:
> I don't understand what is going on with a simple example I created to
> understand how GD graphics are presented in a web page.
[[snip]]
> However if I replace:
> <img src=graphic.php>
>
> with
>
> <img src=<?php
> $image = imagecreatefrompng("my_graphic.png");
> imagepng($image);
> ?> >
>
> my_graphic.png is no longer displayed and the web page gets filled with
> random characters.
>
> Why is this happening or what am I missing.
You're not missing anything. That is exactly the expected behaviour. You
can call graphic.php with GET variables if you need to pass information
on, but you can't put images inline like that except for with data:
URIs.
data: URIs are currently only supported by Gecko browsers (Mozilla,
Firefox, etc) and maybe Safari or Opera (not sure about the latter two).
Do a search for "data: URI RFC" or similar to find out about them.
--
Jasper Bryant-Greene
General Manager
Album Limited
e: jasper
album.co.nz
w: http://www.album.co.nz/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand
attached mail follows:
On Mon, October 24, 2005 7:14 pm, Chris wrote:
> I don't understand what is going on with a simple example I created to
> understand how GD graphics are presented in a web page.
Basically, you were right the first time.
Think of it this way:
HTML pages generally have, well, HTML in them.
Sometimes that HTML has an IMG tag, and that provides a URL to an image.
But, with static images, you don't copy/paste the image itself right
into your HTML.
It's just another URL that the browser gets after it gets the HTML.
PHP doesn't change any of this, really, except that now the URL for
the image just *happens* to be an image that is composed on the fly.
> Now if I treat graphic.php as an image, and reference in another page
graphic.php *is* an image, just like, any other image.
So you should treat it like an image.
> my_graphic.png is no longer displayed and the web page gets filled
> with
> random characters.
If you had a PNG, and if you opened up that file in Notepad/BBEdit/vi
and you copied all the stuff out of it and pasted it into your HTML,
that's pretty much what you would get, right?
Just like you just did with PHP doing the "paste"
Now, one little caveat:
Microsoft, in its infinite wisdom, frequently IGNORES the
"Content-type:" head from the HTTP specification in various versions
of Internet Explorer.
Instead, MS IE will examine the URL and see: graphic.php and say, "Oh,
never mind that silly HTTP specification and Content-type, *this* must
be a .php file because it ends in .php, and everybody uses 8.3,
right?"
Then, of course, MS IE says, "Oh my goodness! I don't know how to
handle a '.php' file! Woe is me!" and then pops up a Window telling
the user it has encountered a file of type .php and doesn't know what
to do with it.
[I'll tell 'em what to do with it... :-)]
Anyway, if you're going to do much with dynamic images, you might as
well start getting them to have ".png" filenames now.
There are lots of techniques for this, but the whole ignoring
Content-type mess of MS IE, and because of their similar idiocy with
GET parameters for .pdf and .swf files, I recommend this:
Make your HTML and your URL indistinguishable from static HTML/URL, so
that MS IE can't *possibly* [bleep] up.
Put this in an .htaccess file next to the graphic.php script:
<Files graphic.png>
ForceType application/x-httpd-php
</Files>
Now, rename graphic.php to graphic.png
Voila.
MS IE "sees" graphic.png and "knows" it's a PNG.
Apache was told that graphic.png is *really* a PHP script, so Apache
fires up PHP and PHP/GD make the image and spit it out.
Your HTML and PNG are indistinguishable by the browser from a static
image, and they'd have to break every PNG out there to make yours not
work. Which, knowing MS, is not *impossible* but it's a lot less
likely than their various versions of IE that will break on
http://example.com/graphic.php as a PNG image URL.
--
Like Music?
http://l-i-e.com/artists.htm
attached mail follows:
Can anyone give me a clue on how to change this script so it can be used
with basic SMTP authentication?
TNX, Etienne
<?
function another_mail($to,$subject,$headers,$message)
{
// Could get this from the php ini?
$from="me
here.com";
list($me,$mydomain) = split("
",$from);
// Now look up the mail exchangers for the recipient
list($user,$domain) = split("
",$to,2);
if(getmxrr($domain,$mx,$weight) == 0) return FALSE;
// Try them in order of lowest weight first
array_multisort($mx,$weight);
$success=0;
foreach($mx as $host) {
// Open an SMTP connection
$connection = fsockopen ($host, 25, &$errno, &$errstr, 1);
if (!$connection)
continue;
$res=fgets($connection,256);
if(substr($res,0,3) != "220") break;
// Introduce ourselves
fputs($connection, "HELO $mydomain\n");
$res=fgets($connection,256);
if(substr($res,0,3) != "250") break;
// Envelope from
fputs($connection, "MAIL FROM: $from\n");
$res=fgets($connection,256);
if(substr($res,0,3) != "250") break;
// Envelope to
fputs($connection, "RCPT TO: $to\n");
$res=fgets($connection,256);
if(substr($res,0,3) != "250") break;
// The message
fputs($connection, "DATA\n");
$res=fgets($connection,256);
if(substr($res,0,3) != "354") break;
// Send To:, From:, Subject:, other headers, blank line, message, and finish
// with a period on its own line.
fputs($connection, "To: $to\nFrom: $from\nSubject:
$subject\n$headers\n\n$message\n.\n");
$res=fgets($connection,256);
if(substr($res,0,3) != "250") break;
// Say bye bye
fputs($connection,"QUIT\n");
$res=fgets($connection,256);
if(substr($res,0,3) != "221") break;
// It worked! So break out of the loop which tries all the mail exchangers.
$success=1;
break;
}
// Debug for if we fall over - uncomment as desired
// print $success?"Mail sent":"Failure: $res\n";
if($connection) {
if($success==0) fputs($connection, "QUIT\n");
fclose ($connection);
}
return $success?TRUE:FALSE;
}
another_mail("recipient
some.domain","My Subject","X-mailer: PHP
Script\nX-another-header: Whatever","Test email body.\n\nNote if you
actually put a period on a line\nby itself, the function will terminate
prematurely.\n\nYou will get a partial email sent though.\n");
?>
attached mail follows:
Hello,
on 10/24/2005 10:57 PM Etienne Finet said the following:
> Can anyone give me a clue on how to change this script so it can be used
> with basic SMTP authentication?
SMTP authentication is not that simple. There are several authentication
methods and you need to establish an authentication dialog according to
what authentication methods your SMTP server supports.
You may want to take a look at this class that provides a wrapper
function named smtp_mail similar to the one that you wrote, except that
it also implements authentication as you need.
http://www.phpclasses.org/mimemessage
You also need this class for the SMTP dialog:
http://www.phpclasses.org/smtpclass
And this class for the authentication support:
http://www.phpclasses.org/sasl
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
attached mail follows:
I remember trying this. It required GD version 2 or higher, not
mentioned on their requirements page. Most of these galleries do. I'm
waiting to get my sysadmin to install GD 2.x +. I have 1.6.x and only
PHP Version 4.1.2
It also requires changing disable_functions in the php.ini file, which
luckily I can do. But not always for everyone.
Thanks,
John
Richard Lynch wrote:
>On Sun, October 23, 2005 12:09 am, John Taylor-Johnston wrote:
>
>
>>>... out there, I'll eat my hat. :-)
>>>
>>>
>>Get your false teeth out and glue them on. I defy you to find one that
>>works.
>>
>>
>
>Not counting the time I spent reading about Rasmus' powerbook, it took
>me about a minute to find this:
>
>http://gallery.menalto.com/features
>
>which Rasmus praised in 2003 as his fave.
>
>I dunno if it's still his fave or if there isn't a better one.
>
>I don't even know if it works.
>
>I just know it lists the features you ask for.
>
>
>
>>Was it a php3 thing where "= " meant "echo "? I saw this in a number
>>of
>>scripts where folks were still using <? instead of <?php !?
>>
>>
>
>Yes.
>
><?= ... ?>
><?php echo ... ?>
>
>Same thing, different spelling.
>
>It's a shame <?= only works with "short tags" on, as it shouldn't (I
>don't think) conflict with the XHTML or XML or whatever the heck it is
>that caused short_tags to become obsolete.
>
>And, frankly, <?=$foo?> is a lot easier on the eyes (and fingers) than
><?php echo $foo?> if you're not into HereDocs and you want to pepper a
>bunch of simple variables into a FORM or something.
>
>I LIKED <?= personally.
>
>I know some hated it, but there ya go.
>
>
>
>>I've spent 2-3 hours trying to get a number (I can name them) of
>>galeries to work. :(
>>Show me one that generates thumbnails - And works for you personally.
>>
>>
>
>I've never ever bothered to make a slideshow for myself, as I rarely
>WANT a slideshow.
>
>I'd rather see thumbnails and choose the good ones than sit there
>watching a TV-like device...
>
>Just personal choice, but after not turning on my TV for years, I
>guess I just got out of the habit :-)
>
>
>
>>But thanks for the Yahoo key words to search with: "PHP image gallery
>>scripts".
>>Any one :) Please.
>>
>>
>
>Hopefully somebody who has an image gallery with slideshow and
>thumbnails they like will recommend one.
>
>
>
--
John Taylor-Johnston
-----------------------------------------------------------------------------
"If it's not Open Source, it's Murphy's Law."
' ' ' Collège de Sherbrooke:
ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/
- 819-569-2064
°v° Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures
/(_)\ Université de Sherbrooke
^ ^ http://compcanlit.ca/ T: 819.569.2064
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]