Re: [PHP] Clearing POST variable on page refresh

2006-12-18 Thread Jochem Maas
Beauford wrote:
 Hi,
 
 I have a page with a form on it which posts to itself. The problem is when
 someone refreshes the page it enters the data into the DB again. How do I
 clear these variables so that doesn't happen. I tried the unset function,
 but no luck. I really don't want to use sessions or cookies as this is just
 a simple little page, but still, it has to work right.

sessions are no big deal - search the list archive for stuff like 'form token'
until you find one of the many explainations of how to tackle this issue using
a 'one time' token concept (find the posts by Richard Lynch - they are the most
complete/abundant/explicit AFAICR) - the solution does use sessions, but like I
said thats not a big deal at all. :-)

 
 Thanks
 

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



Fwd: [PHP] Problems with Zip+IE6

2006-12-18 Thread Javier Ruiz

Apologies... forgot to CC to the list...

-- Forwarded message --
From: Javier Ruiz [EMAIL PROTECTED]
Date: Dec 18, 2006 11:25 AM
Subject: Re: [PHP] Problems with Zip+IE6
To: [EMAIL PROTECTED]

Hi,

Nah, the only thing I'm trying to do is to serve a regular zip file to the
user of the app I'm coding, I could just put the file in an accesible
folderand provide the link to the user (when I say accesible I mean inside
the docroot of apache), but I really want the files (those zip files) to be
available to the user ONLY if he's logged in and in a session with some
background stuff...

I did this a houndred times and really never realized about this problem
with IE, I'm a linux user (Gentoo :-D ) since years ago and always used
mozilla and/or firefox, but the users of the application I'm making now use
IE, so they reported the problem thinking that it is related to our code.

Ah! And it really doesn't matter what software you have to work with zip
files, the problem is before that software: The concrete problem I found
is that when you click on a zip file link in IE, it asks you to choose: open
it or save it, the only difference between both operations is that if you
say save it it will download the zip file to a temp folder and then move
it to the directory you specify; if you say open, it SHOULD download it to
the temp folder and then call the application you have for zip files
(winzip, winrar, whatever) with the location of the file in the temp
folder. I think all the browsers works more or less the same way. The
problem with IE is that saying open it just doesn't download the file, but
opens anyway the zip application with the temp file location, so the
application (and not IE) complains that the requested location is not
existing, in my case, WinRar...

Indeed it matters the content-type to use with files in webpages! and as I
mentioned before, I like your article because it's just pointing it, but I'm
just trying to find out if anybody, doing any trick (dirty trick even) got
the temporally download problem solved anyhow, and I'm trying whatever to
get it.

But unfortunatelly as much as I'm searching, I'm more realizing that this is
an unsolvable bug in IE and I'll have to ask my client to please, you will
have to always download the zip files before opening them, or change your
habits and use another browser. It's a recognised IE bug, it's not a PHP's
mistake, not a coding mistake (by me I mean) but sincerelly, and I'll say it
like it is... it's a pain in the ass!

I appreciate Richard for your efforts, thanks a lot.
Regards,

Javi Ruiz.


On 12/16/06, Richard Lynch  [EMAIL PROTECTED] wrote:


On Tue, December 12, 2006 4:34 am, Javier Ruiz wrote:
 damn! that's a pretty good article, thanks a lot.

 unfortunatelly, it's not mentioning about zip files concretely, I
 didn't
 find a solution for my problem with them.
 I tried playing a bit with the Content-type, but it seems that
 Internet
 Explorer doesn't really care about Content-type... it uses the
 extention
 of the file to determine the type (microsoft's way...) so it doesn't
 matter
 if I use application/octet-stream or even
 application/force-download or
 application/makethisdownload-or-ikillyou :-D as long as I name the
 file 
 whatever.zip, IE6 shows the open with dialog and if I use open
 with an
 application, it fails :(

It does matter on real browsers...

Use the correct content type for a download: application/octet-stream

 thanks again Richard for the answer and for the article :)

 anybody with a miracle for the ZIP+IE problem??

You're going to HAVE to open the Zip file with some kind of unzip
application such as WinZip, pkunzip, or, possibly, that goofball
Windows unzip thingie that lets you pretend zip archives are
directories, even though they aren't, but only up to a certain point,
as you can't do some things with files in the zip archive that you can
do with normal files, so it's just a very confusing Human Interface...
Sort of like Windows in a microcosm.

If you were hoping that somehow IE would magically unzip the item, and
then let you open the contents within the zip file with a chosen
application...  Even MS Windows isn't THAT stupid.  Yet.

What if there are 2 things in the zip archive?

For that matter, if there aren't 2 things, why is it even zipped?

 1 - To change the mimetype (when writting http headers) from
  application/zip that I used before to
 application/x-zip-compressed
 2 - To not use MOD_DEFLATE in apache2 (I was not using it
  really...)

I now am beginning to wonder if you are trying to send your HTML as
gzip'ed data for the browser to surf to your site, to save on
bandwidth... If so, none of the above has any bearing on this at
all...

--
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?




[PHP] config error

2006-12-18 Thread Simon Forster

Hi

I'm trying to get PHP to build and keep on getting an error:

configure: error: mysql configure failed. Please check config.log for  
more information.


FWIW, I'm trying to install on Mac OS Server 10.3.9 with the  
following options:


./configure --prefix=/usr/local/php5 --with-apxs --with-config-file- 
scan-dir=/sw --with-iconv --with-zlib=/usr --with-zlib-dir=/usr -- 
with-gd --with-iconv-dir=/usr --with-snmp=/usr --enable-exif --enable- 
wddx --enable-soap --enable-sqlite-utf8 --enable-ftp --enable-sockets  
--enable-dbx --enable-dbase --enable-mbstring --enable-memory-limit -- 
enable-calendar --enable-bcmath --with-bz2=/usr --with-mysql=shared,/ 
sw --with-mysqli=shared,/sw --with-pdo-mysql=shared,/sw --with-libxml- 
dir=shared,/sw --with-xsl=shared,/sw --with-pdflib=shared,/sw --with- 
jpeg-dir=/sw --with-png-dir=/sw --enable-gd-native-ttf --with- 
json=shared --enable-memcache


I've installed various libraries (using fink, as you can see) but I'm  
using the packaged version of MySQL available from mysql.com. The  
tail end of the error log is included below the sig.


I've been mucking with this, on and off, for a couple of days now and  
have pretty much exhausted efforts to install a pre-compiled version  
of PHP (preferred route as I'm lazy). Also, I've tweaked the config  
options which, at times, has added a new missing dependency but I  
always come back to this MySQL issue.


If anyone's got any ideas, please let me know as I'm starting to run  
out of things to try.


Many thanks

Simon Forster
___
 LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK
 Tel: +44 (0)20 8133 0528   Fax: +44 (0)70 9230 5247
___



int main() {
mysql_close()
; return 0; }
configure:58254: checking for mysql_error in -lmysqlclient
configure:58273: gcc -o conftest -I/usr/include -g -O2  -no-cpp- 
precomp -L/usr/lib/mysql -L/usr/lib/mysql -liconv -L/usr/lib  -L/sw/ 
lib -L/sw/lib -L/usr/local/lib -L/usr/local/lib conftest.c - 
lmysqlclient  -liconv -lpng -lz -ljpeg -lbz2 -lz -lm  -lxml2 -lz - 
liconv -lm -lxml2 -lz -liconv -lm 15
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of  
relocation entry 53 in section (__TEXT,__text) invalid
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation  
PPC_RELOC_PAIR entry (54) in section (__TEXT,__text)
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of  
relocation entry 55 in section (__TEXT,__text) invalid
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation  
PPC_RELOC_PAIR entry (56) in section (__TEXT,__text)
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of  
relocation entry 57 in section (__TEXT,__text) invalid
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation  
PPC_RELOC_PAIR entry (58) in section (__TEXT,__text)
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of  
relocation entry 59 in section (__TEXT,__text) invalid
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation  
PPC_RELOC_PAIR entry (60) in section (__TEXT,__text)
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of  
relocation entry 61 in section (__TEXT,__text) invalid
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation  
PPC_RELOC_PAIR entry (62) in section (__TEXT,__text)
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of  
relocation entry 63 in section (__TEXT,__text) invalid
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation  
PPC_RELOC_PAIR entry (64) in section (__TEXT,__text)
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of  
relocation entry 65 in section (__TEXT,__text) invalid
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation  
PPC_RELOC_PAIR entry (66) in section (__TEXT,__text)
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of  
relocation entry 67 in section (__TEXT,__text) invalid
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation  
PPC_RELOC_PAIR entry (68) in section (__TEXT,__text)
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of  
relocation entry 69 in section (__TEXT,__text) invalid
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation  
PPC_RELOC_PAIR entry (70) in section (__TEXT,__text)
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of  
relocation entry 71 in section (__TEXT,__text) invalid
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation  
PPC_RELOC_PAIR entry (72) in section (__TEXT,__text)
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of  
relocation entry 73 in section (__TEXT,__text) invalid
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation  
PPC_RELOC_PAIR entry (74) in section (__TEXT,__text)
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of  
relocation entry 75 in section (__TEXT,__text) invalid
ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation 

Re: [PHP] config error

2006-12-18 Thread Jochem Maas
Simon Forster wrote:
 Hi
 
 I'm trying to get PHP to build and keep on getting an error:
 
 configure: error: mysql configure failed. Please check config.log for
 more information.
 
 FWIW, I'm trying to install on Mac OS Server 10.3.9 with the following
 options:
 
 ./configure --prefix=/usr/local/php5 --with-apxs
 --with-config-file-scan-dir=/sw --with-iconv --with-zlib=/usr
 --with-zlib-dir=/usr --with-gd --with-iconv-dir=/usr --with-snmp=/usr
 --enable-exif --enable-wddx --enable-soap --enable-sqlite-utf8
 --enable-ftp --enable-sockets --enable-dbx --enable-dbase
 --enable-mbstring --enable-memory-limit --enable-calendar
 --enable-bcmath --with-bz2=/usr --with-mysql=shared,/sw
 --with-mysqli=shared,/sw --with-pdo-mysql=shared,/sw


do you need mysql and mysqli? have you tried the configure line wirth the 
following?:

--with-mysql --with-mysqli

what version of mysql do you have intalled? mysqli may not compile because
your mysql server is too old.


 --with-libxml-dir=shared,/sw --with-xsl=shared,/sw
 --with-pdflib=shared,/sw --with-jpeg-dir=/sw --with-png-dir=/sw
 --enable-gd-native-ttf --with-json=shared --enable-memcache

try compiling wqith only the mysql configure options to see what happens?

 
 I've installed various libraries (using fink, as you can see) but I'm
 using the packaged version of MySQL available from mysql.com. The tail
 end of the error log is included below the sig.
 
 I've been mucking with this, on and off, for a couple of days now and
 have pretty much exhausted efforts to install a pre-compiled version of
 PHP (preferred route as I'm lazy). Also, I've tweaked the config options
 which, at times, has added a new missing dependency but I always come
 back to this MySQL issue.
 
 If anyone's got any ideas, please let me know as I'm starting to run out
 of things to try.
 
 Many thanks
 
 Simon Forster
 ___
  LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK
  Tel: +44 (0)20 8133 0528   Fax: +44 (0)70 9230 5247
 ___
 
 
 
 int main() {
 mysql_close()
 ; return 0; }
 configure:58254: checking for mysql_error in -lmysqlclient
 configure:58273: gcc -o conftest -I/usr/include -g -O2  -no-cpp-precomp
 -L/usr/lib/mysql -L/usr/lib/mysql -liconv -L/usr/lib  -L/sw/lib
 -L/sw/lib -L/usr/local/lib -L/usr/local/lib conftest.c -lmysqlclient 
 -liconv -lpng -lz -ljpeg -lbz2 -lz -lm  -lxml2 -lz -liconv -lm -lxml2
 -lz -liconv -lm 15
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of
 relocation entry 53 in section (__TEXT,__text) invalid
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation
 PPC_RELOC_PAIR entry (54) in section (__TEXT,__text)
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of
 relocation entry 55 in section (__TEXT,__text) invalid
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation
 PPC_RELOC_PAIR entry (56) in section (__TEXT,__text)
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of
 relocation entry 57 in section (__TEXT,__text) invalid
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation
 PPC_RELOC_PAIR entry (58) in section (__TEXT,__text)
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of
 relocation entry 59 in section (__TEXT,__text) invalid
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation
 PPC_RELOC_PAIR entry (60) in section (__TEXT,__text)
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of
 relocation entry 61 in section (__TEXT,__text) invalid
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation
 PPC_RELOC_PAIR entry (62) in section (__TEXT,__text)
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of
 relocation entry 63 in section (__TEXT,__text) invalid
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation
 PPC_RELOC_PAIR entry (64) in section (__TEXT,__text)
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of
 relocation entry 65 in section (__TEXT,__text) invalid
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation
 PPC_RELOC_PAIR entry (66) in section (__TEXT,__text)
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of
 relocation entry 67 in section (__TEXT,__text) invalid
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation
 PPC_RELOC_PAIR entry (68) in section (__TEXT,__text)
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of
 relocation entry 69 in section (__TEXT,__text) invalid
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation
 PPC_RELOC_PAIR entry (70) in section (__TEXT,__text)
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of
 relocation entry 71 in section (__TEXT,__text) invalid
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) stray relocation
 PPC_RELOC_PAIR entry (72) in section (__TEXT,__text)
 ld: /usr/lib/mysql/libmysqlclient.a(libmysql.o) r_type field of
 relocation entry 73 in section 

Re: [PHP] $POST Q

2006-12-18 Thread Nisse Engström
On Fri, 15 Dec 2006 23:22:13 -0600 (CST), Richard Lynch wrote:

 $selected = $l == $limit ? 'selected=selected' : '';
 echo option value=\$l\ $selected$l/option\n;

[snip]

 The value=x *is* optional, but you'll never convince the people who
 tell you it isn't, unless you force them to read the RFCs and W3C
 recommendations [*], so it's easier to include it than to argue with
 them. :-)

   It is indeed optional, and the HTML spec.[1] even says
that if the attribute is not set, the initial value is
set to the contents of the element. That's all good and
well.

   What's not all good and well are browser implementations.
If you try to retrieve the value from JavaScript (by way
of option.value or select.value) in IE 5.5 [2] and several
versions of Opera [3], you may find the value is simply
not there *unless* you spell it out in HTML.

   Of course, it could be argued that there is a conceptual
difference between the value attribute (as written in HTML
and seen through the JS DOM) and the element value (rendered
by the user agent and passed as part of a form submission).
But that is a different story for a different group (or list).
I fear that I have now strayed so far off topic that I should
volunteer myself for killfile membership. :-)


