php-general Digest 14 Sep 2009 00:08:49 -0000 Issue 6338
Topics (messages 297969 through 297984):
Re: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger
297969 by: Andrea Giammarchi
297971 by: Paul M Foster
297972 by: Eddie Drapkin
297973 by: mm w
297975 by: Andrea Giammarchi
297976 by: Andrea Giammarchi
297978 by: Eddie Drapkin
297980 by: Andrea Giammarchi
297981 by: Andrea Giammarchi
297982 by: Eddie Drapkin
297983 by: Andrea Giammarchi
297984 by: tedd
Re: Reading files in PHP 5.3.0
297970 by: tedd
PDO with text in BLOB's
297974 by: Lester Caine
Re: Fixing the path
297977 by: Rico Secada
looking through old posts/emails
297979 by: Fred Silsbee
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
I can only say if these are our prespective about innovation and technologies,
we need to thanks silly people like me moving further than what is already
there and common convention.
This ML is a bit different from what I was expecting, fortunately who
understood the project and gave it a try to test it has been happy with it.
Finally, I am working with FirePHP developer for a FirePHP + Formaldehyde
natural integration in FirePHP and obviously he liked Formaldehyde, since
there's nothing like that inside FirePHP - they are simply different, and
FirePHP does not manage Fatal Errors and other crucial one.
The good part is that at least you know there is that possibility, so the day
you'll realize that your set_error_handler could be useless in certain
circumstances you'll probably re-evaluate Formaldehyde ;-)
Thanks to those who tried or tried to understand.
Regards
P.S. I am certified Zend Engineer with 10 years of experience with PHP and
dunno how many innovation awards in phpclasses.org ... so it was not just to
waste my time guys, and it is open source, maybe next time I'll keep for me
> From: [email protected]
> Date: Sat, 12 Sep 2009 22:37:01 +0200
> To: [email protected]
> Subject: Re: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger
>
> On Sat, Sep 12, 2009 at 8:47 PM, Jim Lucas <[email protected]> wrote:
>
> > Andrea Giammarchi wrote:
> >
> >> something I cannot find in any other library or framework.
> >>
> >
> > This should tell you something then...
> >
> > If something like Formandehyde isn't useful, then why is Charles so popular
> (note: popular from my perspective. I wouldn't dare think that it is popular
> with anyone on this list unless they expressly told me so)
> http://www.charlesproxy.com/ . I can't say anything about the responses
> Andrea has gotten without sounding rude and likely starting an internet
> fight, so I won't say anything. Except for this. Tedd, the ajax example you
> linked to does not need any debugging, that is for sure.
>
>
> > --
> > Jim Lucas
> >
> > "Some men are born to greatness, some achieve greatness,
> > and some have greatness thrust upon them."
> >
> > Twelfth Night, Act II, Scene V
> > by William Shakespeare
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
_________________________________________________________________
With Windows Live, you can organize, edit, and share your photos.
http://www.microsoft.com/middleeast/windows/windowslive/products/photo-gallery-edit.aspx
--- End Message ---
--- Begin Message ---
On Sun, Sep 13, 2009 at 01:33:49PM +0200, Andrea Giammarchi wrote:
<snip>
>
> This ML is a bit different from what I was expecting,
<snip>
>
> P.S. I am certified Zend Engineer with 10 years of experience with PHP and
> dunno how many innovation awards in phpclasses.org ... so it was not just to
> waste my time guys, and it is open source, maybe next time I'll keep for me
Yeah, we people on this list just don't get it.
So, you're gonna leave the list now, right?
Paul
--
Paul M. Foster
--- End Message ---
--- Begin Message ---
What does this offer that a real debugger, like xdebug, doesn't?
--- End Message ---
--- Begin Message ---
Hello Andrea,
I am developing with PHP since now 12 years (did a couple stuff in
Zend Core), and was one of a few guy using and sharing about php when
it was only an THE Apache mode in the world C++ CGI, I am not Zend
Certified, I won't :), anyway those things make me smarter or give me
the "truth" or the right to be a jerk?,
you came here to claim that you were right not to discuss, what did
you expect?, if you want to discuss we can, but I can tell you I don't
share your points at all, it is not my way to code in scripting
language. back to silence.
Best,
On Sun, Sep 13, 2009 at 4:33 AM, Andrea Giammarchi <[email protected]> wrote:
>
> I can only say if these are our prespective about innovation and
> technologies, we need to thanks silly people like me moving further than what
> is already there and common convention.
>
> This ML is a bit different from what I was expecting, fortunately who
> understood the project and gave it a try to test it has been happy with it.
>
> Finally, I am working with FirePHP developer for a FirePHP + Formaldehyde
> natural integration in FirePHP and obviously he liked Formaldehyde, since
> there's nothing like that inside FirePHP - they are simply different, and
> FirePHP does not manage Fatal Errors and other crucial one.
>
> The good part is that at least you know there is that possibility, so the day
> you'll realize that your set_error_handler could be useless in certain
> circumstances you'll probably re-evaluate Formaldehyde ;-)
>
> Thanks to those who tried or tried to understand.
>
> Regards
>
> P.S. I am certified Zend Engineer with 10 years of experience with PHP and
> dunno how many innovation awards in phpclasses.org ... so it was not just to
> waste my time guys, and it is open source, maybe next time I'll keep for me
>
>> From: [email protected]
>> Date: Sat, 12 Sep 2009 22:37:01 +0200
>> To: [email protected]
>> Subject: Re: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error
>> Debugger
>>
>> On Sat, Sep 12, 2009 at 8:47 PM, Jim Lucas <[email protected]> wrote:
>>
>> > Andrea Giammarchi wrote:
>> >
>> >> something I cannot find in any other library or framework.
>> >>
>> >
>> > This should tell you something then...
>> >
>> > If something like Formandehyde isn't useful, then why is Charles so popular
>> (note: popular from my perspective. I wouldn't dare think that it is popular
>> with anyone on this list unless they expressly told me so)
>> http://www.charlesproxy.com/ . I can't say anything about the responses
>> Andrea has gotten without sounding rude and likely starting an internet
>> fight, so I won't say anything. Except for this. Tedd, the ajax example you
>> linked to does not need any debugging, that is for sure.
>>
>>
>> > --
>> > Jim Lucas
>> >
>> > "Some men are born to greatness, some achieve greatness,
>> > and some have greatness thrust upon them."
>> >
>> > Twelfth Night, Act II, Scene V
>> > by William Shakespeare
>> >
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>> >
>
> _________________________________________________________________
> With Windows Live, you can organize, edit, and share your photos.
> http://www.microsoft.com/middleeast/windows/windowslive/products/photo-gallery-edit.aspx
--- End Message ---
--- Begin Message ---
> Hello Andrea,
>
> I am developing with PHP since now 12 years (did a couple stuff in
> Zend Core), and was one of a few guy using and sharing about php when
> it was only an THE Apache mode in the world C++ CGI, I am not Zend
> Certified, I won't :), anyway those things make me smarter or give me
> the "truth" or the right to be a jerk?,
Which part is jerk, people starting replying without even looking for 1 minute
the project page?
People saying: what's wrong with set_error_handler, ignoring it does not catch
all errors?
Or people saying: if nobody did before it means it should not be done, as if
the programming world and all ideas ended years ago?
I wrote my skills summary just to tell you: hey guys, I am not the last arrived
here, so do not threat me as a noob please, OK?
I prefer answers such: I am using this other program, application, strategy,
and I do not need it
rather then people writing unrelated stuff or linking pages that perfectly
represent the Formaldehyde scenario but they did not even spend a minute to
read what Formaldehyde is so proud of theirself and their intuition ... right?
They confirmed they did not read, so WTF?
I was expecting somebody that develop massive Ajax application, not a link with
3 pages and zero point about the reply.
> you came here to claim that you were right not to discuss, what did
> you expect?, if you want to discuss we can, but I can tell you I don't
> share your points at all, it is not my way to code in scripting
> language. back to silence.
>
> Best
I never discuss if I do not know what I am discussing about, this is my only
point.
Best
_________________________________________________________________
Show them the way! Add maps and directions to your party invites.
http://www.microsoft.com/windows/windowslive/products/events.aspx
--- End Message ---
--- Begin Message ---
Hosting support, since it is 100% php with zero dependencies and zero config
effort plus the ability do debug directly via console, unit testing via
Selenium and/or others, and it does not require manual error catch after the
generic problemi, since it will simply be showed on the client side.
On the other hand, xdebug could offer a bit more such memory allocation,
something could require APD if integrated with Formaldehyde (and it could be
interesting, so I am not excluding I won't do it next release)
Best Regards
P.S. for others ... these kind of answers, questions, opinions, that IS what I
was expecting
> Date: Sun, 13 Sep 2009 13:52:11 -0400
> From: [email protected]
> To: [email protected]
> CC: [email protected]
> Subject: Re: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error Debugger
>
> What does this offer that a real debugger, like xdebug, doesn't?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
_________________________________________________________________
Share your memories online with anyone you want.
http://www.microsoft.com/middleeast/windows/windowslive/products/photos-share.aspx?tab=1
--- End Message ---
--- Begin Message ---
On Sun, Sep 13, 2009 at 5:01 PM, Andrea Giammarchi <[email protected]> wrote:
>
> Hosting support, since it is 100% php with zero dependencies and zero config
> effort plus the ability do debug directly via console, unit testing via
> Selenium and/or others, and it does not require manual error catch after the
> generic problemi, since it will simply be showed on the client side.
>
> On the other hand, xdebug could offer a bit more such memory allocation,
> something could require APD if integrated with Formaldehyde (and it could be
> interesting, so I am not excluding I won't do it next release)
>
> Best Regards
>
> P.S. for others ... these kind of answers, questions, opinions, that IS what
> I was expecting
>
>> Date: Sun, 13 Sep 2009 13:52:11 -0400
>> From: [email protected]
>> To: [email protected]
>> CC: [email protected]
>> Subject: Re: [PHP] RE: [Formaldehyde] The Most Basic Ajax - PHP Error
>> Debugger
>>
>> What does this offer that a real debugger, like xdebug, doesn't?
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> _________________________________________________________________
> Share your memories online with anyone you want.
> http://www.microsoft.com/middleeast/windows/windowslive/products/photos-share.aspx?tab=1
The thing is, in a properly configured development environment, it's
local, so I can immediately read the logs, or just fire the script up
with xdebug, or the errors will get caught in the editor. And I would
NEVER imagine publicly exposing error messages in a production
environment, so I'm just really confused as to what this offers, other
than some seemingly small benefit in readability, specifically in
firebug (and some other cruft that you really ought to remove, like
the X-Formaldehyde header). And furthermore, this requires code
changes from development -> production, which is a problem I've always
had with FirePHP, too, as that information does not belong in a
production environment. As far as support for shared hosting is
concerned, I've stated on this list several times that my firm opinion
is shared hosting is shooting yourself in the foot (especially as a
good VPS isn't that much more expensive, I'm paying $20/mo for mine).
I think you best summed up why so many on this list think Formaldehyde
isn't a very useful product yourself: the errors are shown on the
client side. In theory, a good development environment already
exposes this information to the developer and things should fail a lot
more gracefully than error output for the user. You said that this
project is something that doesn't already exist, perhaps you should
consider that it doesn't exist because a sane development cycle
precludes Formaldehyde's usefulness?
--- End Message ---
--- Begin Message ---
Right, errors should never be exposed, and error_reporting should be 0 in
production but log function and the fact you can move Formaldehyde with the
application means it does not require extra effort.
In few words, if in production Formaldehyde constant is false, and it must be
false, nothing will be exposed.
You do not need to change your code if you configure properly the defined
constant while you can use what logs have to offers plus you'll have 1:1
production/development application
Finally, locally, and at least for me, I find extremely useful the runtime
debug, rather than keep logs under control, since specially Ajax interactions
needs to be performed runtime via emulators (Selenium) or not (We testing) and
other applications I know do not offer this simplicity that you call "useless"
but which is the reason I have created Formaldehyde.
That simplicity is not offered so far by your suggested one as well, and please
tell me how quick could be an instant PHP error "on screen" during tests or
debug rather than a log analysis but in any case, thanks for the feedback.
This is the only serious analysis so far, and I am looking forward for others,
if any.
Best Regards
> The thing is, in a properly configured development environment, it's
> local, so I can immediately read the logs, or just fire the script up
> with xdebug, or the errors will get caught in the editor. And I would
> NEVER imagine publicly exposing error messages in a production
> environment, so I'm just really confused as to what this offers, other
> than some seemingly small benefit in readability, specifically in
> firebug (and some other cruft that you really ought to remove, like
> the X-Formaldehyde header). And furthermore, this requires code
> changes from development -> production, which is a problem I've always
> had with FirePHP, too, as that information does not belong in a
> production environment. As far as support for shared hosting is
> concerned, I've stated on this list several times that my firm opinion
> is shared hosting is shooting yourself in the foot (especially as a
> good VPS isn't that much more expensive, I'm paying $20/mo for mine).
>
> I think you best summed up why so many on this list think Formaldehyde
> isn't a very useful product yourself: the errors are shown on the
> client side. In theory, a good development environment already
> exposes this information to the developer and things should fail a lot
> more gracefully than error output for the user. You said that this
> project is something that doesn't already exist, perhaps you should
> consider that it doesn't exist because a sane development cycle
> precludes Formaldehyde's usefulness?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
_________________________________________________________________
Show them the way! Add maps and directions to your party invites.
http://www.microsoft.com/windows/windowslive/products/events.aspx
--- End Message ---
--- Begin Message ---
Sorry, I meant environment
> ... plus you'll have 1:1 production/development application
_________________________________________________________________
More than messages–check out the rest of the Windows Live™.
http://www.microsoft.com/windows/windowslive/
--- End Message ---
--- Begin Message ---
> Right, errors should never be exposed, and error_reporting should be 0 in
> production but log function and the fact you can move Formaldehyde with the
> application means it does not require extra effort.
No, display_errors should be turned off (with log_errors turned on)
and error_reporting should be set to whatever standard you're coding
to (preferably, E_ALL | E_STRICT, but a lot of people like to ignore
E_NOTICE's).
> In few words, if in production Formaldehyde constant is false, and it must be
> false, nothing will be exposed.
So it's not zero configuration, then?
> You do not need to change your code if you configure properly the defined
> constant while you can use what logs have to offers plus you'll have 1:1
> production/development application
How do I configure a constant without changing code? And I wasn't
aware that a 1:1 development:production environment was a desirable
thing. Things like xdebug, display_errors, inclued, etc. should be
disabled for production and enabled for development.
> That simplicity is not offered so far by your suggested one as well, and
> please tell me how quick could be an instant PHP error "on screen" during
> tests or debug rather than a log analysis but in any case, thanks for the
> feedback.
Run "tail -f /path/to/your/php/error.log" and watch the error logs as
they're appended, if you need instant error notification.
Honestly, I'm sure it sounds like this by now but I'm not trying to
trash your application, but you've not done a very good job selling
it. It looks like you took some keywords ("ajax", "zero
configuration", "portable", etc. etc.) and tried to apply them to your
project, without actually seriously describing what your project is.
As best I can tell, your project doesn't do much other than facilitate
php debugging with Firebug, which is a very niche thing to do and any
development cycle that I've been a part of has had no need to do such
things, so I'm still failing to see Formaldahyde's usefulness. Maybe
I've missed something?
>
> This is the only serious analysis so far, and I am looking forward for
> others, if any.
>
> Best Regards
>
>> The thing is, in a properly configured development environment, it's
>> local, so I can immediately read the logs, or just fire the script up
>> with xdebug, or the errors will get caught in the editor. And I would
>> NEVER imagine publicly exposing error messages in a production
>> environment, so I'm just really confused as to what this offers, other
>> than some seemingly small benefit in readability, specifically in
>> firebug (and some other cruft that you really ought to remove, like
>> the X-Formaldehyde header). And furthermore, this requires code
>> changes from development -> production, which is a problem I've always
>> had with FirePHP, too, as that information does not belong in a
>> production environment. As far as support for shared hosting is
>> concerned, I've stated on this list several times that my firm opinion
>> is shared hosting is shooting yourself in the foot (especially as a
>> good VPS isn't that much more expensive, I'm paying $20/mo for mine).
>>
>> I think you best summed up why so many on this list think Formaldehyde
>> isn't a very useful product yourself: the errors are shown on the
>> client side. In theory, a good development environment already
>> exposes this information to the developer and things should fail a lot
>> more gracefully than error output for the user. You said that this
>> project is something that doesn't already exist, perhaps you should
>> consider that it doesn't exist because a sane development cycle
>> precludes Formaldehyde's usefulness?
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> _________________________________________________________________
> Show them the way! Add maps and directions to your party invites.
> http://www.microsoft.com/windows/windowslive/products/events.aspx
--- End Message ---
--- Begin Message ---
> No, display_errors should be turned off (with log_errors turned on)
> and error_reporting should be set to whatever standard you're coding
> to (preferably, E_ALL | E_STRICT, but a lot of people like to ignore
> E_NOTICE's).
yep, it should be a production environment
> So it's not zero configuration, then?
it is, described in the Security page inside the wiki, zero config means no
extensions, no code to change except a single require ... we can call it zero
config compared with everything else, specially something to compile or able to
change the env as your solution does
> And I wasn't
> aware that a 1:1 development:production environment was a desirable
> thing.
sure, PHP 4 on production and 5 as dev then is desiderable, right?
What about specific PHP version, extensions, and other specific env
problems/bugs?
I hope you are not following errors that could appear only because of your
plugns/extensions ... that would be a massive waste of time, isn't it?
> Things like xdebug, display_errors, inclued, etc. should be
> disabled for production and enabled for development.
1:1 is about what is running and where it is running ... you have an extension
which is not official and which could cause false positives or could have other
problems. I prefer same extensions in both dev/prod environments in order to be
sure behaviors will be the same, got it?
> Run "tail -f /path/to/your/php/error.log" and watch the error logs as
> they're appended, if you need instant error notification.
on windows dev env? and with at least two monitors to maintain a decent
application size for client side testings? checking both logs and errors
without a red line easily "surfable" with entire stack rather than pure text to
analyze? I prefer Formaldehyde here
> Honestly, I'm sure it sounds like this by now but I'm not trying to
> trash your application, but you've not done a very good job selling
> it. It looks like you took some keywords ("ajax", "zero
> configuration", "portable", etc. etc.) and tried to apply them to your
> project, without actually seriously describing what your project is.
did you describe xdebug? I had a read, I got what it is, and I am replying ...
> As best I can tell, your project doesn't do much other than facilitate
> php debugging with Firebug, which is a very niche thing to do and any
> development cycle that I've been a part of has had no need to do such
> things, so I'm still failing to see Formaldahyde's usefulness.
'cause you have tail habit ... I do exactly what you do except I spot it
quicker and I can isntantly red Errors expanding and contracting stack traces
without any extra effort. This is the difference.
If you think Formaldehyde is useless, I can say your way is useless as well,
since the purpose is the same, the way logs/errors are showed is different.
You had no choice before, and you'll probably never go for Formaldehyde, but
you kinda confirmed there was nithing similar before, and I can tell you I am
using it and I will do, so this project is not going to die soon, that is for
sure, as xdebug will hopefully be maintained (as FirePHP or others)
I call them alternatives, and I am an open minded person, I'll give xdebug a
try indeed, maybe I can integrate some feature.
Of course every of us developed Ajax application 'till now, does it mean the
debug process is death as is? Can we try to improve it somehow? That is what I
have done but everybody is free to choose his way, this is just a new one, and
you already said why (facilitate php debugging).
The fact you had no need is also because you had not this option, now you do.
Regards
P.S. Firebug is just one of compatible consoles, the best so far though, but
not because Formaldehyde is for Firebug, client side does not matter, it will
work with IE as well for those behind "legacy companies" (me right now, as
example)
_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.
http://www.microsoft.com/windows/windowslive/products/photos.aspx
--- End Message ---
--- Begin Message ---
At 10:49 PM +0200 9/13/09, Andrea Giammarchi wrote:
I was expecting somebody that develop massive Ajax application, not
a link with 3 pages and zero point about the reply.
You asked if anyone did any ajax? So, I replied and provided you with
an example.
Who cares if my example only has three pages? It could be hundreds --
the technique scales.
In any event, I provided you an example that does not need your
debugger -- it works and works good.
But then you get all testy because I did not read your documentation.
I never said I did AND there was never any requirement for me to do
so before posting. I was simply replying to your question.
But instead of establishing a constructive line of communication, you
start off my criticizing me because I didn't read your documentation.
You ask not to be treated as a noob, but you come in here telling
others where to get off and bragging about your credentials (as if
the rest of us can't do better) -- I'm not sure who you think you
are, but you sure act like an noob.
If nothing else, you have a lot to learn about making a point.
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
At 12:32 AM -0400 9/13/09, Paul M Foster wrote:
On Sat, Sep 12, 2009 at 10:22:10AM -0400, tedd wrote:
At 6:02 PM -0400 9/11/09, Paul M Foster wrote:
I typically use us2.php.net, which is hosted by Hurricane Electric.
Paul
Paul:
I wouldn't use Hurricane Electric if their accounts were provided for free!
The following is an experience I had with Hurricane Electric and
support for my opinion as to their "service".
You see, many years ago Hurricane Electric hosted (IMO with
complicity) a porn site that sent out over 2000 porn spams to AOL
using MY email address as the person to contact. That incident caused
me a great deal of trouble.
In an attempt to understand and resolve the problem, I sent several
emails to Hurricane Electric; I called them numerous times via
telephone; and I even sent them letters via the US mail. But
unfortunately they refused to answer ANY of my correspondence. Their
lack of communication provided support for my opinion of their
complicity with what had happened.
A few years back they contacted me (again more spam) soliciting my
interest in hosting with them. Normally, I would have just reported
such spam to spamcop, but because of the incident I replied and told
them what had happened.
Later I was contacted by one of their technicians who looked thorough
their records and confirmed/admitted the incident. However, he told
me that they could not be held responsible for they clients they
host. Furthermore, they have no intention of screening their clients.
He said that they will provide hosting to whomever they want,
including porn and spam sites. If their clients do anything wrong per
"their standards", then they will deal with it internally. Otherwise
they don't care about any harm done to anyone by them hosting such
sites. In short, they want the money but not the responsibility.
> Now, maybe Hurricane Electric has changed its ways, but they can't
change their past.
In my opinion, there are more than enough hosting companies who care
about the damage they might cause and take steps to reduce the about
spam and porn on the net. My advice, seek hosts other than Hurricane
Electric.
I don't know much about HE, other than the fact that they run ads in
Linux Journal. But they're a real hosting company, like Rackspace or
1and1. Yahoo (who hosts www.php.net) isn't a company I think of as a
hosting company. And they're an internet behemoth, like Godaddy or
Microsoft. So I'd personally steer away from them. Just my bias.
It sounds like HE's real problem is their TOS. I've hosted with a lot of
companies who will drop accounts where they find porn, spam and warez;
it's part of their TOS. The other problem I can see is that they are
apparently unwilling to even mediate a problem between two of their
accounts. "We just host 'em. Other than that, we don't care." Typical. I
expect the porn company paid them a *lot* more money than you did, so
they simply looked the other way. A shame.
The lesson, I suppose, is to look at the terms of service before you
sign up with a hosting company. You may still end up being a victim, but
at least you know what you're getting yourself into. If they don't
specifically disavow porn, spam and warez, then they allow (and in
effect, condone) it.
Paul
Paul:
Good advice, but you assumed that I was one of their clients -- I wasn't.
I was just an innocent bystander who found his email address being
used as a return address for porn spam. It wasn't until after I
started receiving hate email that I discovered who/what Hurricane
Electric was.
Imagine that suddenly out of the blue you started receiving hate mail
from hundreds of AOL users telling you what a low-life you are
because you sent porn to their children -- what would you do?
I imagine you would: a) find out who was behind it; b) contact them
and ask for an explanation; c) and try to restore your good name.
One might think that suing them would be a good idea, but the last
suit I was in cost me over $20k and I won! I didn't have that spare
change laying around at the time to go after a company in another
state.
I just wanted an explanation, but Hurricane Electric wouldn't do
anything. In my opinion, they are an example of what a hosting
company should not be.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
I'm having fun with a project that has moved exclusively to PDO, and I'm
now trying to restore firebird as an alternative database. The problem I
am having is with text fields in firebird which are BLOB SUB_TYPE TEXT.
These are essentially TEXT in other databases, and I'm used to ADOdb
simply loading them with text strings what ever the database is using
behind them. On PDO it would seem that these fields can only be
connected to streams? How does one load a simple long string into one of
these fields?
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
--- End Message ---
--- Begin Message ---
On Sat, 12 Sep 2009 00:43:50 -0400
Paul M Foster <[email protected]> wrote:
> (Or maybe I've completely misread what you're trying to do.)
Yes you did, but never mind :)
> Paul
>
> --
> Paul M. Foster
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
enclosed is a php for oracle that worked on Windows AND Fedora 9
<?php
/*
Oracle 11g1 version handle_log_book11g1.php
drop sequence log_id;
create sequence log_id
increment by 1
start with 1;
drop table log_book_id;
create table log_book_id ( log_id number primary key, fdate date, actype
varchar2(16), acid varchar(16), nlandings number, nhoursnumber);
insert into log_book_id values (logid.nextval,
TO_DATE('08/12/1973','MM/dd/YYYY'),'C150','N5787G',1,1.8);
insert into log_book_id values (logid.nextval,
TO_DATE('08/17/1973','MM/dd/YYYY'),'C150','N5787G',3,1.5);
insert into log_book_id values (logid.nextval,
TO_DATE('08/26/1973','MM/dd/YYYY'),'C150','N5787G',10,1.8);
insert into log_book_id values (logid.nextval,
TO_DATE('09/01/1973','MM/dd/YYYY'),'C150','N5293S',9,1.7);
*/
//construct a global variable for the form profile
$fields = array("fdate", "actype", "acid", "nlandings", "nhours");
global $connection;
session_start();
$db = "(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = landon)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = LMKGDN)
)
)";
$user = $_SESSION['userx'] ;
$password = $_SESSION['passwordx'] ;
$user = "lmkiii";
$password = "xxxxxxxxx" ;
if(!$connection && $user && $password)
{
if ($connection=oci_connect($user, $password, $db))
{
echo "Successfully connected to Oracle.\n";
}
else
{
$err = OCIError();
echo "Oracle Connect Error " . $err['message'];
}
}
if(isset($_POST['delete'])){
deleteRecords();
} elseif(isset($_POST['login'])){
loginOracle();
} elseif (isset($_POST['continue'])){
displayDeleteForm();
} elseif (isset($_POST['new'])){
displayEntryForm();
} elseif (isset($_POST['update'])){
showRecord();
} elseif (isset($_POST['timeInType'])){
timeInType();
} else {
//first time execution
echo <<<HTML
<form action="{$_SERVER['PHP_SELF']}" method="post">
<p>
Oracle User Name:<br />
<input type="text" size="20" maxlength="40" name="user"
value="$user" />
</p>
<p>
Oracle Password:<br />
<input type="password" size="20" maxlength="40" name="password"
value="$password" />
</p>
<button type="submit" name = "login" value="<b>Login!</b>"
style="color:maroon font:18pt Courier; font-weight:bold ">LOGIN
</button>
</form>
HTML;
$_SESSION['userx'] = $_POST[$user] ;
$_SESSION['passwordx'] = $_POST[$password] ;
}
//...........................................................................function
loginOracle()
function loginOracle(){
global $connection;
$db = "(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LANDON)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID = LMKGDN)
)
)";
$_SESSION['userx'] = $_POST['user'];
$_SESSION['passwordx'] = $_POST['password'];
$connection=oci_pconnect($_POST['user'], $_POST['password'], $db);
if ($connection)
{
echo "Successfully connected to Oracle.\n";
//default action
displayDeleteForm();
}
else
{
$err = OCIError();
echo "Oracle Connect Error " . $err['message'];
}
}
//...........................................................................function
displayDeleteForm()
function displayDeleteForm(){
//get $fields into the function namespace
global $fields;
global $connection;
/* Create and execute query. */
// Loop through each row, outputting the actype and name
echo <<<HTML
Pilots Logbook entries stored in Oracle Relational Database
under Redhat Fedora 9 Linux
<form action="{$_SERVER['PHP_SELF']}" method="post">
<table width="50%" align="center" border="1">
<tr>
<td colspan="7">
<input type="submit" name="delete" value="delete checked
items"/>
<input type="submit" name="update" value="update checked
items"/>
<input type="submit" name="new" value="new log entry"/>
<input type="submit" name="timeInType" value="Time In Type" />
</td>
</tr>
<tr>
<th>checked</th>
<th>rowID</th>
<th>fdate</th>
<th>actype</th>
<th>acid</th>
<th>nlandings</th>
<th>nhours</th>
</tr>
HTML;
//get log_book_id table information
$user = "select * from log_book_id order by log_id";
$result = oci_parse($connection, $user);
$r = oci_execute($result);
//display log_book_id information
while ($newArray = oci_fetch_assoc($result)) {
foreach ($fields as $field){
$fieldx = strtoupper($field);
${$field} = $newArray[$fieldx];
}
$rowID = $newArray['LOG_ID'];
echo <<<HTML
<TR>
<td>
<input type="checkbox" name="checkbox[$rowID]" value="$rowID">Check
to select record
</td>
<TD>$rowID</TD>
<TD>$fdate</TD>
<TD>$actype</TD>
<TD>$acid</TD>
<TD>$nlandings</TD>
<TD>$nhours</TD>
</TR>
HTML;
} // while
echo <<<HTML
</table>
</form>
HTML;
} //close function
// ................................................................. function
timeInType()
//
function timeInType()
{
global $connection;
$query = "select actype,sum(nhours) from log_book_id group by actype";
$statement = oci_parse ($connection, $query);
oci_execute ($statement);
// Loop through each row, outputting the actype and name
echo <<<HTML
<form action="{$_SERVER['PHP_SELF']}" method="post">
<table width="30%" align="center" border="1">
<tr>
<th>A/C Type</th>
<th>Time in Type</th>
</tr>
HTML;
while ($row = oci_fetch_array ($statement, OCI_ASSOC)) {
$actype = $row['ACTYPE'];
$sum = $row['SUM(NHOURS)'];
echo <<<HTML
<TR>
<TD>$actype</TD>
<TD>$sum</TD>
</TR>
HTML;
} // while
$query = "select sum(nhours) from log_book_id";
$statement = oci_parse ($connection, $query);
oci_execute ($statement);
// Loop through each row, outputting the actype and name
while ($row = oci_fetch_array ($statement, OCI_ASSOC)) {
$sum = $row['SUM(NHOURS)'];
echo <<<HTML
<TR>
<TD>Total Hours =$sum</TD>
</TR>
HTML;
} // while
echo <<<HTML
<tr>
<td colspan="7">
<input type="submit" name="continue" value="Continue" />
</td>
</tr>
HTML;
}
// ................................................................. function
deleteRecords()
//
function deleteRecords()
{
global $connection;
// Loop through each log_book_id with an enabled checkbox
if (!isset($_POST['checkbox'])){
displayDeleteForm();
return true;
}
//else
foreach($_POST['checkbox'] as $key=>$val){
$toDelete[] = $key;
}
//expand the array for an IN query
$where = implode(',', $toDelete);
$query = "DELETE FROM log_book_id WHERE log_id IN ($where)";
$result = oci_parse($connection, $query);
$r = oci_execute($result);
// Commit transaction
$committed = oci_commit($connection);
// Test whether commit was successful. If error occurred, return error message
if (!$committed) {
$error = oci_error($connection);
echo 'Commit failed. Oracle reports: ' . $error['message'];
}
// Should have one affected row
if ((oci_num_rows($result)== 0) ) {
echo "<p>There was a problem deleting some of the selected
items.</p><p>".oci_error().'</p>';
// exit();
} else {
echo "<p>The selected items were successfully deleted.</p>";
}
//direct the user back to the delete form
displayDeleteForm();
} //end function
//...........................................................................function
insertRecord()
function insertRecord()
{
// global $rowInsert;
global $connection;
global $dFields;
// Retrieve the posted log book information.
global $fields;
// $messages = array();
//add some very crude validation
foreach ($fields as $field){
if (empty($_POST[$field])){
$messages[] = "You must complete the field $field \r\n";
} else {
// $dFields[$field] = mysql_real_escape_string(trim($_POST[$field]));
$dFields[$field] = trim($_POST[$field]);
}
}
if (count($messages)>0) {
displayEntryForm($messages, $dFields);
exit();
}
//end validation
$rowInsert = $_SESSION['rowInsert'] ;
// $rowInsert = $_COOKIE('row_insert');
//get variables into the namespace
extract($dFields);
// Insert the log book information into the log book table
if($rowInsert)
{
$query = "UPDATE log_book_id set fdate = '$fdate',
actype='$actype', acid='$acid', nlandings='$nlandings', nhours='$nhours' where
log_id='$rowInsert'";
}
else
{
$query = "INSERT INTO log_book_id (log_id , fdate, actype,
acid, nlandings, nhours) values
(logid.nextval,'$fdate','$actype','$acid','$nlandings','$nhours')";
}
$rowInsert = 0;
$_SESSION['rowInsert'] = $rowInsert;
$result = oci_parse($connection, $query);
$r = oci_execute($result);
// Display an appropriate message
if ($r) {
echo "<p>Product successfully inserted!</p>";
}else {
echo "<p>There was a problem inserting the log book!</p>";
$error = oci_error($connection);
echo 'Insert failed. Oracle reports: ' . $error['message'];
}
//direct the user back to the entry form
// Commit transaction
$committed = oci_commit($connection);
// Test whether commit was successful. If error occurred, return error message
if (!$committed) {
$error = oci_error($connection);
echo 'Commit failed. Oracle reports: ' . $error['message'];
}
// Should have one affected row
if ((oci_num_rows($result)== 0) ) {
echo "<p>There was a problem inserting some of the selected
items.</p><p>".oci_error().'</p>';
// exit();
} else {
echo "<p>The selected items were successfully inserted.</p>";
}
displayDeleteForm();
}
//...........................................................................function
showRecord()
function showRecord() {
// show selected record
global $fields;
global $dFields;
global $connection;
global $rowInsert;
// Loop through each log_book_id with an enabled checkbox
if (!isset($_POST['checkbox'])){
displayDeleteForm();
return true;
}
//else
foreach($_POST['checkbox'] as $key=>$val){
$toDelete[] = $key;
}
// errors
//get log_book_id table information
$user = "select * from log_book_id where log_id = $toDelete[0]";
$result = oci_parse($connection, $user);
$r = oci_execute($result);
//display log_book_id information
$newArray = oci_fetch_assoc($result);
foreach ($fields as $field){
$fieldx = strtoupper($field);
${$field} = $newArray[$fieldx];
$dFields[$field] = ${$field};
}
$rowID = $newArray['LOG_ID'];
$rowInsert = $rowID;
$_SESSION['rowInsert'] = $rowInsert;
// setcookie('row_insert',$rowInsert)
//note that we do not rely on the checkbox value as not all browsers
submit it
//instead we rely on the name of the checkbox.
// insert the row information in the entry form
global $fields;
//end validation
displayEntryForm();
}
//...........................................................................function
displayEntryForm()
function displayEntryForm($errorMessages=null, $dFields=null){
if (!empty($errorMessages)){
echo "<ul><li>".implode('</li><li>', $errorMessages) . "</li></ul>";
}
global $dFields;
//sort out field values
global $fields;
foreach ($fields as $field){
$fieldx = strtoupper($field);
if (isset($dFields[$field])){
${$field} = $dFields[$field];
} else {
${$field} = '';
}
}
// print_r($dFields);
echo <<<HTML
<form action="{$_SERVER['PHP_SELF']}" method="post">
<p>
Flight Date:<br />
<input type="text" size="20" maxlength="40" name="fdate"
value="$fdate" />
</p>
<p>
Aircraft Type:<br />
<input type="text" size="20" maxlength="40" name="actype"
value="$actype" />
</p>
<p>
Aircraft ID:<br />
<input type="text" size="20" maxlength="40" name="acid"
value="$acid" />
</p>
<p>
Number Landings:<br />
<input type="text" size="20" maxlength="40" name="nlandings"
value="$nlandings" />
</p>
<p>
Number Hours:<br />
<input type="text" size="20" maxlength="40" name="nhours"
value="$nhours" />
</p>
<button type="submit" name = "insert" value="<b>Insert Row!</b>"
style="color:maroon font:18pt Courier; font-weight:bold ">Insert/Update Row
</button>
</form>
HTML;
} //end display function
?>
--- End Message ---