php-general Digest 20 Feb 2004 12:27:31 -0000 Issue 2601

Topics (messages 178304 through 178335):

Security Issue?
        178304 by: Ed Lazor

Re: date
        178305 by: Tom Rogers
        178321 by: Lucian Cozma
        178333 by: Richard Davey

Re: PHP & PDFs...
        178306 by: Evan Nemerson

Re: heavy parsing of text, storing both versions
        178307 by: John W. Holmes
        178308 by: joel boonstra
        178309 by: Justin French
        178310 by: John W. Holmes
        178313 by: joel boonstra
        178320 by: Torsten Schabdach

Flash and Sessions
        178311 by: Jack Baty

PEAR DB 1.6.0 has been released
        178312 by: Daniel Convissor
        178315 by: Jakes
        178317 by: daniel.electroteque.org

Advice Needed
        178314 by: daniel.electroteque.org
        178326 by: Richard Davey

PROBLEM: Explorer trying to save my *.php files...
        178316 by: ãÙÇÁÎÅÎËÏ áÒÔ£Í
        178324 by: Marek Kilimajer

PEAR::MAIL Problem
        178318 by: Stanley Chan

Re: XSLT in php v5 beta 4
        178319 by: Lucian Cozma

Re: Headers Again
        178322 by: Stuart

Re: [PEAR] RE: [PHP] Re: PEAR DB 1.6.0 has been released
        178323 by: Lukas Smith

problem handling files.
        178325 by: php

display a hiddenfield
        178327 by: Dominique ANOKRE
        178328 by: Michael Egan
        178329 by: Nadim Attari
        178330 by: Dominique ANOKRE
        178331 by: Richard Davey
        178332 by: Marek Kilimajer

[OT slightly] PHP and Ewebeditpro CMS
        178334 by: David Robley

returning image from CGI.
        178335 by: Nicklas Kittelmann

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 ---
Hi Everyone,

Oddball error randomly shows up when accessing pages on my web hosting
provider.  The error message is below.

My account is obb4wine.  PHP behaves as if I'm the account budguy when
the script error occurs.  A page refresh usually makes the error go
away.  The error happens frequently enough that site users are
complaining.

Any ideas?

-Ed


------------------------------------------------------------------------
----

PHP:  4.3.4.  (See below for Configure Command)

Apache:  Apache/1.3.29 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2
mod_bwlimited/1.4 PHP/4.3.4 FrontPage/5.0.2.2634 mod_ssl/2.8.16
OpenSSL/0.9.6b

------------------------------------------------------------------------
----
Error Message:
------------------------------------------------------------------------
----
Warning: Unknown(): open_basedir restriction in effect.
File(/home/obb4wine/public_html/prepend.php) is not within the allowed
path(s): (/home/budguy:/usr/lib/php:/usr/local/lib/php:/tmp) in Unknown
on line 0

Warning: Unknown(/home/obb4wine/public_html/prepend.php): failed to open
stream: Operation not permitted in Unknown on line 0

Warning: (null)(): Failed opening
'/home/obb4wine/public_html/prepend.php' for inclusion
(include_path='.:/home/obb4wine/public_html') in Unknown on line 0


-------------------------------------------------
PHP Configure Command
-------------------------------------------------

'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml'
'--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom'
'--with-dom-xslt' '--with-dom-exslt' '--enable-ftp' '--with-gd'
'--with-jpeg-dir=/usr/local' '--with-png-dir=/usr'
'--with-xpm-dir=/usr/X11R6' '--with-imap' '--with-imap-ssl'
'--with-kerberos' '--with-mcrypt' '--with-ming=../ming-0.2a'
'--enable-magic-quotes' '--with-mysql=/usr' '--with-openssl'
'--with-pear' '--enable-xslt' '--with-xslt-sablot' '--enable-sockets'
'--enable-track-vars' '--enable-versioning' '--enable-wddx'
'--with-xmlrpc' '--with-zlib'

--- End Message ---
--- Begin Message ---
Hi,

Friday, February 20, 2004, 6:32:27 AM, you wrote:
JB> [snip]
JB> hi there

JB> how do i make php give me yesterday's date?

JB> i tried

JB> date("Y-m-d")-1

JB> but if today would be the 1st of july (2004-07-01), yesterday would be
JB> 00.
JB> july (2004-07-00) according to that calculator.
JB> is there any way to make this one get it right? without any
JB> if-structures if
JB> possible
JB> [/snip]

JB> http://www.php.net/strtotime