--nfe


[1]: I'm not going to bother checking the XHTML spec.
[2]: I don't know about other versions.
[3]: The bug dates back to at least Opera 7.23. I reported
 it in july 2004 against 7.52, as did others before me.
 It was finally fixed in 9.00 preview 1, some two years
 after I reported it.

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



[PHP] Php Error Output Redirection

2006-12-18 Thread Sancar Saran
Hi,

Is anyone know that errors generated by php (like Notice: Uninitialized string 
offset: 0 in ...) may stored in a php variable and print out later ?

I want to put them some other location and show them in a debug window. I do 
this for my error reporting and I could not manage how to do with php 
messages.

Regards

Sancar

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



Re: [PHP] Php Error Output Redirection

2006-12-18 Thread Saqib Ali

Use the set_error_handle function:
http://us2.php.net/manual/en/function.set-error-handler.php

saqib
http://www.full-disk-encryption.net

On 12/18/06, Sancar Saran [EMAIL PROTECTED] wrote:

Hi,

Is anyone know that errors generated by php (like Notice: Uninitialized string
offset: 0 in ...) may stored in a php variable and print out later ?

I want to put them some other location and show them in a debug window. I do
this for my error reporting and I could not manage how to do with php
messages.

Regards

Sancar

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





--
Saqib Ali, CISSP, ISSAP
http://www.full-disk-encryption.net

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



Re: [PHP] Php Error Output Redirection

2006-12-18 Thread Jochem Maas
Sancar Saran wrote:
 Hi,
 
 Is anyone know that errors generated by php (like Notice: Uninitialized 
 string 
 offset: 0 in ...) may stored in a php variable and print out later ?
 
 I want to put them some other location and show them in a debug window. I do 
 this for my error reporting and I could not manage how to do with php 
 messages.

congratulations, you are the 1,000,000th php user not to bother
so much as think of looking in the manual:

http://php.net/manual/en/ref.errorfunc.php
http://php.net/manual/en/language.operators.errorcontrol.php
http://php.net/manual/en/function.error-reporting.php
http://php.net/manual/en/function.set-error-handler.php
http://php.net/manual/en/function.error-get-last.php

 
 Regards
 
 Sancar
 

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



Re: [PHP] config error

2006-12-18 Thread Simon Forster


On 18 Dec 2006, at 11:05, Jochem Maas wrote:

do you need mysql and mysqli? have you tried the configure line  
wirth the following?:


--with-mysql --with-mysqli

what version of mysql do you have intalled? mysqli may not compile  
because

your mysql server is too old.


Thanks for the suggestions. Stripped back the configure options, made  
a couple of other tweaks and got it to compile. Then it failed on make.


sigh /

Happily, someone pointed me to http://www.mamp.info/en/index.php.  
As this is meant to be a simple installer package, I hope this'll  
work. Downloading as I type.


All the best

Simon

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



Re: [PHP] config error

2006-12-18 Thread Jochem Maas
Simon Forster wrote:
 
 On 18 Dec 2006, at 11:05, Jochem Maas wrote:
 
 do you need mysql and mysqli? have you tried the configure line wirth
 the following?:

 --with-mysql --with-mysqli

 what version of mysql do you have intalled? mysqli may not compile
 because
 your mysql server is too old.
 
 Thanks for the suggestions. Stripped back the configure options, made a
 couple of other tweaks and got it to compile. 

you mean you got it to configure, right?

 Then it failed on make.

what was the error?

 
 sigh /
 
 Happily, someone pointed me to http://www.mamp.info/en/index.php. As
 this is meant to be a simple installer package, I hope this'll work.
 Downloading as I type.
 
 All the best
 
 Simon

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



RE: [PHP] Clearing POST variable on page refresh

2006-12-18 Thread Brad Fuller
 -Original Message-
 From: Jochem Maas [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 18, 2006 3:39 AM
 To: Beauford
 Cc: PHP
 Subject: Re: [PHP] Clearing POST variable on page refresh
 
 Beauford wrote:
  Hi,
 
  I have a page with a form on it which posts to itself. The problem is
 when
  someone refreshes the page it enters the data into the DB again. How do
 I
  clear these variables so that doesn't happen. I tried the unset
 function,
  but no luck. I really don't want to use sessions or cookies as this is
 just
  a simple little page, but still, it has to work right.
 
 sessions are no big deal - search the list archive for stuff like 'form
 token'
 until you find one of the many explainations of how to tackle this issue
 using
 a 'one time' token concept (find the posts by Richard Lynch - they are the
 most
 complete/abundant/explicit AFAICR) - the solution does use sessions, but
 like I
 said thats not a big deal at all. :-)
 
 
  Thanks
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

My way of getting around this has been to put the data manipulation into a
process page, which redirects back to the content page when its finished
processing.  That way, when the user hits refresh it doesn't ask to resubmit
the data.  It just refreshes the display.

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



Re: [PHP] Clearing POST variable on page refresh

2006-12-18 Thread Jochem Maas
Brad Fuller wrote:
 -Original Message-
 From: Jochem Maas [mailto:[EMAIL PROTECTED]
 Sent: Monday, December 18, 2006 3:39 AM
 To: Beauford
 Cc: PHP
 Subject: Re: [PHP] Clearing POST variable on page refresh

 Beauford wrote:
 Hi,

 I have a page with a form on it which posts to itself. The problem is
 when
 someone refreshes the page it enters the data into the DB again. How do
 I
 clear these variables so that doesn't happen. I tried the unset
 function,
 but no luck. I really don't want to use sessions or cookies as this is
 just
 a simple little page, but still, it has to work right.
 sessions are no big deal - search the list archive for stuff like 'form
 token'
 until you find one of the many explainations of how to tackle this issue
 using
 a 'one time' token concept (find the posts by Richard Lynch - they are the
 most
 complete/abundant/explicit AFAICR) - the solution does use sessions, but
 like I
 said thats not a big deal at all. :-)

 Thanks

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

 
 My way of getting around this has been to put the data manipulation into a
 process page, which redirects back to the content page when its finished
 processing.  That way, when the user hits refresh it doesn't ask to resubmit
 the data.  It just refreshes the display.

I can still hit the back button twice though can't I, and that would trigger 
another POST.

 

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



Re: [PHP] config error

2006-12-18 Thread Simon Forster


On 18 Dec 2006, at 14:00, Jochem Maas wrote:

Thanks for the suggestions. Stripped back the configure options,  
made a

couple of other tweaks and got it to compile.


you mean you got it to configure, right?


Oops. Sloppy. You're right of course. Got it to configure.


Then it failed on make.


what was the error?


Whole host of 'em. Hold on, I'll clean and run again to see what pops  
up...


See below sig. Seems to be referencing a lot of XML stuff but I'm not  
trying to include any XML / XSL bits:


ATB

Simon Forster
___
 LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK
 Tel: +44 (0)20 8133 0528   Fax: +44 (0)70 9230 5247
___

./configure --prefix=/usr/local/php5 --with-apxs --with-config-file- 
scan-dir=/sw --with-iconv --with-zlib=/usr --with-zlib-dir=/usr -- 
with-gd --with-iconv-dir=/usr --enable-exif --enable-sqlite-utf8 -- 
enable-ftp --enable-sockets --enable-mbstring --enable-memory-limit -- 
enable-calendar --enable-bcmath --with-bz2=/usr --with-mysql=/usr/ 
local/mysql --with-pdflib=shared,/sw --with-jpeg-dir=/sw --with-png- 
dir=/sw --enable-gd-native-ttf --enable-memcache



make
/bin/sh /Users/steve/Desktop/php-5.2.0/libtool --silent --preserve- 
dup-deps --mode=compile gcc  -Iext/libxml/ -I/Users/steve/Desktop/ 
php-5.2.0/ext/libxml/ -DPHP_ATOM_INC -I/Users/steve/Desktop/php-5.2.0/ 
include -I/Users/steve/Desktop/php-5.2.0/main -I/Users/steve/Desktop/ 
php-5.2.0 -I/usr/include/libxml2 -I/Users/steve/Desktop/php-5.2.0/ext/ 
date/lib -I/sw/include -I/usr/local/include -I/Users/steve/Desktop/ 
php-5.2.0/ext/mbstring/oniguruma -I/Users/steve/Desktop/php-5.2.0/ext/ 
mbstring/libmbfl -I/Users/steve/Desktop/php-5.2.0/ext/mbstring/ 
libmbfl/mbfl -I/usr/local/mysql/include -I/Users/steve/Desktop/ 
php-5.2.0/TSRM -I/Users/steve/Desktop/php-5.2.0/Zend  -no-cpp- 
precomp  -I/usr/include -g -O2  -c /Users/steve/Desktop/php-5.2.0/ext/ 
libxml/libxml.c -o ext/libxml/libxml.lo
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:43:28: libxml/ 
xmlsave.h: No such file or directory
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:428: error: parse  
error before error
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c: In function  
`_php_libxml_free_error':
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:430: error:  
`error' undeclared (first use in this function)
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:430: error: (Each  
undeclared identifier is reported only once
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:430: error: for  
each function it appears in.)

/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c: At top level:
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:434: error: parse  
error before error
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c: In function  
`_php_list_set_error_structure':
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:436: error:  
`xmlError' undeclared (first use in this function)
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:436: error: parse  
error before error_copy
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:441: error:  
`error_copy' undeclared (first use in this function)
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:443: error:  
`error' undeclared (first use in this function)
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:448: error:  
`XML_ERR_ERROR' undeclared (first use in this function)
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:454: error: `msg'  
undeclared (first use in this function)

