php-general Digest 19 Apr 2007 20:58:49 -0000 Issue 4744
Topics (messages 253251 through 253283):
Re: Json.php
253251 by: Jochem Maas
253267 by: Roman Neuhauser
serialize an object
253252 by: Tobias Wurst
253253 by: Stut
253254 by: Zoltán Németh
253256 by: Buesching, Logan J
253257 by: Buesching, Logan J
253269 by: for
253274 by: Tobias Wurst
Re: "register_argc_argv" directive
253255 by: David Giragosian
Migrating php4 to php5 on a shared host
253258 by: Al
253260 by: clive
253261 by: Zoltán Németh
Re: CSS vs. Tables OT
253259 by: tedd
253263 by: tedd
253265 by: Philip Thompson
253266 by: Wolf
253275 by: Jim Moseby
253276 by: Dave Goodchild
Re: how to get var name and value from function?
253262 by: Tijnema !
PHP & Text Messaging
253264 by: Philip Thompson
253282 by: Brian Seymour
253283 by: Daniel Brown
Re: retrieve POST body?
253268 by: Myron Turner
253281 by: Tijnema !
Session with microtime
253270 by: Panquekas
253277 by: Jim Lucas
Re: auto page generation
253271 by: Michelle Konzack
Re: free allocated memory: HOW ?
253272 by: Michelle Konzack
Re: Suggestions for Web based FileServer/Mailaccess
253273 by: Michelle Konzack
Re: sendmail smrsh symlinks not working against php scripts
253278 by: dan1
253279 by: dan1
Re: Problems with Curl and POST
253280 by: Tijnema !
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 ---
Roman Neuhauser wrote:
...
>
> You'll have to change the code. I'm suggesting a nice clean way that'll
> not only conform to the probable rules of PHP 6 (which are not specific
> to PHP, at least static is not), but that'll also conform to the rules
> of good design. You're saying the changes are superfluous. Ok then,
> but what do you really want? I'm fine with you just griping, if it's
> labeled as such.
I just want it to keep working - the code began life in Nov 2003, when php5
was still in beta3 ... I'm all for writing better code but *having* to fix
something
that works bites.
>
>>> I wouldn't do it that way. A single class should not be a database
>>> driver *and* manage connections.
>> fair enough, although personally I find that going a bit far, I don't
>> see the win in splitting up the 'driver' and 'connection manager'. not
>> that this is the problem in this case.
>
> You wouldn't be having this upgrade problem if static DB::query(...)
> wasn't there, and it's there because class DB is a client library *and*
> a connection manager. So I'd say this design mistake (and the fact that
> PHP allowed you to have almostatic methods) are the problem in this case.
>
I might plead with internals for: ;-)
class DB {
almostatic function query() { /*existence of $this is MY problem */ }
}
though I can't see atm how the connection management is the problem,
I assume you think this because of the way connection ids and transaction ids in
ibase are interchangable.
regardless I have a problem, I'll keep looking at the code until a clean
solution
presents itself, it's in/out there somewhere.
>> I could easily split out the actual connection management into a
>> seperate object but I'd still be stuck with the problem described
>> above (which is not actually related to connection management).
>
> Not if you make the separation visible to the client code, which, as you
I don't follow you here. could you try an explain it in idiot language? :-P
> write below, is actually only a fraction of those "10000's of lines of code".
>
>>> Do those 10000's of lines of code concern you? rlynch says indirection
>>> and separation of concerns are useless, you either have decent
>>> programmers and global search & replace, or you don't.
>> yes & no. I don't have an endless budget or legions of world-class
>> analysts, designers and programmers at my disposal for building
>> megabucks codebases that implement near-on perfect loosely-coupled
>> application designs, and I don't have the same legion to do search and
>> replace.
>
> I'm at a complete loss then. Richard, what would you advise to someone
> in such a messy situation?
my advice to myself is "find a way to fix it, and then do it" - not sure
what exactly that means in terms of design or code but I figure that has to be
an answer/solution somewhere :-)
>
--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2007-04-19 10:50:19 +0200:
> Roman Neuhauser wrote:
> >>> I wouldn't do it that way. A single class should not be a database
> >>> driver *and* manage connections.
> >> fair enough, although personally I find that going a bit far, I don't
> >> see the win in splitting up the 'driver' and 'connection manager'. not
> >> that this is the problem in this case.
> >
> > You wouldn't be having this upgrade problem if static DB::query(...)
> > wasn't there, and it's there because class DB is a client library *and*
> > a connection manager. So I'd say this design mistake (and the fact that
> > PHP allowed you to have almostatic methods) are the problem in this case.
> >
>
> I might plead with internals for: ;-)
>
> class DB {
> almostatic function query() { /*existence of $this is MY problem */ }
> }
Existence of $this is YOUR problem only as long as you don't share the
code with anybody else. At that moment, you have made life harder for
someone else.
> though I can't see atm how the connection management is the problem,
> I assume you think this because of the way connection ids and transaction ids
> in
> ibase are interchangable.
No, I've had virtually zero exposure to Interbase/Firebird, and have had
no idea about the phenomenon you mention. I think it's a problem
because of the ways it reduces quality of the code.
Or does DB not handle database connections? If not, how come the static
call DB::query("SELECT fubar FROM snafu") works? Guess it does things
besides querying (probably why it's a generic "DB" in the first place).
> regardless I have a problem, I'll keep looking at the code until a clean
> solution
> presents itself, it's in/out there somewhere.
>
> >> I could easily split out the actual connection management into a
> >> seperate object but I'd still be stuck with the problem described
> >> above (which is not actually related to connection management).
> >
> > Not if you make the separation visible to the client code, which, as you
>
> I don't follow you here. could you try an explain it in idiot language? :-P
Split the two functions, and don't try to hide the fact that they're two
functions; after all, if you do it correctly, the static one will
probably end in a different class.
> > write below, is actually only a fraction of those "10000's of lines of
> > code".
> >
> >>> Do those 10000's of lines of code concern you? rlynch says indirection
> >>> and separation of concerns are useless, you either have decent
> >>> programmers and global search & replace, or you don't.
> >> yes & no. I don't have an endless budget or legions of world-class
> >> analysts, designers and programmers at my disposal for building
> >> megabucks codebases that implement near-on perfect loosely-coupled
> >> application designs, and I don't have the same legion to do search and
> >> replace.
> >
> > I'm at a complete loss then. Richard, what would you advise to someone
> > in such a messy situation?
>
> my advice to myself is "find a way to fix it, and then do it" - not sure
> what exactly that means in terms of design or code but I figure that has to be
> an answer/solution somewhere :-)
Don't try to cram connection management into a db client driver class.
The rest will just fall out of it.
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
--- End Message ---
--- Begin Message ---
hi,
i use serialize() to save my object in $_SESSION.
But i have one Problem:
the member-variables from the baseclass are not saved.. :(
How can i fix this?
thanks in advance
--- End Message ---
--- Begin Message ---
Tobias Wurst wrote:
i use serialize() to save my object in $_SESSION.
Why? There's no point in serialising something into $_SESSION. Anything
you put in there gets serialised by the session handler.
But i have one Problem:
the member-variables from the baseclass are not saved.. :(
How can i fix this?
Pass. I know you can specify member variables to be saved in __sleep(),
so I guess that would be one possible workaround.
-Stut
--- End Message ---
--- Begin Message ---
as far as I know serialize() saves all the properties of the object...
and I think you can store objects in session without serializing it
since PHP serializes-unserializes it for you automatically - or not?
greets
Zoltán Németh
2007. 04. 19, csütörtök keltezéssel 13.17-kor Tobias Wurst ezt írta:
> hi,
> i use serialize() to save my object in $_SESSION.
> But i have one Problem:
> the member-variables from the baseclass are not saved.. :(
> How can i fix this?
>
> thanks in advance
>
--- End Message ---
--- Begin Message ---
>From the PHP manual:
-----Original Message-----
From: Zoltán Németh [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 19, 2007 8:40 AM
To: Tobias Wurst
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] serialize an object
as far as I know serialize() saves all the properties of the object...
and I think you can store objects in session without serializing it
since PHP serializes-unserializes it for you automatically - or not?
greets
Zoltán Németh
2007. 04. 19, csütörtök keltezéssel 13.17-kor Tobias Wurst ezt írta:
> hi,
> i use serialize() to save my object in $_SESSION.
> But i have one Problem:
> the member-variables from the baseclass are not saved.. :(
> How can i fix this?
>
> thanks in advance
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Sorry for that.... ctrl+enter sends, when I wanted ctrl+V to paste :(
All registered variables are serialized after the request finishes. Registered
variables which are undefined are marked as being not defined. On subsequent
accesses, these are not defined by the session module unless the user defines
them later.
Warning
Some types of data can not be serialized thus stored in sessions. It includes
resource variables or objects with circular references (i.e. objects which
passes a reference to itself to another object).
Note: Session handling was added in PHP 4.0.0.
Note: Please note when working with sessions that a record of a session is
not created until a variable has been registered using the session_register()
function or by adding a new key to the $_SESSION superglobal array. This holds
true regardless of if a session has been started using the session_start()
function.
So I'd assume his class has a circular reference if it cannot be serialized,
and how to fix that I'm going to pass on.
-----Original Message-----
From: Zoltán Németh [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 19, 2007 8:40 AM
To: Tobias Wurst
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] serialize an object
as far as I know serialize() saves all the properties of the object...
and I think you can store objects in session without serializing it
since PHP serializes-unserializes it for you automatically - or not?
greets
Zoltán Németh
2007. 04. 19, csütörtök keltezéssel 13.17-kor Tobias Wurst ezt írta:
> hi,
> i use serialize() to save my object in $_SESSION.
> But i have one Problem:
> the member-variables from the baseclass are not saved.. :(
> How can i fix this?
>
> thanks in advance
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On 19.04.2007 13:17 Tobias Wurst wrote:
hi,
i use serialize() to save my object in $_SESSION.
you don't need this. php serializes your objects for you
But i have one Problem:
the member-variables from the baseclass are not saved.. :(
How can i fix this?
can you provide a small example?
thanks in advance
--
gosha bine
extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
--- End Message ---
--- Begin Message ---
i think I "found" a bug: http://bugs.php.net/bug.php?id=36172
i used __sleep and __wakeup -> don't work
without __sleep and __wakeup -> it is working :)
>you don't need this. php serializes your objects for you
thats true, thanks :)
--- End Message ---
--- Begin Message ---
On 4/18/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
On Wed, April 18, 2007 9:04 am, Bagus Nugroho wrote:
> I'm confuse about usage of php.ini directive "register_argc_argv".
> Is used for command line purpose only?
I suspect that in CGI (and possibly even FCGI) $argv and $argc may
also end up being populated, due to the way CGI works.
But, yes, essentially you'd be using those in CLI in most circumstances.
I'm not sure why you'd want to not fill in argv/argc in CLI...
But I suppose if you've got a fancy GetOPTS package of some sort
going, you might need that turned off or something...
Or maybe there's some sort of big time savings to turn them off...
There may even be Security Considerations for some people/cases where
having those off is "better"...
I'm just making up answers as I go here for why that setting might
even exist, but I guess somebody needed it sometime in the past.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
$argv and $argc came in way handy when I wrote several php-gtk apps a few
years ago, which uses the CLI exe version...
David
--- End Message ---
--- Begin Message ---
I've got 2 sites on a shared host running php4 and I think it's a matter of
when, not if, I should move them to one of my host's php5 servers.
I don't see anything in the php manual on migrating that indicates my code
would be affected.
I'm a little concerned about "gotchas" that would take my sites down while I
fix the
particulars for php5.
Anyone had experience or comments on the subject.
Thanks....
--- End Message ---
--- Begin Message ---
Al wrote:
Anyone had experience or comments on the subject.
setup php5 dev (local||hosted) server, setup site on dev server, test
clive
--- End Message ---
--- Begin Message ---
I suggest installing php locally on a dev machine, testing your code on
it and if it works just go on.
greets
Zoltán Németh
2007. 04. 19, csütörtök keltezéssel 10.03-kor Al ezt írta:
> I've got 2 sites on a shared host running php4 and I think it's a matter of
> when, not if, I should move them to one of my host's php5 servers.
>
> I don't see anything in the php manual on migrating that indicates my code
> would be affected.
>
> I'm a little concerned about "gotchas" that would take my sites down while I
> fix the
> particulars for php5.
>
> Anyone had experience or comments on the subject.
>
> Thanks....
>
--- End Message ---
--- Begin Message ---
At 8:59 AM +1200 4/19/07, Bruce Cowin wrote:
Now can we please close this thread! There are better forums to discuss
this - it has nothing to do with PHP!!
Lori
Lori:
True, it has nothing to do with php programming other than
compliance, accessibility, data gathering and data presentation.
If php lived in a vacuum where computation was all there was, then
that would not be a concern. However, we use other languages to grab
our input and present our findings. IMO, to be "well rounded" we have
to understand other languages such as html, xml, mysql, css,
javascript and even ajax. These languages have both good and bad
practices and carry with them responsibilities to our clients and
adherence to standards and compliance issues. It's more than just
pounding code.
I think it's good that we discuss these things because it brings
about an understanding and appreciation of issues where our actions
may have far reaching influence on important matters of which we may
not be aware. Knowledge carries with it responsibility.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
At 11:36 PM -0500 4/18/07, Richard Lynch wrote:
But I don't think we're going to reach that Utopia where IE and FF
actually follow the standards in the same ways well enough to get out
of this CSS hack nightmare.
Well, as long as the old IE browsers are being used, then we'll
continue to have problems. But even those problems can be solved.
True, some requires "hacks" BUT that's a good thing that we can use
the code to solve the problems. To me, that's not a "hack", but
rather a solution.
And I don't see the CSS spec author folks really addressing some
fundamental problems that real-world designers need addressed so they
can get the layouts they want.
I disagree. The CSS folks have solved hundreds of different types of
layouts and have provided the techniques to solve almost any problem
imaginable. Plus, they have been foremost in promoting a completely
new medium -- these people have done wonders!
Whether they *ought* to want those layouts, or whether they are good
layouts for websites is arguable, but there it is... The CSS folks
don't seem to be addressing the needs of their Designer user-base,
afaics...
IF there is a problem, it is that the designers aren't taking the
time to look at what's available. If a designer wants a two column
layout with a footer, side bar, header and is liquid -- it's there!
If the designer wants a static "keep to the top left corner of the
browser window" three column with only a header -- it's there too! In
fact, I may be going out on a limb here, but I challenge anyone to
describe a layout that isn't covered.
I'm hoping "some day" (soon) this will all be worked out all nicey-nice.
Similar to most php questions posted here, all one has to do is look.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
On Apr 19, 2007, at 9:08 AM, tedd wrote:
At 8:59 AM +1200 4/19/07, Bruce Cowin wrote:
Now can we please close this thread! There are better forums to
discuss
this - it has nothing to do with PHP!!
Lori
Lori:
True, it has nothing to do with php programming other than
compliance, accessibility, data gathering and data presentation.
If php lived in a vacuum where computation was all there was, then
that would not be a concern. However, we use other languages to
grab our input and present our findings. IMO, to be "well rounded"
we have to understand other languages such as html, xml, mysql,
css, javascript and even ajax. These languages have both good and
bad practices and carry with them responsibilities to our clients
and adherence to standards and compliance issues. It's more than
just pounding code.
I think it's good that we discuss these things because it brings
about an understanding and appreciation of issues where our actions
may have far reaching influence on important matters of which we
may not be aware. Knowledge carries with it responsibility.
Cheers,
tedd
*CLAP CLAP CLAP*
=P
--- End Message ---
--- Begin Message ---
That, and the big OT at the end means Off-Topic... So if you don't want
to get OT, just hit delete. ;)
tedd wrote:
At 8:59 AM +1200 4/19/07, Bruce Cowin wrote:
Now can we please close this thread! There are better forums to discuss
this - it has nothing to do with PHP!!
Lori
Lori:
True, it has nothing to do with php programming other than compliance,
accessibility, data gathering and data presentation.
If php lived in a vacuum where computation was all there was, then that
would not be a concern. However, we use other languages to grab our
input and present our findings. IMO, to be "well rounded" we have to
understand other languages such as html, xml, mysql, css, javascript and
even ajax. These languages have both good and bad practices and carry
with them responsibilities to our clients and adherence to standards and
compliance issues. It's more than just pounding code.
I think it's good that we discuss these things because it brings about
an understanding and appreciation of issues where our actions may have
far reaching influence on important matters of which we may not be
aware. Knowledge carries with it responsibility.
Cheers,
tedd
--- End Message ---
--- Begin Message ---
<snip>
> In
> fact, I may be going out on a limb here, but I challenge anyone to
> describe a layout that isn't covered.
</snip>
I want a layout that looks identical in every browser without resorting to
something like:
switch($browser){
case 'IE':include('ie.css');
case 'Mozilla':include('mozilla.css');
{...}
default:throw_hands_up_in_disgust();
)
I don't think thats possible right now, is it?
JM
--- End Message ---
--- Begin Message ---
Can we kill this now please? It's not a php issue, is an old and endless
argument and is better addressed on a css / design list.
--- End Message ---
--- Begin Message ---
On 4/19/07, Ford, Mike <[EMAIL PROTECTED]> wrote:
On 19 April 2007 04:36, Richard Lynch wrote:
> On Wed, April 18, 2007 4:57 am, Ford, Mike wrote:
> > On 17 April 2007 01:18, Richard Lynch wrote:
> > > Or is it explicitly stated in the manual somewhere I'm not seeing
> > > that one can put things in $GLOBALS directly? [shrug]
> >
> http://uk2.php.net/manual/en/language.variables.predefined.php
> #language.variables.superglobals
>
> When I read that section of the manual, along with similar variables,
> such as: $_SERVER, $_GET, $_POST, $_COOKIE, $_FILES, $_ENV, $_REQUEST
>
> I do not, in my mind, see anything indicating that it is a documented
> feature that cramming some value into $_GLOBALS['foo'] is
> specifically supported...
Well the definition of $GLOBALS says:
"Contains a reference to every variable which is currently available
within the global scope of the script."
I take that to mean reference as in the & operator, so that
$GLOBALS['foo'] is a reference to $foo, and when you assign to a
reference you also assign to....
But, notwithstanding that, how about Example 12.3 at
http://php.net/global#language.variables.scope.global?
Cheers!
Mike
Hmm, that's quite ugly, what happens when defining a variable outside,
and inside a function. and then get the reference to it? Will the
first var be overwritten, and when the function ends, it will refer to
the old var again?
Tijnema
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
JG125, The Headingley Library,
James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 812 4730 Fax: +44 113 812 3211
To view the terms under which this email is distributed, please go to
http://disclaimer.leedsmet.ac.uk/email.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi. I have attempted to look at the archives for this, but keep
getting redirected back to the main PHP site when I click on the
archive link. With that said, does anyone know of any good resources
for sending text messages using PHP? I have Googled this topic and
found a few, but find it hard to judge which ones are "good." I have
also looked at the SAM package, but wasn't sure how much that is
being used by the community.
Thanks in advance,
~Philip
--- End Message ---
--- Begin Message ---
I know vtext.com sends email to phones. Perhaps using the mail function you
could just send a message to [EMAIL PROTECTED] and they would get the
message. To my knowledge this is a free service and works with all phone
providers since they do the message for you. Just a thought.
Hope this helps,
Brian
-----Original Message-----
From: Philip Thompson [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 19, 2007 10:28 AM
To: php General List
Subject: [PHP] PHP & Text Messaging
Hi. I have attempted to look at the archives for this, but keep
getting redirected back to the main PHP site when I click on the
archive link. With that said, does anyone know of any good resources
for sending text messages using PHP? I have Googled this topic and
found a few, but find it hard to judge which ones are "good." I have
also looked at the SAM package, but wasn't sure how much that is
being used by the community.
Thanks in advance,
~Philip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I actually believe that vText is strictly for Verizon Wireless users,
but I tried sending web messages to friends without it and, according to the
system, the messages went through. So I guess you could give it a shot.
On 4/19/07, Brian Seymour <[EMAIL PROTECTED]> wrote:
I know vtext.com sends email to phones. Perhaps using the mail function
you
could just send a message to [EMAIL PROTECTED] and they would get the
message. To my knowledge this is a free service and works with all phone
providers since they do the message for you. Just a thought.
Hope this helps,
Brian
-----Original Message-----
From: Philip Thompson [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 19, 2007 10:28 AM
To: php General List
Subject: [PHP] PHP & Text Messaging
Hi. I have attempted to look at the archives for this, but keep
getting redirected back to the main PHP site when I click on the
archive link. With that said, does anyone know of any good resources
for sending text messages using PHP? I have Googled this topic and
found a few, but find it hard to judge which ones are "good." I have
also looked at the SAM package, but wasn't sure how much that is
being used by the community.
Thanks in advance,
~Philip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
--- End Message ---
--- Begin Message ---
André Medeiros wrote:
php://stdin perhaps?
On 4/18/07, Justin Frim <[EMAIL PROTECTED]> wrote:
André Medeiros wrote:
> Reading from php://input on a webserver will retrieve the Body of the
> HTTP Request.
Not for me it doesn't.
That only seems to work when the form is submitted as
application/x-www-form-urlencoded. When the form is submitted as
multipart/form-data, php://input is blank.
You probably could use this small Perl script via exec:
#!/usr/bin/perl
if ($ENV{'REQUEST_METHOD'} eq "POST") {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
}
print $buffer;
--
_____________________
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/
--- End Message ---
--- Begin Message ---
On 4/19/07, Myron Turner <[EMAIL PROTECTED]> wrote:
André Medeiros wrote:
> php://stdin perhaps?
>
> On 4/18/07, Justin Frim <[EMAIL PROTECTED]> wrote:
>> André Medeiros wrote:
>>
>> > Reading from php://input on a webserver will retrieve the Body of the
>> > HTTP Request.
>>
>> Not for me it doesn't.
>> That only seems to work when the form is submitted as
>> application/x-www-form-urlencoded. When the form is submitted as
>> multipart/form-data, php://input is blank.
>
You probably could use this small Perl script via exec:
#!/usr/bin/perl
if ($ENV{'REQUEST_METHOD'} eq "POST") {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
}
print $buffer;
If you call this script via exec, it can't return the POST data send
to the PHP script right?
btw, we are here on a PHP list, not PERL :)
Tijnema
--
_____________________
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
hello,
I'm writting a script where I use the function microtime with sessions and I
have a problem.
This is my code:
if( $_SESSION['uperm'] == '1' ){
$t_start = microtime(1);
}
(....)
if( $_SESSION['uperm'] == '1' ){
$t_end = microtime(1) - $t_start;
$time .= "\n " . '<P>This page was loaded in ' .
number_format($t_end, 3) . ' seconds.</P>';
}
And when I log with any account (admin or user) is "echoed" to me something
like this:
"This page was loaded in 1,177,003,846.594 seconds."
This is too much because the page isn't loaded in this time. And when I
refresh the page it appears:
"This page was loaded in 0.012 seconds."
Why is this? I can't explain.
And this started to appear when I put the "if" to check the user
permissions. If I "turn off" the "if" it'll run normally.
Can anyone explain why is that?
Thanks in advance.
--- End Message ---
--- Begin Message ---
Panquekas wrote:
hello,
I'm writting a script where I use the function microtime with sessions
and I
have a problem.
This is my code:
if( $_SESSION['uperm'] == '1' ){
$t_start = microtime(1);
}
when you initially log in, it creates this variable.
Sounds to me like it is creating the $_SESSION['uperm'] value after you are calling the previous
if() {...}
do this
if ( $_SESSION['uperm'] == '1' ) {
$t_start = microtime(1);
die('I made it here');
}
if it does not die(), then you know that it isn't getting into this first IF
statement.
also, sounds like you have E_WARNING & E_NOTICE turned off. I would suggest that you enable these by
placing this at the very top of your script. ( at least for debugging purpose, not in production )
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
.
.
.
?>
this will probably if you a notice not that the variable $t_start is undefined when try and hit the
following block of code.
(....)
if( $_SESSION['uperm'] == '1' ){
$t_end = microtime(1) - $t_start;
$time .= "\n " . '<P>This page was loaded in ' .
number_format($t_end, 3) . ' seconds.</P>';
}
And when I log with any account (admin or user) is "echoed" to me something
like this:
"This page was loaded in 1,177,003,846.594 seconds."
This is too much because the page isn't loaded in this time. And when I
refresh the page it appears:
"This page was loaded in 0.012 seconds."
Why is this? I can't explain.
And this started to appear when I put the "if" to check the user
permissions. If I "turn off" the "if" it'll run normally.
Can anyone explain why is that?
Thanks in advance.
--
Enjoy,
Jim Lucas
Different eyes see different things. Different hearts beat on different strings. But there are times
for you and me when all such things agree.
- Rush
--- End Message ---
--- Begin Message ---
Hello Tim,
Am 2007-04-16 19:22:21, schrieb Tim:
> Also can i reccomend:
>
> "Web Database Applications with PHP and MySQL"
Do you know an equivalent book for php5 and PostgreSQL 8.1/8.2?
Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant
--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack Apt. 917 ICQ #328449886
50, rue de Soultz MSN LinuxMichi
0033/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com)
signature.pgp
Description: Digital signature
--- End Message ---
--- Begin Message ---
Hello Arthur,
Am 2007-04-12 13:40:08, schrieb Arthur Erdös:
> Hello all,
>
> is there a way to free memory allocated by variables in PHP?? This is a
> very important issue concerning long running scripts...
>
> I have a script that generates > 5000 Newsletters and when the script
> finishes it uses 1.8 GB (!!) of RAM. Although I am using unset() to
> clean up variables (tried with $var = null too).
Are you running Linux?
If yes, are aou realy sure it "eat" this amount of memory?
I have a pgp-cli prog which seems to eat 12 GByte (of 16 GByte)
after one week of use, but the stuff is ONLY cached...
Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant
--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack Apt. 917 ICQ #328449886
50, rue de Soultz MSN LinuxMichi
0033/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com)
signature.pgp
Description: Digital signature
--- End Message ---
--- Begin Message ---
Hello Richard,
It seems no one had understood me right...
Am 2007-04-10 21:48:12, schrieb Richard Lynch:
> Personally, I would use http://php.net/imap_open and friends to add
> the mailbox, and let the OS and installed IMAP software choose the
> correct mbox/Maildir option based on the server configuration, rather
> than try to out-guess them...
This is WHAT I already do...
But currently I have two Spaces:
The one for the E-Mails and one for the files
WHich mean, if I ahve a friend called "Richard" and his Messages goes
into the Mailfolder "Peoples/Richard" and I want to see what I have
from him, like Files, Pics or whatever... I have to go to a second
place the "File Section" to look at it.
What I want is a fusion of the "MailSpace" and the "FileSpace".
Currently I have a black hole and do not know HOW to implement this.
In general, EACH "Mailfolder" can have a "FileSpace" and visa versa.
Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant
--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack Apt. 917 ICQ #328449886
50, rue de Soultz MSN LinuxMichi
0033/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com)
signature.pgp
Description: Digital signature
--- End Message ---
--- Begin Message ---
However, if I put a hardlink instead of the symlink, all works fine!
The permissions of the symlink and the file linekd are all 777.
Has anyone already had this problem before, or would anyone have an
idea of
the cause?
smrsh itself may disallow symlinks. Wouldn't surprise me.
Why not just use #!/usr/bin/php -q at the top of your PHP script?
I cannot do this, because the script itself is not executed. The e-mail I
sent from within this script does not arrive when it is failing.
But it works well with a hardlink.
I didn't expect smrsh to prevent symlinks.
When I contact sendmail people, they tell me it is a PHP problem. Would you
agree that this is not the case, and merely to have to do with smrsh?
Thanks,
Daniel
--- End Message ---
--- Begin Message ---
smrsh itself may disallow symlinks. Wouldn't surprise me.
Why not just use #!/usr/bin/php -q at the top of your PHP script?
Something else to my previous answer.
Here is the answer of the sendmail guys. Maybe they are still right? Would
PHP have a problem to handle symlinked input files? I have the security mode
disabled in the php.ini file.
Thanks,
Daniel
----
This is a poor place to find an answer, because the one thing that
stands out is that this is a problem with php, not Sendmail, and this is
a Sendmail newsgroup not a php newsgroup. Your dangerously outdated
version of php is running and emitting an error ("No input file
specified.") that doesn't make sense outside of php, but probably
indicates special handling done by php when given a symlink instead of a
regular file.
Looking at the output there, I'd *guess* that you have php set up wrong
for this sort of use. I'm not a php expert, so I won't try to guess at a
fix.
--- End Message ---
--- Begin Message ---
On 4/17/07, mbneto <[EMAIL PROTECTED]> wrote:
Hi Richard,
I am using the same script. And it is using the CURLOPT_POST.
- mb
On 4/16/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>
> HEAD is just like GET, only it gets just the headers (hence the name)
> usually to see if the document has changed according to LastModified:
> before doing a full-blown GET.
>
> There shouldn't be a HEAD done before a POST...
>
> Are you sure you are doing a CURLOPT_POST and not CURLOPT_GET...?
>
> On Mon, April 16, 2007 4:43 pm, mbneto wrote:
> > Hi,
> >
> > I am tring to use curl to access, via POST, a remote 'service'.
> > I've
> > managed to test it fine but when I use real data to feed the curl it
> > gives
> > me strange results.
> >
> > When I check the logs of the remote web server one thing that alarms
> > me is
> > that with test data I see
> >
> > A.B.C.D - - [16/Apr/2007:17:41:53 -0400] "POST /service.php HTTP/1.1"
> > 200 61
> >
> > with real data (using the same script)
> >
> > A.B.C.D - - [16/Apr/2007:17:48:55 -0400] "HEAD /service.php HTTP/1.1"
> > 200 -
> >
> > After reading the user contributed notes I found that it must be
> > related
> > with encoding. But even if I use the suggested code
> >
> > $o=""; foreach ($post_data as $k=>$v)
> > { $o.=
> > "$k=".utf8_encode($v)."&"; }
> > $post_data=substr($o,0,-1);
echo $post_data; // Echo your data here to check if this is really
what you want to insert.
> > // Add error handling
> > if(!curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data)) {
echo curl_error($ch);
}
> >
> > I get the same results.
> >
> > Any tips?
> >
> > php 5.0.4
I guess you insert data twice, or something like that. I modified
above code, test it.
Tijnema
> >
>
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>
>
--- End Message ---