php-general Digest 28 Jan 2008 02:46:08 -0000 Issue 5260

2008-01-27 Thread php-general-digest-help

php-general Digest 28 Jan 2008 02:46:08 - Issue 5260

Topics (messages 268168 through 268182):

Re: php installation problem
268168 by: Andrés Robinet
268170 by: Andrés Robinet

Re: determine file-upload's tmp-filename
268169 by: Andrés Robinet
268171 by: Michael Fischer

htmlentities() does not remove escape
268172 by: jekillen
268174 by: Nathan Nobbe
268175 by: Robert Cummings
268177 by: jekillen

Re: Foreach
268173 by: Nathan Nobbe
268178 by: Eric Butera
268179 by: Nathan Nobbe

Re: Posting Summary for Week Ending 18 January,2008:[EMAIL PROTECTED]
268176 by: Nisse Engström

How to prevent direct access..
268180 by: Chuck
268181 by: Nathan Rixham

interface inheritance
268182 by: Nathan Nobbe

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
---BeginMessage---
 -Original Message-
 From: Umar [mailto:[EMAIL PROTECTED]
 Sent: Sunday, January 27, 2008 3:55 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] php installation problem
 
 
 Dear Members!
 
 I have installed php-5.2.5 on slackware 12.0 with these option
 successfully
 
 ./configure --prefix=/usr/local/php --with-
 apxs=/usr/local/apache/bin/apxs
 --with-config-file-path=/usr/local/apache/conf --with-pcre-regex
 --with-layout=GNU --enable-sysvshm --enable-shmop --enable-sysvmsg
 --enable-sysvsem --enable-exif --enable-ftp --enable-safe-mode
 --enable-bcmath --disable-debug --enable-sockets --enable-force-cgi-
 redirect
 --with-gettext --with-zlib --with-gd --enable-gd-native-ttf --disable-
 rpath
 --enable-mbregex --with-bz2 --with-mime-magic --enable-calendar
 --enable-inline-optimization --enable-magic-quotes --enable-wddx=shared
 --with-ncurses=shared --with-xmlrpc --with-regex=system --with-pear
 --with-curl --with-gmp --with-png-dir=/usr/local --enable-mbstring
 --with-jpeg-dir=/usr/local --with-pic --with-mm=/usr/local
 --with-libexpat-dir=/usr/local --with-xsl=/usr/local --with-mcrypt
 --with-mhash --with-ldap=/usr/local/ldap
 
 Now I am trying to install php-5.2.5 on another slackware 12.0 with
 same
 options but i got error on make
 
 ext/gd/libgd/.libs/gdkanji.o: In function `do_convert':
 /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/gd/libgd/gdkanji.c:350:
 und
 efined reference to `libiconv_open'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/gd/libgd/gdkanji.c:365:
 und
 efined reference to `libiconv'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/gd/libgd/gdkanji.c:381:
 und
 efined reference to `libiconv_close'
 ext/iconv/.libs/iconv.o: In function `_php_iconv_strlen':
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:603:
 undefine
 d reference to `libiconv_open'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:626:
 undefine
 d reference to `libiconv'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:660:
 undefine
 d reference to `libiconv_close'
 ext/iconv/.libs/iconv.o: In function `php_iconv_string':
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:441:
 undefine
 d reference to `libiconv_open'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:453:
 undefine
 d reference to `libiconv'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:467:
 undefine
 d reference to `libiconv'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:478:
 undefine
 d reference to `libiconv_close'
 ext/iconv/.libs/iconv.o: In function `_php_iconv_strpos':
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:851:
 undefine
 d reference to `libiconv_open'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:879:
 undefine
 d reference to `libiconv'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:993:
 undefine
 d reference to `libiconv_close'
 ext/iconv/.libs/iconv.o: In function `_php_iconv_appendl':
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:348:
 undefine
 d reference to `libiconv'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:385:
 undefine
 d reference to `libiconv'
 ext/iconv/.libs/iconv.o: In function `_php_iconv_substr':
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:723:
 undefine
 d reference to `libiconv_open'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:747:
 undefine
 d reference to `libiconv'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:802:
 undefine
 d reference to `libiconv_close'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:806:
 undefine
 d reference to `libiconv_close'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:755:
 undefine
 d 

[PHP] php installation problem

2008-01-27 Thread Umar

Dear Members!

I have installed php-5.2.5 on slackware 12.0 with these option successfully

./configure --prefix=/usr/local/php --with-apxs=/usr/local/apache/bin/apxs
--with-config-file-path=/usr/local/apache/conf --with-pcre-regex
--with-layout=GNU --enable-sysvshm --enable-shmop --enable-sysvmsg
--enable-sysvsem --enable-exif --enable-ftp --enable-safe-mode
--enable-bcmath --disable-debug --enable-sockets --enable-force-cgi-redirect
--with-gettext --with-zlib --with-gd --enable-gd-native-ttf --disable-rpath
--enable-mbregex --with-bz2 --with-mime-magic --enable-calendar
--enable-inline-optimization --enable-magic-quotes --enable-wddx=shared
--with-ncurses=shared --with-xmlrpc --with-regex=system --with-pear
--with-curl --with-gmp --with-png-dir=/usr/local --enable-mbstring
--with-jpeg-dir=/usr/local --with-pic --with-mm=/usr/local
--with-libexpat-dir=/usr/local --with-xsl=/usr/local --with-mcrypt
--with-mhash --with-ldap=/usr/local/ldap

Now I am trying to install php-5.2.5 on another slackware 12.0 with same
options but i got error on make

ext/gd/libgd/.libs/gdkanji.o: In function `do_convert':
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/gd/libgd/gdkanji.c:350:
und
efined reference to `libiconv_open'
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/gd/libgd/gdkanji.c:365:
und
efined reference to `libiconv'
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/gd/libgd/gdkanji.c:381:
und
efined reference to `libiconv_close'
ext/iconv/.libs/iconv.o: In function `_php_iconv_strlen':
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:603:
undefine

d reference to `libiconv_open'
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:626:
undefine

d reference to `libiconv'
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:660:
undefine