/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c: At top level:
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:546: error: parse  
error before xmlErrorPtr
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c: In function  
`php_libxml_structured_error_handler':
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:548: error:  
`error' undeclared (first use in this function)
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c: In function  
`zm_startup_libxml':
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:603: error:  
`XML_PARSE_NOENT' undeclared (first use in this function)
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:604: error:  
`XML_PARSE_DTDLOAD' undeclared (first use in this function)
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:605: error:  
`XML_PARSE_DTDATTR' undeclared (first use in this function)
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:606: error:  
`XML_PARSE_DTDVALID' undeclared (first use in this function)
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:607: error:  
`XML_PARSE_NOERROR' undeclared (first use in this function)
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:608: error:  
`XML_PARSE_NOWARNING' undeclared (first use in this function)
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:609: error:  
`XML_PARSE_NOBLANKS' undeclared (first use in this function)
/Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:610: error:  
`XML_PARSE_XINCLUDE' 

RE: [PHP] Clearing POST variable on page refresh

2006-12-18 Thread Robert Cummings
On Mon, 2006-12-18 at 09:34 -0500, Brad Fuller wrote:
  -Original Message-
  From: Jochem Maas [mailto:[EMAIL PROTECTED]
  Sent: Monday, December 18, 2006 3:39 AM
  To: Beauford
  Cc: PHP
  Subject: Re: [PHP] Clearing POST vari

 My way of getting around this has been to put the data manipulation into a
 process page, which redirects back to the content page when its finished
 processing.  That way, when the user hits refresh it doesn't ask to resubmit
 the data.  It just refreshes the display.

I've never seen a good implementation of that style. If there's an error
in the form submission then such implementations usually have a generic
error message saying, please go back, or they then need to stuff th
eentire post contents into a session var or favourite deity forbid, into
the URL. It's almost certainly always better to submit to the same page
and move along when the processing is done.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Recomended host

2006-12-18 Thread R B

Hello.
I'm looking for a host to put my website.
I was looking godaddy.com, but i read in phplist forum that godaddy have
limitations in the number of mail to send per day.

Someone can recomend me a good host provider, with good stability, good
support, good features, and no limitation in the use of a list of
members...?

Thanks


Re: [PHP] cannot quiet notice error

2006-12-18 Thread Youri LACAN-BARTLEY


Gonzalo Gorosito wrote:
 Hello friends,
 
  
 
 I have a little problem with the error_reporting in my php.ini
 
  
 
 Every time I get errors like this:
 
  
 
 Notice: Undefined index: userData in
 /var/www/devzone/megacam/inc/functions.php on line
 
  
 
 And here is my php.ini:
 
  
 
 error_reporting = E_ALL  ~E_NOTICE
 
  
 
 display_errors = On
 
  
I guess http://fr.php.net/error-reporting should answer all that ...
Here's a clue though :

error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
display_errors = On

You might want to play around with E_STRICT if you're running PHP 5 though.

HTH

 
  
 
 how can I do to shut up these fucking notices? :$
 
  
 
  
 
  
 
 --
 Gonzalo Gorosito
 
  
 
 Sistemas | By-Cycle
 Humboldt 2495, Piso 10
 C1425FUG - Bs.As. Argentina
 Tel.: + 54 (11) 4774 6006 | Fax: + 54 (11) 4774 7117
 www.by-cycle.com http://www.by-cycle.com/ 
 [EMAIL PROTECTED]
 
  
 
 

-- 
Cordialement,

Youri LACAN-BARTLEY

PCAM
Espace HERVANN
641 Chemin des terriers
06600 ANTIBES
Tel: 04.93.33.26.25
Fax: 04.93.33.73.45

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



RE: [PHP] cannot quiet notice error

2006-12-18 Thread Gonzalo Gorosito
I tried to do this:

error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR

and this:

error_reporting = E_ERROR

and the php still display notices :(

-Mensaje original-
De: Youri LACAN-BARTLEY [mailto:[EMAIL PROTECTED] 
Enviado el: Lunes, 18 de Diciembre de 2006 12:06 p.m.
CC: php-general@lists.php.net
Asunto: Re: [PHP] cannot quiet notice error



Gonzalo Gorosito wrote:
 Hello friends,
 
  
 
 I have a little problem with the error_reporting in my php.ini
 
  
 
 Every time I get errors like this:
 
  
 
 Notice: Undefined index: userData in
 /var/www/devzone/megacam/inc/functions.php on line
 
  
 
 And here is my php.ini:
 
  
 
 error_reporting = E_ALL  ~E_NOTICE
 
  
 
 display_errors = On
 
  
I guess http://fr.php.net/error-reporting should answer all that ...
Here's a clue though :

error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
display_errors = On

You might want to play around with E_STRICT if you're running PHP 5 though.

HTH

 
  
 
 how can I do to shut up these fucking notices? :$
 
  
 
  
 
  
 
 --
 Gonzalo Gorosito
 
  
 
 Sistemas | By-Cycle
 Humboldt 2495, Piso 10
 C1425FUG - Bs.As. Argentina
 Tel.: + 54 (11) 4774 6006 | Fax: + 54 (11) 4774 7117
 www.by-cycle.com http://www.by-cycle.com/ 
 [EMAIL PROTECTED]
 
  
 
 

-- 
Cordialement,

Youri LACAN-BARTLEY

PCAM
Espace HERVANN
641 Chemin des terriers
06600 ANTIBES
Tel: 04.93.33.26.25
Fax: 04.93.33.73.45

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




__ Información de NOD32, revisión 1925 (20061218) __

Este mensaje ha sido analizado con  NOD32 antivirus system
http://www.nod32.com

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



Re: [PHP] config error

2006-12-18 Thread Jochem Maas
Simon Forster wrote:
 
 On 18 Dec 2006, at 14:00, Jochem Maas wrote:
 
 Thanks for the suggestions. Stripped back the configure options, made a
 couple of other tweaks and got it to compile.

 you mean you got it to configure, right?
 
 Oops. Sloppy. You're right of course. Got it to configure.
 
 Then it failed on make.

 what was the error?
 
 Whole host of 'em. Hold on, I'll clean and run again to see what pops up...
 
 See below sig. Seems to be referencing a lot of XML stuff but I'm not
 trying to include any XML / XSL bits:

that there by default, check these 2 configure options to see if that gets you 
past
this hurdle:


  --disable-libxmlDisable new LIBXML support
  --with-libxml-dir[=DIR]   libxml2 install prefix


 
 ATB
 
 Simon Forster
 ___
  LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK
  Tel: +44 (0)20 8133 0528   Fax: +44 (0)70 9230 5247
 ___
 
 ./configure --prefix=/usr/local/php5 --with-apxs
 --with-config-file-scan-dir=/sw --with-iconv --with-zlib=/usr
 --with-zlib-dir=/usr --with-gd --with-iconv-dir=/usr --enable-exif
 --enable-sqlite-utf8 --enable-ftp --enable-sockets --enable-mbstring
 --enable-memory-limit --enable-calendar --enable-bcmath --with-bz2=/usr
 --with-mysql=/usr/local/mysql --with-pdflib=shared,/sw
 --with-jpeg-dir=/sw --with-png-dir=/sw --enable-gd-native-ttf
 --enable-memcache
 
 
 make
 /bin/sh /Users/steve/Desktop/php-5.2.0/libtool --silent
 --preserve-dup-deps --mode=compile gcc  -Iext/libxml/
 -I/Users/steve/Desktop/php-5.2.0/ext/libxml/ -DPHP_ATOM_INC
 -I/Users/steve/Desktop/php-5.2.0/include
 -I/Users/steve/Desktop/php-5.2.0/main -I/Users/steve/Desktop/php-5.2.0
 -I/usr/include/libxml2 -I/Users/steve/Desktop/php-5.2.0/ext/date/lib
 -I/sw/include -I/usr/local/include
 -I/Users/steve/Desktop/php-5.2.0/ext/mbstring/oniguruma
 -I/Users/steve/Desktop/php-5.2.0/ext/mbstring/libmbfl
 -I/Users/steve/Desktop/php-5.2.0/ext/mbstring/libmbfl/mbfl
 -I/usr/local/mysql/include -I/Users/steve/Desktop/php-5.2.0/TSRM
 -I/Users/steve/Desktop/php-5.2.0/Zend  -no-cpp-precomp  -I/usr/include
 -g -O2  -c /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c -o
 ext/libxml/libxml.lo
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:43:28:
 libxml/xmlsave.h: No such file or directory
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:428: error: parse
 error before error
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c: In function
 `_php_libxml_free_error':
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:430: error: `error'
 undeclared (first use in this function)
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:430: error: (Each
 undeclared identifier is reported only once
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:430: error: for each
 function it appears in.)
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c: At top level:
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:434: error: parse
 error before error
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c: In function
 `_php_list_set_error_structure':
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:436: error:
 `xmlError' undeclared (first use in this function)
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:436: error: parse
 error before error_copy
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:441: error:
 `error_copy' undeclared (first use in this function)
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:443: error: `error'
 undeclared (first use in this function)
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:448: error:
 `XML_ERR_ERROR' undeclared (first use in this function)
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:454: error: `msg'
 undeclared (first use in this function)
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c: At top level:
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:546: error: parse
 error before xmlErrorPtr
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c: In function
 `php_libxml_structured_error_handler':
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:548: error: `error'
 undeclared (first use in this function)
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c: In function
 `zm_startup_libxml':
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:603: error:
 `XML_PARSE_NOENT' undeclared (first use in this function)
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:604: error:
 `XML_PARSE_DTDLOAD' undeclared (first use in this function)
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:605: error:
 `XML_PARSE_DTDATTR' undeclared (first use in this function)
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:606: error:
 `XML_PARSE_DTDVALID' undeclared (first use in this function)
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:607: error:
 `XML_PARSE_NOERROR' undeclared (first use in this function)
 /Users/steve/Desktop/php-5.2.0/ext/libxml/libxml.c:608: error:
 `XML_PARSE_NOWARNING' undeclared (first use in this 

Re: [PHP] cannot quiet notice error

2006-12-18 Thread Jochem Maas
Gonzalo Gorosito wrote:
 I tried to do this:
 
 error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
 
 and this:
 
 error_reporting = E_ERROR
 
 and the php still display notices :(

phpinfo() will probably show that either you
are editing the wrong php.ini, that you forgot to restart your webserver
or that the code is calling error_reporting() with values other than
what you want somewhere.

 
 -Mensaje original-
 De: Youri LACAN-BARTLEY [mailto:[EMAIL PROTECTED] 
 Enviado el: Lunes, 18 de Diciembre de 2006 12:06 p.m.
 CC: php-general@lists.php.net
 Asunto: Re: [PHP] cannot quiet notice error
 
 
 
 Gonzalo Gorosito wrote:
 Hello friends,

  

 I have a little problem with the error_reporting in my php.ini

  

 Every time I get errors like this:

  

 Notice: Undefined index: userData in
 /var/www/devzone/megacam/inc/functions.php on line

  

 And here is my php.ini:

  

 error_reporting = E_ALL  ~E_NOTICE

  

 display_errors = On

  
 I guess http://fr.php.net/error-reporting should answer all that ...
 Here's a clue though :
 
 error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
 display_errors = On
 
 You might want to play around with E_STRICT if you're running PHP 5 though.
 
 HTH
 
  

 how can I do to shut up these fucking notices? :$

  

  

  

 --
 Gonzalo Gorosito

  

 Sistemas | By-Cycle
 Humboldt 2495, Piso 10
 C1425FUG - Bs.As. Argentina
 Tel.: + 54 (11) 4774 6006 | Fax: + 54 (11) 4774 7117
 www.by-cycle.com http://www.by-cycle.com/ 
 [EMAIL PROTECTED]

  


 

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



Re: [PHP] cannot quiet notice error

2006-12-18 Thread Sumeet



how can I do to shut up these f** notices? :$


error_reporting( 0 );

--
Thanking You

Sumeet Shroff
http://www.prateeksha.com
Web Designers and PHP / Mysql Ecommerce Development, Mumbai India

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



Re: [PHP] cannot quiet notice error

2006-12-18 Thread Robert Cummings
On Mon, 2006-12-18 at 21:28 +0530, Sumeet wrote:
  how can I do to shut up these f** notices? :$
 
 error_reporting( 0 );

Or preferably he could learn to code :/ Putting hands over ears while
singing lalalalallalala at the top of your voice isn't a solution.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Recomended host

2006-12-18 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-12-18 08:56:09 -0600:
 Someone can recomend me a good host provider, with good stability, good
 support, good features, and no limitation in the use of a list of
 members...?

Mailing list hosting queries are OT on [EMAIL PROTECTED]

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] Php Error Output Redirection

2006-12-18 Thread Sancar Saran
On Monday 18 December 2006 15:39, Jochem Maas wrote:
 Sancar Saran wrote:
  Hi,
 
  Is anyone know that errors generated by php (like Notice: Uninitialized
  string offset: 0 in ...) may stored in a php variable and print out later
  ?
 
  I want to put them some other location and show them in a debug window. I
  do this for my error reporting and I could not manage how to do with php
  messages.

 congratulations, you are the 1,000,000th php user not to bother
 so much as think of looking in the manual:

 http://php.net/manual/en/ref.errorfunc.php
 http://php.net/manual/en/language.operators.errorcontrol.php
 http://php.net/manual/en/function.error-reporting.php
 http://php.net/manual/en/function.set-error-handler.php
 http://php.net/manual/en/function.error-get-last.php

  Regards
 
  Sancar

Oh really? 
so where is my spy-adware windows trojan prize ?

Thank you Jochem, asking you always easy than the searching documentation and 
I always wonder what can I do without you and your great comments :). 