JB> --
JB> PHP General Mailing List (http://www.php.net/)
JB> To unsubscribe, visit: http://www.php.net/unsub.php


date('Y-m-d',strtotime('-1 day'));

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
date('Y-m-d', time()- 60*60*24);

You could also use mktime.

Regards,
Lucian

"Madcat" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi there
>
> how do i make php give me yesterday's date?
>
> i tried
>
> date("Y-m-d")-1
>
> but if today would be the 1st of july (2004-07-01), yesterday would be 00.
> july (2004-07-00) according to that calculator.
> is there any way to make this one get it right? without any if-structures
if
> possible
>
> regards

--- End Message ---
--- Begin Message ---
>> how do i make php give me yesterday's date?
>>
>> i tried
>>
>> date("Y-m-d")-1

LC> date('Y-m-d', time()- 60*60*24);
LC> You could also use mktime.

Someone has already advised you look at strtotime, but just incase you
haven't here is one way you can use it:

$yesterdays_timestamp = strtotime("-1 day");

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

--- End Message ---
--- Begin Message ---
On Thursday 19 February 2004 11:42 am, Russell P Jones wrote:
> Is there any way to deal with PDFS using PHP and not installing PHPlib? I
> simply need to pull the first page of a PDF document and print it out
> using PHP. (Like a PDF preview of sorts)...
>
> Any ideas?

I'm assuming you meant pdflib, not phplib? If I'm reading your question right, 
I don't know of a way to do it purely from PHP. However,

gs -q -dNOPAUSE -dBATCH -sOutputFile=output_file.pdf -sDEVICE=pdfwrite 
-dFirstPage=1 -dLastPage=1 -f input_file.pdf

will give you what you want. What you want is a PDF of the first page of 
another PDF, right?

>
> Russ Jones

-- 
Evan Nemerson
[EMAIL PROTECTED]
http://coeusgroup.com/en

--
"They that can give up essential liberty to obtain a little temporary safety 
deserve neither liberty nor safety."

-Benjamin Franklin

--- End Message ---
--- Begin Message --- Justin French wrote:
Hi all,

I'm building a CMS that does heavy parsing of a "HTML shorthand" plain text to XHTML strict, in a similar way to Textile <http://www.textism.com/tools/textile/>.
>
1. Parse the text on demand into HTML -- the parsing script is to heavy/slow for this.


2. Store both the plain (shorthand HTML) text and parsed XHTML versions of each field -- the problem with this being that i'm storing double the data in the database...
>
3. write a reverse set of functions which converts the XHTML back to the shorthand on demand for editing -- this seems great, but I don't like the idea of maintaining two functions for such a beast.

Well, you pretty much listed all of the options. Personally, I'd probably go with #2 because hard drive space is cheap. But... if the process is really that intensive and you're really that concerned about space, then I'd do #3. It doesn't seem like it'd be that hard to maintain as you're just reversing everything and how often do you expect it to change? Sorry I can't offer a better option. :)


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
On Fri, Feb 20, 2004 at 10:35:11AM +1100, Justin French wrote:
> 1. Parse the text on demand into HTML -- the parsing script is to 
> heavy/slow for this.
> 
> 2. Store both the plain (shorthand HTML) text and parsed XHTML versions 
> of each field -- the problem with this being that i'm storing double 
> the data in the database... combine this with versioning of each 
> 'page', and I'm going to be storing a LOT of data in the DB.
<snip>
> 3. write a reverse set of functions which converts the XHTML back to 
> the shorthand on demand for editing -- this seems great, but I don't 
> like the idea of maintaining two functions for such a beast.
> 
> 
> Has anyone got any further ideas?

4. Store the plain (shorthand HTML) text and when users 'save' changes,
generate a static page containing the transformed XHTML version.  You
will have the processing overhead once (when data is changed), and
everytime else visitors get static files.

It sounds like #3 would be quite difficult.  Going from HTML->XHTML you
know what the end result would look like.  Going the other way, you
won't know for sure what the users originally entered when they authored
the content.  I'm assuming this isn't a 1-to-1 transformation, so that
these:

  <b>Some bold text</b>
  <B>Some bold text</B>
  <b>Some bold text</B>

will all get turned into:

  <strong>Some bold text</strong>

If you turn the <strong> text back into <b>, then it's not clear which
of the three options you should use.

Unless I'm misunderstanding...

joel

-- 
[ joel boonstra | gospelcom.net ]

--- End Message ---
--- Begin Message --- On Friday, February 20, 2004, at 10:58 AM, Torsten Schabdach wrote:

Hi Justin,

I'm building a CMS that does heavy parsing of a "HTML shorthand" plain text to XHTML strict, in a similar way to Textile <http://www.textism.com/tools/textile/>.
The problem is this conversion might take place on 2-3 columns of text, and unlimited other fields (my CMS has user-defined data models),

Could you please provide a short example or an URL of your data model? This would clear things a little bit.

Well, I'm still trying to define the DM, but something like this:


pages
id,path,status,dataModel_id
1,"/products/foo/",1,"3col"
2,"/home/",1,"2col"
etc

dataModel_3col
pageid, title,desc,keywords,col1,col2,col3

dataModel_2col
pageid, title,desc,keywords,col1,col2

... the above would be enough if it were all plain text, but since I'm doing a lot of parsing (especially on <textarea>'s), dataModel "3col" might look more like this:

dataModel_3col
pageid,title,desc_in,desc_out,keywords,col1_in,col1_out, col2_in,col2_out, col3_in,col3_out


There may be an entirely better way of doing this though :)


2. [...] I'm going to be storing a LOT of data in the DB.

Why not save both as files? Maybe you find a structure for this, i.e. http://example.org/articles/2004/02/19/text34_v3.html or something like this. You save the "editfiles" and cache the xhtml-output.

That's a good idea which I'll definitely look into... ideally, I was hoping for everything to sit in one place -- either a database OR file structure -- not both. It makes for an easier learning curve, easier back-ups, etc etc.


The other problem with the above is that I don't wish to merge the fields with the template at this point -- I want that to be on-the-fly. So the question is how to store the multiple fields (in their parsed state) in flat files. I guess simple XML would be an option...