d reference to `libiconv_close'
ext/iconv/.libs/iconv.o: In function `php_iconv_string':
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:441:
undefine

d reference to `libiconv_open'
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:453:
undefine

d reference to `libiconv'
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:467:
undefine

d reference to `libiconv'
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:478:
undefine

d reference to `libiconv_close'
ext/iconv/.libs/iconv.o: In function `_php_iconv_strpos':
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:851:
undefine

d reference to `libiconv_open'
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:879:
undefine

d reference to `libiconv'
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:993:
undefine

d reference to `libiconv_close'
ext/iconv/.libs/iconv.o: In function `_php_iconv_appendl':
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:348:
undefine

d reference to `libiconv'
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:385:
undefine

d reference to `libiconv'
ext/iconv/.libs/iconv.o: In function `_php_iconv_substr':
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:723:
undefine

d reference to `libiconv_open'
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:747:
undefine

d reference to `libiconv'
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:802:
undefine

d reference to `libiconv_close'
/home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:806:
undefine

d reference to `libiconv_close'

Re: [PHP] determine file-upload's tmp-filename

2008-01-27 Thread Michael Fischer

 Original-Nachricht 
 Datum: Sat, 26 Jan 2008 16:09:58 -0800
 Von: Casey [EMAIL PROTECTED]
 An: Michael Fischer [EMAIL PROTECTED]
 CC: php-general@lists.php.net
 Betreff: Re: [PHP] determine file-upload\'s tmp-filename

 On Jan 26, 2008 3:57 PM, Michael Fischer [EMAIL PROTECTED] wrote:
  hi there,
 
  is there a way to determine the tmp-filename of a file upload while the
 upload is still in progress?
 
  the tmp-file is stored in /tmp and it's name is something like
 PHP.
 
  what i would like to do is:
  i want to upload a file via a html-form and while the upload is in
 progress make repeatedly ajax-requests to a php-script on the server that
 replies the size of the tmp file (the amount of data that was already 
 uploaded).
 So in this script i need to know what the tmp-filename is.
 
  or do you think this is a completely useless approach?
 
  lg, Michi
 
 
 
 Will this help?
 http://tomas.epineer.se/archives/3
 
 -- 
 -Casey

well, i've found this before and this script uses perl-cgi and not php.
it determines the tmp-filename as such:

$post_data_file = $tmp_dir/$sessionid._postdata;
$monitor_file = $tmp_dir/$sessionid._flength;
$error_file = $tmp_dir/$sessionid._err;
$signal_file = $tmp_dir/$sessionid._signal;
$qstring_file = $tmp_dir/$sessionid._qstring;

i'm looking for something similar in php...

lg, michi

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



Re: [PHP] determine file-upload's tmp-filename

2008-01-27 Thread Brady Mitchell

On Jan 26, 2008, at 357PM, Michael Fischer wrote:


hi there,

is there a way to determine the tmp-filename of a file upload while  
the upload is still in progress?


I'm not sure when it becomes available, but $_FILES['file_name'] 
['tmp_name'] is the only place I know of to find the temporary name.


the tmp-file is stored in /tmp and it's name is something like  
PHP.


what i would like to do is:
i want to upload a file via a html-form and while the upload is in  
progress make repeatedly ajax-requests to a php-script on the server  
that replies the size of the tmp file (the amount of data that was  
already uploaded). So in this script i need to know what the tmp- 
filename is.


You could try doing a print_r($_GLOBALS); in that script to find out  
if there are any other helpful places to check.


HTH,

Brady

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



Re: [PHP] determine file-upload's tmp-filename

2008-01-27 Thread Michael Fischer

 Original-Nachricht 
 Datum: Sun, 27 Jan 2008 01:21:19 -0800
 Von: Brady Mitchell [EMAIL PROTECTED]
 An: Michael Fischer [EMAIL PROTECTED]
 CC: php-general@lists.php.net
 Betreff: Re: [PHP] determine file-upload\'s tmp-filename

 On Jan 26, 2008, at 357PM, Michael Fischer wrote:
 
  hi there,
 
  is there a way to determine the tmp-filename of a file upload while  
  the upload is still in progress?
 
 I'm not sure when it becomes available, but $_FILES['file_name'] 
 ['tmp_name'] is the only place I know of to find the temporary name.
 
  the tmp-file is stored in /tmp and it's name is something like  
  PHP.
 
  what i would like to do is:
  i want to upload a file via a html-form and while the upload is in  
  progress make repeatedly ajax-requests to a php-script on the server  
  that replies the size of the tmp file (the amount of data that was  
  already uploaded). So in this script i need to know what the tmp- 
  filename is.
 
 You could try doing a print_r($_GLOBALS); in that script to find out  
 if there are any other helpful places to check.
 
 HTH,
 
 Brady
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

hm, there's nothing to spectacular in $_GLOBALS:

Array
(
[GLOBALS] = Array
 *RECURSION*
[_ENV] = Array
(
[TERM] = xterm
[SHELL] = /bin/bash
[DEFAULTLEVEL] = default
[LC_ALL] = [EMAIL PROTECTED]
[USER] = root
[PATH] = 
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/usr/i386-pc-linux-gnu/gcc-bin/3.4.4
[PWD] = /etc/apache2/modules.d
[LANG] = [EMAIL PROTECTED]
[BOOTLEVEL] = boot
[SVCNAME] = apache2
[CONSOLETYPE] = pty
[SHLVL] = 1
[HOME] = /home/albert
[SOFTLEVEL] = default
[_] = /usr/sbin/apache2
)

[HTTP_ENV_VARS] = Array
(
[TERM] = xterm
[SHELL] = /bin/bash
[DEFAULTLEVEL] = default
[LC_ALL] = [EMAIL PROTECTED]
[USER] = root
[PATH] = 
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/usr/i386-pc-linux-gnu/gcc-bin/3.4.4
[PWD] = /etc/apache2/modules.d
[LANG] = [EMAIL PROTECTED]
[BOOTLEVEL] = boot
[SVCNAME] = apache2
[CONSOLETYPE] = pty
[SHLVL] = 1
[HOME] = /home/albert
[SOFTLEVEL] = default
[_] = /usr/sbin/apache2
)

[_POST] = Array
(
)

[HTTP_POST_VARS] = Array
(
)

[_GET] = Array
(
)

[HTTP_GET_VARS] = Array
(
)

[_COOKIE] = Array
(
[PHPSESSID] = a959c533aa718bc94801431ae34f6fa6
)

[HTTP_COOKIE_VARS] = Array
(
[PHPSESSID] = a959c533aa718bc94801431ae34f6fa6
)

[_SERVER] = Array
(
[UNIQUE_ID] = 6jqHi38AAAEAAHn7e14J
[HTTP_X_REQUESTED_WITH] = XMLHttpRequest
[HTTP_ACCEPT_LANGUAGE] = de-at,en-us;q=0.5
[HTTP_REFERER] = http://webfischer.at/~albert/upload.php
[HTTP_ACCEPT] = text/javascript, text/html, application/xml, 
text/xml, */*
[HTTP_UA_CPU] = x86
[HTTP_ACCEPT_ENCODING] = gzip, deflate
[HTTP_USER_AGENT] = Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 
5.1; InfoPath.1)
[HTTP_HOST] = webfischer.at
[HTTP_CONNECTION] = Keep-Alive
[HTTP_COOKIE] = PHPSESSID=a959c533aa718bc94801431ae34f6fa6
[PATH] = 
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/usr/i386-pc-linux-gnu/gcc-bin/3.4.4
[SERVER_SIGNATURE] = Apache Server at webfischer.at Port 80

[SERVER_SOFTWARE] = Apache
[SERVER_NAME] = webfischer.at
[SERVER_ADDR] = 192.168.0.2
[SERVER_PORT] = 80
[REMOTE_ADDR] = 193.80.38.250
[DOCUMENT_ROOT] = /var/www/htdocs
[SERVER_ADMIN] = [EMAIL PROTECTED]
[SCRIPT_FILENAME] = /home/albert/public_html/upload2.php
[REMOTE_PORT] = 62795
[GATEWAY_INTERFACE] = CGI/1.1
[SERVER_PROTOCOL] = HTTP/1.1
[REQUEST_METHOD] = GET
[QUERY_STRING] = 
[REQUEST_URI] = /~albert/upload2.php
[SCRIPT_NAME] = /~albert/upload2.php
[PHP_SELF] = /~albert/upload2.php
[REQUEST_TIME] = 1201426541
[argv] = Array
(
)

[argc] = 0
)

[HTTP_SERVER_VARS] = Array
(
[UNIQUE_ID] = 6jqHi38AAAEAAHn7e14J
[HTTP_X_REQUESTED_WITH] = XMLHttpRequest

[PHP] Hex Strings Appended to Pathnames

2008-01-27 Thread Mick

Operating System: CentOS 4.6
PHP Version: 4.3.9-3.22.9
Zend Optimizer (free) version: 3.2.6

Hello.

I've got somewhat of a strange problem here involving Squirrelmail.  
Basically, what is happening is that one of our customers is logged out 
of his Squirrelmail session at random intervals.  This can occur when 
he  goes to read an email or, after composing an email, when he clicks 
on the Send button.


The following log entries correspond with those times that the customer 
is logged out.


[error] [client X.X.X.X] File does not exist: 
/var/www/squirrelmail/src/redirect.php3a5def33
[error] [client X.X.X.X] File does not exist: 
/var/www/squirrelmail/src/redirect.php29e09f87
[error] [client X.X.X.X] File does not exist: 
/var/www/squirrelmail/src/move_messages.phpf9f96dfb
[error] [client X.X.X.X] File does not exist: 
/var/www/squirrelmail/src/redirect.phpdc6cc80a


So what would be the cause of appending those hex strings to those 
pathnames?  


Cheers,
Mick

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



RE: [PHP] php installation problem

2008-01-27 Thread Andrés Robinet
 -Original Message-
 From: Umar [mailto:[EMAIL PROTECTED]
 Sent: Sunday, January 27, 2008 3:55 AM
 To: php-general@lists.php.net
 Subject: [PHP] php installation problem
 
 
 Dear Members!
 
 I have installed php-5.2.5 on slackware 12.0 with these option
 successfully
 
 ./configure --prefix=/usr/local/php --with-
 apxs=/usr/local/apache/bin/apxs
 --with-config-file-path=/usr/local/apache/conf --with-pcre-regex
 --with-layout=GNU --enable-sysvshm --enable-shmop --enable-sysvmsg
 --enable-sysvsem --enable-exif --enable-ftp --enable-safe-mode
 --enable-bcmath --disable-debug --enable-sockets --enable-force-cgi-
 redirect
 --with-gettext --with-zlib --with-gd --enable-gd-native-ttf --disable-
 rpath
 --enable-mbregex --with-bz2 --with-mime-magic --enable-calendar
 --enable-inline-optimization --enable-magic-quotes --enable-wddx=shared
 --with-ncurses=shared --with-xmlrpc --with-regex=system --with-pear
 --with-curl --with-gmp --with-png-dir=/usr/local --enable-mbstring
 --with-jpeg-dir=/usr/local --with-pic --with-mm=/usr/local
 --with-libexpat-dir=/usr/local --with-xsl=/usr/local --with-mcrypt
 --with-mhash --with-ldap=/usr/local/ldap
 
 Now I am trying to install php-5.2.5 on another slackware 12.0 with
 same
 options but i got error on make
 
 ext/gd/libgd/.libs/gdkanji.o: In function `do_convert':
 /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/gd/libgd/gdkanji.c:350:
 und
 efined reference to `libiconv_open'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/gd/libgd/gdkanji.c:365:
 und
 efined reference to `libiconv'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/gd/libgd/gdkanji.c:381:
 und
 efined reference to `libiconv_close'
 ext/iconv/.libs/iconv.o: In function `_php_iconv_strlen':
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:603:
 undefine
 d reference to `libiconv_open'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:626:
 undefine
 d reference to `libiconv'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:660:
 undefine
 d reference to `libiconv_close'
 ext/iconv/.libs/iconv.o: In function `php_iconv_string':
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:441:
 undefine
 d reference to `libiconv_open'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:453:
 undefine
 d reference to `libiconv'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:467:
 undefine
 d reference to `libiconv'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:478:
 undefine
 d reference to `libiconv_close'
 ext/iconv/.libs/iconv.o: In function `_php_iconv_strpos':
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:851:
 undefine
 d reference to `libiconv_open'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:879:
 undefine
 d reference to `libiconv'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:993:
 undefine
 d reference to `libiconv_close'
 ext/iconv/.libs/iconv.o: In function `_php_iconv_appendl':
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:348:
 undefine
 d reference to `libiconv'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:385:
 undefine
 d reference to `libiconv'
 ext/iconv/.libs/iconv.o: In function `_php_iconv_substr':
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:723:
 undefine
 d reference to `libiconv_open'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:747:
 undefine
 d reference to `libiconv'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:802:
 undefine
 d reference to `libiconv_close'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:806:
 undefine
 d reference to `libiconv_close'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:755:
 undefine
 d reference to `libiconv_open'
 ext/iconv/.libs/iconv.o: In function `_php_iconv_mime_decode':
 /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:1354:
 undefin
 ed reference to `libiconv_open'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:1465:
 undefin
 ed reference to `libiconv_close'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:1468:
 undefin
 ed reference to `libiconv_open'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:1823:
 undefin
 ed reference to `libiconv_close'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:1826:
 undefin
 ed reference to `libiconv_close'
 ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_dtor':
 /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:2465:
 undefin
 ed reference to `libiconv_close'
 ext/iconv/.libs/iconv.o: In function `_php_iconv_mime_encode':
 /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:1043:
 undefin
 ed reference to `libiconv_open'
 /home/data/pkgs_docs/unix-pkgs/web/php/php-
 

RE: [PHP] determine file-upload's tmp-filename

2008-01-27 Thread Andrés Robinet
 -Original Message-
 From: Michael Fischer [mailto:[EMAIL PROTECTED]
 Sent: Sunday, January 27, 2008 4:03 AM
 To: php-general@lists.php.net
 Subject: Re: [PHP] determine file-upload's tmp-filename
 
 
  Original-Nachricht 
  Datum: Sat, 26 Jan 2008 16:09:58 -0800
  Von: Casey [EMAIL PROTECTED]
  An: Michael Fischer [EMAIL PROTECTED]
  CC: php-general@lists.php.net
  Betreff: Re: [PHP] determine file-upload\'s tmp-filename
 
  On Jan 26, 2008 3:57 PM, Michael Fischer [EMAIL PROTECTED]
 wrote:
   hi there,
  
   is there a way to determine the tmp-filename of a file upload while
 the
  upload is still in progress?
  
   the tmp-file is stored in /tmp and it's name is something like
  PHP.
  
   what i would like to do is:
   i want to upload a file via a html-form and while the upload is in
  progress make repeatedly ajax-requests to a php-script on the server
 that
  replies the size of the tmp file (the amount of data that was already
 uploaded).
  So in this script i need to know what the tmp-filename is.
  
   or do you think this is a completely useless approach?
  
   lg, Michi
  
 
 
  Will this help?
  http://tomas.epineer.se/archives/3
 
  --
  -Casey
 
 well, i've found this before and this script uses perl-cgi and not php.
 it determines the tmp-filename as such:
 
 $post_data_file = $tmp_dir/$sessionid._postdata;
 $monitor_file = $tmp_dir/$sessionid._flength;
 $error_file = $tmp_dir/$sessionid._err;
 $signal_file = $tmp_dir/$sessionid._signal;
 $qstring_file = $tmp_dir/$sessionid._qstring;
 
 i'm looking for something similar in php...
 
 lg, michi
 

If all you want is to display a progress bar, you'd better move all of your
logic to the client side. Check this out
http://www.swfupload.org/documentation/demonstration

Regards,

Rob


Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308
| TEL 954-607-4207 | FAX 954-337-2695 | 
Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE:
bestplace |  Web: bestplace.biz  | Web: seo-diy.com

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.11/1244 - Release Date: 1/25/2008
7:44 PM
 

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



RE: [PHP] php installation problem

2008-01-27 Thread Andrés Robinet
 -Original Message-
 From: Andrés Robinet [mailto:[EMAIL PROTECTED]
 Sent: Sunday, January 27, 2008 11:03 AM
 To: php-general@lists.php.net
 Subject: RE: [PHP] php installation problem
 
  -Original Message-
  From: Umar [mailto:[EMAIL PROTECTED]
  Sent: Sunday, January 27, 2008 3:55 AM
  To: php-general@lists.php.net
  Subject: [PHP] php installation problem
 
 
  Dear Members!
 
  I have installed php-5.2.5 on slackware 12.0 with these option
  successfully
 
  ./configure --prefix=/usr/local/php --with-
  apxs=/usr/local/apache/bin/apxs
  --with-config-file-path=/usr/local/apache/conf --with-pcre-regex
  --with-layout=GNU --enable-sysvshm --enable-shmop --enable-sysvmsg
  --enable-sysvsem --enable-exif --enable-ftp --enable-safe-mode
  --enable-bcmath --disable-debug --enable-sockets --enable-force-cgi-
  redirect
  --with-gettext --with-zlib --with-gd --enable-gd-native-ttf --
 disable-
  rpath
  --enable-mbregex --with-bz2 --with-mime-magic --enable-calendar
  --enable-inline-optimization --enable-magic-quotes --enable-
 wddx=shared
  --with-ncurses=shared --with-xmlrpc --with-regex=system --with-pear
  --with-curl --with-gmp --with-png-dir=/usr/local --enable-mbstring
  --with-jpeg-dir=/usr/local --with-pic --with-mm=/usr/local
  --with-libexpat-dir=/usr/local --with-xsl=/usr/local --with-mcrypt
  --with-mhash --with-ldap=/usr/local/ldap
 
  Now I am trying to install php-5.2.5 on another slackware 12.0 with
  same
  options but i got error on make
 
  ext/gd/libgd/.libs/gdkanji.o: In function `do_convert':
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
  5.2.5/ext/gd/libgd/gdkanji.c:350:
  und
  efined reference to `libiconv_open'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
  5.2.5/ext/gd/libgd/gdkanji.c:365:
  und
  efined reference to `libiconv'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
  5.2.5/ext/gd/libgd/gdkanji.c:381:
  und
  efined reference to `libiconv_close'
  ext/iconv/.libs/iconv.o: In function `_php_iconv_strlen':
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:603:
  undefine
  d reference to `libiconv_open'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:626:
  undefine
  d reference to `libiconv'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:660:
  undefine
  d reference to `libiconv_close'
  ext/iconv/.libs/iconv.o: In function `php_iconv_string':
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:441:
  undefine
  d reference to `libiconv_open'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:453:
  undefine
  d reference to `libiconv'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:467:
  undefine
  d reference to `libiconv'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:478:
  undefine
  d reference to `libiconv_close'
  ext/iconv/.libs/iconv.o: In function `_php_iconv_strpos':
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:851:
  undefine
  d reference to `libiconv_open'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:879:
  undefine
  d reference to `libiconv'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:993:
  undefine
  d reference to `libiconv_close'
  ext/iconv/.libs/iconv.o: In function `_php_iconv_appendl':
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:348:
  undefine
  d reference to `libiconv'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:385:
  undefine
  d reference to `libiconv'
  ext/iconv/.libs/iconv.o: In function `_php_iconv_substr':
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:723:
  undefine
  d reference to `libiconv_open'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:747:
  undefine
  d reference to `libiconv'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:802:
  undefine
  d reference to `libiconv_close'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:806:
  undefine
  d reference to `libiconv_close'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:755:
  undefine
  d reference to `libiconv_open'
  ext/iconv/.libs/iconv.o: In function `_php_iconv_mime_decode':
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
  5.2.5/ext/iconv/iconv.c:1354:
  undefin
  ed reference to `libiconv_open'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
  5.2.5/ext/iconv/iconv.c:1465:
  undefin
  ed reference to `libiconv_close'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
  5.2.5/ext/iconv/iconv.c:1468:
  undefin
  ed reference to `libiconv_open'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
  5.2.5/ext/iconv/iconv.c:1823:
  undefin
  ed reference to `libiconv_close'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
  5.2.5/ext/iconv/iconv.c:1826:
  undefin
  ed reference to `libiconv_close'
  ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_dtor':
  

RE: [PHP] determine file-upload's tmp-filename

2008-01-27 Thread Michael Fischer
On Sun, 2008-01-27 at 11:12 -0500, Andrés Robinet wrote:
  -Original Message-
  From: Michael Fischer [mailto:[EMAIL PROTECTED]
  Sent: Sunday, January 27, 2008 4:03 AM
  To: php-general@lists.php.net
  Subject: Re: [PHP] determine file-upload's tmp-filename
  
  
   Original-Nachricht 
   Datum: Sat, 26 Jan 2008 16:09:58 -0800
   Von: Casey [EMAIL PROTECTED]
   An: Michael Fischer [EMAIL PROTECTED]
   CC: php-general@lists.php.net
   Betreff: Re: [PHP] determine file-upload\'s tmp-filename
  
   On Jan 26, 2008 3:57 PM, Michael Fischer [EMAIL PROTECTED]
  wrote:
hi there,
   
is there a way to determine the tmp-filename of a file upload while
  the
   upload is still in progress?
   
the tmp-file is stored in /tmp and it's name is something like
   PHP.
   
what i would like to do is:
i want to upload a file via a html-form and while the upload is in
   progress make repeatedly ajax-requests to a php-script on the server
  that
   replies the size of the tmp file (the amount of data that was already
  uploaded).
   So in this script i need to know what the tmp-filename is.
   
or do you think this is a completely useless approach?
   
lg, Michi
   
  
  
   Will this help?
   http://tomas.epineer.se/archives/3
  
   --
   -Casey
  
  well, i've found this before and this script uses perl-cgi and not php.
  it determines the tmp-filename as such:
  
  $post_data_file = $tmp_dir/$sessionid._postdata;
  $monitor_file = $tmp_dir/$sessionid._flength;
  $error_file = $tmp_dir/$sessionid._err;
  $signal_file = $tmp_dir/$sessionid._signal;
  $qstring_file = $tmp_dir/$sessionid._qstring;
  
  i'm looking for something similar in php...
  
  lg, michi
  
 
 If all you want is to display a progress bar, you'd better move all of your
 logic to the client side. Check this out
 http://www.swfupload.org/documentation/demonstration
 
 Regards,
 
 Rob
 
 
 Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 
 5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308
 | TEL 954-607-4207 | FAX 954-337-2695 | 
 Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE:
 bestplace |  Web: bestplace.biz  | Web: seo-diy.com
 
 No virus found in this outgoing message.
 Checked by AVG Free Edition. 
 Version: 7.5.516 / Virus Database: 269.19.11/1244 - Release Date: 1/25/2008
 7:44 PM
  
 
You are right, the client side would be the best solution.
BUT - this requires the client to either have flash or java browser
plugin installed. i don't want that.
and i don't know any way in javascript to get the amount of data already
sent - so i thought i'd try on the server-side.

lg, Michi
-- 
Sautergasse 27-29/35
1160 Wien
phone: 0043 650 2526276
email: [EMAIL PROTECTED]
web: http://www.webfischer.at

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



[PHP] htmlentities() does not remove escape

2008-01-27 Thread jekillen

Hello:
I have a form that has a textarea and I do not want to
disallow the use of single quote as apostrophe, or
for any other normal stylization. So I am using html
entities to change these characters into html entities.
But the function does not remove the escapes added
by the browser when sending the input.
Is there a special function in php for removing the \ escapes
as well?
My plan b would be to look for a similar function in javascript
and convert to html entities before the input is sent to the
server.
I want to screen for damaging code but do not want to
prevent legitimate use of punctuation. If the input in the
text field is then displayed as html (which it will be) I do
not want things like 'It\'s a nice day' showing up in the
html.
Thanks in advance;
Jeff k

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



Re: [PHP] Foreach

2008-01-27 Thread Nathan Nobbe
On Jan 23, 2008 8:02 AM, Eric Butera [EMAIL PROTECTED] wrote:

 Maybe someday SPL will become part of the PHP manual too. ;)


ill admit, the doxygen documentation is a little daunting at first.  at
least
more so than phpDocumentor for example.  but once youve cruised around
the spl docs for a little while, you can see its truly amazing.  marcus has
done a superb job with it!
and, ive made a discovery.  im sure this is novice level, for people who
actually
have a clue what they are doing w/ spl, which unfortunately seems like next
to
no one.   well, im getting to know it; anyway, i digress.
DualIterator is not 'in' php, because well, its not written in c.  marcus
has distributed
several classes and procedural files along with the c code to round out the
spl
extension.  the example code is included in the php source, so in order to
use it
youll have to download the source and unpack it.  you will find the example
code
beneath
ext/spl/examples
in particular, the DualIterator class is in the
dualiterator.inc
file.  and now, for my last trick, an example of the DualIterator, to
illustrate how simple
it is, (and incidentally less error prone than rolling your own, since its
been tested).

?php
require('dualiterator.inc');

 $leftSideArray = array('one' = 1, 'two' = 2, 'three' = 3, 'four' = 4);
 $rightSideArray = array('one' = 'a', 'two' = 'b', 'three' = 'c', 'four'
= 'd');

 $di = new DualIterator(new ArrayIterator($leftSideArray), new
ArrayIterator($rightSideArray));

while($di-valid()) {
var_dump($di-key());
var_dump($di-current());
$di-next();
}
?

to test whether the arrays have the same number of keys and values; in this
example all we
would have to do is:
$di-areEqual();

-nathan


Re: [PHP] htmlentities() does not remove escape

2008-01-27 Thread Nathan Nobbe
On Jan 27, 2008 1:27 PM, jekillen [EMAIL PROTECTED] wrote:

 Hello:
 I have a form that has a textarea and I do not want to
 disallow the use of single quote as apostrophe, or
 for any other normal stylization. So I am using html
 entities to change these characters into html entities.
 But the function does not remove the escapes added
 by the browser when sending the input.
 Is there a special function in php for removing the \ escapes
 as well?


stripslashes()

-nathan


Re: [PHP] htmlentities() does not remove escape

2008-01-27 Thread Robert Cummings

On Sun, 2008-01-27 at 10:27 -0800, jekillen wrote:
 Hello:
 I have a form that has a textarea and I do not want to
 disallow the use of single quote as apostrophe, or
 for any other normal stylization. So I am using html
 entities to change these characters into html entities.
 But the function does not remove the escapes added
 by the browser when sending the input.
 Is there a special function in php for removing the \ escapes
 as well?
 My plan b would be to look for a similar function in javascript
 and convert to html entities before the input is sent to the
 server.
 I want to screen for damaging code but do not want to
 prevent legitimate use of punctuation. If the input in the
 text field is then displayed as html (which it will be) I do
 not want things like 'It\'s a nice day' showing up in the
 html.

Browser doesn't escape those quotes. You're PHP configuration has magic
quotes enabled. See strip_slashes() if you must strip them. The
preferable solution is to get rid of the magic quotes dependency but
that's a longer topic and there's plenty on the net for you to read.

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] Re: Posting Summary for Week Ending 18 January,2008:php-general@lists.php.net

2008-01-27 Thread Nisse Engström
On Mon, 21 Jan 2008 00:14:34 +, David Powers wrote:

 A Google check on my email address shows that, with one exception, it 
 has been released into the public domain solely through archives and 
 mirrors of this list. The exception is a private group, whose 
 administrator I have alerted to avoid the leaking of other people's 
 addresses.

   Google also found (for me) an XLS file, containing
your email address and what appears to be your home
address and phone number. The file itself is gone but
Google has an HTML version of it, if you know where to
find it. One more google comes up with a nice picture
of your house in the first result.

   Interesting what you can find these days.


/Nisse

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



Re: [PHP] htmlentities() does not remove escape

2008-01-27 Thread jekillen


On Jan 27, 2008, at 10:37 AM, Nathan Nobbe wrote:


On Jan 27, 2008 1:27 PM, jekillen [EMAIL PROTECTED] wrote:


I have a form that has a textarea and I do not want to
disallow the use of single quote as apostrophe, or
for any other normal stylization. So I am using html
entities to change these characters into html entities.
 But the function does not remove the escapes added
by the browser when sending the input.
Is there a special function in php for removing the \ escapes
as well?

stripslashes()

-nathan


Thanks, of course. Sometimes the brain just does not kick over
the way it should.
Jeff K




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



Re: [PHP] Foreach

2008-01-27 Thread Eric Butera
On Jan 27, 2008 1:33 PM, Nathan Nobbe [EMAIL PROTECTED] wrote:
 On Jan 23, 2008 8:02 AM, Eric Butera [EMAIL PROTECTED] wrote:

  Maybe someday SPL will become part of the PHP manual too. ;)
 

 ill admit, the doxygen documentation is a little daunting at first.  at
 least
 more so than phpDocumentor for example.  but once youve cruised around
  the spl docs for a little while, you can see its truly amazing.  marcus has
 done a superb job with it!
 and, ive made a discovery.  im sure this is novice level, for people who
 actually
 have a clue what they are doing w/ spl, which unfortunately seems like next
 to
  no one.   well, im getting to know it; anyway, i digress.
 DualIterator is not 'in' php, because well, its not written in c.  marcus
 has distributed
 several classes and procedural files along with the c code to round out the
 spl
  extension.  the example code is included in the php source, so in order to
 use it
 youll have to download the source and unpack it.  you will find the example
 code
 beneath
 ext/spl/examples
  in particular, the DualIterator class is in the
 dualiterator.inc
 file.  and now, for my last trick, an example of the DualIterator, to
 illustrate how simple
 it is, (and incidentally less error prone than rolling your own, since its
 been tested).

 ?php
 require('dualiterator.inc');

  $leftSideArray = array('one' = 1, 'two' = 2, 'three' = 3, 'four' = 4);
  $rightSideArray = array('one' = 'a', 'two' = 'b', 'three' = 'c', 'four'
 = 'd');

  $di = new DualIterator(new ArrayIterator($leftSideArray), new
 ArrayIterator($rightSideArray));

 while($di-valid()) {
 var_dump($di-key());
 var_dump($di-current());
 $di-next();
  }
 ?

 to test whether the arrays have the same number of keys and values; in this
 example all we
 would have to do is:
 $di-areEqual();

 -nathan


I was just pointing out how fragmented PHP5+ is.  Look at the docs on
SPL and the DOM stuff, it's horrible.

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



Re: [PHP] Foreach

2008-01-27 Thread Nathan Nobbe
On Jan 27, 2008 7:24 PM, Eric Butera [EMAIL PROTECTED] wrote:

 I was just pointing out how fragmented PHP5+ is.  Look at the docs on
 SPL and the DOM stuff, it's horrible.


i hear you, and i agree, most of the php docs are good, but some of the
oop stuff is kinda weak, like SoapClient, and DateTime for example.  In
this regard i think the SPL docs are pretty kick-ass.  although isolated,
they are in themselves quite robust and complete.
but really, after saying DualIterator would be perfect for this case, i had
to post an example ;)

-nathan


[PHP] How to prevent direct access..

2008-01-27 Thread Chuck
I have a php file that produces an image and is only referred to from
an img tag like so:

img src=getRandImage.php

I want to prevent anyone from directly accessing the getRandImage.php
file. The file has to be world readable or the image will not display.
I played around with testing $_SERVER['HTTP_REFERER'] using regular
expressions but the above image tag appears in the default splash page
and there is no http referer set when they first visit the site. (also
ran into some IE quirkiness as well) I played around with putting
getRandImage.php into a subdirectory that is only viewable by the user
the web server is running as and the image also would not appear. I
couldn't figure out a way to embed this into a function that could be
hidden in a non-world readable subdirectory -- which would be my
preferred approach. (Is there a way to call a php function that
returns an image from within an img tag, instead of calling a php
file?)

I can easily check http request type but the img tag is doing a GET
request which is also what request type is used if they try and
directly access the URL.

I'm sure its something simple I am overlooking. Maybe another $_SERVER
variable or something I can work with.

fyi: running php 5.2.5 and apache 2.2.

Thanks for any help..
/CC

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



[PHP] Re: How to prevent direct access..

2008-01-27 Thread Nathan Rixham

Chuck wrote:

I have a php file that produces an image and is only referred to from
an img tag like so:

img src=getRandImage.php

I want to prevent anyone from directly accessing the getRandImage.php
file. The file has to be world readable or the image will not display.
I played around with testing $_SERVER['HTTP_REFERER'] using regular
expressions but the above image tag appears in the default splash page
and there is no http referer set when they first visit the site. (also
ran into some IE quirkiness as well) I played around with putting
getRandImage.php into a subdirectory that is only viewable by the user
the web server is running as and the image also would not appear. I
couldn't figure out a way to embed this into a function that could be
hidden in a non-world readable subdirectory -- which would be my
preferred approach. (Is there a way to call a php function that
returns an image from within an img tag, instead of calling a php
file?)

I can easily check http request type but the img tag is doing a GET
request which is also what request type is used if they try and
directly access the URL.

I'm sure its something simple I am overlooking. Maybe another $_SERVER
variable or something I can work with.

fyi: running php 5.2.5 and apache 2.2.

Thanks for any help..
/CC


Pass the session_id in the url..
img src=getRandImage.php?img=SESSION_ID_HERE /

then in the php
?php
if(isset($_GET['img'])  $_GET['img'] == session_id()) {
#code to show image
}
?

you can ultra harden it by putting a destroy session code in that block 
aswell, meaning they can only single access the file.


alternatively (and a bit harder on the machine)
have the index.php script create a php on the fly based on session_id or 
something ie: 3h238bc98da9e0a880237d7c8ef09.php
and have that script echo out the image and delete itself once the image 
has been sent to the buffer (ob_* and flush())


:)

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



[PHP] interface inheritance

2008-01-27 Thread Nathan Nobbe
all,

previously, on this list and elsewhere, i have raised the topic of
interface inheritance, lamenting that php is void of the feature.
to my utter amazement i discovered that php does in fact support
interface inheritance, reading through some of Marcus Boergers'
code in SPL..  i noticed RecursiveIterator extends Iterator, which
is an internal interface (part of the zend engine), so i thought to
myself, perhaps only internal interfaces can be extended, but
then a quick test proved my suspicions wrong.  in fact, interfaces
can even extend multiple parent interfaces, just like java (*ducks*).
here is the sample code so you can see for yourself:

?php
interface Somethingable {
public function doSomething();
}

interface Crazyfiable {
public function getCrazy();
}

interface Extendable extends Somethingable, Crazyfiable {
public function extend();
}

class SuperClass implements Extendable {
public function doSomething() {
echo 'i did something ..' . PHP_EOL;
}

public function extend() {
echo 'i extended something..' . PHP_EOL;
}

public function getCrazy() {
echo 'im a crazy bastard now!' . PHP_EOL;
}
}

/*
 * TEST HERE
 */
 $sc = new SuperClass();
 $sc-doSomething();
 $sc-extend();
 $sc-getCrazy();
?

and the output:
[EMAIL PROTECTED] /usr/share/php5/splExperiment/tests $ php
testInterfaceInheritence.php
i did something ..
i extended something..
im a crazy bastard now!

i for one am quite excited.  heres to happy adventures in oop-land w/ php!

-nathan


[PHP] i enconter a question when use Zend Framework's _foward function

2008-01-27 Thread little btx
in the function init()  ,i want to use the function _foward but it doesn't
work. how to deal the problem


Re: [PHP] i enconter a question when use Zend Framework's _foward function

2008-01-27 Thread Nathan Nobbe
On Jan 27, 2008 9:53 PM, little btx [EMAIL PROTECTED] wrote:

 in the function init()  ,i want to use the function _foward but it doesn't
 work. how to deal the problem



i think youll have to be more specific, can you
supply some code that illustrates the problem ?

-nathan


Re: [PHP] i enconter a question when use Zend Framework's _foward function

2008-01-27 Thread Nathan Nobbe
On Jan 27, 2008 10:01 PM, little btx [EMAIL PROTECTED] wrote:

 public function init()
 try{
 $this-subject = new subject($subject_id);
 }catch (Zend_Exception $e)
 {

 $this-_forward('index','error',null,array('error'=$e-getMessage());
 }
 }
 when it catch the Zend_Exception ,the function _forward doesn't work



please keep posts on list for the benefit of others.
what is the precise error you receive when _forward() is called?
also, what is the context of this code you have posted?  are you extending
a class from the zend framework?

-nathan


RE: [PHP] php installation problem

2008-01-27 Thread Umar

Hi Andres!

Thanks for your reply.. That is intresting there is no libiconv or icon
installed on my First Slackware machine where I have successfully installed
php.

But there is a libiconv installed on second Slackware machine.

Regards,

Umar Draz


Andrés Robinet wrote:
 
 -Original Message-
 From: Andrés Robinet [mailto:[EMAIL PROTECTED]
 Sent: Sunday, January 27, 2008 11:03 AM
 To: php-general@lists.php.net
 Subject: RE: [PHP] php installation problem
 
  -Original Message-
  From: Umar [mailto:[EMAIL PROTECTED]
  Sent: Sunday, January 27, 2008 3:55 AM
  To: php-general@lists.php.net
  Subject: [PHP] php installation problem
 
 
  Dear Members!
 
  I have installed php-5.2.5 on slackware 12.0 with these option
  successfully
 
  ./configure --prefix=/usr/local/php --with-
  apxs=/usr/local/apache/bin/apxs
  --with-config-file-path=/usr/local/apache/conf --with-pcre-regex
  --with-layout=GNU --enable-sysvshm --enable-shmop --enable-sysvmsg
  --enable-sysvsem --enable-exif --enable-ftp --enable-safe-mode
  --enable-bcmath --disable-debug --enable-sockets --enable-force-cgi-
  redirect
  --with-gettext --with-zlib --with-gd --enable-gd-native-ttf --
 disable-
  rpath
  --enable-mbregex --with-bz2 --with-mime-magic --enable-calendar
  --enable-inline-optimization --enable-magic-quotes --enable-
 wddx=shared
  --with-ncurses=shared --with-xmlrpc --with-regex=system --with-pear
  --with-curl --with-gmp --with-png-dir=/usr/local --enable-mbstring
  --with-jpeg-dir=/usr/local --with-pic --with-mm=/usr/local
  --with-libexpat-dir=/usr/local --with-xsl=/usr/local --with-mcrypt
  --with-mhash --with-ldap=/usr/local/ldap
 
  Now I am trying to install php-5.2.5 on another slackware 12.0 with
  same
  options but i got error on make
 
  ext/gd/libgd/.libs/gdkanji.o: In function `do_convert':
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
  5.2.5/ext/gd/libgd/gdkanji.c:350:
  und
  efined reference to `libiconv_open'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
  5.2.5/ext/gd/libgd/gdkanji.c:365:
  und
  efined reference to `libiconv'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
  5.2.5/ext/gd/libgd/gdkanji.c:381:
  und
  efined reference to `libiconv_close'
  ext/iconv/.libs/iconv.o: In function `_php_iconv_strlen':
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:603:
  undefine
  d reference to `libiconv_open'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:626:
  undefine
  d reference to `libiconv'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:660:
  undefine
  d reference to `libiconv_close'
  ext/iconv/.libs/iconv.o: In function `php_iconv_string':
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:441:
  undefine
  d reference to `libiconv_open'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:453:
  undefine
  d reference to `libiconv'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:467:
  undefine
  d reference to `libiconv'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:478:
  undefine
  d reference to `libiconv_close'
  ext/iconv/.libs/iconv.o: In function `_php_iconv_strpos':
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:851:
  undefine
  d reference to `libiconv_open'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:879:
  undefine
  d reference to `libiconv'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:993:
  undefine
  d reference to `libiconv_close'
  ext/iconv/.libs/iconv.o: In function `_php_iconv_appendl':
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:348:
  undefine
  d reference to `libiconv'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:385:
  undefine
  d reference to `libiconv'
  ext/iconv/.libs/iconv.o: In function `_php_iconv_substr':
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:723:
  undefine
  d reference to `libiconv_open'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:747:
  undefine
  d reference to `libiconv'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:802:
  undefine
  d reference to `libiconv_close'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:806:
  undefine
  d reference to `libiconv_close'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
 5.2.5/ext/iconv/iconv.c:755:
  undefine
  d reference to `libiconv_open'
  ext/iconv/.libs/iconv.o: In function `_php_iconv_mime_decode':
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
  5.2.5/ext/iconv/iconv.c:1354:
  undefin
  ed reference to `libiconv_open'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
  5.2.5/ext/iconv/iconv.c:1465:
  undefin
  ed reference to `libiconv_close'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
  5.2.5/ext/iconv/iconv.c:1468:
  undefin
  ed reference to `libiconv_open'
  /home/data/pkgs_docs/unix-pkgs/web/php/php-
  

[PHP] Getting part of string matched with regular expressions

2008-01-27 Thread Teck

Hi,


I'm trying to find a way to get part of a string where the part is  
matched with regular expressions.


So, for example, if I have a string:

a2b3cd5ef6ghi7232jklmn

I need to grab 12b3cd5 using regular expressions and store the part  
in a variable.


$var = do_something(,,a2b3cd5ef6ghi7232jklmn);

I was using preg_replace for this, and try to delete (i.e., replace  
the non-matched part with an empty string) the second part, but I  
can't make it work.


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



Re: [PHP] Getting part of string matched with regular expressions

2008-01-27 Thread Paul Scott

On Mon, 2008-01-28 at 14:28 +0900, Teck wrote:
 I was using preg_replace for this, and try to delete (i.e., replace  
 the non-matched part with an empty string) the second part, but I  
 can't make it work.

Rather use preg_match_all() as that will produce an array of values,
with the first value being the original that you can then compare with.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm 

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