|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 9 Dec 2003 05:14:02 -0000 Issue 2462
php-general-digest-help
lists.php.net
Date: Mon Dec 08 2003 - 23:14:02 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 9 Dec 2003 05:14:02 -0000 Issue 2462
Topics (messages 172156 through 172226):
Re: PHP eregi filtering problem
172156 by: Sven
Re: Problem With Apache / PHP Installation
172157 by: Sven
172158 by: Sven
Fedora and Firebird
172159 by: Todd Cary
How to use PHP to view the file permision???
172160 by: Scott Fletcher
172161 by: Jason Wong
172162 by: Marcos Thiago Merschamnn Fabis
172173 by: Scott Fletcher
172174 by: Roger B.A. Klorese
172175 by: Scott Fletcher
172176 by: Scott Fletcher
PHP, XML, UTF-8
172163 by: Russell P Jones
172164 by: Manuel Lemos
Re: Can I request ?
172165 by: Iain Staffell
Re: POST upload script timeout
172166 by: Iain Staffell
PHP to HTML
172167 by: Steve Marquez
172168 by: Chris W. Parker
172169 by: Chris Shiflett
How do I apt-get newer php4 cgi with mysql on debian?
172170 by: Daevid Vincent
preg_match and regular expression
172171 by: fred
172172 by: fred
172178 by: Justin Patrin
PHP My SQL vs ASP.NET SQL 2000 Server
172177 by: Ryotaro Ishikawa MD
172179 by: Justin Patrin
172185 by: Manuel Lemos
172214 by: Hardik Doshi
Reading email from sendmail
172180 by: Robin Kopetzky
172181 by: Justin Patrin
172186 by: Manuel Lemos
172196 by: Justin French
query to display the results without...
172182 by: Eric Holmstrom
172183 by: Justin Patrin
172184 by: Eric Holmstrom
172187 by: Chris W. Parker
172188 by: Justin Patrin
post an array into another site
172189 by: fred
172190 by: Chris W. Parker
172191 by: Justin Patrin
172192 by: Mike Migurski
172193 by: Manuel Lemos
172194 by: Justin Patrin
172195 by: Manuel Lemos
172197 by: Chris Shiflett
172198 by: Justin Patrin
172200 by: Justin Patrin
172203 by: Manuel Lemos
172204 by: Chris Shiflett
172205 by: Justin Patrin
172206 by: Justin Patrin
172207 by: Manuel Lemos
172208 by: Rodney Green
172209 by: Justin Patrin
172210 by: Justin Patrin
172215 by: Manuel Lemos
172217 by: Ralph Guzman
172220 by: Chris Shiflett
172221 by: Chris Shiflett
172222 by: Justin Patrin
172223 by: Manuel Lemos
172224 by: Chris Shiflett
restrict access to multiple pages
172199 by: Chris W. Parker
172201 by: Justin Patrin
172202 by: Chris Shiflett
172216 by: Justin French
php validator
172211 by: Terence
172219 by: Manuel Lemos
spambothoney: script to pollute spammer's databases
172212 by: daniel hahler
172213 by: daniel.electroteque.org
172218 by: Manuel Lemos
Why Imap_open takes a so long time delay???
172225 by: alsoran
Re: Random Numbers..
172226 by: Curt Zirzow
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Purpleonyx schrieb:
> Greetings all, I ran into a problem today and was
> hoping someone could provide an answer.
>
> I am fetching a web page, and attempting to parse
> certain variables from it. I've done this plenty of
> times in the past with no problem. The only
> difference this time is the file that I am parsing is
> much larger. The HTML file is about 42kb in size
> (usually I only parse ~4kb worth). In the web
> browser, the script seems to just shut down, but
> reports no errors, not even to the web server logs.
> Is there some specific max size that it can accept or
> a setting in php.ini I need to modify?
>
> Thanks
hi,
i don't think, that 42k is too much for the size of your file. mut maybe
php simply times out while parsing? there is a php.ini-parameter
max_execution_time and a runtime-function set_time_limit(). try
set_time_limit(0) at top of your script fo debugging.
also take a look at preg_* functions instead of ereg_*. they are said to
be much faster.
hth SVEN
attached mail follows:
Shaun schrieb:
> "Ajai Khattri" <ajai
bway.net> wrote in message
> news:20031206203540.GA2749
bway.net...
>
>>On Sat, Dec 06, 2003 at 07:46:07PM -0000, Shaun wrote:
>>
>>
>>>I have installed PHP and Apache but when i try to view a PHP file i.e.
>>>http://127.0.0.1/hello.php i get a dialog box asking me if i want to
>
> open or
>
>>>save the file?
>>>
>>>Any ideas why this is happening?
>>
>>Assuming, your Apache is configured to load the php module:
>>
>>Your Apache is not configured to handle .php files. You need
>>to add directives in httpd.conf for PHP files.
>>
>>See PHP installation docs.
>>
>>--
>>Aj.
>>Sys. Admin / Developer
>
>
> Thanks for your reply,
>
> I have added the following lines to the beginning of httpd.conf
>
> LoadModule php4_module c:/php/sapi/php4apache.dll
> AddModule mod_php4.c
> AddType application/x-httpd-php .php
>
> But am still unable to view php files...
>
> Any ideas?
hi,
did you install apache 1.x or 2.x?
does http://127.0.0.1 or http://localhost show your apache-startpage?
did you stop and restart apache after changing httpd.conf?
did you copy php4ts.dll to one of the dirs as said in the manual?
just some thoughts from me.
every time i install a new envionment i make a file to '/htdocs'-dir
called 'phpinfo.php' with the following:
<?php
phpinfo();
?>
i call this file for testing: 'http://localhost/phpinfo.php'. this file
will also be vey useful when developing new scripts.
hth SVEN
attached mail follows:
Shaun schrieb:
> "Ajai Khattri" <ajai
bway.net> wrote in message
> news:20031206203540.GA2749
bway.net...
>
>>On Sat, Dec 06, 2003 at 07:46:07PM -0000, Shaun wrote:
>>
>>
>>>I have installed PHP and Apache but when i try to view a PHP file i.e.
>>>http://127.0.0.1/hello.php i get a dialog box asking me if i want to
>
> open or
>
>>>save the file?
>>>
>>>Any ideas why this is happening?
>>
>>Assuming, your Apache is configured to load the php module:
>>
>>Your Apache is not configured to handle .php files. You need
>>to add directives in httpd.conf for PHP files.
>>
>>See PHP installation docs.
>>
>>--
>>Aj.
>>Sys. Admin / Developer
>
>
> Thanks for your reply,
>
> I have added the following lines to the beginning of httpd.conf
>
> LoadModule php4_module c:/php/sapi/php4apache.dll
> AddModule mod_php4.c
> AddType application/x-httpd-php .php
>
> But am still unable to view php files...
>
> Any ideas?
hi,
did you install apache 1.x or 2.x?
does http://127.0.0.1 or http://localhost show your apache-startpage?
did you stop and restart apache after changing httpd.conf?
did you copy php4ts.dll to one of the dirs as said in the manual?
just some thoughts from me.
every time i install a new envionment i make a file to '/htdocs'-dir
called 'phpinfo.php' with the following:
<?php
phpinfo();
?>
i call this file for testing: 'http://localhost/phpinfo.php'. this file
will also be vey useful when developing new scripts.
hth SVEN
attached mail follows:
I am using Fedora Core 1 and I downloaded the php
source(php-4.3.3-6.src.rpm).
If I add
--with-interbase=shared,/opt/firebird/lib/
I get the error that it cannot find libgds or libib_util.
libib_util.so is in /opt/firebird/lib/. There is no libgds after
installing Firebird.
What am I missing?
Todd
attached mail follows:
Hi Everyone!
Looked up on the manual about the chmod() function for PHP, nice but it
wouldn't work if the ownership file permission is set, so that bring up a
question. How do I view the file permission or folder permission to see if
it have the neccessnary permission before proceeding. That way, I can halt
the script if there is no write permission or something.
Thanks,
Scott F.
attached mail follows:
On Tuesday 09 December 2003 02:19, Scott Fletcher wrote:
> Looked up on the manual about the chmod() function for PHP, nice but it
> wouldn't work if the ownership file permission is set, so that bring up a
> question. How do I view the file permission or folder permission to see if
> it have the neccessnary permission before proceeding. That way, I can
> halt the script if there is no write permission or something.
manual > Filesystem functions > is_*(), lstat()
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
QOTD:
"Sure, I turned down a drink once. Didn't understand the question."
*/
attached mail follows:
> > Looked up on the manual about the chmod() function for PHP, nice but
it
> > wouldn't work if the ownership file permission is set, so that bring up
a
> > question. How do I view the file permission or folder permission to see
if
> > it have the neccessnary permission before proceeding. That way, I can
> > halt the script if there is no write permission or something.
Maybe this help:
http://br.php.net/manual/en/function.fileperms.php
http://br.php.net/manual/en/ref.filesystem.php
attached mail follows:
Um, not sure what this meant with the fileperms() function. I have file
permission as "-rw-r--r--" or "644" and when using hte fileperms() funciton,
it spitted a result as "33188". If you know what it is then I'm all ear!
Don't know what the hell is 33188 stand for, so will stick to easier
functions, is_writeable() and is_readable().
Thank for the response!
Scott F.
"Marcos Thiago Merschamnn Fabis" <fabismt
neobiz.com.br> wrote in message
news:20031208183559.98231.qmail
pb1.pair.com...
> > > Looked up on the manual about the chmod() function for PHP, nice
but
> it
> > > wouldn't work if the ownership file permission is set, so that bring
up
> a
> > > question. How do I view the file permission or folder permission to
see
> if
> > > it have the neccessnary permission before proceeding. That way, I
can
> > > halt the script if there is no write permission or something.
>
> Maybe this help:
>
> http://br.php.net/manual/en/function.fileperms.php
> http://br.php.net/manual/en/ref.filesystem.php
attached mail follows:
> Um, not sure what this meant with the fileperms() function.
> I have file
> permission as "-rw-r--r--" or "644" and when using hte
> fileperms() funciton,
> it spitted a result as "33188". If you know what it is then
> I'm all ear!
33188 (base 10) == 0x100644 (base 8).
attached mail follows:
What's the function for converting it to base 8 ???
Thanks!!!!
"Roger B.A. Klorese" <rogerk
queernet.org> wrote in message
news:7CEFA9CA4D5BE74586551915EC9C9C33527842
consera1.corpnet.consera.com...
> > Um, not sure what this meant with the fileperms() function.
> > I have file
> > permission as "-rw-r--r--" or "644" and when using hte
> > fileperms() funciton,
> > it spitted a result as "33188". If you know what it is then
> > I'm all ear!
>
> 33188 (base 10) == 0x100644 (base 8).
attached mail follows:
Alright found it. it is base_convert, just use ...
--snip--
echo base_convert($filename,8,10);
--snip--
Cheer!
"Scott Fletcher" <scott
abcoa.com> wrote in message
news:20031208213529.80650.qmail
pb1.pair.com...
> What's the function for converting it to base 8 ???
>
> Thanks!!!!
>
> "Roger B.A. Klorese" <rogerk
queernet.org> wrote in message
>
news:7CEFA9CA4D5BE74586551915EC9C9C33527842
consera1.corpnet.consera.com...
> > > Um, not sure what this meant with the fileperms() function.
> > > I have file
> > > permission as "-rw-r--r--" or "644" and when using hte
> > > fileperms() funciton,
> > > it spitted a result as "33188". If you know what it is then
> > > I'm all ear!
> >
> > 33188 (base 10) == 0x100644 (base 8).
attached mail follows:
Im storing a lot of user-entered data in XML files but i have a problem
with folks submitting stuff just by copying and pasting from microsoft
word. "Smart Quotes" and other awkward text then gets submitted and ruins
the xml, meaning i am searching and replacing item by item to replace
stuff.
Does anyone know how I could do this automatically, as in is there
anything that will convert a string to UTF-8 automatically
ideally $fixed = convert-to-utf($oldmessedupstring)
any ideas? Will CDATA sections allow non UTF-8 text?
Russ Jones
attached mail follows:
Hello,
On 12/08/2003 04:37 PM, Russell P Jones wrote:
> Im storing a lot of user-entered data in XML files but i have a problem
> with folks submitting stuff just by copying and pasting from microsoft
> word. "Smart Quotes" and other awkward text then gets submitted and ruins
> the xml, meaning i am searching and replacing item by item to replace
> stuff.
>
> Does anyone know how I could do this automatically, as in is there
> anything that will convert a string to UTF-8 automatically
>
> ideally $fixed = convert-to-utf($oldmessedupstring)
>
> any ideas? Will CDATA sections allow non UTF-8 text?
There is the function utf8_encode() but if you want to generate XML, you
may also want to try this class that performs whatever conversions you need:
http://www.phpclasses.org/xmlwriter
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
"Playerfr" <playerfr
online.fr> wrote in message
news:20031207163436.28053.qmail
pb1.pair.com...
> Hi,
>
> I am using a PHPBB to have forum and site in php and i need a little
script
> , can i request it here or do you know an otehr group where i can request
> it.
>
> Thnaks
If it is a script relating to the forum, you can find many pre-made
modifications from the phpBB forum: <http://www.phpbb.com/phpBB/>. You
might be able to find one that does close to what you want, and modifying
something that is most of the way there is a lot easier than writing your
own script from scratch :o)
attached mail follows:
"Eric Bolikowski" <eric
broadpark.no> wrote in message
news:20031206151109.34550.qmail
pb1.pair.com...>
> ini_set('max_execution_time', '3600');
Thankyou very much, it works fine now! :o)
attached mail follows:
Greetings!
Is there a way to have PHP write an HTML file? What I would like to do is
have a user fill out a form, then have the information write an HTML file
and then save the file either for the first time, or overwrite the existing
one.
I hope this makes sense. Can anyone help?
--
Steve Marquez
Marquez Design
smarquez
marquez-design.com
attached mail follows:
Steve Marquez <mailto:smarquez
marquez-design.com>
on Monday, December 08, 2003 12:28 PM said:
> Greetings!
Hi.
> Is there a way to have PHP write an HTML file?
Yes. Start here http://us2.php.net/manual/en/function.fwrite.php.
Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/
attached mail follows:
--- Steve Marquez <smarquez
marquez-design.com> wrote:
> Is there a way to have PHP write an HTML file?
Sure. This is no different from writing any other file.
If you want it to write a file instead of outputting the content, a
convenient way (my opinion) of doing this is to use ob_start() at the top
of your script, and then do something like this at the very end:
$html = ob_get_contents();
$fp = fopen('./foo.html', 'w');
fwrite($fp, $html);
fclose($fp);
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
attached mail follows:
I am setting up a Soekris box (256MB CF card) that needs a newer PHP with
mySQL support.
I followed some instructions I googled and finally got a v4.1.2 of PHP that
has mysql working even though phpinfo() says '--without-mysql' (?!). But
this is a pretty old version of PHP.
I do NOT need the webserver and all that overhead as this is simply going to
connect to another remote DB (via PHP). I don't have the tools to compile it
on there either, nor do I want them.
Please tell me how to apt-get a newer version of the CGI PHP with mySQL
support.
attached mail follows:
Hi
I have problems with a regular expression.
I have a html file like this:
....
<body>
<div>Hello</div>
<br>
<br>
<div>somthing</div>
<br>
</body>
....
And i want to use preg_match to get a list of all the <div> tags in the
file:
result:
$list[0] = <div>Hello</div>
$list[1] = <div>somthing</div>
I have tryed this:
preg_match('/.*(\<div\>.*\<\/div\>).*/', $contents, $list);
attached mail follows:
Hi
I have problems with a regular expression.
I have a html file like this:
....
<body>
<div>Hello</div>
<br>
<br>
<div>somthing</div>
<br>
</body>
....
And i want to use preg_match to get a list of all the <div> tags in the
file:
result:
$list[0] = <div>Hello</div>
$list[1] = <div>somthing</div>
I have tryed this:
preg_match('/.*(\<div\>.*\<\/div\>).*/', $contents, $list);
attached mail follows:
Fred wrote:
> Hi
>
> I have problems with a regular expression.
>
> I have a html file like this:
> ....
> <body>
> <div>Hello</div>
> <br>
> <br>
> <div>somthing</div>
> <br>
> </body>
> ....
>
> And i want to use preg_match to get a list of all the <div> tags in the
> file:
> result:
> $list[0] = <div>Hello</div>
> $list[1] = <div>somthing</div>
>
> I have tryed this:
> preg_match('/.*(\<div\>.*\<\/div\>).*/', $contents, $list);
Your regex is matching EVERYTHING before and after the div. It's also
matching the maximum of content between the div tags. Here's a better one:
/(<div>.*?<\/div>/i
1) You don't need to escape the < and >.
2) The ? after .* makes it match a minimum of content between the div tags.
3) the /i matches case insensitive, meaning that DIV will be matched as well
Note that this won't work quite right on nested div tags.
--
paperCrane <Justin Patrin>
attached mail follows:
> Hi, I am a MD, involved in a very large medical project that requieres a strong database plataform, the project must be .NET , the estimated transactional movement is about 40 on line users accesing a DB with a 200 relational tables. The policy is to program this SW in three layer design, our first oprion is ASP.NET and SQL Server 2000, because is worldwide spread. I had investigated PHP and MySQL, and I wonder if you can give me a imparcial advise if I must continue with ASP.NET or if PHP is a reasonable alternative.
>
> Thanks.
attached mail follows:
Ryotaro Ishikawa Md wrote:
>>Hi, I am a MD, involved in a very large medical project that requieres a strong database plataform, the project must be .NET , the estimated transactional movement is about 40 on line users accesing a DB with a 200 relational tables. The policy is to program this SW in three layer design, our first oprion is ASP.NET and SQL Server 2000, because is worldwide spread. I had investigated PHP and MySQL, and I wonder if you can give me a imparcial advise if I must continue with ASP.NET or if PHP is a reasonable alternative.
>>
>>Thanks.
>
>
>
The short answer is yes, PHP is used in many production environments and
is very stable and featureful. There is a large developer community
which creates lots of extensions. One of the largest and best written
sets is PEAR (http://pear.php.net).
As for mysql, it also is used in many production environments. If you
feel that normal mysql doesn't have enough "enterprise" features, you
could use the InnoDB table type, which supports foreign keys and such.
If that still doesn't satisfy you, you can use PostgreSQL, which is
another open-source database system, but has more "enterprise" like
features. If even that isn't enough, you can always use Oracle or
another database system that you have to pay for.
The long answer is: get ready for a holy war.
--
paperCrane <Justin Patrin>
attached mail follows:
Hello,
On 12/08/2003 07:42 PM, Ryotaro Ishikawa Md wrote:
>>Hi, I am a MD, involved in a very large medical project that requieres a strong database plataform, the project must be .NET , the estimated transactional movement is about 40 on line users accesing a DB with a 200 relational tables. The policy is to program this SW in three layer design, our first oprion is ASP.NET and SQL Server 2000, because is worldwide spread. I had investigated PHP and MySQL, and I wonder if you can give me a imparcial advise if I must continue with ASP.NET or if PHP is a reasonable alternative.
You may want to take a look at Care 2000 before going to reinvent the wheel:
http://www.care2x.net/
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
Before you make any decision please take a look the
power of PHP.
http://www.dreamlab.ca/technology/phpsites/
Thanks
Hardik
--- Manuel Lemos <mlemos
acm.org> wrote:
> Hello,
>
> On 12/08/2003 07:42 PM, Ryotaro Ishikawa Md wrote:
> >>Hi, I am a MD, involved in a very large medical
> project that requieres a strong database plataform,
> the project must be .NET , the estimated
> transactional movement is about 40 on line users
> accesing a DB with a 200 relational tables. The
> policy is to program this SW in three layer design,
> our first oprion is ASP.NET and SQL Server 2000,
> because is worldwide spread. I had investigated PHP
> and MySQL, and I wonder if you can give me a
> imparcial advise if I must continue with ASP.NET or
> if PHP is a reasonable alternative.
>
> You may want to take a look at Care 2000 before
> going to reinvent the wheel:
>
> http://www.care2x.net/
>
>
>
> --
>
> Regards,
> Manuel Lemos
>
> Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
attached mail follows:
Good afternoon, all!!
Is there a function or series of functions in PHP that will allow a PHP
package to read email from a sendmail account, look for a specific
information in the subject line, then be able to resend that email to a
group of users?? I know mail can be used to send email but reading from
sendmail???...
Any information is greatly appreciated and profoundly useful.
Robin 'Sparky' Kopetzky
Black Mesa Computers/Internet Service
Grants, NM 87020
attached mail follows:
Robin Kopetzky wrote:
> Good afternoon, all!!
>
> Is there a function or series of functions in PHP that will allow a PHP
> package to read email from a sendmail account, look for a specific
> information in the subject line, then be able to resend that email to a
> group of users?? I know mail can be used to send email but reading from
> sendmail???...
>
> Any information is greatly appreciated and profoundly useful.
>
> Robin 'Sparky' Kopetzky
> Black Mesa Computers/Internet Service
> Grants, NM 87020
You could use the imap functions to read from an IMAP account quite easily.
--
paperCrane <Justin Patrin>
attached mail follows:
Hello,
On 12/08/2003 07:58 PM, Robin Kopetzky wrote:
> Is there a function or series of functions in PHP that will allow a PHP
> package to read email from a sendmail account, look for a specific
> information in the subject line, then be able to resend that email to a
> group of users?? I know mail can be used to send email but reading from
> sendmail???...
You can always try to read the mail box file directly if your Web server
user has the right permissions. However, the most portable way is to
connect to your POP3 server to fetch the messages as you need.
In that case you may want to take a look at this POP3 client class:
http://www.phpclasses.org/pop3class
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
On Tuesday, December 9, 2003, at 08:58 AM, Robin Kopetzky wrote:
> Good afternoon, all!!
>
> Is there a function or series of functions in PHP that will allow a
> PHP
> package to read email from a sendmail account, look for a specific
> information in the subject line, then be able to resend that email to a
> group of users?? I know mail can be used to send email but reading from
> sendmail???...
>
> Any information is greatly appreciated and profoundly useful.
>
http://au2.php.net/imap
Might be a good starting point.
Justin French
attached mail follows:
Hi there
I have a database called "Eric" and table name called "Rocket'.
Table consists of three values.
PARTNO | DESCRIPTION | COMMENT
So far if i want to show copper headgaskets from the 5r field i put this
string into the php script (along with the rest of the html/php code)
$sql = "SELECT * FROM rocket WHERE partno like '5r%' AND description like
'COPPER HEADGASKET%'";
The problem is there is 1000s of different querys i want to run and dont
want to make a page for each query. So what im trying to ask is how do i run
a query to display the results (like http://www.domain.com/query.php?"the
query i want to run" rather then link to a .php/html file with the query
inside of it.)
attached mail follows:
Eric Holmstrom wrote:
> Hi there
>
> I have a database called "Eric" and table name called "Rocket'.
>
> Table consists of three values.
> PARTNO | DESCRIPTION | COMMENT
>
> So far if i want to show copper headgaskets from the 5r field i put this
> string into the php script (along with the rest of the html/php code)
>
> $sql = "SELECT * FROM rocket WHERE partno like '5r%' AND description like
> 'COPPER HEADGASKET%'";
>
> The problem is there is 1000s of different querys i want to run and dont
> want to make a page for each query. So what im trying to ask is how do i run
> a query to display the results (like http://www.domain.com/query.php?"the
> query i want to run" rather then link to a .php/html file with the query
> inside of it.)
The short answer is to use a GET variable for this.
http://example.com/script.php?sql=SELECT...
You have to remember to url encode the SQL, though (see urlencode()).
You can access it like this:
$_GET['sql']
The longer answer is to use a package such as DB_DataObject_FormBuilder
(http://pear.php.net/package/DB_DataObject_FormBuilder) to generate this
stuff for you. It will take some setup, but once you're used to it, it
can make this kind of app happen real quick.
--
paperCrane <Justin Patrin>
attached mail follows:
Okay i have this so far
-----------------------------------------------
<?php
$conn = mysql_connect("localhost", "", "");
mysql_select_db("ERIC",$conn);
$sql = "SELECT * FROM rocket";
$result = mysql_query($sql, $conn) or die(mysql_error());
while ($newArray = mysql_fetch_array($result)) {
$partno = $newArray['PARTNO'];
$description = $newArray['DESCRIPTION'];
$comment = $newArray['COMMENT'];
}
?>
-----------------------------------------------------------
How do i make it so if i type
http://localhost/test.php?partno=5r&description=copper
Cheers if you can help out!
"Justin Patrin" <papercrane
reversefold.com> wrote in message
news:20031208224125.86629.qmail
pb1.pair.com...
> Eric Holmstrom wrote:
>
> > Hi there
> >
> > I have a database called "Eric" and table name called "Rocket'.
> >
> > Table consists of three values.
> > PARTNO | DESCRIPTION | COMMENT
> >
> > So far if i want to show copper headgaskets from the 5r field i put this
> > string into the php script (along with the rest of the html/php code)
> >
> > $sql = "SELECT * FROM rocket WHERE partno like '5r%' AND description
like
> > 'COPPER HEADGASKET%'";
> >
> > The problem is there is 1000s of different querys i want to run and dont
> > want to make a page for each query. So what im trying to ask is how do i
run
> > a query to display the results (like
http://www.domain.com/query.php?"the
> > query i want to run" rather then link to a .php/html file with the query
> > inside of it.)
>
> The short answer is to use a GET variable for this.
>
> http://example.com/script.php?sql=SELECT...
>
> You have to remember to url encode the SQL, though (see urlencode()).
> You can access it like this:
>
> $_GET['sql']
>
> The longer answer is to use a package such as DB_DataObject_FormBuilder
> (http://pear.php.net/package/DB_DataObject_FormBuilder) to generate this
> stuff for you. It will take some setup, but once you're used to it, it
> can make this kind of app happen real quick.
>
> --
> paperCrane <Justin Patrin>
attached mail follows:
Eric Holmstrom <mailto:eric
rocketind.com>
on Monday, December 08, 2003 3:06 PM said:
> How do i make it so if i type
> http://localhost/test.php?partno=5r&description=copper
$partno = $_GET['partno'];
$description = $_GET['description'];
$sql = "
SELECT partno
, description
, comment
FROM Eric
WHERE partno = '$partno'
AND description = '$description'
";
// execute your sql query
HTH,
Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/
attached mail follows:
Eric Holmstrom wrote:
> Okay i have this so far
>
> -----------------------------------------------
>
> <?php
> $conn = mysql_connect("localhost", "", "");
> mysql_select_db("ERIC",$conn);
> $sql = "SELECT * FROM rocket";
>
> $result = mysql_query($sql, $conn) or die(mysql_error());
> while ($newArray = mysql_fetch_array($result)) {
>
> $partno = $newArray['PARTNO'];
> $description = $newArray['DESCRIPTION'];
> $comment = $newArray['COMMENT'];
>
> }
> ?>
>
> -----------------------------------------------------------
>
>
> How do i make it so if i type
> http://localhost/test.php?partno=5r&description=copper
>
> Cheers if you can help out!
>
>
> "Justin Patrin" <papercrane
reversefold.com> wrote in message
> news:20031208224125.86629.qmail
pb1.pair.com...
>
>>Eric Holmstrom wrote:
>>
>>
>>>Hi there
>>>
>>>I have a database called "Eric" and table name called "Rocket'.
>>>
>>>Table consists of three values.
>>>PARTNO | DESCRIPTION | COMMENT
>>>
>>>So far if i want to show copper headgaskets from the 5r field i put this
>>>string into the php script (along with the rest of the html/php code)
>>>
>>>$sql = "SELECT * FROM rocket WHERE partno like '5r%' AND description
>
> like
>
>>>'COPPER HEADGASKET%'";
>>>
>>>The problem is there is 1000s of different querys i want to run and dont
>>>want to make a page for each query. So what im trying to ask is how do i
>
> run
>
>>>a query to display the results (like
>
> http://www.domain.com/query.php?"the
>
>>>query i want to run" rather then link to a .php/html file with the query
>>>inside of it.)
>>
>>The short answer is to use a GET variable for this.
>>
>>http://example.com/script.php?sql=SELECT...
>>
>>You have to remember to url encode the SQL, though (see urlencode()).
>>You can access it like this:
>>
>>$_GET['sql']
>>
>>The longer answer is to use a package such as DB_DataObject_FormBuilder
>>(http://pear.php.net/package/DB_DataObject_FormBuilder) to generate this
>>stuff for you. It will take some setup, but once you're used to it, it
>>can make this kind of app happen real quick.
>>
>>--
>>paperCrane <Justin Patrin>
At this point, I will recommend you to ANY PHP tutorial and the PHP
manual. The point of these lists is to help after you've tried things,
not to write your code for you.
--
paperCrane <Justin Patrin>
attached mail follows:
Hi
I have an array in php like this:
$arr[0][0] = "Something";
$arr[0][1] = "Hello";
$arr[0][2] = "Hi";
It is possible to post this array to another site in a form? Or how can i do
this?
Fred
attached mail follows:
fred <mailto:sturle_damm
hotmail.com>
on Monday, December 08, 2003 4:31 AM said:
> I have an array in php like this:
>
> $arr[0][0] = "Something";
> $arr[0][1] = "Hello";
> $arr[0][2] = "Hi";
>
> It is possible to post this array to another site in a form? Or how
> can i do this?
Yes. Here is a hint: delimit.
Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/
attached mail follows:
Chris W. Parker wrote:
> fred <mailto:sturle_damm
hotmail.com>
> on Monday, December 08, 2003 4:31 AM said:
>
>
>>I have an array in php like this:
>>
>>$arr[0][0] = "Something";
>>$arr[0][1] = "Hello";
>>$arr[0][2] = "Hi";
>>
>>It is possible to post this array to another site in a form? Or how
>>can i do this?
>
>
> Yes. Here is a hint: delimit.
>
>
>
> Chris.
> --
> Don't like reformatting your Outlook replies? Now there's relief!
> http://home.in.tum.de/~jain/software/outlook-quotefix/
...that's a strange response. I doubt that's what was asked anyway.
What you want is probably a php function/class that can post form data
to another script. PEAR's HTTP_Request can do that.
--
paperCrane <Justin Patrin>
attached mail follows:
>I have an array in php like this:
>
>$arr[0][0] = "Something";
>$arr[0][1] = "Hello";
>$arr[0][2] = "Hi";
>
>It is possible to post this array to another site in a form? Or how can i do
>this?
It would help to serialize the array into a string, then pass it as a
regular value in a GET or POST request.
http://php.net/serialize
http://php.net/unserialize
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html
attached mail follows:
Hello,
On 12/08/2003 10:30 AM, Fred wrote:
> I have an array in php like this:
>
> $arr[0][0] = "Something";
> $arr[0][1] = "Hello";
> $arr[0][2] = "Hi";
>
> It is possible to post this array to another site in a form? Or how can i do
> this?
You may want to try this class that lets you make HTTP requests like a
normal browser:
http://www.phpclasses.org/httpclient
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
Manuel Lemos wrote:
> Hello,
>
> On 12/08/2003 10:30 AM, Fred wrote:
>
>> I have an array in php like this:
>>
>> $arr[0][0] = "Something";
>> $arr[0][1] = "Hello";
>> $arr[0][2] = "Hi";
>>
>> It is possible to post this array to another site in a form? Or how
>> can i do
>> this?
>
>
> You may want to try this class that lets you make HTTP requests like a
> normal browser:
>
> http://www.phpclasses.org/httpclient
>
Or even better, use PEAR's HTTP_Client.
http://pear.php.net/package/HTTP_Client
--
paperCrane <Justin Patrin>
attached mail follows:
Hello,
On 12/08/2003 10:39 PM, Justin Patrin wrote:
>>> $arr[0][0] = "Something";
>>> $arr[0][1] = "Hello";
>>> $arr[0][2] = "Hi";
>>>
>>> It is possible to post this array to another site in a form? Or how
>>> can i do
>>> this?
>>
>>
>>
>> You may want to try this class that lets you make HTTP requests like a
>> normal browser:
>>
>> http://www.phpclasses.org/httpclient
>>
>
> Or even better, use PEAR's HTTP_Client.
> http://pear.php.net/package/
> HTTP_Client
Why better? Have you tried both packages?
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
--- Manuel Lemos <mlemos
acm.org> wrote:
> >> http://www.phpclasses.org/httpclient
> >
> > Or even better, use PEAR's HTTP_Client.
> > http://pear.php.net/package/HTTP_Client
>
> Why better? Have you tried both packages?
I can make a guess as to why he would say this, aside from the obvious
fact that one is part of the PHP project and one is not.
Visitng http://www.phpclasses.org/httpclient results in several pages of
banner ads that one must navigate before finally being shown:
"You need to be a subscriber and log in to access this file."
Visiting http://pear.php.net/package/HTTP_Client results in a relevant
page of information that contains a link to code,
http://pear.php.net/get/HTTP_Client-0.1.tgz.
Ads or code. Which would you choose?
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
attached mail follows:
Manuel Lemos wrote:
> Hello,
>
> On 12/08/2003 10:39 PM, Justin Patrin wrote:
>
>>>> $arr[0][0] = "Something";
>>>> $arr[0][1] = "Hello";
>>>> $arr[0][2] = "Hi";
>>>>
>>>> It is possible to post this array to another site in a form? Or how
>>>> can i do
>>>> this?
>>>
>>>
>>>
>>>
>>> You may want to try this class that lets you make HTTP requests like
>>> a normal browser:
>>>
>>> http://www.phpclasses.org/httpclient
>>>
>>
>> Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/
>
> > HTTP_Client
>
> Why better? Have you tried both packages?
>
>
>
No, however, the httpclient system is a lot of code that is part of one
class. HTTP_Client is based on lots of sub-systems, each of which can be
used seperately and for other purposes (and each of which is maintained
by seperate, multiple people). For instance, there is the Socket API,
URL parsing, the HTTP Request, etc. All of which HTTP_Client is built
upon instead of re-inventing.
Also, and just as important, using PEAR packages gives you a centralized
way of dealing with errors.
--
paperCrane <Justin Patrin>
attached mail follows:
Chris Shiflett wrote:
> --- Manuel Lemos <mlemos
acm.org> wrote:
>
>>>>http://www.phpclasses.org/httpclient
>>>
>>>Or even better, use PEAR's HTTP_Client.
>>>http://pear.php.net/package/HTTP_Client
>>
>>Why better? Have you tried both packages?
>
>
> I can make a guess as to why he would say this, aside from the obvious
> fact that one is part of the PHP project and one is not.
>
> Visitng http://www.phpclasses.org/httpclient results in several pages of
> banner ads that one must navigate before finally being shown:
>
> "You need to be a subscriber and log in to access this file."
>
> Visiting http://pear.php.net/package/HTTP_Client results in a relevant
> page of information that contains a link to code,
> http://pear.php.net/get/HTTP_Client-0.1.tgz.
>
> Ads or code. Which would you choose?
>
> Chris
>
> =====
> Chris Shiflett - http://shiflett.org/
>
> PHP Security Handbook
> Coming mid-2004
> HTTP Developer's Handbook
> http://httphandbook.org/
This is also a very good point.
Actually PEAR isn't a PHP project per se. It is simply supported by many
of the PHP developers and by many very talented PHP coders. Another very
important aspect of PEAR that I didn't mention in my other message is
that PEAR has standards that must be upheld in all of their packages.
The packages are also under peer-review; anyone cna download and use
them and anyone can submit bug reports if they find an error or want a
new feature. In addition, anyone can add a new package or a feature to
an existing package (after it has been reveiwed, of course).
--
paperCrane <Justin Patrin>
attached mail follows:
Hello,
On 12/08/2003 11:06 PM, Justin Patrin wrote:
>>>> You may want to try this class that lets you make HTTP requests like
>>>> a normal browser:
>>>>
>>>> http://www.phpclasses.org/httpclient
>>>>
>>>
>>> Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/
>>
>>
>> > HTTP_Client
>>
>> Why better? Have you tried both packages?
>>
>>
>>
>
> No, however, the httpclient system is a lot of code that is part of one
No? If you have not tried it at all WTF are you claiming that something
else is better? Better than what? Something you have not tried?
> class. HTTP_Client is based on lots of sub-systems, each of which can be
> used seperately and for other purposes (and each of which is maintained
> by seperate, multiple people). For instance, there is the Socket API,
Are you telling me that to make HTTP requests, loading half of dozen
classes is better than doing it all with just one?
> URL parsing, the HTTP Request, etc. All of which HTTP_Client is built
> upon instead of re-inventing.
AFAIK, this HTTP client class was released for the first time in 1999.
The way I see it, if anybody reinvented anything, that must have been
whoever came after that to do the same.
> Also, and just as important, using PEAR packages gives you a centralized
> way of dealing with errors.
You meant that 800 line fat base class that many PEAR classes inherit
and require in order to run even when developers do not want anything
from it?
No thanks, I am not interested in bloated software development.
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
--- Justin Patrin <papercrane
reversefold.com> wrote:
> Actually PEAR isn't a PHP project per se.
I disagree.
You have to become a member of the PHP development team, as far as I know,
to participate in PEAR development (CVS account, php.net email address,
etc.). The project is also governed by the PHP Group, and it is hosted on
php.net servers (pear.php.net). Many PHP extensions (PECL) are a part of
it (http://pear.php.net/manual/en/pecl.php) also.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
attached mail follows:
Chris W. Parker wrote:
> Justin Patrin <mailto:papercrane
reversefold.com>
> on Monday, December 08, 2003 4:39 PM said:
>
>
>>If all you want to do is give an array to another
>>script, sure you can delimit (although that's much more error prone
>>than serializing).
>
>
> Serialize, delimit. It's pretty much the same idea.
>
>
>
> Chris.
> --
> Don't like reformatting your Outlook replies? Now there's relief!
> http://home.in.tum.de/~jain/software/outlook-quotefix/
Not really. If you just delimit, you have to worry about escaping that
value in your string somehow. If your delimiter was ',' say and you had
one in a field, how would you handle it?
In addition, serializing is part of PHP, so you know that what you put
in is what you get out. Writing your own simple serialization through
delimiting is just asking for problems. What if, say, the array has
textual keys instead of just numbered ones? Or the array has three
indices? Or one of the values is an object? Using serializa() and
unserialize() means that you don't EVER have to worry about this (unless
there are errors in these functions, in which case, you submit a bug
report and it gets fixed).
--
paperCrane <Justin Patrin>
attached mail follows:
Chris Shiflett wrote:
> --- Justin Patrin <papercrane
reversefold.com> wrote:
>
>>Actually PEAR isn't a PHP project per se.
>
>
> I disagree.
>
> You have to become a member of the PHP development team, as far as I know,
> to participate in PEAR development (CVS account, php.net email address,
> etc.). The project is also governed by the PHP Group, and it is hosted on
> php.net servers (pear.php.net). Many PHP extensions (PECL) are a part of
> it (http://pear.php.net/manual/en/pecl.php) also.
>
> Chris
>
> =====
> Chris Shiflett - http://shiflett.org/
>
> PHP Security Handbook
> Coming mid-2004
> HTTP Developer's Handbook
> http://httphandbook.org/
Ok, I can give you that. But anyone (and I mean anyone) can submit
patches to the maintainers for inclusion. The standards are also there
and open. All source code and documentation is easily readable (well,
not docs for all of the projects, but the code is almost always
documented well enough). My point here is that a team of people deal
with all of these packages and their interactions.
And even so, you can get a PEAR account if you need one. If you want to
help maintain a project or create your own, all you have to do is ask
(and show that you're serious).
--
paperCrane <Justin Patrin>
attached mail follows:
Hello,
On 12/08/2003 11:04 PM, Chris Shiflett wrote:
>>>>http://www.phpclasses.org/httpclient
>>>
>>>Or even better, use PEAR's HTTP_Client.
>>>http://pear.php.net/package/HTTP_Client
>>
>>Why better? Have you tried both packages?
>
>
> I can make a guess as to why he would say this, aside from the obvious
> fact that one is part of the PHP project and one is not.
And? Does that meant that all the 130.000+ subscribers of the PHP
Classes site are all wrong and you are one that is right?
> Visitng http://www.phpclasses.org/httpclient results in several pages of
> banner ads that one must navigate before finally being shown:
Do you have a problem with site that use advertising to keep themselves
alive?
> "You need to be a subscriber and log in to access this file."
If you do not want to subscribe to have access, fine, that is going to
be your problem.
However, I think that nobody can say that B is better than A if he did
not gave himself the opportunity to try both. Just good common sense.
> Visiting http://pear.php.net/package/HTTP_Client results in a relevant
> page of information that contains a link to code,
> http://pear.php.net/get/HTTP_Client-0.1.tgz.
>
> Ads or code. Which would you choose?
I think any person with good sense would try both before coming to any
conclusions.
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
----- Original Message -----
From: "Manuel Lemos" <mlemos
acm.org>
To: <php-general
lists.php.net>
Sent: Monday, December 08, 2003 8:30 PM
Subject: Re: [PHP] Re: post an array into another site
> Hello,
>
> On 12/08/2003 11:04 PM, Chris Shiflett wrote:
> >>>>http://www.phpclasses.org/httpclient
> >>>
> >>>Or even better, use PEAR's HTTP_Client.
> >>>http://pear.php.net/package/HTTP_Client
> >>
> >>Why better? Have you tried both packages?
> >
> >
> > I can make a guess as to why he would say this, aside from the obvious
> > fact that one is part of the PHP project and one is not.
>
> And? Does that meant that all the 130.000+ subscribers of the PHP
> Classes site are all wrong and you are one that is right?
phpclasses.org is a great site!
attached mail follows:
Manuel Lemos wrote:
> Hello,
>
> On 12/08/2003 11:06 PM, Justin Patrin wrote:
>
>>>>> You may want to try this class that lets you make HTTP requests
>>>>> like a normal browser:
>>>>>
>>>>> http://www.phpclasses.org/httpclient
>>>>>
>>>>
>>>> Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/
>>>
>>>
>>>
>>> > HTTP_Client
>>>
>>> Why better? Have you tried both packages?
>>>
>>>
>>>
>>
>> No, however, the httpclient system is a lot of code that is part of one
>
>
> No? If you have not tried it at all WTF are you claiming that something
> else is better? Better than what? Something you have not tried?
>
Even if I have not used the other thing, I am still very likely to work
with PEAR packages. Why? Because I know that I can get help with it from
the PEAR developers and get fixes and updates easily and quickly.
>
>> class. HTTP_Client is based on lots of sub-systems, each of which can
>> be used seperately and for other purposes (and each of which is
>> maintained by seperate, multiple people). For instance, there is the
>> Socket API,
>
>
> Are you telling me that to make HTTP requests, loading half of dozen
> classes is better than doing it all with just one?
>
Yes, it is better to have them all in seperate packages for
maintainability. If you have everything in one place, you're VERY prone
to errors.
Now, I haven't seen the code for the phpclasses project, so I can't say
anything about it, but in general having thing seperated is much better
practice.
>
>> URL parsing, the HTTP Request, etc. All of which HTTP_Client is built
>> upon instead of re-inventing.
>
>
> AFAIK, this HTTP client class was released for the first time in 1999.
> The way I see it, if anybody reinvented anything, that must have been
> whoever came after that to do the same.
>
Ok, valid point.
>
>> Also, and just as important, using PEAR packages gives you a
>> centralized way of dealing with errors.
>
>
> You meant that 800 line fat base class that many PEAR classes inherit
> and require in order to run even when developers do not want anything
> from it?
>
> No thanks, I am not interested in bloated software development.
>
>
PEAR is used in many production systems and the classes are tuned for
speed. Or if they aren't you can alter them and send in a patch. PEAR
promotes standards instead of ad-hoc programming. It's better to write
your error handling code once instead of re-creating it for every
package you ever write.
Not all PEAR packages inherit from PEAR. Some just use pieces of it.
Some don't use it at all. It all depends on what the package needs.
--
paperCrane <Justin Patrin>
attached mail follows:
Justin Patrin wrote:
> Manuel Lemos wrote:
>
>> Hello,
>>
>> On 12/08/2003 10:30 AM, Fred wrote:
>>
>>> I have an array in php like this:
>>>
>>> $arr[0][0] = "Something";
>>> $arr[0][1] = "Hello";
>>> $arr[0][2] = "Hi";
>>>
>>> It is possible to post this array to another site in a form? Or how
>>> can i do
>>> this?
>>
>>
>>
>> You may want to try this class that lets you make HTTP requests like a
>> normal browser:
>>
>> http://www.phpclasses.org/httpclient
>>
>
> Or even better, use PEAR's HTTP_Client.
> http://pear.php.net/package/HTTP_Client
>
I hereby retract the "Or even better" part of my statement. It was wrong
since I had not used httpclient. However, I still stand by PEAR and am
still more likely to use PEAR packages than any other, simply because I
trust them and I like the way that it works.
--
paperCrane <Justin Patrin>
attached mail follows:
Hello,
On 12/08/2003 11:36 PM, Justin Patrin wrote:
>>>>>> You may want to try this class that lets you make HTTP requests
>>>>>> like a normal browser:
>>>>>>
>>>>>> http://www.phpclasses.org/httpclient
>>>>>>
>>>>>
>>>>> Or even better, use PEAR's HTTP_Client. http://pear.php.net/package/
>>>>
>>>> > HTTP_Client
>>>>
>>>> Why better? Have you tried both packages?
>>>>
>>>
>>> No, however, the httpclient system is a lot of code that is part of one
>>
>> No? If you have not tried it at all WTF are you claiming that
>> something else is better? Better than what? Something you have not tried?
>>
>
> Even if I have not used the other thing, I am still very likely to work
Therefore, your claim that it is better is void because you have no
basis for comparison.
> with PEAR packages. Why? Because I know that I can get help with it from
> the PEAR developers and get fixes and updates easily and quickly.
Who told you that you do not get help from developers that contribute to
the PHP Classes site?
The way I see it depends. Some developers provide better support then
others . It depends on if and when they are available when you ask. That
applies to any developers regardless of the where they contribute their
classes.
In this case, I developed the HTTP client class and I can tell you that
I try to provide prompt support whenever I am not so busy (which is not
all the time, but frequently).
I even tell you more, recently I even had to develop a patch to fix a
bug in PHP itself that affected all code that deals with socket connections.
Personally, I am not looking for medals of recognition or whatever, but
one thing that you can't say is that only developers that contribute to
PEAR always provide prompt support.
Not only that is not always true, but you are probably insulting all
other PHP authors that contribute to PHP Classes or other repositories
that are very commited to providing great support despite they all work
for free and benefit of many thousands of PHP users.
>>> class. HTTP_Client is based on lots of sub-systems, each of which can
>>> be used seperately and for other purposes (and each of which is
>>> maintained by seperate, multiple people). For instance, there is the
>>> Socket API,
>>
>>
>>
>> Are you telling me that to make HTTP requests, loading half of dozen
>> classes is better than doing it all with just one?
>>
>
> Yes, it is better to have them all in seperate packages for
> maintainability. If you have everything in one place, you're VERY prone
> to errors.
I completely disagree. Spliting all in classes that provide more
functionality that you may need to make HTTP requests certainly is more
likely to have more bugs because you end up with more code.
>>> Also, and just as important, using PEAR packages gives you a
>>> centralized way of dealing with errors.
>>
>>
>>
>> You meant that 800 line fat base class that many PEAR classes inherit
>> and require in order to run even when developers do not want anything
>> from it?
>>
>> No thanks, I am not interested in bloated software development.
>>
>>
>
> PEAR is used in many production systems and the classes are tuned for
> speed. Or if they aren't you can alter them and send in a patch. PEAR
I am sorry, but you can't convince me that using a bloated 800 line base
class, that most of the time you do not need, it is tuned for speed.
If you knew the PHP object model minimally, you would know that inherit
classes for needless reasons only adds overhead to object creation,
meaning it takes more time and memory to create objects of subclasses.
> promotes standards instead of ad-hoc programming. It's better to write
> your error handling code once instead of re-creating it for every
> package you ever write.
I am sorry but I disagree that PEAR error handling is any good because
it replicates the error handling functions that PHP already provides.
Furthermore, I prefer that functions that are susceptible to fail return
a boolean condition that is simple to verify and an additional error
variable that explains the error to humans. I do not need to inherit
bloated 800 line base class to do that.
> Not all PEAR packages inherit from PEAR. Some just use pieces of it.
> Some don't use it at all. It all depends on what the package needs.
You are just validating my point. Those classes that do not use the PEAR
base class are meant for speed and simplification.
Anyway, your initial point is that PEAR is good because it provides
central error handling, when you have just confirmed that some classes
do not use it because at least some of use know that it is a bad idea.
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
= THE END =
attached mail follows:
--- Justin Patrin <papercrane
reversefold.com> wrote:
> Ok, I can give you that. But anyone (and I mean anyone) can submit
> patches to the maintainers for inclusion.
This is no different than with PHP or most any other open source project.
In fact, submitting patches is probably the most common precursor to
getting your own CVS account.
> My point here is that a team of people deal with all of these
> packages and their interactions.
The same with PHP.
> And even so, you can get a PEAR account if you need one. If you want
> to help maintain a project or create your own, all you have to do is
> ask (and show that you're serious).
This is also the same with PHP. In fact, as far as I know, the same group
of people authorize you to receive the CVS account.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
attached mail follows:
--- Manuel Lemos <mlemos
acm.org> wrote:
> > I can make a guess as to why he would say this, aside from the
> > obvious fact that one is part of the PHP project and one is not.
>
> And? Does that meant that all the 130.000+ subscribers of the PHP
> Classes site are all wrong and you are one that is right?
So, your argument is that the people who subscribe, which you mention
below is required to even try these classes (and you argue that this
should be required before making a decision), are voting in favor of these
PHP classes over PEAR? This makes absolutely no sense.
So, we have two groups of people:
1. Those who have tried your PHP classes
2. Those who have not
Your argument is that group 2's opinion is not valid and that group 1's
opinion is decided by you (to prefer the PHP classes over PEAR). Yes, if
your erroneous assumptions were somehow true, you would be right. However,
most people on this list are too logical to be fooled by such an argument.
> > Visitng http://www.phpclasses.org/httpclient results in several pages
> > of banner ads that one must navigate before finally being shown:
>
> Do you have a problem with site that use advertising to keep
> themselves alive?
Nope, that's their choice. It's just funny when the maintainers cry foul
when people aren't interested in their site. Your choice is to have ads.
My choice is to not visit. Live with it. :-)
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
attached mail follows:
Ralph Guzman wrote:
> = THE END =
I apologize, everyone. I should have realized a while ago that this
would become a holy war.
--
paperCrane <Justin Patrin>
attached mail follows:
Hello,
On 12/09/2003 01:55 AM, Chris Shiflett wrote:
>>>I can make a guess as to why he would say this, aside from the
>>>obvious fact that one is part of the PHP project and one is not.
>>
>>And? Does that meant that all the 130.000+ subscribers of the PHP
>>Classes site are all wrong and you are one that is right?
>
>
> So, your argument is that the people who subscribe, which you mention
> below is required to even try these classes (and you argue that this
> should be required before making a decision), are voting in favor of these
> PHP classes over PEAR? This makes absolutely no sense.
I never said that. What I said that is that nobody can tell that one
class is better than the other before trying both.
Anyway, this thread is not about PHP Classes vs. PEAR but rather about
HTTP client solutions. You are the one that is trying to turn this
thread into a dispute between two sites where the classes are hosted
that says nothing about how good each class can be.
> So, we have two groups of people:
>
> 1. Those who have tried your PHP classes
> 2. Those who have not
>
> Your argument is that group 2's opinion is not valid and that group 1's
> opinion is decided by you (to prefer the PHP classes over PEAR). Yes, if
> your erroneous assumptions were somehow true, you would be right. However,
> most people on this list are too logical to be fooled by such an argument.
Anybody with common sense could see in the beginning of the thread that
I just suggested one class that I wrote that is available in PHP Classes
site and then Justin Patrin came and said that a class available on PEAR
is better.
Then you can and stated the above guessing that Justin reasons to prefer
one class over the other is because one is in one repository sponsored
by the PHP group and the other isn't.
Who is making erroneous assumptions here, i.e. assumptions about things
that they never tried?
It seems to me that there is fanatic people like yourself that is trying
very hard to impose PEAR classes over PHP Classes as if there is any
sort of competion. Only on your mind certainly.
>>>Visitng http://www.phpclasses.org/httpclient results in several pages
>>>of banner ads that one must navigate before finally being shown:
>>
>>Do you have a problem with site that use advertising to keep
>>themselves alive?
>
>
> Nope, that's their choice. It's just funny when the maintainers cry foul
It is really funny that you mention that in this thread when anybody can
read it from the begginning and see that I was the one to suggest the
use of a class that I wrote and only after I did it, Justin Patrin came
and said that the PEAR class that does the same is better. So, who is
crying foul here?
> when people aren't interested in their site. Your choice is to have ads.
The site has ads because it is one way that I found to generate enough
income to keep it open and still dedicate 100% of my time to continue to
develop it, providing more useful features that all users and
contributors appreciate.
Since the site takes me a lot of time and costs money to keep open, my
alternative would be to shut it up and return to working to companies
that would pay me a lot more money then I can make with the site even
with ads.
But no, I decided to keep the site open for the benefit of every user
and author that care about PHP, even it takes putting ads all over the site.
What is so hard to understand accept about this?
I have a friend that suggested that there will always be people that do
not stand the success of others. When I see people like yourself
bitching against a site that I developed and is beneficial to so many
PHP users, I tend to agree with my friend.
> My choice is to not visit. Live with it. :-)
Do you really think the PHP Classes site users miss your visits? Man,
grow up!
> Chris Shiflett - http://shiflett.org/
>
> PHP Security Handbook
> Coming mid-2004
> HTTP Developer's Handbook
> http://httphandbook.org/
Oh, you write PHP books? Interesting. Once in a while I publish reviews
of PHP books because I feel they are interesting to the users of the
site. Just yesterday I published a review of a very good PHP book:
http://www.phpclasses.org/products.html/latest/latest.html
Sometimes I invite authors to send review copies, but most of the times
the publishing companies contact me and ask me to review the books.
If your publisher contacts me to ask to review your books, I will point
them to the archives of this thread so they decide if a book written by
PHP Classes site hater like yourself deserves to be reviewed in the site.
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
--- Manuel Lemos <mlemos
acm.org> wrote:
> If your publisher contacts me to ask to review your books, I will
> point them to the archives of this thread so they decide if a book
> written by PHP Classes site hater like yourself deserves to be reviewed
> in the site.
I'll leave you to your own arguments, which I won't bother correcting, but
describing me (or anyone on this thread) as a PHP Classes hater is a bit
extreme. I simply explained why I don't visit. I have in the past, and I
can never find any code, so I feel that I have better things to do with my
time (such as helping people on this list).
Your choices are your own, and my choices are my own. I don't understand
why that's difficult to grasp or why stating this should anger you. You
can choose to make personal attacks, if it makes you feel better, but it
doesn't do anything to strengthen your argument, nor is this list the
proper place for such things.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
attached mail follows:
Hey y'all.
Ok so I am working on the admin sectin of the e-commerce app I'm writing
and I'm hoping there's a better way to do what I am currently doing.
In an effort to prevent circumvention of the login page I've placed a
check at the beginning of each page that basically does the following:
<?php
if(loggedin())
{
// entire page of code goes here
}
else
{
// redirect back to login page
}
?>
By doing this people will not be able to just enter manually any URL
they want and have the page load.
As far as better ways go I was thinking that maybe I could employ
.htaccess somehow? But then I think that might require having user
accounts registered with the server instead of just using a db and I
don't want to do that.
I was thinking that maybe I could change it to this:
<?php
// define function stored in class file
// (basic auth function, not at all what i'm using.
// just an example.)
function IsLoggedIn($input)
{
if(isset($input) && !empty($input))
{
return 1;
}
else
{
// redirect to login page
}
}
IsLoggedIn($input);
// entire page of code goes here
?>
Any want to share their experiences and ideas?
Thanks,
Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/
attached mail follows:
Chris W. Parker wrote:
> Hey y'all.
>
> Ok so I am working on the admin sectin of the e-commerce app I'm writing
> and I'm hoping there's a better way to do what I am currently doing.
>
> In an effort to prevent circumvention of the login page I've placed a
> check at the beginning of each page that basically does the following:
>
> <?php
>
> if(loggedin())
> {
> // entire page of code goes here
> }
> else
> {
> // redirect back to login page
> }
>
> ?>
>
> By doing this people will not be able to just enter manually any URL
> they want and have the page load.
>
> As far as better ways go I was thinking that maybe I could employ
> .htaccess somehow? But then I think that might require having user
> accounts registered with the server instead of just using a db and I
> don't want to do that.
>
> I was thinking that maybe I could change it to this:
>
> <?php
>
> // define function stored in class file
> // (basic auth function, not at all what i'm using.
> // just an example.)
> function IsLoggedIn($input)
> {
> if(isset($input) && !empty($input))
> {
> return 1;
> }
> else
> {
> // redirect to login page
> }
> }
>
> IsLoggedIn($input);
>
> // entire page of code goes here
>
>
> ?>
>
> Any want to share their experiences and ideas?
>
>
> Thanks,
> Chris.
> --
> Don't like reformatting your Outlook replies? Now there's relief!
> http://home.in.tum.de/~jain/software/outlook-quotefix/
I tend to include the same file which does this for me at the beginning
of pages which must have authentication. Using a function as you
described (with automatic redirection to the login page) is how I would
do it.
You may also want to look into a the PEAR Auth package.
http://pear.php.net/package/Auth
--
paperCrane <Justin Patrin>
attached mail follows:
--- "Chris W. Parker" <cparker
swatgear.com> wrote:
> In an effort to prevent circumvention of the login page I've placed
> a check at the beginning of each page that basically does the
> following:
>
> <?php
> if(loggedin())
> {
> // entire page of code goes here
> }
> else
> {
> // redirect back to login page
> }
> ?>
This is fine, assuming loggedin() does what you intend and can't be
subverted. The only risk is forgetting to add this check, since I assume
you mean that you have to copy/paste this into every script. You might
want to consider whether you can design your application in such a way
that you can have a more centralized way to enforce authorization.
The one thing I would definitely consider doing differently is the
redirect. You could, instead, just include the logic necessary for the
login page, so that you avoid the superfluous transaction.
> As far as better ways go I was thinking that maybe I could employ
> .htaccess somehow?
Yes, and you can use a database like you're wanting. There is existing
code to help you do this. However, this implements HTTP authentication,
which has the little popup window. This is fine, but some people might
perceive this as being unprofessional, so you might want to keep your
audience in mind.
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security Handbook
Coming mid-2004
HTTP Developer's Handbook
http://httphandbook.org/
attached mail follows:
On Tuesday, December 9, 2003, at 12:08 PM, Chris W. Parker wrote:
> Hey y'all.
>
> Ok so I am working on the admin sectin of the e-commerce app I'm
> writing
> and I'm hoping there's a better way to do what I am currently doing.
>
> In an effort to prevent circumvention of the login page I've placed a
> check at the beginning of each page that basically does the following:
>
> <?php
>
> if(loggedin())
> {
> // entire page of code goes here
> }
> else
> {
> // redirect back to login page
> }
>
> ?>
That's essentially what I do too... except I've got all this stored in
a restricted.inc file which I just include() where needed.
I think you can minimise your code though, by checking (in my case) for
an invalid uid or a uid without admin clearance
(redirect and exit), otherwise just show the page:
---
<?php
if(!$_SESSION['uid'] || !$_SESSION['admin'])
{
header("Location: login.php");
exit;
}
?>
the rest of your page here
---
Cheers,
Justin
attached mail follows:
Dear List,
Is there an application somewhere that can be used to determine
incompatibilities with different versions of PHP of ones code?
Something like a recursive directory scan checking functions used and
determining the versions they will / won't work on. Hope this makes sence.
Thanks
Terence
attached mail follows:
Hello,
On 12/09/2003 12:14 AM, Terence wrote:
> Is there an application somewhere that can be used to determine
> incompatibilities with different versions of PHP of ones code?
> Something like a recursive directory scan checking functions used and
> determining the versions they will / won't work on. Hope this makes sence.
I do not know if this is what you are looking for. Here you may find a
class that comes with a few functions that had their behaviour broken
between PHP 4.0 and 4.2 .
The class provides functions the reproduce the original behaviour as
well a script that tests whether the original functions were broken in
the current version that you use.
Class: Fixed functions broken before PHP 4.2.0
http://mlemos.users.phpclasses.org/fixedfunctions
These are just functions that were broken despite PHP developers do not
agree that they should not have been broken, so they will not fix them.
There are certainly many functions that were broken between versions but
were fixed. For that you may want to try PHP test suite scripts that
come with the latest PHP version and try them in the PHP version that
you use.
--
Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
attached mail follows:
Hello PHP-list,
I proudly announce the first release of my first PHP script:
spambothoney.
It provides a class to generate different types of email addresses
(random invalid, combination of users/hosts, with spambots IP/host,
"binary" output) and is meant to pollute the crawling spambots that
harvest email addresses from webpages.
It uses a MySQL database for configuration (through web-interface) and
for logging purposes.
I would be glad, if this is of some interest for you and you would
take a look: http://thequod.de/comp/mysoft/spambothoney (direct
download: http://thequod.de/action.php?download=1)
I'm especially interested into security issues, but feedback in
general is very appreciated..
Thanks.. have a nice week!
--
shinE!
http://www.thequod.de ICQ#152282665
PGP 8.0 key: http://thequod.de/danielhahler.asc
attached mail follows:
Hi, i'll definately have a look, maybe the PHP list should intergrate a
protection system, as i definately got bombarded with spam as soon as i
joined, funny enough never happened when i was using the newsgroup ??
> Hello PHP-list,
>
> I proudly announce the first release of my first PHP script:
> spambothoney.
>
> It provides a class to generate different types of email addresses
> (random invalid, combination of users/hosts, with spambots IP/host,
> "binary" output) and is meant to pollute the crawling spambots that
> harvest email addresses from webpages.
>
> It uses a MySQL database for configuration (through web-interface) and
> for logging purposes.
>
> I would be glad, if this is of some interest for you and you would take
> a look: http://thequod.de/comp/mysoft/spambothoney (direct
> download: http://thequod.de/action.php?download=1)
>
> I'm especially interested into security issues, but feedback in
> general is very appreciated..
>
> Thanks.. have a nice week!