I promise, next time I'll try to do better.

Really !!! ;)

Sancar...

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



Re: [PHP] Php Error Output Redirection

2006-12-18 Thread Robert Cummings
On Mon, 2006-12-18 at 20:55 +0200, Sancar Saran wrote:

 Oh really? 
 so where is my spy-adware windows trojan prize ?
 
 Thank you Jochem, asking you always easy than the searching documentation and 
 I always wonder what can I do without you and your great comments :). 
 
 I promise, next time I'll try to do better.

ominousToneWe'll be watching.../ominousTone

 Really !!! ;)

ominousTone... .../ominousTone


-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] cannot quiet notice error

2006-12-18 Thread Richard Lynch
On Mon, December 18, 2006 8:39 am, Gonzalo Gorosito wrote:
 I have a little problem with the error_reporting in my php.ini

 Every time I get errors like this:

 Notice: Undefined index: userData in
 /var/www/devzone/megacam/inc/functions.php on line

 And here is my php.ini:

 error_reporting = E_ALL  ~E_NOTICE

Check with ?php phpinfo();? but almost for sure your php.ini that
you are editing is not the one PHP is actually using...

Cuz you wouldn't be getting those notices if it was.

Either that, or you forgot to re-start Apache (or other web-server)
after you edited php.ini

php.ini gets read at web server startup rather than on every page hit,
for performance reasons.

 display_errors = On

 how can I do to shut up these fucking notices? :$

Of course, the BETTER solution is to use [bleeping] data that doesn't
[bleeping] exist.
:-)

if (isset($whatever['userData'])) do_whatever($whatever['userData']);

The message you are getting is pointing out a logic bug in your code,
where you are relying on the value of the data to be '' by default,
rather than explicitly stating what value it should be.

It's also crucial if you have register_globals ON to fix any E_NOTICE
messages of this nature, or you're wide open for some kind of data
insertion attack.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] $POST Q

2006-12-18 Thread Richard Lynch
On Mon, December 18, 2006 7:09 am, Nisse Engström wrote:
 On Fri, 15 Dec 2006 23:22:13 -0600 (CST), Richard Lynch wrote:

 $selected = $l == $limit ? 'selected=selected' : '';
 echo option value=\$l\ $selected$l/option\n;

 [snip]

 The value=x *is* optional, but you'll never convince the people
 who
 tell you it isn't, unless you force them to read the RFCs and W3C
 recommendations [*], so it's easier to include it than to argue with
 them. :-)

It is indeed optional, and the HTML spec.[1] even says
 that if the attribute is not set, the initial value is
 set to the contents of the element. That's all good and
 well.

What's not all good and well are browser implementations.
 If you try to retrieve the value from JavaScript (by way
 of option.value or select.value) in IE 5.5 [2] and several
 versions of Opera [3], you may find the value is simply
 not there *unless* you spell it out in HTML.

Ah.

Yeah, now that I actually occasionally use JavaScript, I should
actually pay attention to the gotchas of JS.
:-)

Thanks!

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] $POST Q

2006-12-18 Thread Jochem Maas
Richard Lynch wrote:
 On Mon, December 18, 2006 7:09 am, Nisse Engström wrote:
 On Fri, 15 Dec 2006 23:22:13 -0600 (CST), Richard Lynch wrote:

 $selected = $l == $limit ? 'selected=selected' : '';
 echo option value=\$l\ $selected$l/option\n;
 [snip]

 The value=x *is* optional, but you'll never convince the people
 who
 tell you it isn't, unless you force them to read the RFCs and W3C
 recommendations [*], so it's easier to include it than to argue with
 them. :-)
It is indeed optional, and the HTML spec.[1] even says
 that if the attribute is not set, the initial value is
 set to the contents of the element. That's all good and
 well.

What's not all good and well are browser implementations.
 If you try to retrieve the value from JavaScript (by way
 of option.value or select.value) in IE 5.5 [2] and several
 versions of Opera [3], you may find the value is simply
 not there *unless* you spell it out in HTML.
 
 Ah.
 
 Yeah, now that I actually occasionally use JavaScript, I should

^^--- LOOK EVERYONE - we have it in writing at 
last ;-)

 actually pay attention to the gotchas of JS.

I tend to classify them as 'wtf's and 'omg's but that's just the cynic in me :-)

 :-)
 
 Thanks!
 

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



Re: [PHP] Recomended host

2006-12-18 Thread tedd

At 7:29 PM + 12/18/06, Roman Neuhauser wrote:

# [EMAIL PROTECTED] / 2006-12-18 08:56:09 -0600:

 Someone can recomend me a good host provider, with good stability, good
 support, good features, and no limitation in the use of a list of
 members...?


Mailing list hosting queries are OT on [EMAIL PROTECTED]

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991


I certainly don't find his post as off-topic as your signature. As a 
Vietnam Vet, I think we've taken enough bashing from people like you. 
Considering that you wouldn't say that face-to-face to a Vietnam 
Veteran speaks volumes about you.


tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] simplest way in php to get our content on another site / included javascript question

2006-12-18 Thread Richard Lynch
On Sun, December 17, 2006 8:44 pm, jonathan wrote:
 I'm working on a project where we'd want partner sites to get our
 content on the other web sites.

Might I suggest that you support several options?...

 A key priority is that they won't have much technical sophistication
 (probably no db experience or php experience).

Offering more formats gives the partners more options to choose what
suits their experience/needs/skills.

 Also, these would be third party sites so there would also be an
 issue of requirements (differnet xsl processors,
 no allow_url_fopen, etc...)

Without allow_url_fopen(), you're down to curl or no PHP at all, with
an iFrame or JS...

 I tried looking at sites that get their content on other sites to see
 how they do it:

 the possible solutions seem to be:
 1. rss / xml - this is well known but would have a pretty high
 technical hurdles on the other sites. We could create
 every walk through and code sample but I still think it would be too
 involved. Only way out is either a xsl transformation (not
 going to happen), custom parsing library in php (maybe) or writing to
 db with associated libraries (too complex)

You should probably provide your content as RSS, no matter what else
you do, because it's so ubiquitous.

Assuming your content is in a db, dumping out an RSS feed is pretty
much a no-brainer, really.

 2. serialized php with custom library - this seems more feasible than
 #1 in terms of requirements

I don't even know what this means...

 3. php proxy and ajax call / json - i think this would be too complex
 and would require too  much manipulation of apache to handle
 subdomains, etc.