<pageid>4</pageid>
<title>Parsed title</title>
<desc>Parsed desc</desc>
<keywords>...</keywords>
<col1>...</col1>
<col2>...</col2>
<col3>...</col3>

... but that's adding complexity that perhaps doesn't need to be there.


I think I'd rather everything in the database. Perhaps I need to keep all the versions of the input text in one table, and all the versions of the output in another -- in this case, I could choose to keep ALL versions of the input, but perhaps only 1-5 versions of the output... reducing the "double data".


So, the process of adding/editing a page might be:

- user hits submit
- input saved into dataModel_3col_in (all versions are stored)
- input parsed
- output saved into dataModel_3col_out
- older versions of output (eg any more than 3) are cleaned out

And the process of retrieving data for output to a page would be simply retrieving the latest from dataModel_3col_out.

My only concern here is that there's 2 tables for every data model, which need to "match" at all times.


3. write a reverse set of functions which converts the XHTML back to the shorthand on demand for editing -- this seems great, but I don't like the idea of maintaining two functions for such a beast.

Only parse one way. I mean only from your format to XHTML. There is no need for converting back (I believe). your people edit the text, after that they open up the browser and hitting refresh. So that's when your parser comes in play. And with caching only once per document.

--- Justin French http://indent.com.au

--- End Message ---
--- Begin Message --- joel boonstra wrote:

On Fri, Feb 20, 2004 at 10:35:11AM +1100, Justin French wrote:

1. Parse the text on demand into HTML -- the parsing script is to heavy/slow for this.

2. Store both the plain (shorthand HTML) text and parsed XHTML versions of each field -- the problem with this being that i'm storing double the data in the database... combine this with versioning of each 'page', and I'm going to be storing a LOT of data in the DB.

<snip>


3. write a reverse set of functions which converts the XHTML back to the shorthand on demand for editing -- this seems great, but I don't like the idea of maintaining two functions for such a beast.


Has anyone got any further ideas?


4. Store the plain (shorthand HTML) text and when users 'save' changes,
generate a static page containing the transformed XHTML version.  You
will have the processing overhead once (when data is changed), and
everytime else visitors get static files.

Isn't that just an alternate version of #2? You're still duplicating the data and taking up storage space. Again, I wouldn't really be worried about this, but that's the issue presented in #2. Sure, static files would probably be faster, but that doesn't answer the issue of when/how to do the conversion.


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
On Thu, Feb 19, 2004 at 09:15:35PM -0500, John W. Holmes wrote:
>>2. Store both the plain (shorthand HTML) text and parsed XHTML
>>versions 
>>of each field -- the problem with this being that i'm storing double 
>>the data in the database... combine this with versioning of each 
>>'page', and I'm going to be storing a LOT of data in the DB.
<snip>
> >4. Store the plain (shorthand HTML) text and when users 'save' changes,
> >generate a static page containing the transformed XHTML version.  You
> >will have the processing overhead once (when data is changed), and
> >everytime else visitors get static files.
> 
> Isn't that just an alternate version of #2? You're still duplicating the 
> data and taking up storage space. Again, I wouldn't really be worried 
> about this, but that's the issue presented in #2. Sure, static files 
> would probably be faster, but that doesn't answer the issue of when/how 
> to do the conversion.

Version #2 involved an identical database structure, or multiple
database fields, or some sort of redundant data storage that mirrors the
HTML database structure.  The bigger problem to me seemed to be the
complexity introduced into the database, not the extra storage space
required.

This solves the script run problem (only runs once), and lets the
database remain as originally planned.

