php-general Digest 26 Jun 2007 14:18:02 -0000 Issue 4870
Topics (messages 257769 through 257789):
Re: using CURL or something similar to click on a link
257769 by: Robert Cummings
Re: Create .php file with php
257770 by: jekillen
257771 by: jekillen
parsin XML with DOM
257772 by: pobox.verysmall.org
Handling animated GIFs with GD?
257773 by: Tijnema
generate letter combination..
257774 by: jeffry s
PHP5 TUTORIAL
257775 by: Preethi
257776 by: php-ml.sky-bizz.com
257787 by: Nathan Nobbe
Database administration framework
257777 by: Andy
257778 by: Chris Boget
257780 by: Edward Kay
257781 by: Andy
257782 by: Richard Heyes
Disadvantages of output buffering
257779 by: Emil Edeholt
257783 by: Robert Cummings
257784 by: Emil Edeholt
257785 by: Stut
257786 by: Robert Cummings
257788 by: Robin Vickery
257789 by: William Lovaton
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 ---
On Mon, 2007-06-25 at 19:01 -0700, Siavash Miri wrote:
> Hi All,
>
>
> I just recently started writing a php script that would get some search
> results from some other sites and display them.
>
> I believe the only php way to do this is using CURL. am I correct?? or is
> there a more efficient way to do this?
cURL is one of the best ways to do it since it provides a fairly high
level interface for performing page retrieval via GET or POST. You can
also do it using sockets but that's lower level and probably less
efficient due to the way cURL encapsulates low level communication
within the C layer.
> Anyways, i got it working fine with curl, except one site where I need to
> click on a link before doing the search. I can't find a way to click on a
> link using CURL. is this possible?
You probably need cookies. Read about the following cURL options and see
if they change things for you:
CURLOPT_COOKIEJAR
CURLOPT_COOKIEFILE
Alternatively there may be other issues at play. Perhaps an onclick()
even in JavaScript or something else.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
On Jun 25, 2007, at 5:13 PM, Marius Toma wrote:
I can not create .php files from PHP. I can save them as *.php5,
*.php3, asp, *.txt , etc... but not as .php. I tried both touch and
fopen but
none of them worked.
I'm running PHP 5.1.6 on Apache 2, safe_mode is off
Is this a security measure somewhere? How can I bypass it?
Thank you,
Marius
I had trouble with this also running php 5.1.2 and now 5.2.1. But I got
the hang of it to the point
that I have mostly abandoned xml and flat files for temporary files and
quick and dirty data bases
that can just be included for their content. I do not remember what I
did that got it going but it is
definitely possible, almost spooky. You certainly do not want any user
supplied content written to
a php file as variable values or anything without being completely
sanitized.
I also had trouble opening and modifying html files but got the hang of
that too.
I am running Apache 1.3.x on FreeBSD 6.0, 6.2, Mac OSX, and Yellow Dog
Linux.
Keep trying...I had to.
JK
--- End Message ---
--- Begin Message ---
On Jun 25, 2007, at 9:08 PM, jekillen wrote:
On Jun 25, 2007, at 5:13 PM, Marius Toma wrote:
I can not create .php files from PHP. I can save them as *.php5,
*.php3, asp, *.txt , etc... but not as .php. I tried both touch and
fopen but
none of them worked.
I'm running PHP 5.1.6 on Apache 2, safe_mode is off
Is this a security measure somewhere? How can I bypass it?
Thank you,
Marius
I had trouble with this also running php 5.1.2 and now 5.2.1. But I
got the hang of it to the point
that I have mostly abandoned xml and flat files for temporary files
and quick and dirty data bases
that can just be included for their content. I do not remember what I
did that got it going but it is
definitely possible, almost spooky. You certainly do not want any user
supplied content written to
a php file as variable values or anything without being completely
sanitized.
I also had trouble opening and modifying html files but got the hang
of that too.
I am running Apache 1.3.x on FreeBSD 6.0, 6.2, Mac OSX, and Yellow Dog
Linux.
Keep trying...I had to.
JK
I just do $fp = fopen('so_and_so.php', 'w+'); // the 'w+' is necessary
for creating files that do not exist and writing to them, just 'w'
requires the file to exist already.
fwrite($fp, "<?php\n(code)\n?>");
fclose($fp);
Also in my code editor, the closing php tag screws up the syntax
coloring but does not indicate a coding error, so
I do $close_tag = '?'.'>'; and in the fclose($fp,
"<?php\n(code)\n$close_tag ); and my editor will keep the syntax
coloring. (BBEdit)
JK
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
hello,
could somebody give me some direction here.
i am trying to build a RSS 2.0 parser using DOM. what puzzles me is the
following -
i get the XML -
$RSS_XML = file_get_contents($params['uri']);
then i instantiate a DOM object -
$RSS_DOM = new DomDocument();
then i load the XML -
$RSS_DOM->loadXML($RSS_XML);
then i get the first node -
$NODE = $RSS_DOM->firstChild;
here $NODE->tagName is "rss", so far OK
but then if i get the first child of "rss", which is "channel" -
$NODE = $NODE->firstChild;
its type is not DomNode, but DomText.
Only the 2nd child -
$NODE = $NODE->nextSibling;
has $NODE->tagName "channel".
My question is - why is the first child after "rss" DomText?
Thank you,
Iv
--- End Message ---
--- Begin Message ---
Hello all again,
Is it possible to parse animated GIFs with GD, just frame by frame?
Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info
--- End Message ---
--- Begin Message ---
i made a mistake when i say i can solve this problem to a friend.
finally i realize it is not as simple as i appear to be.
what he ask me to do is write a simple script that, given a word.. the
script will generate a list of words combinaton
from the each character in in that word. i am tired thinking.
to make it clear. i give a simple scenario. i don't have an idea what i
should name my baby.
so, i took my wife name and me and input to the script.(i want a name that
is from our name combination).
later the output will present many words that i can choose.
the input string can be of any length.
anyone have an idea?
--- End Message ---
--- Begin Message ---
BlankHi,
Need to have a kick start on PHP5.
Kindly suggest me the good online tutorial for PHP5.
Am already working on php4.
Need to migrate from php4 to php5.
Regards,
Preethi.
Extn No: 4099
Some of the greatest science comes from those unaware of established rules and
theories.
--- End Message ---
--- Begin Message ---
Hi Preethi
> Kindly suggest me the good online tutorial for PHP5.
> Am already working on php4.
> Need to migrate from php4 to php5.
i think this is very important for OOP:
http://www.php.net/manual/en/language.oop5.php
and this one:
http://www.php.net/manual/en/language.exceptions.php
regards,
Hagen
--- End Message ---
--- Begin Message ---
if you want to spend a little i would recommend this book from php|arch
http://www.phparch.com/shop_product.php?itemid=135
-nathan
On 6/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hi Preethi
> Kindly suggest me the good online tutorial for PHP5.
> Am already working on php4.
> Need to migrate from php4 to php5.
i think this is very important for OOP:
http://www.php.net/manual/en/language.oop5.php
and this one:
http://www.php.net/manual/en/language.exceptions.php
regards,
Hagen
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi,
I just need a framework for administrating tables in a database. These are
simple add/edit/remove operations from tables.
Can you suggest a framework for this kind of job? Cause there are a lot of
tables and I hope I can find a nice tool to work with.
Thank you.
--- End Message ---
--- Begin Message ---
I just need a framework for administrating tables in a database. These are
simple add/edit/remove operations from tables.
Can you suggest a framework for this kind of job? Cause there are a lot of
tables and I hope I can find a nice tool to work with.
What database are you working with? phpMyAdmin is probably the most
ubiquitous when working with MySQL databases.
thnx,
Chris
--- End Message ---
--- Begin Message ---
> Hi,
>
> I just need a framework for administrating tables in a database. These are
> simple add/edit/remove operations from tables.
>
> Can you suggest a framework for this kind of job? Cause there are a lot of
> tables and I hope I can find a nice tool to work with.
>
Look at Qcodo (http://www.qcodo.com).
Edward
--- End Message ---
--- Begin Message ---
The DB ist mysql.
No, you didn't understand me clearly.
I need a framework, toolkit, class call it how you want, with wich I develop
an application that administrates the data's in the database. Something like
Smarty but more specific for what I need.
The ideea is the following:
I have 20 tables that have data's in them. And these table data's must be
edited with this admin tool. There are very few joins but there are
references between the tables.
Regards,
Andy.
> -----Original Message-----
> From: Chris Boget [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 26, 2007 3:29 PM
> To: Andy; [EMAIL PROTECTED]
> Subject: Re: [PHP] Database administration framework
>
> > I just need a framework for administrating tables in a
> database. These
> > are simple add/edit/remove operations from tables.
> > Can you suggest a framework for this kind of job? Cause there are a
> > lot of tables and I hope I can find a nice tool to work with.
>
> What database are you working with? phpMyAdmin is probably
> the most ubiquitous when working with MySQL databases.
>
> thnx,
> Chris
>
>
>
--- End Message ---
--- Begin Message ---
The DB ist mysql.
No, you didn't understand me clearly.
I need a framework, toolkit, class call it how you want, with wich I develop
an application that administrates the data's in the database. Something like
Smarty but more specific for what I need.
The ideea is the following:
I have 20 tables that have data's in them. And these table data's must be
edited with this admin tool. There are very few joins but there are
references between the tables.
You could try MySQL TableEditor:
http://www.phpguru.org/static/TableEditor.html
It's a (big) one file class which is good for editing the tables, though
it's not phpMyAdmin; you can't "administer" the database.
--
Richard Heyes
0844 801 1072
http://www.websupportsolutions.co.uk
Knowledge Base and HelpDesk software
--- End Message ---
--- Begin Message ---
Hi!
My php project would get a much cleaner code if I could set cookies
anywhere in the code. So I thought of output buffering. But I can't find
any articles on the cons of output buffering. I mean it most be a reason
for it being off by default?
Kind Regards Emil Edeholt
--- End Message ---
--- Begin Message ---
On Tue, 2007-06-26 at 14:33 +0200, Emil Edeholt wrote:
> Hi!
>
> My php project would get a much cleaner code if I could set cookies
> anywhere in the code. So I thought of output buffering. But I can't find
> any articles on the cons of output buffering. I mean it most be a reason
> for it being off by default?
Cons of output buffering:
- teeeeeeeency weency time overhead
- memory overhead since buffered content remains in memory
until flushed.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
Thanks for your help Dave and Rob. I will start using output buffering a
lot more now.
Regards Emil
Robert Cummings wrote:
Cons of output buffering:
- teeeeeeeency weency time overhead
- memory overhead since buffered content remains in memory
until flushed.
Cheers,
Rob.
--- End Message ---
--- Begin Message ---
Robert Cummings wrote:
On Tue, 2007-06-26 at 14:33 +0200, Emil Edeholt wrote:
Hi!
My php project would get a much cleaner code if I could set cookies
anywhere in the code. So I thought of output buffering. But I can't find
any articles on the cons of output buffering. I mean it most be a reason
for it being off by default?
Cons of output buffering:
- teeeeeeeency weency time overhead
Compared to the time taken to flush to the client more often? This is
incorrect in most cases, and even when it's not it really really is
"teeeeeeeency weency".
- memory overhead since buffered content remains in memory
until flushed.
Indeed, but memory is cheap and you're likely to run out of memory for
other reasons waaaaay before output buffering causes it.
-Stut
--
http://stut.net/
--- End Message ---
--- Begin Message ---
On Tue, 2007-06-26 at 14:09 +0100, Stut wrote:
> Robert Cummings wrote:
> > On Tue, 2007-06-26 at 14:33 +0200, Emil Edeholt wrote:
> >> Hi!
> >>
> >> My php project would get a much cleaner code if I could set cookies
> >> anywhere in the code. So I thought of output buffering. But I can't find
> >> any articles on the cons of output buffering. I mean it most be a reason
> >> for it being off by default?
> >
> > Cons of output buffering:
> >
> > - teeeeeeeency weency time overhead
>
> Compared to the time taken to flush to the client more often? This is
> incorrect in most cases, and even when it's not it really really is
> "teeeeeeeency weency".
>
> > - memory overhead since buffered content remains in memory
> > until flushed.
>
> Indeed, but memory is cheap and you're likely to run out of memory for
> other reasons waaaaay before output buffering causes it.
Agreed, I was hard pressed to come up with cons in the first place :)
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
On 26/06/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
On Tue, 2007-06-26 at 14:09 +0100, Stut wrote:
> Robert Cummings wrote:
> > On Tue, 2007-06-26 at 14:33 +0200, Emil Edeholt wrote:
> >> Hi!
> >>
> >> My php project would get a much cleaner code if I could set cookies
> >> anywhere in the code. So I thought of output buffering. But I can't find
> >> any articles on the cons of output buffering. I mean it most be a reason
> >> for it being off by default?
> >
> > Cons of output buffering:
> >
> > - teeeeeeeency weency time overhead
>
> Compared to the time taken to flush to the client more often? This is
> incorrect in most cases, and even when it's not it really really is
> "teeeeeeeency weency".
>
> > - memory overhead since buffered content remains in memory
> > until flushed.
>
> Indeed, but memory is cheap and you're likely to run out of memory for
> other reasons waaaaay before output buffering causes it.
Agreed, I was hard pressed to come up with cons in the first place :)
Modern browsers often start partially rendering HTML as soon as it
arrives rather than waiting for the page to load completely.
Obviously, if you're waiting until the end of the script before
actually sending any HTML, they can't do that so your page might
appear less responsive.
-robin
--- End Message ---
--- Begin Message ---
These two reasons are in fact of little impact.
The real problem I have with output buffering in my web app is that it
doesn't handle .xls and .pdf files generated on the fly with PHP. Every
time the browser is going to download those kind of files it will get
corrupted.
The only solution I could find for this was to disable output buffering.
Another thing: you can even compress the buffer before sending it so it
will help a lot if a user have little bandwidth. Text files have a very
good compression ratio.
Cheers,
-William
On Tue, 2007-06-26 at 09:04 -0400, Robert Cummings wrote:
> On Tue, 2007-06-26 at 14:33 +0200, Emil Edeholt wrote:
> > Hi!
> >
> > My php project would get a much cleaner code if I could set cookies
> > anywhere in the code. So I thought of output buffering. But I can't find
> > any articles on the cons of output buffering. I mean it most be a reason
> > for it being off by default?
>
> Cons of output buffering:
>
> - teeeeeeeency weency time overhead
> - memory overhead since buffered content remains in memory
> until flushed.
>
> Cheers,
> Rob.
> --
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting |
> | a powerful, scalable system for accessing system services |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for |
> | creating re-usable components quickly and easily. |
> `------------------------------------------------------------'
>
--- End Message ---