I can sort of see where you are going, where they'd use Ajax to input
the parameters of the content they want, but, really, just a
well-designed GET and an iFrame or Ajax or whatever the partner wants
to use to snarf and display the content is probably easier.

 4. included javascript - kinda how digg handles syndication (see
 http://www.digg.com/add-digg for example).
 This would seem to be the lowest barrier to entry. The main concern
 is preventing unauthorized bots from crawling. It would seem
 our only option would be using the referer property but this could be
 forged relatively easily.

It's very common to require a username/password in the URL for content
partners.

And you can require them to pre-register the IP of their server[s]
that will be crawling for the content -- Only their servers need to
access your content, not all their visitors' machines.  So they are
static IP and they should not have TOO many of them to register, even
in a mutli-data-center setup.

I worked for a content aggregator for awhile, and virtually all their
content partners required a username/password in the URL, and we had
to register the IPs of the servers that were getting the data.  I
suppose you could do a reverse DNS lookup and cache the results, but,
really, it's easier to get the IP address up front.

 5. SOAP - no way

Again, if you have the db already, and if you have PHP5, this is
actually not difficult at all to implement on your side.

So maybe it only helps you get one more content partner (sale) that
loves using SOAP instead of RSS or whatever.

It's a pretty small investment on your side, for relatively good odds
on payoff.

It's a bit tougher in PHP4, though there are libraries out there that
can take care of 99% of it.

 6. REST - if meant to just mean xml, i see this as an extension of #1.

Somewhere between #1 and #5, sort of.

Same answer though.

A PHP REST library and a couple hours of hacking and a couple days of
serious development and a couple weeks of hard-core QA, and you're
good to go.

So I'm suggesting that you could support MOST of the above, probably
with the same core set of functions and minimal effort for the output
layers:
   RSS / XML
   SOAP
   REST

You could also provide a nice CSS Zen Garden span/div only HTML output
for an iframe so that a CSS hack could make decent output.

Perhaps even a CSV or tab-delimited data dump for somebody who wants
to store-and-forward the data.

If you plan well, you could build the application so that you can roll
out a new API layer every month or so, and not have to do *ALL* of
them from the get-go, but always be in touch with your partners,
bragging on yourself about how you now support XYZ and giving them
more options and the warm fuzzies about how much you cater to them.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Clearing POST variable on page refresh

2006-12-18 Thread Richard Lynch
On Sun, December 17, 2006 4:59 pm, Beauford wrote:
 I have a page with a form on it which posts to itself. The problem is
 when
 someone refreshes the page it enters the data into the DB again. How
 do I
 clear these variables so that doesn't happen. I tried the unset
 function,
 but no luck. I really don't want to use sessions or cookies as this is
 just
 a simple little page, but still, it has to work right.

The redirect solution has several gotchas

It tends to mess up the back button, which is annoying to some
users.  (Okay, maybe that's just me.)

It's possible for an impatient user to hit Back and Stop fast
enough to re-submit the data anyway, in some browsers, so it doesn't
solve the problem 100%, really.

A header() to redirect chews up HTTP connections, which can be
problematic on a heavy-traffic site, because it has to send the 302 to
the browser, which then has to send back another HTTP request to the
server to get the new page.  So you double your traffic load and
number of Apache children needed to provide the feature-set of this
page.  On a much-visited page on a busy server, that can be a real
issue, instead of the non-issue it usually is.  YMMV  NAIAA


Embedding a token in the FORM, and tracking that token as used in
a session or db is what I prefer, personally.

Since you don't want to use sessions, you can simply have one more
table in your DB:

create table used_token (
  token char(32) unique not null primary key,
  whatdate date
);
create index used_token_whatdate_index on used_token(whatdate);

Then in your original FORM part of the script:
form action=?php echo $_SERVER['PHP_SELF']? method=post
  input type=hidden name=token value=?php echo
md5(uniqid(rand(), true)? /
  Rest of form here
/form

In the processing section:
?php
  $token = $_POST['token'];
  if (!preg_match('/[0-9a-g]{32}/i', $token)) die(Bad Guy);
  $query = select count(*) from used_token where token = '$token';
  $used = mysql_query($query, $connection) or die(Database Offline .
error_log(mysql_error($connection));
  $used = mysql_result($used, 0, 0);
  if (!$used){
//insert form contents to DB (your existing code goes here)
$query = insert into used_token(token, whatdate) values('$token',
now());
mysql_query($query, $connection) or die(Database Offline .
error_log(mysql_error($conection));
  }
  else{
//do whatever you want to do with a re-submission, possibly nothing
  }
?


Then you'll want a cron job to clear out any token in used_token where
the whatdate field is, say, a week or more old.  Less than a week on
an ultra busy server.

?php
  //cron job to clear out old data
  $query = delete from used_token where whatdate  date_sub(now(),
interval 1 week);
  mysql_query($query, $connection) or die(mysql_error($connection));
?

There is a 1 in a billion chance that two users could get the same
token, but you can play games with that as well to guarantee
uniqueness.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] problem with imagecreate on new webserver

2006-12-18 Thread Richard Lynch




On Sat, December 16, 2006 2:53 pm, [EMAIL PROTECTED] wrote:
 i am moving my webserver from a windows box to a linux box with php
 ver
 5.2.0 and noticed i am having a problem with a php file(code below). i
 thought it was a module i was missing but looking at the php config
 file all the same modules are loaded. allow_url_fopen is enabled. what
 would i be missing in the php install that would make this code not
 work correctly from one machine to the other.

 when loading on the new box all i get is a image with
 'http://localhost/imgfile.php'

 ?
 session_start();
 define( 'SITE' , 'http://localhost' );

 //define 7char code
 $md5 = md5(microtime() * mktime());
 $string = substr($md5,0,7);

 //create image


Take OUT the following line temporarily, and surf directly to the SRC
of the image:
 header(Content-type: image/png);

PHP will probably be spewing out error messages there for you to look at.

 $img= imagecreatefrompng(SITE. '/images/img.png');
 $white = imagecolorallocate($img, 233, 239, 239);
 $line = imagecolorallocate($img,233,239,239);

 for ($i = 1; $i = 5; $i++) {
 $x1 = rand(1,149);
 $x2 = rand(1,149);
 $y1 = rand(1,49);
 $y2 = rand(1,49);

 imageline($img, $x1, $y1, $x2, $y2, $line);
 }

 //put code in image
 imagestring($img, 5, 35, 25, $string, $white);

 //save key to session
 $_SESSION['key'] = md5($string);
 imagepng($img);
 ?

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




-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] problem loading phpinfo

2006-12-18 Thread Richard Lynch

You didn't actually install PHP correctly.

Check your httpd error.log file -- You may need to restart Apache and
check the log to get the error messages it spews out at start up if
you've had it going with a bunch of other messages clogging up the log
(e.g., Missing robots.txt, missing favicon.ico, ...)

On Sat, December 16, 2006 8:04 am, [EMAIL PROTECTED] wrote:
  Please,

 Could you tell me if this problem has been resolved:
 I am using php-5.2X and has this problem, I also had this problem when
 I was using php-5.1.X.
 My Apache is httpd-2.2.3.

 Here is the post from someone who is having the same problem.

 
 I config PHP4.0.6 for Apache 1.3.12 for Win32

 : in apache configuation file:

 ScriptAlias /php/ C:/PHP/
 AddType application/x-httpd-php .php
 Action application/x-httpd-php /php/php.exe

 then I test with phpinfo.php file in htdocs directory.

 : phpinfo.php :

 ?php phpinfo(); ?

 when I type: http://localhost/phpinfo.php, Browser should show me some
 information table but It show me the original code.

 ?php phpinfo(); ?
 [16 Nov 2001 5:17am UTC] [EMAIL PROTECTED]
 Please ask support questions on the php-general@lists.php.net
 mailinglist.

 Not a bug  closing
 ###

 Any help would be highly appriciated.

  Thank You,
 IT Consultant (UNIX, Oracle, Sybase, MSSQL,MYSQL,MCSA)
 Chris Ok'Onkwo
 [EMAIL PROTECTED]
 Tel: 0041-79-656-0889
 
 Check Out the new free AIM(R) Mail -- 2 GB of storage and
 industry-leading spam and email virus protection.



-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Recomended host

2006-12-18 Thread tg-php
I'm going to be controversial here and take issue with both of you.

1. The original question was about a hosting provider. Presumably a PHP web 
hosting provider.  So it is vaguely on-topic and is a question that's asked a 
lot.  It's easy to get a list of hosting providers online, but I believe the 
intent was to ask for people's opinions on providers they've used and to give 
testimonials (which you won't always find on hosting lists).

2. Pointing out someone's signature as being off topic is even further off 
topic for this list. Please take personal issues into private email.  I bring 
it up publicly as a reminder of proper list etiquette for anyone who happens to 
be reading this thread and to discourge this from going any further publicly.

Now.. back to the original question.

If the original poster (Roman) would take a look at the list of ISP and ISP 
directories at the bottom of the following page, he should find a good starting 
place for his search:

http://us3.php.net/links.php

Myself, I've used Dixiesys.com and Dotster.com when I havn't been playing with 
my own server or something internal to whatever company I happened to be 
working for.

Dixie is a small operation that served me very well for quite a while and stil 
has some features that I miss.  They have very personal support (even an IM and 
IRC point of contact pretty much 24/7).

Dotster actually has a pretty nice and affordable setup.  They let me put all 
my domains under one hosting umbrella and share storage space and bandwidth.  
That's something I was looking for and has saved me a lot of money by letting 
me have one hosting package for as many domains as I care to register.

I personally don't have any mailing list requirements so can't really speak on 
that if that's one of your big needs, but keep looking and checking features. 
 Hopefully you'll find what you need.

-TG


= = = Original message = = =

At 7:29 PM + 12/18/06, Roman Neuhauser wrote:
# [EMAIL PROTECTED] / 2006-12-18 08:56:09 -0600:
  Someone can recomend me a good host provider, with good stability, good
  support, good features, and no limitation in the use of a list of
  members...?

Mailing list hosting queries are OT on [EMAIL PROTECTED]

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

I certainly don't find his post as off-topic as your signature. As a 
Vietnam Vet, I think we've taken enough bashing from people like you. 
Considering that you wouldn't say that face-to-face to a Vietnam 
Veteran speaks volumes about you.

tedd
-- 
---
http://sperling.com  http://ancientstones.com  http://earthstones.com




___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



Re: [PHP] Recomended host

2006-12-18 Thread tg-php
I'm going to be controversial here and take issue with both of you.

1. The original question was about a hosting provider. Presumably a PHP web 
hosting provider.  So it is vaguely on-topic and is a question that's asked a 
lot.  It's easy to get a list of hosting providers online, but I believe the 
intent was to ask for people's opinions on providers they've used and to give 
testimonials (which you won't always find on hosting lists).

2. Pointing out someone's signature as being off topic is even further off 
topic for this list. Please take personal issues into private email.  I bring 
it up publicly as a reminder of proper list etiquette for anyone who happens to 
be reading this thread and to discourge this from going any further publicly.

Now.. back to the original question.

If the original poster (Roman) would take a look at the list of ISP and ISP 
directories at the bottom of the following page, he should find a good starting 
place for his search:

http://us3.php.net/links.php

Myself, I've used Dixiesys.com and Dotster.com when I havn't been playing with 
my own server or something internal to whatever company I happened to be 
working for.

Dixie is a small operation that served me very well for quite a while and stil 
has some features that I miss.  They have very personal support (even an IM and 
IRC point of contact pretty much 24/7).

Dotster actually has a pretty nice and affordable setup.  They let me put all 
my domains under one hosting umbrella and share storage space and bandwidth.  
That's something I was looking for and has saved me a lot of money by letting 
me have one hosting package for as many domains as I care to register.

I personally don't have any mailing list requirements so can't really speak on 
that if that's one of your big needs, but keep looking and checking features. 
 Hopefully you'll find what you need.

-TG


= = = Original message = = =

At 7:29 PM + 12/18/06, Roman Neuhauser wrote:
# [EMAIL PROTECTED] / 2006-12-18 08:56:09 -0600:
  Someone can recomend me a good host provider, with good stability, good
  support, good features, and no limitation in the use of a list of
  members...?

Mailing list hosting queries are OT on [EMAIL PROTECTED]

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

I certainly don't find his post as off-topic as your signature. As a 
Vietnam Vet, I think we've taken enough bashing from people like you. 
Considering that you wouldn't say that face-to-face to a Vietnam 
Veteran speaks volumes about you.

tedd
-- 
---
http://sperling.com  http://ancientstones.com  http://earthstones.com




___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



Re: [PHP] Problems with Zip+IE6

2006-12-18 Thread Richard Lynch
On Sat, December 16, 2006 6:17 am, Roman Neuhauser wrote:
 # [EMAIL PROTECTED] / 2006-12-15 22:55:54 -0600:
 On Tue, December 12, 2006 11:04 am, Frank M. Kromann wrote:
  if you use:
 
  header(Content-Type: application/zip);
  header(Content-Disposition: attachment;
 filename=\somefile.zip\);
 
  That works for me with IE 6/7 and other browsers.

 Argh.

 Please read this:
 http://richardlynch.blogspot.com/

 Go test with MORE browsers and MORE OSes, because you haven't yet
 hit
 the ones where your Content-Disposition does not work, and they are
 out there somewhere.

 As if it mattered that much. The filename's just a hint, the browser
 can be configured to ignore it even if it understands it, whatever.
 I would even say you're bound to hit a browser configured for some
 unintelligent reason to handle all app/o-s files with winamp. So what?
 You cannot count on anything the UA will/not do to the content.

If the browser ignores application/octet-stream and doesn't do a
download, it's broken.

It *HAS* to prompt you for a filename and do a download, by the
original HTTP RFC spec.  Please read more RFCs until you find the one
about application/octet-stream

If the UA opens up application/octet-stream it is in direct
violation of one of the few HTTP standards that every other UA on the
planet actually honors!

A standard that is clear-cut, with no wiggle room for
mis-interpretation whatsoever.

What filename will any sane browser use for:
http://example.com/dir1/dir2/iwant.xyz

 BTW, the 1995 johnny-come-lately Microsoft made-up
 Content-disposition
 header has been proposed for MIME by Qualcomm (RFC1806, RFC2183).

 HTTP/1.1 (RFC2616) says:

 15.5 Content-Disposition Issues:

RFC 1806 [35], from which the often implemented Content-Disposition
(see section 19.5.1) header in HTTP is derived, has a number of
 very
serious security considerations. Content-Disposition is not part of
the HTTP standard, but since it is widely implemented, we are
documenting its use and risks for implementors. See RFC 2183 [49]
(which updates RFC 1806) for details.

 [...]

 19.5.1 Content-Disposition

The Content-Disposition response-header field has been proposed as
 a
means for the origin server to suggest a default filename if the
 user
requests that the content is saved to a file. This usage is derived
from the definition of Content-Disposition in RFC 1806 [35].

 content-disposition = Content-Disposition :
   disposition-type *( ; disposition-parm
 )
 disposition-type = attachment | disp-extension-token
 disposition-parm = filename-parm | disp-extension-parm
 filename-parm = filename = quoted-string
 disp-extension-token = token
 disp-extension-parm = token = ( token | quoted-string )

An example is

 Content-Disposition: attachment; filename=fname.ext

The receiving user agent SHOULD NOT respect any directory path
information present in the filename-parm parameter, which is the
 only
parameter believed to apply to HTTP implementations at this time.
 The
filename SHOULD be treated as a terminal component only.

If this header is used in a response with the application/octet-
stream content-type, the implied suggestion is that the user agent
should not display the response, but directly enter a `save
 response
as...' dialog.

See section 15.5 for Content-Disposition security issues.

If you read between the lines, what you will find is that Qualcomm
essentially asked for an RFC to standardize the stupid behaviour of MS
IE, which was using Content-Disposition, originally conceived for MIME
Email, and not HTTP at all.

Fact is, the browsers didn't really pick up and run with this RFC for
a long time.

Not to mention that it's a STUPID thing for MS IE to have done in the
first place, to re-purpose a MIME email header for HTTP.  It doesn't
even make sense, since Content-Disposition has a MIME type embedded in
it, which may or may not match the Content-type of the HTTP Request!

Not to mention the aforementioned security considerations they noted.

There are so many inherent internal inconsistencies with this RFC if
you think about the HTTP interaction and how UA and server works, I'm
amazed Qualcomm even put their name on it.  But I guess they preferred
that to living with the un-documented behaviour of IE.

Bottom Line:
Content-Disposition will come back to bite you on the butt sooner or
later.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] php redirection..

2006-12-18 Thread Richard Lynch
On Sat, December 16, 2006 5:58 am, Stut wrote:
 Casey Chu wrote:
 Well... They skip all  !-- --'s, so they skip script!--
 //--/script's.

 And you *know* this how?

 They may well skip comments in terms of what content actually gets
 indexed, but I would expect their indexer is smart enough to parse
 HTML
 comments in a script block as though it were not in an HTML comment
 because that's what a browser does. What they actually do with that
 content - execute it, or just analyze it, or whatever - we don't know.

 You can't make sweeping statements like that unless you can back it up
 with at least one reference, preferably official.

... and current, as the search engine algorithms change even faster
than Internet speeds.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] php redirection..

2006-12-18 Thread Richard Lynch
On Mon, December 18, 2006 12:08 am, Chris Shiflett wrote:
 Richard Lynch wrote:
 The old school HTTP-EQUIV of a refresh with a time and URL
 would probably be suitable for this.

 YMMV

 And it's still not PHP. :-)

 It is if you use header(). :-)

You mean Refresh is a real header?

I always thought it was just some made-up poor-man's hack for a
not-quite Location:  header, and it never really existed in its own
right as a real header.

Learn something every day.

'Course Wikipedia and W3C indicate that it's proprietary and
discourage its use, but, hey, there ya go.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



[PHP] DOMDocument Size limit

2006-12-18 Thread Chris W
When calling |-createElement($name, $value) My content is truncated to 
around 4k.  If what is in $value is less than 4000 bytes then it works 
fine but if it is more, the data is truncated.  Is there a setting I 
don't know about that will change that limit?  I need it to be more like 
100k or maybe even more.|


--
Chris W
KE5GIX

Protect your digital freedom and privacy, eliminate DRM, 
learn more at http://www.defectivebydesign.org/what_is_drm;


Gift Giving Made Easy
Get the gifts you want  
give the gifts they want
One stop wish list for any gift, 
from anywhere, for any occasion!

http://thewishzone.com

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



Re: [PHP] How php works?

2006-12-18 Thread Richard Lynch
On Sat, December 16, 2006 6:24 am, Robert Cummings wrote:
 On Sat, 2006-12-16 at 19:58 +0800, Kai Xiang wrote:
 On 12/16/06, Richard Lynch [EMAIL PROTECTED] wrote:
  (*)
  Actually, if somebody wants to embed the ZE inside of something
 other
  than PHP, then I think Zend expects to get paid for that.

 I don't think so... the PHP and Zend licenses are quite liberal with
 very few restrictions. Namely that you don't call your software php or
 use php in the name (something many packages seem to ignore (either
 that
 or they got permission)). The Zend license is practically a clone of
 the
 PHP license with a search and replace for PHP to Zend :) There's
 nothing
 that says you have to pay to embed it in your own software. That said,
 if you make a product that uses either the PHP or Zend engine and
 makes
 oodles of money, I think you should feel somewhat morally obliged to
 give back in some way.

Put it this way:  In 2000, if somebody wanted to embed the ZE in a
commercial product, Zend was planning on charging for it.  I dunno
what their license for the ZE reads like today, and I wasn't
authorized to speak on this topic for them then, much less now.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Recomended host

2006-12-18 Thread Jochem Maas
[EMAIL PROTECTED] wrote:
 I'm going to be controversial here and take issue with both of you.
 
 1. The original question was about a hosting provider. Presumably a PHP web 
 hosting provider.  So it is vaguely on-topic and is a question that's asked a 
 lot.  It's easy to get a list of hosting providers online, but I believe the 
 intent was to ask for people's opinions on providers they've used and to give 
 testimonials (which you won't always find on hosting lists).

you presume a php hoster, but the OP didn't even bother to mention that (and 
how often do people post here
even when they *know* this is not the place at all) - additionally if the OP 
had searched the archives he would
never have had to ask the question (plenty of recommendations/testimonials have 
been offered in response to similar
questions in the [recent] past)

 
 2. Pointing out someone's signature as being off topic is even further off 
 topic for this list. Please take personal issues into private email.  I bring 
 it up publicly as a reminder of proper list etiquette for anyone who happens 
 to be reading this thread and to discourge this from going any further 
 publicly.

Roman N. has been posting quite alot here recently and his signature has been 
the 'Vietnam Vet'
one for all that time AFAIR. Tedd has never mentioned it before and I am 
willing to bet that today was
not the first time he had seen it - I don't think Tedd was bringing up a real 
issue so much as pointing
out that the 'off topic' gripes cuts many ways.

I don't quite get the don't do as I do, do as I say part at the end of your 
second point; well I do
but I just think that it's a bit anal. I find getting all worked up about 
'proper list etiquette' rather twisted,
given that every 60 seconds a child dies due to lack of food/water (you get the 
picture)

that said I've never had much with potentially offensive signatures -  I find
my posts are, quite often, offensive to some people all by themselves ;-)

 
 Now.. back to the original question.

nah lets keep it ot shall we. :-) (your reply was helpful for the OP to be sure 
:-)

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



Re: [PHP] DOMDocument Size limit

2006-12-18 Thread Jochem Maas
Chris W wrote:
 When calling |-createElement($name, $value) My content is truncated to

what version of php? what version of libxml?

 around 4k.  If what is in $value is less than 4000 bytes then it works

is the limit actually 4096 bytes per chance? (that seems more likely)

what happens when you create the element with an empty value then use
something like this?:

$el = $foo-createElement($name, '');
$el-nodeValue = $yourBigString;

also are you able to use $foo-createElementNS() ? does that suffer from the 
same limit?

could it be a problem with the actual contents of your $value variable?
what does it contain? (especially around the 4K bytes mark)

I tried in vain to find something in the php source that might
point to your problem.. that's not to say there is nothing there, it's just my
skills/understanding aren't up to the job.

 fine but if it is more, the data is truncated.  Is there a setting I
 don't know about that will change that limit?  I need it to be more like
 100k or maybe even more.|
 

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



Re: [PHP] imap_open('/path/to/mbox', '', '')

2006-12-18 Thread Richard Lynch
On Sat, December 16, 2006 4:02 am, Jochem Maas wrote:
 Richard Lynch wrote:
 I'm having trouble with Windows imap_open.

 I have the exact same mbox on a Linux box, with the exact same PHP
 code opening it just fine.

 I FTP (binary) to the Windows box (and a second time to be sure it
 wasn't an FTP flake-out).

 Opening the mbox in Windows yields a message like:
 PHP Notice:
 Unknown:
 C:\\data\\mbox.excerpt (file C:\\data\\mbox.excerpt) is not in valid
 mailbox format (errflg=2)

 LONG SHOT: the path is freaking imap_open out - maybe it can be
 tricked
 by using a path like so '/data/mbox.excerpt' (which windows should
 swallow -
 although it assumes C: is the default drive [I think])

Tried that.

Would never have expected C: to be a default, but shows what I know.

Didn't help.

 other than that I can only think to switch the line-endings in the
 mbox file
 (at least to rule out the line ending as the problem)?!

Linux is happy to take either line-ending.
Windows just plain doesn't work.
:-v

 Can somebody point me to anything that would de-mystify (errflg = 2)
 in the error message?
 Obviously that '2' has SOME kind of meaning, but is that from PHP,
 IMAP, Windows OS, File System, ...?

 I think the errflg is coming from IMAP ... I have found several bits
 of C code related to IMAP (and seemingly nothing to do with php)
 that reference 'errflg' - I have also found
 that a value of 2 for errflg can mean anything from 'invalid mbox
 format'
 to 'authentication failed'  (not very helpful!)

 what do these functions return for you?:

 imap_errors(),imap_alerts(), imap_last_error()

imap_errors():
Can't open mailbox
C:/www/complaints.com/data/testunix.mbox: no such mailbox

HTTP Error Log:
Couldn't open stream
C:/www/complaints.com/data/testdos.mbox in
C:\\www\\complaints.com\\imap_bug.php on
line 9

Unknown: Can't open mailbox C:/www/complaints.com/dat
a/testdos.mbox: no such mailbox (errflg=2) in Unknown on line 0

http://bugs.php.net/bug.php?id=39880

Looks like it's time to just dual boot and abandon Windows. (again).
:-v

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



RE: [PHP] Clearing POST variable on page refresh

2006-12-18 Thread Beauford
 

 -Original Message-
 From: Richard Lynch [mailto:[EMAIL PROTECTED] 
 Sent: December 18, 2006 3:46 PM
 To: Beauford
 Cc: PHP
 Subject: Re: [PHP] Clearing POST variable on page refresh
 
 On Sun, December 17, 2006 4:59 pm, Beauford wrote:
  I have a page with a form on it which posts to itself. The 
 problem is 
  when someone refreshes the page it enters the data into the 
 DB again. 
  How do I clear these variables so that doesn't happen. I tried the 
  unset function, but no luck. I really don't want to use sessions or 
  cookies as this is just a simple little page, but still, it has to 
  work right.
 
 The redirect solution has several gotchas
 
 It tends to mess up the back button, which is annoying to 
 some users.  (Okay, maybe that's just me.)
 
 It's possible for an impatient user to hit Back and Stop 
 fast enough to re-submit the data anyway, in some browsers, 
 so it doesn't solve the problem 100%, really.
 
 A header() to redirect chews up HTTP connections, which can 
 be problematic on a heavy-traffic site, because it has to 
 send the 302 to the browser, which then has to send back 
 another HTTP request to the server to get the new page.  So 
 you double your traffic load and number of Apache children 
 needed to provide the feature-set of this page.  On a 
 much-visited page on a busy server, that can be a real issue, 
 instead of the non-issue it usually is.  YMMV  NAIAA
 
 
 Embedding a token in the FORM, and tracking that token as 
 used in a session or db is what I prefer, personally.
 
 Since you don't want to use sessions, you can simply have one 
 more table in your DB:
 
 create table used_token (
   token char(32) unique not null primary key,
   whatdate date
 );
 create index used_token_whatdate_index on used_token(whatdate);
 
 Then in your original FORM part of the script:
 form action=?php echo $_SERVER['PHP_SELF']? method=post
   input type=hidden name=token value=?php echo 
 md5(uniqid(rand(), true)? /
   Rest of form here
 /form
 
 In the processing section:
 ?php
   $token = $_POST['token'];
   if (!preg_match('/[0-9a-g]{32}/i', $token)) die(Bad Guy);
   $query = select count(*) from used_token where token = '$token';
   $used = mysql_query($query, $connection) or die(Database Offline .
 error_log(mysql_error($connection));
   $used = mysql_result($used, 0, 0);
   if (!$used){
 //insert form contents to DB (your existing code goes here)
 $query = insert into used_token(token, whatdate) 
 values('$token', now());
 mysql_query($query, $connection) or die(Database Offline .
 error_log(mysql_error($conection));
   }
   else{
 //do whatever you want to do with a re-submission, 
 possibly nothing
   }
 ?
 
 
 Then you'll want a cron job to clear out any token in 
 used_token where the whatdate field is, say, a week or more 
 old.  Less than a week on an ultra busy server.
 
 ?php
   //cron job to clear out old data
   $query = delete from used_token where whatdate  
 date_sub(now(), interval 1 week);
   mysql_query($query, $connection) or 
 die(mysql_error($connection)); ?
 
 There is a 1 in a billion chance that two users could get the 
 same token, but you can play games with that as well to 
 guarantee uniqueness.
 
 --

Hmm. I was thinking more of a one liner that would just clear the memory
buffer of these variables, but it seems this is a little more involved than
I anticipated. And it's not that I didn't want to use sessions, I just
didn't want the extra work - but what you suggested above is way more work
than sessions. So now I've just used a simple session. If it's true, don't
add the user, if false add user. Still not exactly what I want, but will do
until I find something better. 

This is most likely not a php thing, but would there be a way to refresh the
page, fooling the browser into thinking it's being freshly loaded?

Thanks to all.

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



Re: [PHP] imap_open('/path/to/mbox', '', '')

2006-12-18 Thread Jochem Maas
Richard Lynch wrote:
 On Sat, December 16, 2006 4:02 am, Jochem Maas wrote:
 Richard Lynch wrote:
 I'm having trouble with Windows imap_open.

...

 
 http://bugs.php.net/bug.php?id=39880
 
 Looks like it's time to just dual boot and abandon Windows. (again).
 :-v

ouch.
one day you'll have a problem that I *can* help with ;-)
(well I can hope anyway)

 

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



[PHP] New windows build

2006-12-18 Thread Edin Kadribasic
Hello all,

Since we will soon be switching to the new Microsoft compiler for making
official PHP builds I have created a couple test builds to see how it
goes. There were some initial problems and we do have to adjust things
in the build to accommodate for changes of how the C++ redistributable
is packaged. We are now at a point where we have a usable build.

I encourage PHP users on Windows to download the test build from
http://edin.dk/archives/24-Second-PHP-build-using-the-new-compiler.html
and provide feedback on any issues thy might have experienced.

Edin

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



Re: [PHP] New windows build

2006-12-18 Thread Jürgen Wind



edink wrote:
 
 Hello all,
 
 Since we will soon be switching to the new Microsoft compiler for making
 official PHP builds I have created a couple test builds to see how it
 goes. There were some initial problems and we do have to adjust things
 in the build to accommodate for changes of how the C++ redistributable
 is packaged. We are now at a point where we have a usable build.
 
 I encourage PHP users on Windows to download the test build from
 http://edin.dk/archives/24-Second-PHP-build-using-the-new-compiler.html
 and provide feedback on any issues thy might have experienced.
 
 Edin
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
wrong pecl link on that site :(
-- 
View this message in context: 
http://www.nabble.com/New-windows-build-tf2842986.html#a7938707
Sent from the PHP - General mailing list archive at Nabble.com.

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



Re: [PHP] How php works?

2006-12-18 Thread Robert Cummings
On Mon, 2006-12-18 at 15:20 -0600, Richard Lynch wrote:
 On Sat, December 16, 2006 6:24 am, Robert Cummings wrote:
  On Sat, 2006-12-16 at 19:58 +0800, Kai Xiang wrote:
  On 12/16/06, Richard Lynch [EMAIL PROTECTED] wrote:
   (*)
   Actually, if somebody wants to embed the ZE inside of something
  other
   than PHP, then I think Zend expects to get paid for that.
 
  I don't think so... the PHP and Zend licenses are quite liberal with
  very few restrictions. Namely that you don't call your software php or
  use php in the name (something many packages seem to ignore (either
  that
  or they got permission)). The Zend license is practically a clone of
  the
  PHP license with a search and replace for PHP to Zend :) There's
  nothing
  that says you have to pay to embed it in your own software. That said,
  if you make a product that uses either the PHP or Zend engine and
  makes
  oodles of money, I think you should feel somewhat morally obliged to
  give back in some way.
 
 Put it this way:  In 2000, if somebody wanted to embed the ZE in a
 commercial product, Zend was planning on charging for it.  I dunno
 what their license for the ZE reads like today, and I wasn't
 authorized to speak on this topic for them then, much less now.

Hmmm, seems a tad risky upgrading software over a 6 year timespan
without ever checking that the licenses haven't discretely added a we
own your immortal soul clause :| Unless of course you're still using
PHP 4.0 or whatever was around back then (I'm guessing you're not since
you seem a fairly reasonable sort :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Recomended host

2006-12-18 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-12-18 15:50:07 -0500:
 I'm going to be controversial here and take issue with both of you.
 
 1. The original question was about a hosting provider. Presumably a
 PHP web hosting provider.

The mail again:

# [EMAIL PROTECTED] / 2006-12-18 08:56:09 -0600:
: Hello.
: I'm looking for a host to put my website.
: I was looking godaddy.com, but i read in phplist forum that godaddy
: have limitations in the number of mail to send per day.
: 
: Someone can recomend me a good host provider, with good stability,
: good support, good features, and no limitation in the use of a list of
: members...?
: 
: Thanks

Sorry, but even as I'm rereading the mail for an umpteenth time, this
guy is looking for a mailing list hosting. And *that* is OT.

http://www.google.com/search?q=mailing+list+hosting

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] Problems with Zip+IE6

2006-12-18 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-12-18 15:00:48 -0600:
 On Sat, December 16, 2006 6:17 am, Roman Neuhauser wrote:
  # [EMAIL PROTECTED] / 2006-12-15 22:55:54 -0600:
  On Tue, December 12, 2006 11:04 am, Frank M. Kromann wrote:
   if you use:
  
   header(Content-Type: application/zip);
   header(Content-Disposition: attachment;
  filename=\somefile.zip\);
  
   That works for me with IE 6/7 and other browsers.
 
  Argh.
 
  Please read this:
  http://richardlynch.blogspot.com/
 
  Go test with MORE browsers and MORE OSes, because you haven't yet
  hit
  the ones where your Content-Disposition does not work, and they are
  out there somewhere.
 
  As if it mattered that much. The filename's just a hint, the browser
  can be configured to ignore it even if it understands it, whatever.
  I would even say you're bound to hit a browser configured for some
  unintelligent reason to handle all app/o-s files with winamp. So what?
  You cannot count on anything the UA will/not do to the content.
 
 If the browser ignores application/octet-stream and doesn't do a
 download, it's broken.

I think you missed my point, which was: broken software is.

 It *HAS* to prompt you for a filename and do a download, by the
 original HTTP RFC spec.  Please read more RFCs until you find the one
 about application/octet-stream

 If the UA opens up application/octet-stream it is in direct
 violation of one of the few HTTP standards that every other UA on the
 planet actually honors!

 A standard that is clear-cut, with no wiggle room for
 mis-interpretation whatsoever.

The only mention of a/o-s in HTTP 1.0 or 1.1 is this (1.1 version):

   Any HTTP/1.1 message containing an entity-body SHOULD include a
   Content-Type header field defining the media type of that body. If
   and only if the media type is not given by a Content-Type field, the
   recipient MAY attempt to guess the media type via inspection of its
   content and/or the name extension(s) of the URI used to identify the
   resource. If the media type remains unknown, the recipient SHOULD
   treat it as type application/octet-stream.

HTTP actually defers to MIME for the CT entity header values.

a/o-s was actually proposed in RFC1341 (obsoleted by RFC1521), the
latter says:

application -- some other kind of data, typically
 either uninterpreted binary data or information to
 be processed by a mail-based application.  The
 primary subtype, octet-stream, is to be used in
 the case of uninterpreted binary data, in which
 case the simplest recommended action is to offer
 to write the information into a file for the user.

and:

   RFC 1341 also defined the use of a NAME parameter which gave a
   suggested file name to be used if the data were to be written to a
   file.  This has been deprecated in anticipation of a separate
   Content-Disposition header field, to be defined in a subsequent RFC.

   The recommended action for an implementation that receives
   application/octet-stream mail is to simply offer to put the data in a
   file, with any Content-Transfer-Encoding undone, or perhaps to use it
   as input to a user-specified process.

 What filename will any sane browser use for:
 http://example.com/dir1/dir2/iwant.xyz
 
HTTP doesn't discuss this at all, as far as I can tell.

  [RFC2616 quote]

 If you read between the lines, what you will find is that Qualcomm
 essentially asked for an RFC to standardize the stupid behaviour of MS
 IE, which was using Content-Disposition, originally conceived for MIME
 Email, and not HTTP at all.

Qualcomm simply wanted to standardize something it badly needed for Eudora.
 
 Not to mention that it's a STUPID thing for MS IE to have done in the
 first place, to re-purpose a MIME email header for HTTP.  It doesn't
 even make sense, since Content-Disposition has a MIME type embedded in
 it, which may or may not match the Content-type of the HTTP Request!

Now you've completely discredited yourself.
 
-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



[PHP] Search Results Accuracy

2006-12-18 Thread zoticaic
Hello,

 

I'm just wondering, from a list of search results from a database query, how do
we trim down and return the most accurate one? 

 

Hints, links and suggestions are most welcome.

 

TIA

Jervin

 

--
 Outsource Now | GetAFreelancer
http://www.getafreelancer.com/affiliates/shockx/ 

 



Re: [PHP] How php works?

2006-12-18 Thread Larry Garfield
On Monday 18 December 2006 15:20, Richard Lynch wrote:

 Put it this way:  In 2000, if somebody wanted to embed the ZE in a
 commercial product, Zend was planning on charging for it.  I dunno
 what their license for the ZE reads like today, and I wasn't
 authorized to speak on this topic for them then, much less now.

Is that why the PHP License is non-GPL compatible, or is there a different 
reason for that?  (That's always bugged me, personally.)

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it.  -- Thomas 
Jefferson

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



[PHP] ob_flush() possible memory leak in Apache

2006-12-18 Thread Chris Miller


Server Specs

CentOS 4.4
Apache 2.0.52 (httpd-2.0.52-28.ent.centos4)
PHP 5.1.6 (php-5.1.6-1.2.centos)
PHP running as Apache Module.

Simple script reads a file in (mp3 or other binary file) and spits out
to browser. Upon completion, memory consumption of the Apache child
rises dramatically and CPU usage spikes. Same is true under PHP 5.2.0.
Removing ob_flush and using ini_set(output_buffering = Off);
eliminates the problem, but causes others (browser doesn't appear to see
the headers).

Just want to make sure I'm using the function correctly before filing a
bug report. Offending code example below, just add mp3 file. Use 'top -u
apache' to monitor httpd process, RSS (memory) will jump at the end of 
download. You can safely kill that child process ID without having to 
restart the entire server.


Chris

?php
$filename = test.mp3;
   if ($handle = fopen($filename,r)) {
   header(Content-Type: application/octet-stream);
   header(Pragma: public);
   header(Expires: 0);
   header(Cache-Control: public, must-revalidate, post-check=0,  .
 pre-check=0);
   header(Content-Description: File Transfer);
   header(Content-Disposition: attachment; filename= . $filename);
   header(Content-Transfer-Encoding: binary);
   header(Content-Length:  . filesize($filename));
   while (($content = fread($handle,1024)) !== FALSE) {
 echo $content;
 ob_flush();
 flush();
   }
 }
 fclose($handle);
?

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



Re: [PHP] php redirection..

2006-12-18 Thread Chris Shiflett
Richard Lynch wrote:
 You mean Refresh is a real header?

Yeah, although if I remember correctly, the W3C really dislikes people
using it for redirection instead of just refreshing the current URL. If
that's the case, however, why can we indicate the URL at all? :-)

A few years ago, someone conducted some pretty extensive research into
browser support for Refresh. I can't seem to find the URL, but the
results demonstrated extremely widespread support. (I can't imagine
support for a real HTTP header being poorer than support for the same
header expressed as http-equiv.)

Anyway, it's as real as Content-Disposition. :-)

Chris

-- 
Chris Shiflett
http://shiflett.org/

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



[PHP] ECHO

2006-12-18 Thread Fahad Pervaiz

ECHO is a language construct but still is there any work around to override
it or change its functionality???


Re: [PHP] ECHO

2006-12-18 Thread Casey Chu

Why do you need to change its functionality?

On 12/18/06, Fahad Pervaiz [EMAIL PROTECTED] wrote:

ECHO is a language construct but still is there any work around to override
it or change its functionality???




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



[PHP] Re: ECHO

2006-12-18 Thread Fahad Pervaiz

I have written a framework for internationalization. Now i have incoorperate
it into and existing system that is huge and it will take alot of time to
change ECHO to a function call, so i want to override its implementation so
that i can use it for my own purposes with having to change all the echo
calls

--
Regards
Fahad Pervaiz
www.ecommerce-xperts.com


Re: [PHP] Re: ECHO

2006-12-18 Thread Casey Chu

You could try to manipulate what the echo's output by ob_start(), etc.
Or maybe you could change the standard output?

On 12/18/06, Fahad Pervaiz [EMAIL PROTECTED] wrote:

I have written a framework for internationalization. Now i have incoorperate
it into and existing system that is huge and it will take alot of time to
change ECHO to a function call, so i want to override its implementation so
that i can use it for my own purposes with having to change all the echo
calls

--
Regards
Fahad Pervaiz
www.ecommerce-xperts.com




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



[PHP] Re: ECHO

2006-12-18 Thread Fahad Pervaiz

Manipulating out with Output Control Functions sounds a good idea but it can
become cumbersome.

Do you know any good methods to control standard output??


On 12/19/06, Casey Chu [EMAIL PROTECTED] wrote:


You could try to manipulate what the echo's output by ob_start(), etc.
Or maybe you could change the standard output?

On 12/18/06, Fahad Pervaiz [EMAIL PROTECTED] wrote:
 I have written a framework for internationalization. Now i have
incoorperate
 it into and existing system that is huge and it will take alot of time
to
 change ECHO to a function call, so i want to override its implementation
so
 that i can use it for my own purposes with having to change all the echo
 calls

 --
 Regards
 Fahad Pervaiz
 www.ecommerce-xperts.com






--
Regards
Fahad Pervaiz
www.ecommerce-xperts.com


[PHP] heredoc

2006-12-18 Thread clr

Please can someone advise me on heredoc and its shortcommings,

I am designing a complex site and elected to use DIV's as opposed to 
frames.
Heredoc seems to be ideal in that I can do all processing first and 
then layout with relative ease.


I was wondering if it was acceptable to use and maintain going forward 
as i have read on a few mailing archives

that this is a cheat and lazy and to be depreciated??


Thanks
Colin

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



RE: [PHP] Search Results Accuracy

2006-12-18 Thread zoticaic
Hi,

 

I'm not really sure which is the best path to go but let me give you an example
scenario : 



1. We already have a database of varchar data : 

+---+

|   links  |

+---+

| 340-golfers-dream-and-swimmers|

+---+

| 89-golfers-dream   |

+---+

| 45-golf-equipments|

+---+

| 3-best-golf-training |

+---+

| 0-golf-equipment-and-training  |

+---+

| 39-golf-training  |

+---+



 

2. From data above if we search the database for '%golf%' it would return all
rows as results, if we search for '%golf%training%' it would return three rows .

 

How do I choose from the multiple results? For the '%golf%' query, the desired
result is golf-equipments or golf-training, while for '%golf%training%' the
desired result should be 39-golf-training alone . This is sort of like search
engine ranking their results, but for this how do I set the criteria using MySQL
queries or if not possible using PHP .

 

I hope it makes it more clear, questions are welcomed.

 

TIA

Jervin

 

--
 Outsource Now | GetAFreelancer
http://www.getafreelancer.com/affiliates/shockx/ 

  _  

From: Shafiq Rehman [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 19, 2006 2:07 PM
To: zoticaic
Subject: Re: [PHP] Search Results Accuracy

 

Hello,

Your question is not very clear, please elaborate it.

btw, Are you talking about the fulltext search?

-- 
Shafiq Rehman
Sr. Web Engineer
http://www.phpgurru.com  http://www.phpgurru.com 



On 12/19/06, zoticaic [EMAIL PROTECTED] wrote:

Hello,



I'm just wondering, from a list of search results from a database query, how do
we trim down and return the most accurate one?



Hints, links and suggestions are most welcome.



TIA

Jervin



--
 Outsource Now | GetAFreelancer
http://www.getafreelancer.com/affiliates/shockx/











Re: [PHP] DOMDocument Size limit

2006-12-18 Thread Chris W

Jochem Maas wrote:

what version of php? what version of libxml?
  

php: 5.2.0
libxml: 2.6.26

is the limit actually 4096 bytes per chance? (that seems more likely)


the limit is probably 4096 but I think it may be due to the length of 
tags and other things not just the value.

what happens when you create the element with an empty value then use
something like this?:

$el = $foo-createElement($name, '');
$el-nodeValue = $yourBigString;
  


Same thing happened there

also are you able to use $foo-createElementNS() ? does that suffer from the 
same limit?

  


I'm not familiar enough with the how this dom works to make that 
modification.  I didn't write this code I'm just trying to fix it.




could it be a problem with the actual contents of your $value variable?
what does it contain? (especially around the 4K bytes mark)
  


the variable contains htmlspecialchars encoded html.  The next character 
after it stops is either a space or a period.

I tried in vain to find something in the php source that might
point to your problem.. that's not to say there is nothing there, it's just my
skills/understanding aren't up to the job.

  
I looked for something in the php.ini file but the only thing I found 
was output_buffering = 4096 and that doesn't seem like it would be a  
problem.


--
Chris W
KE5GIX

Protect your digital freedom and privacy, eliminate DRM, 
learn more at http://www.defectivebydesign.org/what_is_drm;


Gift Giving Made Easy
Get the gifts you want  
give the gifts they want
One stop wish list for any gift, 
from anywhere, for any occasion!

http://thewishzone.com

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



Re: [PHP] ECHO

2006-12-18 Thread Chris

Fahad Pervaiz wrote:

ECHO is a language construct but still is there any work around to override
it or change its functionality???


Nope. You're stuck with how it works now.

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] heredoc

2006-12-18 Thread Chris

clr wrote:

Please can someone advise me on heredoc and its shortcommings,

I am designing a complex site and elected to use DIV's as opposed to 
frames.
Heredoc seems to be ideal in that I can do all processing first and then 
layout with relative ease.


I was wondering if it was acceptable to use and maintain going forward 
as i have read on a few mailing archives

that this is a cheat and lazy and to be depreciated??


I think it comes down to personal preference. Some people use it and 
like, some don't. If you want to use it, do it. It's just another 
option to consider..


I don't think it's going to be removed any time soon (I'm sure there 
would be plenty of upset people  plenty of broken applications if it 
was removed).


--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] heredoc

2006-12-18 Thread Paul Novitski

At 12/18/2006 10:14 PM, clr wrote:

Please can someone advise me on heredoc and its shortcommings,

I am designing a complex site and elected to use DIV's as opposed to frames.
Heredoc seems to be ideal in that I can do all processing first and 
then layout with relative ease.


I was wondering if it was acceptable to use and maintain going 
forward as i have read on a few mailing archives

that this is a cheat and lazy and to be depreciated??



Yikes!  Then a scoundrel I must be indeed.  I love using heredoc, 
primarily because it lets me compose blocks of pure output text 
without interrupting it with control structures, nested quotes, and 
concatenation syntax, even when it contains nested variables.  It 
helps me to separate logic from markup, something that benefits my 
code (if not my character!).


I imagine you'll hear from others whose sensibilities are offended by 
heredoc -- in particular those whose careful indentation it spoils -- 
so I wanted to make sure you knew that it had an (admittedly cheating 
and lazy yet) ardent supporter as well.


I don't know whom, in programming, you can cheat other than yourself; 
I've been suffering under the misapprehension that laziness is a 
virtue because it teaches efficiency; but I really hadn't heard that 
heredoc was going to be deprecated.  If it is then it will be my loss 
and the gain of those who earn royalties from the use of quotation 
marks and periods and who make their living pulling the tangled and 
bloody fragments of logic and markup from the wreckage of their collision.


Regards,
Paul 


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



Re: [PHP] Re: ECHO

2006-12-18 Thread Paul Novitski



On 12/18/06, Fahad Pervaiz [EMAIL PROTECTED] wrote:

I have written a framework for internationalization. Now i have incoorperate
it into and existing system that is huge and it will take alot of time to
change ECHO to a function call, so i want to override its implementation so
that i can use it for my own purposes with having to change all the echo
calls


At 12/18/2006 10:01 PM, Casey Chu wrote:

You could try to manipulate what the echo's output by ob_start(), etc.
Or maybe you could change the standard output?



Given the probably unalterable nature of echo, I'd say Casey's 
suggestion of buffering output and running it through a 
post-processor is an excellent one.  However my first choice would 
probably be to bite the bullet and globally replace echo with my own 
function.  Once that painful step is taken, you can modify the output 
methodology to your heart's content.


This sounds like an excellent object lesson in the separation of 
logic from markup.  If you design your applications to first figure 
out what to output and then to output it as one or more solid lumps, 
you can more easily tweak the logic or the markup or the output 
method without messing with the others.  It can be hard medicine to 
swallow the first time, but it will make you a leaner  cleaner coder.


Regards,
Paul 


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



Re: [PHP] Search Results Accuracy

2006-12-18 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-12-19 09:33:02 +0800:
 Hello,
 
  
 
 I'm just wondering, from a list of search results from a database query, how 
 do
 we trim down and return the most accurate one? 
 
  
 
 Hints, links and suggestions are most welcome.

is this what you're looking for?

http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] heredoc

2006-12-18 Thread Casey Chu

I usually use an include rather than a heredoc.

On 12/18/06, Paul Novitski [EMAIL PROTECTED] wrote:

At 12/18/2006 10:14 PM, clr wrote:
Please can someone advise me on heredoc and its shortcommings,

I am designing a complex site and elected to use DIV's as opposed to frames.
Heredoc seems to be ideal in that I can do all processing first and
then layout with relative ease.

I was wondering if it was acceptable to use and maintain going
forward as i have read on a few mailing archives
that this is a cheat and lazy and to be depreciated??


Yikes!  Then a scoundrel I must be indeed.  I love using heredoc,
primarily because it lets me compose blocks of pure output text
without interrupting it with control structures, nested quotes, and
concatenation syntax, even when it contains nested variables.  It
helps me to separate logic from markup, something that benefits my
code (if not my character!).

I imagine you'll hear from others whose sensibilities are offended by
heredoc -- in particular those whose careful indentation it spoils --
so I wanted to make sure you knew that it had an (admittedly cheating
and lazy yet) ardent supporter as well.

I don't know whom, in programming, you can cheat other than yourself;
I've been suffering under the misapprehension that laziness is a
virtue because it teaches efficiency; but I really hadn't heard that
heredoc was going to be deprecated.  If it is then it will be my loss
and the gain of those who earn royalties from the use of quotation
marks and periods and who make their living pulling the tangled and
bloody fragments of logic and markup from the wreckage of their collision.

Regards,
Paul

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




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



Re: [PHP] DOMDocument Size limit

2006-12-18 Thread Jochem Maas
Chris W wrote:
 Jochem Maas wrote:
 what version of php? what version of libxml?
   
 php: 5.2.0
 libxml: 2.6.26

nothing wrong there I believe, although I haven't yet played with php5.2 myself

 is the limit actually 4096 bytes per chance? (that seems more likely)
 
 the limit is probably 4096 but I think it may be due to the length of
 tags and other things not just the value.
 what happens when you create the element with an empty value then use
 something like this?:

 $el = $foo-createElement($name, '');
 $el-nodeValue = $yourBigString;
   
 
 Same thing happened there
 also are you able to use $foo-createElementNS() ? does that suffer
 from the same limit?

   
 
 I'm not familiar enough with the how this dom works to make that
 modification.  I didn't write this code I'm just trying to fix it.
 
 
 could it be a problem with the actual contents of your $value variable?
 what does it contain? (especially around the 4K bytes mark)
   
 
 the variable contains htmlspecialchars encoded html.  The next character

this last comment leads me to believe that the data in $value (your html)
should be contained in a CDATA node, in which case you should be
using the following to create a the CDATA node and add $value to that, after
which you can add the CDATA node to the node your are currently trying to
add $value to:

http://php.net/manual/en/function.dom-domdocument-createcdatasection.php

 after it stops is either a space or a period.
 I tried in vain to find something in the php source that might
 point to your problem.. that's not to say there is nothing there, it's
 just my
 skills/understanding aren't up to the job.

   
 I looked for something in the php.ini file but the only thing I found
 was output_buffering = 4096 and that doesn't seem like it would be a 
 problem.

agreed - but in the spirit of Murphy it's worth setting it to something
bigger to see if it has affect.

 

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



RE: [PHP] Search Results Accuracy

2006-12-18 Thread zoticaic
Thanks,

 

All I needed was that to get started with.

 

Regards

jervin

--
 Outsource Now | GetAFreelancer
http://www.getafreelancer.com/affiliates/shockx/ 

  _  

From: Shafiq Rehman [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 19, 2006 2:41 PM
To: zoticaic
Subject: Re: [PHP] Search Results Accuracy

 

Hello,

In searching, like queries are not recommended because these are the most
slowest queries. You must use full text searching. It will rocks your search
speed and suits your scenario. Here is an article for fulltext searching 

http://www.onlamp.com/pub/a/onlamp/2003/06/26/fulltext.html

-- 
Shafiq Rehman
Sr. Web Engineer
http://www.phpgurru.com



On 12/19/06, zoticaic [EMAIL PROTECTED] wrote:

Hi,

 

I'm not really sure which is the best path to go but let me give you an example
scenario : 

1. We already have a database of varchar data : 

+---+

|   links  |

+---+

| 340-golfers-dream-and-swimmers|

+---+

| 89-golfers-dream   |

+---+

| 45-golf-equipments|

+---+

| 3-best-golf-training |

+---+

| 0-golf-equipment-and-training  |

+---+

| 39-golf-training  |

+---+



 

2. From data above if we search the database for '%golf%' it would return all
rows as results, if we search for '%golf%training%' it would return three rows .

 

How do I choose from the multiple results? For the '%golf%' query, the desired
result is golf-equipments or golf-training, while for '%golf%training%' the
desired result should be 39-golf-training alone . This is sort of like search
engine ranking their results, but for this how do I set the criteria using MySQL
queries or if not possible using PHP .

 

I hope it makes it more clear, questions are welcomed.

 

TIA

Jervin

 

--
 Outsource Now | GetAFreelancer
http://www.getafreelancer.com/affiliates/shockx/  

  _  

From: Shafiq Rehman [mailto: [EMAIL PROTECTED] 
Sent: Tuesday, December 19, 2006 2:07 PM
To: zoticaic
Subject: Re: [PHP] Search Results Accuracy

 

Hello,

Your question is not very clear, please elaborate it.

btw, Are you talking about the fulltext search?

-- 
Shafiq Rehman
Sr. Web Engineer
http://www.phpgurru.com  http://www.phpgurru.com 

On 12/19/06, zoticaic [EMAIL PROTECTED] wrote:

Hello,



I'm just wondering, from a list of search results from a database query, how do
we trim down and return the most accurate one?



Hints, links and suggestions are most welcome.



TIA

Jervin



--
 Outsource Now | GetAFreelancer
http://www.getafreelancer.com/affiliates/shockx/