The point is that the XHTML version is only necessary for display on the
finished webpage, and the simple HTML version is only necessary for
editing in the administrative interface.  Publishing static XHTML files
eliminates the need to do database interactivity on each page request
(after all, the content isn't going to change with each request, is it?)
and keeping the HTML in the database lets the admin. interface be as
interactive and dynamic as is necessary.

Just my $.02, though -- I'm not going to have to end up maintaining
this, so the best answer is the one that works the best for the OP.

joel

-- 
[ joel boonstra | gospelcom.net ]

--- End Message ---
--- Begin Message --- Hi,

2. [...] I'm going to be storing a LOT of data in the DB.
Why not save both as files? Maybe you find a structure for this, i.e. http://example.org/articles/2004/02/19/text34_v3.html or something like this. You save the "editfiles" and cache the xhtml-output.
> The other problem with the above is that I don't wish to merge the
fields with the template at this point -- I want that to be on-the-fly.

Of course you can when storing as files. Just keep both on serveral branches. The public XHTML-stuff to the URL and your "raw material" on a different branch in your filesystem. To cache the output is just a option. You can always do the stuff on-the-fly. Just map the URL in a secrue way to the filesystem and the parser.


I guess simple XML would be an option...

Yep. I did this once for a friend. It was great, because we defined a couple of tags to work with. It was so easy for him, I didnt need to write some forms. He wrote the stuff right in the editor with all the tags in mind. I dont know if this is the same situation here. Maybe I'm missing something :)


But: While it was a great thing for him, it was a real pain for me to write the parser. As long as the stuff kept simple, than there was no problem. But when the output depends on some nesting tags, it will become real hell! So this is something that would be better to solve with PHP5 and SimpleXML and not with PHP4.

--
Torsten

--- End Message ---
--- Begin Message ---
I have a page with an embedded Flash movie that I'm having trouble with. The
Flash movie loads and calls a different url on the same host, retrieving some
XML and parsing it.

The problem is that many people are reporting that they lose thier session
when leaving the page with the Flash movie. Essentially, when posting the
form on that page, they get "kicked out" of the app. After removing the Flash
movie completely, the problem goes away. This seems to occur about 1 out of 5
posts, but only for about 1/3 of the users. This doesn't seem to be specific
to a particular Flash or browser version, as I'm using the same combination
as some of the folks reporting problems and have never seen it. Server is IIS
5 and PHP 4.3.3. It also doesn't seem to be a cookie or javascript issue
either.

Any thoughts?

-- 
Jack Baty
Fusionary Media - http://www.fusionary.com/

for life is not a paragraph, and death i think is no parenthesis.
                                            -e.e. cummings

--- End Message ---
--- Begin Message ---
[This has be cross-posted. Be careful when following up, please.]

Greetings:

Crack open the beer, PEAR DB 1.6.0 is here!  (Hey, I'm a bit giddy
with excitement that my intense work during the past seven weeks
has come to fruition.)

For those unfamiliar with PEAR DB, it's a package of PHP classes
that provide an object oriented API with common methods of accessing
thirteen of PHP's database driver extensions:
    dBase, FrontBase, InterBase, Informix, mSQL, MS SQL Server,
    MySQL, Oracle, ODBC (tested with DB2 and Access), PostgreSQL,
    SQLite and Sybase.

Key links for PEAR DB:

Download:    http://pear.php.net/get/DB
Change Log:  http://pear.php.net/package-changelog.php?package=DB
Manual:      http://pear.php.net/manual/en/package.database.php
Home Page:   http://pear.php.net/package/DB

Notable changes since 1.5.0RC2 include:

    * New portability features, making it possible to write
      applications which can be easily ported between DBMS's.

    * Tons of bug fixes, making the package actually work for more
      than just MySQL systems.

    * Improved error reporting.

    * Getting prepare/execute to work the same way for all DBMS's
      and allow escaping of placeholder characters.

    * Deploying tableInfo() in more drivers and officially moving
      it from DB_result to DB_common.  See the documentation for
      proper usage.

    * Making the test suite simpler to use and work on both
      windows and *nix platforms.

    * Various optimizations, several of which were uncovered
      using Zend Studio's Code Analyzer.

    * Countless documentation corrections.

    * Full PHP 5 compatibility.

    * Requiring PHP to be at version 4.2.0 or higher.

    * Deprecating quote() and quoteString().

If you're one of the lucky few people using PHP's mysqli extension,
do note that the DB file/class has been renamed from mysql4 to mysqli,
but the online documentation won't reflect this modification until
they're rebuilt on Sunday.  Similarly, there are a few other features
and documentation bugs that won't show up there until then either.

Is Dutch, German or Russian your native language?  The manual needs
translating into these languages.  Join in by signing up for the
pear-doc mailing list at http://pear.php.net/support.php.

For those of you in and around New York City this coming
Tuesday, February 24th, I'll be giving a presentation about this at
the NYPHP meeting.  See http://nyphp.org/ for more info.

If you like the changes I've made to DB since version 1.5.0RC2, make
a donation: http://www.analysisandsolutions.com/donate/donate.htm

Enjoy,

--Dan

PS:  I'm not on this list/newsgroup.  Just posting this as an
announcement.  So, if you wish to contact me, please do so directly
or via cc.

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409

--- End Message ---
--- Begin Message ---
What is performance like using this class? I've gone through the class and
it just seams to be over kill, for a DB API (13 databases).

Are there any time stats showing the different time in using a single DB API
class to the PEAR class.

Thanks


"Daniel Convissor" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> [This has be cross-posted. Be careful when following up, please.]
>
> Greetings:
>
> Crack open the beer, PEAR DB 1.6.0 is here!  (Hey, I'm a bit giddy
> with excitement that my intense work during the past seven weeks
> has come to fruition.)
>
> For those unfamiliar with PEAR DB, it's a package of PHP classes
> that provide an object oriented API with common methods of accessing
> thirteen of PHP's database driver extensions:
>     dBase, FrontBase, InterBase, Informix, mSQL, MS SQL Server,
>     MySQL, Oracle, ODBC (tested with DB2 and Access), PostgreSQL,
>     SQLite and Sybase.
>
> Key links for PEAR DB:
>
> Download:    http://pear.php.net/get/DB
> Change Log:  http://pear.php.net/package-changelog.php?package=DB
> Manual:      http://pear.php.net/manual/en/package.database.php
> Home Page:   http://pear.php.net/package/DB
>
> Notable changes since 1.5.0RC2 include:
>
>     * New portability features, making it possible to write
>       applications which can be easily ported between DBMS's.
>
>     * Tons of bug fixes, making the package actually work for more
>       than just MySQL systems.
>
>     * Improved error reporting.
>
>     * Getting prepare/execute to work the same way for all DBMS's
>       and allow escaping of placeholder characters.
>
>     * Deploying tableInfo() in more drivers and officially moving
>       it from DB_result to DB_common.  See the documentation for
>       proper usage.
>
>     * Making the test suite simpler to use and work on both
>       windows and *nix platforms.
>
>     * Various optimizations, several of which were uncovered
>       using Zend Studio's Code Analyzer.
>
>     * Countless documentation corrections.
>
>     * Full PHP 5 compatibility.
>
>     * Requiring PHP to be at version 4.2.0 or higher.
>
>     * Deprecating quote() and quoteString().
>
> If you're one of the lucky few people using PHP's mysqli extension,
> do note that the DB file/class has been renamed from mysql4 to mysqli,
> but the online documentation won't reflect this modification until
> they're rebuilt on Sunday.  Similarly, there are a few other features
> and documentation bugs that won't show up there until then either.
>
> Is Dutch, German or Russian your native language?  The manual needs
> translating into these languages.  Join in by signing up for the
> pear-doc mailing list at http://pear.php.net/support.php.
>
> For those of you in and around New York City this coming
> Tuesday, February 24th, I'll be giving a presentation about this at
> the NYPHP meeting.  See http://nyphp.org/ for more info.
>
> If you like the changes I've made to DB since version 1.5.0RC2, make
> a donation: http://www.analysisandsolutions.com/donate/donate.htm
>
> Enjoy,
>
> --Dan
>
> PS:  I'm not on this list/newsgroup.  Just posting this as an
> announcement.  So, if you wish to contact me, please do so directly
> or via cc.
>
> -- 
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
>             data intensive web and database programming
>                 http://www.AnalysisAndSolutions.com/
>  4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409

--- End Message ---
--- Begin Message ---
unfortunately i tried mdb and it was totally unusable and badly documented,
and to port pear db over to mdb was impossible, i find pear db ok, even
adodb is cool, i had to build my own class specifically just for mysql with
pretty good performance as no others could.

-----Original Message-----
From: Jakes [mailto:[EMAIL PROTECTED]
Sent: Friday, February 20, 2004 5:13 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: [PHP] Re: PEAR DB 1.6.0 has been released


What is performance like using this class? I've gone through the class and
it just seams to be over kill, for a DB API (13 databases).

Are there any time stats showing the different time in using a single DB API
class to the PEAR class.

Thanks


"Daniel Convissor" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> [This has be cross-posted. Be careful when following up, please.]
>
> Greetings:
>
> Crack open the beer, PEAR DB 1.6.0 is here!  (Hey, I'm a bit giddy
> with excitement that my intense work during the past seven weeks
> has come to fruition.)
>
> For those unfamiliar with PEAR DB, it's a package of PHP classes
> that provide an object oriented API with common methods of accessing
> thirteen of PHP's database driver extensions:
>     dBase, FrontBase, InterBase, Informix, mSQL, MS SQL Server,
>     MySQL, Oracle, ODBC (tested with DB2 and Access), PostgreSQL,
>     SQLite and Sybase.
>
> Key links for PEAR DB:
>
> Download:    http://pear.php.net/get/DB
> Change Log:  http://pear.php.net/package-changelog.php?package=DB
> Manual:      http://pear.php.net/manual/en/package.database.php
> Home Page:   http://pear.php.net/package/DB
>
> Notable changes since 1.5.0RC2 include:
>
>     * New portability features, making it possible to write
>       applications which can be easily ported between DBMS's.
>
>     * Tons of bug fixes, making the package actually work for more
>       than just MySQL systems.
>
>     * Improved error reporting.
>
>     * Getting prepare/execute to work the same way for all DBMS's
>       and allow escaping of placeholder characters.
>
>     * Deploying tableInfo() in more drivers and officially moving
>       it from DB_result to DB_common.  See the documentation for
>       proper usage.
>
>     * Making the test suite simpler to use and work on both
>       windows and *nix platforms.
>
>     * Various optimizations, several of which were uncovered
>       using Zend Studio's Code Analyzer.
>
>     * Countless documentation corrections.
>
>     * Full PHP 5 compatibility.
>
>     * Requiring PHP to be at version 4.2.0 or higher.
>
>     * Deprecating quote() and quoteString().
>
> If you're one of the lucky few people using PHP's mysqli extension,
> do note that the DB file/class has been renamed from mysql4 to mysqli,
> but the online documentation won't reflect this modification until
> they're rebuilt on Sunday.  Similarly, there are a few other features
> and documentation bugs that won't show up there until then either.
>
> Is Dutch, German or Russian your native language?  The manual needs
> translating into these languages.  Join in by signing up for the
> pear-doc mailing list at http://pear.php.net/support.php.
>
> For those of you in and around New York City this coming
> Tuesday, February 24th, I'll be giving a presentation about this at
> the NYPHP meeting.  See http://nyphp.org/ for more info.
>
> If you like the changes I've made to DB since version 1.5.0RC2, make
> a donation: http://www.analysisandsolutions.com/donate/donate.htm
>
> Enjoy,
>
> --Dan
>
> PS:  I'm not on this list/newsgroup.  Just posting this as an
> announcement.  So, if you wish to contact me, please do so directly
> or via cc.
>
> --
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
>             data intensive web and database programming
>                 http://www.AnalysisAndSolutions.com/
>  4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Hi there, i have finally built a project space for work, its a collaborate
space for storing important key documents (not public), what is the best
way to store these, outside the web directory or would it be safe within a
htaccess protected directory ? Being that to access that directory i would
have to send the login and pass to the link of the file which i fopen up
and either header output to the browser or download.

--- End Message ---
--- Begin Message ---
Hello daniel,

Friday, February 20, 2004, 6:10:28 AM, you wrote:

deo> Hi there, i have finally built a project space for work, its a collaborate
deo> space for storing important key documents (not public), what is the best
deo> way to store these, outside the web directory or would it be safe within a
deo> htaccess protected directory ? Being that to access that directory i would
deo> have to send the login and pass to the link of the file which i fopen up
deo> and either header output to the browser or download.

If you're going to open the files via fopen on the local filesystem,
your htaccess settings have no implication on this at all. For files
like this I store them outside of the web root and fopen them from my
PHP script and stream them to the browser. That is on a dedicated
server where I know no-one has access to the directory they are stored
in and it can never be found via the web server. Your mileage may
vary.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

--- End Message ---
--- Begin Message ---
            Now, my problem is next:
    When I tryin' to view my phpinfo.php file, Internet Explorer is invite
me to save it to disk.... Not To Open!!!! Why?
I have 11 files in my PHP directory:

LICENSE
MSVCRT.DLL
php4ts.dll
php4isapi.dll
php.exe
php.ini
php.ini-optimized
php_calendar.dll
php_imap.dll
php_ldap.dll
README.txt

And I don't have php4apache2.dll" in "C:\PHP4". Maybe, you'll send me this
file, if deal in it?
I need your help....

____________________________________________________________________________
____________________
Цыганенко Артём wrote:

>Sorry, I'm from Ukraine and, maybe, my English too bad... But I don't
>understand your words "Please keep the discussion on the list".
>
>
It means that don't send your response only to me, but to the list you
originally sent, i.e. [EMAIL PROTECTED] so that others will also
benefit/critisize/contribute.

>And, you words "Don't send html format message" I'm not understand too.
>
>
Check your email client's settings, to figure out how to send only plain
text message.

>Sorry, but, please, explaine... I'll do all that you say... :-)
>And, next. I can't find "php4apache2.dll" in "C:\PHP4" and in all other
>directories on my computer?
>
Have you ever downloaded php package to install? Or you only created a
empty directory C:\PHP4?:)
I suggest you visit www.php.net site or goole 'how to install php on
windows' to find the basics.

Best

Bao

PS: Don't change the subject line each time. It will make people hard to
follow.

--- End Message ---
--- Begin Message --- What installation instructions did you follow?

Цыганенко Артём wrote:
            Now, my problem is next:
    When I tryin' to view my phpinfo.php file, Internet Explorer is invite
me to save it to disk.... Not To Open!!!! Why?
I have 11 files in my PHP directory:

LICENSE
MSVCRT.DLL
php4ts.dll
php4isapi.dll
php.exe
php.ini
php.ini-optimized
php_calendar.dll
php_imap.dll
php_ldap.dll
README.txt

Did you read the README.txt file?

--- End Message ---
--- Begin Message ---
Dear Listmates,

I am using PEAR::MAIL and my code includes the below;

// Send Email Out
$mailCfg = array(
                "host"  => "127.0.0.1",
                "port"  => "25",
                "auth"  => false
                );
$mailRecipient = $hashValue["emailaddress"];
$mailHeader = array(
                "From"  => "[EMAIL PROTECTED]",
                "To"    => $mailRecipient,
                "Subject"       => "Test Message"
                );
$mailBody = $myContent; 
$mailMgr =& Mail::factory("smtp", $mailCfg);
$mailResult = $mailMgr->send($mailRecipient,
$mailHeader, $mailBody);

It is found that the variable $mailResult is always
true but the email cannot be received whenever. 

On the other hand, in the same machine, I can use the
native function mail() very well. It works well.

So I doubt the problem of PEAR::MAIL. Should I
consider anything?

My server is using Qmail and sendmail command is a
shortcut of Qmail executes (standard way).

Please help.

-stan


_________________________________________________________
必殺技、飲歌、小星星...
浪漫鈴聲  情心連繫
http://us.rd.yahoo.com/evt=22281/*http://ringtone.yahoo.com.hk/

--- End Message ---
--- Begin Message ---
I think your problems comes from configuring php with domxml instead of xslt
lib ( that requires sablotron).
You can use domxml's xslt transformations. I actually recomend it. It's
faster and in my opinion more flexible and reliable. (see
http://www.php.net/manual/en/ref.domxml.php for more info )


Extract from manual for installing sablotron:
<<
On UNIX, run configure with the --enable-xslt --with-xslt-sablot options.
The SablotronT library should be installed somewhere your compiler can find
it.
Make sure you have the same libraries linked to the SablotronT library as
those, which are linked with PHP. The configuration
options: --with-expat-dir=DIR --with-iconv-dir=DIR are there to help you
specify them. When asking for support, always mention these directives, and
whether there are other versions of those libraries installed on your system
somewhere. Naturally, provide all the version numbers.
>>

Extract from manual for installing domxml:
<<
This extension is only available if PHP was configured
with --with-dom[=DIR]. Add --with-dom-xslt[=DIR] to include DOM XSLT
support. DIR is the libxslt install directory. Add --with-dom-exslt[=DIR] to
include DOM EXSLT support, where DIR is the libexslt install directory.
>>

If you're still having problems, send me the config line for php.

Regards,
Lucian

"Steve Dieke" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am guesing that I have installed something incorrectly.  I am trying to
> use the function xslt_create().  I installed php v5 Beta 4 successfully.
but
> when I try to use the function xslt_create() I get the following error:
>
> Fatal Error: Call to undefined function xslt_create()
>
> I have a test php page that uses phpinfo() and here's what the xml related
> setting say.
>
> xml
> XML Support  active
> XML Namespace Support  active
> libxml2 Version  2.6.6
>
> xsl
> XSL  enabled
> libxslt Version  1.1.3
> libxslt compiled against libxml Version  2.6.6
> EXSLT  enabled
> libexslt Version  1.1.3
>
> My environment is the following:
> Fedora Core 1
> php - version 5 beta 4
> apache -  2.0.48
>
> Anyone have any ideas?  I have looked at the articles on php.net and
didn't
> see anything that I thought would help.
>
> Thanks,
> Steve

--- End Message ---
--- Begin Message --- PETCOL wrote:
Unfortunately history tells me that php like ColdFusion will one day be
bought out by the big corporates, or at least they'll have a considerable
financial vested interest in it.

Not likely. Since PHP is open source if Zend decided to change the license I'm certain it would be forked and continued as an open source project. This is the basis of why open source software is so popular and also why there is negligible gain to be had by Zend in changing the license.


At which time we hope way off in the future, we'll all have to start paying
for support and maintenance contracts.

EVen if it did happen you'd be in no different a position than you are now. This mailing list is primarily user-supported and would likely continue even if PHP became a commercial product (which it won't - see above).


If you want commercial support for PHP you can get it. And you'll pay for it.

Allaire owned ColdFusion, the developer network was extremely co-operative,
then joint venture between Macromedia and Allaire, now if you want good old
assistance you need a "Devnet" contract.

ColdFusion was never open source (afaik). That's the difference.


For more info on what 'open source' actually means, see http://www.opensource.org/docs/definition.php

--
Stuart

--- End Message ---
--- Begin Message --- electroteque wrote:
unfortunately i tried mdb and it was totally unusable and badly documented,
and to port pear db over to mdb was impossible, i find pear db ok, even
adodb is cool, i had to build my own class specifically just for mysql with
pretty good performance as no others could.

Actually it had just as much documentation as PEAR DB since a while (I will update the MDB docs with DB updates soon .. just as I will port over the improvements made to DB). Its just that MDB can do way more than DB and yes all of those advanced features havent been documented.


I am not sure what you mean with "unuseable". Care to enlighten me?

Anyways yes I guess in alot of ways I have been somewhat foolish in this entire process. Since I did MDB few people helped me even though alot of people wanted all the nice Metabase features. At the same time I keep helping out in DB, posting patches etc. So essentially its a one way direction. I feed DB, but DB doesnt feed MDB (so I have to watch thr CVS commits to figure out if I should apply the same thing to MDB).

So in the end it seems to me that I was a bit blind sided as to what people really wanted in PEAR. Appearently they prefer to stay with DB, adding things here and there to try to add the missing features. While at the same time ignoring the fact that this will make DB even slower as it is today (yes MDB is faster than DB, MDB2 even more so .. but that is another myth I was unable to combat).

Well either way MDB has worked nicely for me and a few people (and will get continued support) and MDB2 works even better for me. So the effort was worth it. Just kinda annoyign getting FUD like this spread across multiple MLs.

regards,
Lukas Smith
[EMAIL PROTECTED]
_______________________________
  BackendMedia
  www.backendmedia.com
  [EMAIL PROTECTED]

  Linn Zwoch Smith GbR
  Pariser Str. 44
  D-10707 Berlin

  Tel +49 30 83 22 50 00
  Fax +49 30 83 22 50 07

--- End Message ---
--- Begin Message --- I have a bit problem with following script in php:


<?php
$fichero = "/var/www/php/fichero/fichero1.txt";


if ($fp=fopen($fichero,"r")) {

print ( "El fichero ha podido abrirse." );

fpassthru($fp);



}

else {

print ("El fichero no ha podido abrirse.");

}
?>



fpassthru doesn't work.


I can see:

El fichero ha podido abrirse.

on the navigator, but I can't see the content of:

/var/www/php/fichero/fichero1.txt


I have php 4.1.2 on debian-woody.


Could you help me with this problem?


Thank you in advance.

--- End Message ---
--- Begin Message ---
I use a simple form like this : 

print("<form method=\"post\" action=\"image.php\">\n");
print("<input type=\"hidden\" name=\"hiddenField\">\n");
$_POST["hiddenField"] = $image_avant;
print("<input type=\"submit\" name=\"avant\" value=\"Avant\">\n");
print("</form>\n");

and when i click on the submit button, i want to display the value of my hiddenField 
(doing by the file image.php) :

 <?php
echo $_POST["hiddenField"];
?>

but nothing is displaying !!!!!!

Please help !




--- End Message ---
--- Begin Message ---
No value has been given to the hidden field.

e.g.

print (<input type=\"hidden\" name=\"hiddenField\" value=\"yourvalue\">);

HTH.

Cheers,

Michael Egan

> -----Original Message-----
> From: Dominique ANOKRE [mailto:[EMAIL PROTECTED]
> Sent: 20 February 2004 11:17
> To: Php List
> Subject: [PHP] display a hiddenfield
> 
> 
> I use a simple form like this : 
> 
> print("<form method=\"post\" action=\"image.php\">\n");
> print("<input type=\"hidden\" name=\"hiddenField\">\n");
> $_POST["hiddenField"] = $image_avant;
> print("<input type=\"submit\" name=\"avant\" value=\"Avant\">\n");
> print("</form>\n");
> 
> and when i click on the submit button, i want to display the 
> value of my hiddenField (doing by the file image.php) :
> 
>  <?php
> echo $_POST["hiddenField"];
> ?>
> 
> but nothing is displaying !!!!!!
> 
> Please help !
> 
> 
> 
> 

--- End Message ---
--- Begin Message ---
echo "<form method='post' action='image.php'>";
echo "  <input type='hidden' name='hiddenField' value='$image_avant'>";
echo "  <input type='submit' name='avant' value='Avant'>";
echo "</form>";
-----------------------

<?php
    //  image.php
    ///////////////////
    echo $_POST["hiddenField"];
?>

--- End Message ---
--- Begin Message ---
I 've given a value se the code :

$_POST["hiddenField"] = $image_avant;

where  $image_avant  is a variable which contains a value !!


Cdt


----- Original Message -----
From: "Michael Egan" <[EMAIL PROTECTED]>
To: "Dominique ANOKRE" <[EMAIL PROTECTED]>; "Php List"
<[EMAIL PROTECTED]>
Sent: Friday, February 20, 2004 11:22 AM
Subject: RE: [PHP] display a hiddenfield


No value has been given to the hidden field.

e.g.

print (<input type=\"hidden\" name=\"hiddenField\" value=\"yourvalue\">);

HTH.

Cheers,

Michael Egan

> -----Original Message-----
> From: Dominique ANOKRE [mailto:[EMAIL PROTECTED]
> Sent: 20 February 2004 11:17
> To: Php List
> Subject: [PHP] display a hiddenfield
>
>
> I use a simple form like this :
>
> print("<form method=\"post\" action=\"image.php\">\n");
> print("<input type=\"hidden\" name=\"hiddenField\">\n");
> $_POST["hiddenField"] = $image_avant;
> print("<input type=\"submit\" name=\"avant\" value=\"Avant\">\n");
> print("</form>\n");
>
> and when i click on the submit button, i want to display the
> value of my hiddenField (doing by the file image.php) :
>
>  <?php
> echo $_POST["hiddenField"];
> ?>
>
> but nothing is displaying !!!!!!
>
> Please help !
>
>
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Hello Dominique,

Friday, February 20, 2004, 11:29:21 AM, you wrote:

DA> I 've given a value se the code :
DA> $_POST["hiddenField"] = $image_avant;
DA> where  $image_avant  is a variable which contains a value !!

No, you've overwritten whatever might have been in the $_POST array
with the image_avant value.

Also even if this would work (which it doesn't) you are still
outputting the HTML to the browser BEFORE you do this anyway.

Try like this (as has already been suggested):

<?
print("<form method=\"post\" action=\"image.php\">\n");
print("<input type=\"hidden\" name=\"hiddenField\"
value=\"$image_avant\">\n");
print("<input type=\"submit\" name=\"avant\" value=\"Avant\">\n");
print("</form>\n");
?>

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

--- End Message ---
--- Begin Message --- Dominique ANOKRE wrote:

I use a simple form like this :

print("<form method=\"post\" action=\"image.php\">\n");
print("<input type=\"hidden\" name=\"hiddenField\">\n");
This will result in
<input type="hidden" name="hiddenField">
That is a hidden field without a value. This will get to the browser.

$_POST["hiddenField"] = $image_avant;
This will assign a value to $_POST["hiddenField"], which means just that, nothing more. It does not change html output.

You need to use:

print("<input type=\"hidden\" name=\"hiddenField\" value=\"". htmlspecialchars($image_avant) ."\">\n");

print("<input type=\"submit\" name=\"avant\" value=\"Avant\">\n");
print("</form>\n");

and when i click on the submit button, i want to display the value of my hiddenField (doing by the file image.php) :

 <?php
echo $_POST["hiddenField"];
?>

but nothing is displaying !!!!!!

Please help !





--- End Message ---
--- Begin Message ---
If anyone has experience with using a PHP interface to EwebeditPro 
content management system, I' ppreciate a little help. In particular, a 
sample script for handling contnet upload would be a godsend. ewebeditpro 
provide samples for ASP which isn't a great deal of help.

-- 
David Robley
Quod subigo farinam

"All my efforts were for nothing," Tom said naughtily.

--- End Message ---
--- Begin Message ---
Hi!

I have a PHP-file which outputs an image when called from a web page. No
problem there.
However, when I change it to a CGI-file (for use by a webserver), and I
insert a line 
#/usr/bin/php -q  
before the <?php -tag, the result is that a newline is inserted in the
output, and the image is broken.

How do I fix this? 
The reason that I need to have it as a cgi is for sequrity (the web
server runs cgi's as a different user).
I have run other php-files renamed to cgi, that output HTML, and that
works perfectly.

/Nicklas Kittelmann

--- End Message ---

Reply via email to