[PHP] who is connected?

2002-12-18 Thread fragmonster
Hello,
Can you share your method to display the users who are connected to your 
web site?

I did it, but I don't know if it's a good way.


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



[PHP] Creating Extensions DLL with Delphi

2002-12-18 Thread Andreas Steibl
Don't know if this is the right place to ask this.

I need to write a little extensions DLL in Delphi for PHP where can i find
inforamtion for this ?

thanxs in advance
snoopy


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




Re: [PHP] who is connected?

2002-12-18 Thread Jason Reid
How I do it for my sites is borrowing from the concept that phpBB uses...
every time a user accesses a page within the site, update the DB with the
username and a timestamp. then have the script that figures out who is on
delete any records older then a specified time, and return the users that
are left. it doesn't display everyone who is on in real time, but any one
who was on within a certain period (usually I stick with 5 minutes)

If any one else has any interesting/creative ways, I'd love to hear them
also.

Jason Reid
[EMAIL PROTECTED]
--
AC Host Canada
www.achost.ca

- Original Message -
From: fragmonster [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 18, 2002 1:05 AM
Subject: [PHP] who is connected?


 Hello,
 Can you share your method to display the users who are connected to your
 web site?

 I did it, but I don't know if it's a good way.


 --
 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] who is connected?

2002-12-18 Thread fragmonster
Ok, it's exactly the same way I'm using. I was wondering if it was 
another way to do the trick.

Jason Reid wrote:
How I do it for my sites is borrowing from the concept that phpBB uses...
every time a user accesses a page within the site, update the DB with the
username and a timestamp. then have the script that figures out who is on
delete any records older then a specified time, and return the users that
are left. it doesn't display everyone who is on in real time, but any one
who was on within a certain period (usually I stick with 5 minutes)

If any one else has any interesting/creative ways, I'd love to hear them
also.

Jason Reid
[EMAIL PROTECTED]
--
AC Host Canada
www.achost.ca

- Original Message -
From: fragmonster [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 18, 2002 1:05 AM
Subject: [PHP] who is connected?




Hello,
Can you share your method to display the users who are connected to your
web site?

I did it, but I don't know if it's a good way.


--
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




[PHP] flush output error

2002-12-18 Thread electroteque
hi guys i have a little problem with flushing the buffer output, in this
loop it should be downloading a file and changing the progress of a progress
bar, although it waits until the shell_exec of all the files are done and
then flushes the buffer which will start @ 95% , so it wont start until
shell_exec is finished , is this a bug ?

foreach ($filename as $file){
 shell_exec(curl -O .$url.$file);
 //shell_exec(wget .$url.$file);
 //echo $file;

$bar-progressbar_percentage($i,$filename,'NewWin','Percentage','Downloading
'.$file);
 $i++;
  }



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




[PHP] Compiling php-4.0.6 with MySQL support

2002-12-18 Thread Igor Shulgin
Hi!

I cannot compile php-4.0.6 with MySQL support as static module for apache_1.3.20 on 
FreeBSD 4.4.
Early I successfully build and install /usr/ports/databases/mysql323-server and 
/usr/ports/databases/mysql323-client with standard configuration.
I have done following without problems:

cd /usr/ports/www/apache13/work/apache_1.3.20
./configure
cd /usr/ports/www/mod_php4/work/php-4.0.6
rm config.cache
./configure --with-mysql= --with-apache=/usr/ports/www/apache13/work/apache_1.3.20 
--enable-track-vars
make
make install
cd /usr/ports/www/apache13/work/apache_1.3.20
./configure --prefix=/usr/local/www --activate-module=src/modules/php4/libphp4.a

But 

make

stops with following:

gcc  -funsigned-char -I/usr/ports/www/mod_php4/work/php-4.0.6 
-I/usr/ports/www/mod_php4/work/php-4.0.6/main 
-I/usr/ports/www/mod_php4/work/php-4.0.6/main 
-I/usr/ports/www/mod_php4/work/php-4.0.6/Zend 
-I/usr/ports/www/mod_php4/work/php-4.0.6/Zend 
-I/usr/ports/www/mod_php4/work/php-4.0.6/TSRM 
-I/usr/ports/www/mod_php4/work/php-4.0.6/TSRM -I/usr/ports/www/mod_php4/work/php-4.0.6 
-DUSE_EXPAT -I./lib/expat-lite -DNO_DL_NEEDED `./apaci` -o httpd buildmark.o 
modules.o  modules/standard/libstandard.a  modules/php4/libphp4.a  main/libmain.a  
./os/unix/libos.a  ap/libap.a  lib/expat-lite/libexpat.a  -rdynamic -Lmodules/php4 
-L../modules/php4 -L../../modules/php4 -lmodphp4  -lpam  -lcrypt -lm-lcrypt
modules/php4/libphp4.a(php_mysql.lo): In function `_free_mysql_result':
php_mysql.lo(.text+0x1c): undefined reference to `mysql_free_result'
modules/php4/libphp4.a(php_mysql.lo): In function `_close_mysql_link':
php_mysql.lo(.text+0x9d): undefined reference to `mysql_close'
modules/php4/libphp4.a(php_mysql.lo): In function `_close_mysql_plink':
php_mysql.lo(.text+0xf9): undefined reference to `mysql_close'
modules/php4/libphp4.a(php_mysql.lo): In function `php_info_mysql':
php_mysql.lo(.text+0x42f): undefined reference to `mysql_get_client_info'
modules/php4/libphp4.a(php_mysql.lo): In function `php_mysql_do_connect':
php_mysql.lo(.text+0xd0e): undefined reference to `mysql_init'
php_mysql.lo(.text+0xd2f): undefined reference to `mysql_real_connect'
php_mysql.lo(.text+0xd5c): undefined reference to `mysql_error'
php_mysql.lo(.text+0xd89): undefined reference to `mysql_errno'
php_mysql.lo(.text+0xe4f): undefined reference to `mysql_stat'
php_mysql.lo(.text+0xe8c): undefined reference to `mysql_real_connect'
php_mysql.lo(.text+0x105a): undefined reference to `mysql_init'
php_mysql.lo(.text+0x107b): undefined reference to `mysql_real_connect'
php_mysql.lo(.text+0x10ac): undefined reference to `mysql_error'
php_mysql.lo(.text+0x10d9): undefined reference to `mysql_errno'
php_mysql.lo(.text+0x10eb): undefined reference to `mysql_error'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_select_db':
php_mysql.lo(.text+0x1550): undefined reference to `mysql_select_db'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_get_client_info':
php_mysql.lo(.text+0x159d): undefined reference to `mysql_get_client_info'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_get_host_info':
php_mysql.lo(.text+0x168d): undefined reference to `mysql_get_host_info'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_get_proto_info':
php_mysql.lo(.text+0x1781): undefined reference to `mysql_get_proto_info'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_get_server_info':
php_mysql.lo(.text+0x184d): undefined reference to `mysql_get_server_info'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_create_db':
php_mysql.lo(.text+0x1a14): undefined reference to `mysql_create_db'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_drop_db':
php_mysql.lo(.text+0x1bcc): undefined reference to `mysql_drop_db'
modules/php4/libphp4.a(php_mysql.lo): In function `php_mysql_do_query_general':
php_mysql.lo(.text+0x1ce5): undefined reference to `mysql_select_db'
php_mysql.lo(.text+0x1d42): undefined reference to `mysql_eof'
php_mysql.lo(.text+0x1d6d): undefined reference to `mysql_fetch_row'
php_mysql.lo(.text+0x1e47): undefined reference to `mysql_real_query'
php_mysql.lo(.text+0x1e72): undefined reference to `mysql_use_result'
php_mysql.lo(.text+0x1e80): undefined reference to `mysql_store_result'
php_mysql.lo(.text+0x1e93): undefined reference to `mysql_field_count'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_list_dbs':
php_mysql.lo(.text+0x21a3): undefined reference to `mysql_list_dbs'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_list_tables':
php_mysql.lo(.text+0x2370): undefined reference to `mysql_select_db'
php_mysql.lo(.text+0x2385): undefined reference to `mysql_list_tables'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_list_fields':
php_mysql.lo(.text+0x2558): undefined reference to `mysql_select_db'
php_mysql.lo(.text+0x2622): undefined reference to `mysql_list_fields'

[PHP] Re: Compiling php-4.0.6 with MySQL support

2002-12-18 Thread electroteque
i tend not to use the internel mysql lib, install mysql into a prefix dir ie
/usr/local/etc/mysql

then do --with-mysql=/usr/local/etc/mysql

u only had --with-mysql= which will use the  internal lib.

Igor Shulgin [EMAIL PROTECTED] wrote in message
227601c2a67a$0e5fb750$e964a8c0@ptt">news:227601c2a67a$0e5fb750$e964a8c0@ptt...
Hi!

I cannot compile php-4.0.6 with MySQL support as static module for
apache_1.3.20 on FreeBSD 4.4.
Early I successfully build and install /usr/ports/databases/mysql323-server
and /usr/ports/databases/mysql323-client with standard configuration.
I have done following without problems:

cd /usr/ports/www/apache13/work/apache_1.3.20
./configure
cd /usr/ports/www/mod_php4/work/php-4.0.6
rm config.cache
./configure --with-mysql= --with-apache=/usr/ports/www/apache13/work/apache_
1.3.20 --enable-track-vars
make
make install
cd /usr/ports/www/apache13/work/apache_1.3.20
./configure --prefix=/usr/local/www --activate-module=src/modules/php4/libph
p4.a

But

make

stops with following:

gcc  -funsigned-char -I/usr/ports/www/mod_php4/work/php-4.0.6 -I/usr/ports/w
ww/mod_php4/work/php-4.0.6/main -I/usr/ports/www/mod_php4/work/php-4.0.6/mai
n -I/usr/ports/www/mod_php4/work/php-4.0.6/Zend -I/usr/ports/www/mod_php4/wo
rk/php-4.0.6/Zend -I/usr/ports/www/mod_php4/work/php-4.0.6/TSRM -I/usr/ports
/www/mod_php4/work/php-4.0.6/TSRM -I/usr/ports/www/mod_php4/work/php-4.0.6 -
DUSE_EXPAT -I./lib/expat-lite -DNO_DL_NEEDED `./apaci` -o httpd
buildmark.o modules.o  modules/standard/libstandard.a
modules/php4/libphp4.a  main/libmain.a  ./os/unix/libos.a  ap/libap.a
lib/expat-lite/libexpat.a  -rdynamic -Lmodules/php4 -L../modules/php4 -L../.
./modules/php4 -lmodphp4  -lpam  -lcrypt -lm-lcrypt
modules/php4/libphp4.a(php_mysql.lo): In function `_free_mysql_result':
php_mysql.lo(.text+0x1c): undefined reference to `mysql_free_result'
modules/php4/libphp4.a(php_mysql.lo): In function `_close_mysql_link':
php_mysql.lo(.text+0x9d): undefined reference to `mysql_close'
modules/php4/libphp4.a(php_mysql.lo): In function `_close_mysql_plink':
php_mysql.lo(.text+0xf9): undefined reference to `mysql_close'
modules/php4/libphp4.a(php_mysql.lo): In function `php_info_mysql':
php_mysql.lo(.text+0x42f): undefined reference to `mysql_get_client_info'
modules/php4/libphp4.a(php_mysql.lo): In function `php_mysql_do_connect':
php_mysql.lo(.text+0xd0e): undefined reference to `mysql_init'
php_mysql.lo(.text+0xd2f): undefined reference to `mysql_real_connect'
php_mysql.lo(.text+0xd5c): undefined reference to `mysql_error'
php_mysql.lo(.text+0xd89): undefined reference to `mysql_errno'
php_mysql.lo(.text+0xe4f): undefined reference to `mysql_stat'
php_mysql.lo(.text+0xe8c): undefined reference to `mysql_real_connect'
php_mysql.lo(.text+0x105a): undefined reference to `mysql_init'
php_mysql.lo(.text+0x107b): undefined reference to `mysql_real_connect'
php_mysql.lo(.text+0x10ac): undefined reference to `mysql_error'
php_mysql.lo(.text+0x10d9): undefined reference to `mysql_errno'
php_mysql.lo(.text+0x10eb): undefined reference to `mysql_error'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_select_db':
php_mysql.lo(.text+0x1550): undefined reference to `mysql_select_db'
modules/php4/libphp4.a(php_mysql.lo): In function
`php_if_mysql_get_client_info':
php_mysql.lo(.text+0x159d): undefined reference to `mysql_get_client_info'
modules/php4/libphp4.a(php_mysql.lo): In function
`php_if_mysql_get_host_info':
php_mysql.lo(.text+0x168d): undefined reference to `mysql_get_host_info'
modules/php4/libphp4.a(php_mysql.lo): In function
`php_if_mysql_get_proto_info':
php_mysql.lo(.text+0x1781): undefined reference to `mysql_get_proto_info'
modules/php4/libphp4.a(php_mysql.lo): In function
`php_if_mysql_get_server_info':
php_mysql.lo(.text+0x184d): undefined reference to `mysql_get_server_info'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_create_db':
php_mysql.lo(.text+0x1a14): undefined reference to `mysql_create_db'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_drop_db':
php_mysql.lo(.text+0x1bcc): undefined reference to `mysql_drop_db'
modules/php4/libphp4.a(php_mysql.lo): In function
`php_mysql_do_query_general':
php_mysql.lo(.text+0x1ce5): undefined reference to `mysql_select_db'
php_mysql.lo(.text+0x1d42): undefined reference to `mysql_eof'
php_mysql.lo(.text+0x1d6d): undefined reference to `mysql_fetch_row'
php_mysql.lo(.text+0x1e47): undefined reference to `mysql_real_query'
php_mysql.lo(.text+0x1e72): undefined reference to `mysql_use_result'
php_mysql.lo(.text+0x1e80): undefined reference to `mysql_store_result'
php_mysql.lo(.text+0x1e93): undefined reference to `mysql_field_count'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_list_dbs':
php_mysql.lo(.text+0x21a3): undefined reference to `mysql_list_dbs'
modules/php4/libphp4.a(php_mysql.lo): In function
`php_if_mysql_list_tables':
php_mysql.lo(.text+0x2370): undefined reference to `mysql_select_db'

Re: [PHP] flush output error

2002-12-18 Thread Wico de Leeuw
At 20:41 18-12-02 +1100, you wrote:

hi guys i have a little problem with flushing the buffer output, in this
loop it should be downloading a file and changing the progress of a progress
bar, although it waits until the shell_exec of all the files are done and
then flushes the buffer which will start @ 95% , so it wont start until
shell_exec is finished , is this a bug ?


php can't multitask, so it's not a bug
what you can try:

page1: (start process)
put an ignore_user_abort on it
put a header location on it to page2
start the command and let it write to a file where it is

page 2 :
read the file and display a processbar
(with javascript or meta refresh)
when done goto page3

page3:
continue




foreach ($filename as $file){
 shell_exec(curl -O .$url.$file);
 //shell_exec(wget .$url.$file);
 //echo $file;

$bar-progressbar_percentage($i,$filename,'NewWin','Percentage','Downloading
'.$file);
 $i++;
  }



--
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] Compiling php-4.0.6 with MySQL support

2002-12-18 Thread Wico de Leeuw
At 14:44 18-12-02 +0500, Igor Shulgin wrote:

Hi!

I cannot compile php-4.0.6 with MySQL support as static module for 
apache_1.3.20 on FreeBSD 4.4.
Early I successfully build and install 
/usr/ports/databases/mysql323-server and 
/usr/ports/databases/mysql323-client with standard configuration.
I have done following without problems:

cd /usr/ports/www/apache13/work/apache_1.3.20
./configure
cd /usr/ports/www/mod_php4/work/php-4.0.6
rm config.cache
./configure --with-mysql= 
--with-apache=/usr/ports/www/apache13/work/apache_1.3.20 --enable-track-vars

shouldn;t it be
./configure --with-mysql 
--with-apache=/usr/ports/www/apache13/work/apache_1.3.20 --enable-track-vars
(so without the =)

Gr,

Wico


make
make install
cd /usr/ports/www/apache13/work/apache_1.3.20
./configure --prefix=/usr/local/www 
--activate-module=src/modules/php4/libphp4.a

But

make

stops with following:

gcc  -funsigned-char -I/usr/ports/www/mod_php4/work/php-4.0.6 
-I/usr/ports/www/mod_php4/work/php-4.0.6/main 
-I/usr/ports/www/mod_php4/work/php-4.0.6/main 
-I/usr/ports/www/mod_php4/work/php-4.0.6/Zend 
-I/usr/ports/www/mod_php4/work/php-4.0.6/Zend 
-I/usr/ports/www/mod_php4/work/php-4.0.6/TSRM 
-I/usr/ports/www/mod_php4/work/php-4.0.6/TSRM 
-I/usr/ports/www/mod_php4/work/php-4.0.6 -DUSE_EXPAT -I./lib/expat-lite 
-DNO_DL_NEEDED `./apaci` -o httpd buildmark.o 
modules.o  modules/standard/libstandard.a  modules/php4/libphp4.a 
main/libmain.a  ./os/unix/libos.a  ap/libap.a  lib/expat-lite/libexpat.a 
-rdynamic -Lmodules/php4 -L../modules/php4 -L../../modules/php4 
-lmodphp4  -lpam  -lcrypt -lm-lcrypt
modules/php4/libphp4.a(php_mysql.lo): In function `_free_mysql_result':
php_mysql.lo(.text+0x1c): undefined reference to `mysql_free_result'
modules/php4/libphp4.a(php_mysql.lo): In function `_close_mysql_link':
php_mysql.lo(.text+0x9d): undefined reference to `mysql_close'
modules/php4/libphp4.a(php_mysql.lo): In function `_close_mysql_plink':
php_mysql.lo(.text+0xf9): undefined reference to `mysql_close'
modules/php4/libphp4.a(php_mysql.lo): In function `php_info_mysql':
php_mysql.lo(.text+0x42f): undefined reference to `mysql_get_client_info'
modules/php4/libphp4.a(php_mysql.lo): In function `php_mysql_do_connect':
php_mysql.lo(.text+0xd0e): undefined reference to `mysql_init'
php_mysql.lo(.text+0xd2f): undefined reference to `mysql_real_connect'
php_mysql.lo(.text+0xd5c): undefined reference to `mysql_error'
php_mysql.lo(.text+0xd89): undefined reference to `mysql_errno'
php_mysql.lo(.text+0xe4f): undefined reference to `mysql_stat'
php_mysql.lo(.text+0xe8c): undefined reference to `mysql_real_connect'
php_mysql.lo(.text+0x105a): undefined reference to `mysql_init'
php_mysql.lo(.text+0x107b): undefined reference to `mysql_real_connect'
php_mysql.lo(.text+0x10ac): undefined reference to `mysql_error'
php_mysql.lo(.text+0x10d9): undefined reference to `mysql_errno'
php_mysql.lo(.text+0x10eb): undefined reference to `mysql_error'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_select_db':
php_mysql.lo(.text+0x1550): undefined reference to `mysql_select_db'
modules/php4/libphp4.a(php_mysql.lo): In function 
`php_if_mysql_get_client_info':
php_mysql.lo(.text+0x159d): undefined reference to `mysql_get_client_info'
modules/php4/libphp4.a(php_mysql.lo): In function 
`php_if_mysql_get_host_info':
php_mysql.lo(.text+0x168d): undefined reference to `mysql_get_host_info'
modules/php4/libphp4.a(php_mysql.lo): In function 
`php_if_mysql_get_proto_info':
php_mysql.lo(.text+0x1781): undefined reference to `mysql_get_proto_info'
modules/php4/libphp4.a(php_mysql.lo): In function 
`php_if_mysql_get_server_info':
php_mysql.lo(.text+0x184d): undefined reference to `mysql_get_server_info'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_create_db':
php_mysql.lo(.text+0x1a14): undefined reference to `mysql_create_db'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_drop_db':
php_mysql.lo(.text+0x1bcc): undefined reference to `mysql_drop_db'
modules/php4/libphp4.a(php_mysql.lo): In function 
`php_mysql_do_query_general':
php_mysql.lo(.text+0x1ce5): undefined reference to `mysql_select_db'
php_mysql.lo(.text+0x1d42): undefined reference to `mysql_eof'
php_mysql.lo(.text+0x1d6d): undefined reference to `mysql_fetch_row'
php_mysql.lo(.text+0x1e47): undefined reference to `mysql_real_query'
php_mysql.lo(.text+0x1e72): undefined reference to `mysql_use_result'
php_mysql.lo(.text+0x1e80): undefined reference to `mysql_store_result'
php_mysql.lo(.text+0x1e93): undefined reference to `mysql_field_count'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_list_dbs':
php_mysql.lo(.text+0x21a3): undefined reference to `mysql_list_dbs'
modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_list_tables':
php_mysql.lo(.text+0x2370): undefined reference to `mysql_select_db'
php_mysql.lo(.text+0x2385): undefined reference to `mysql_list_tables'
modules/php4/libphp4.a(php_mysql.lo): In function 

[PHP] Re: mysql_num_rows

2002-12-18 Thread liljim
Hi John,

John Taylor-Johnston  wrote in message:
 I use $mycounter, not saying it is pretty. But if you have a whole bunch
of stuff deleted, your last id might be worth a lot more than the actual
number of rows.

 $myconnection = mysql_connect($server,$user,$pass);
 mysql_select_db($db,$myconnection);

 $news = mysql_query('select * from '.$table.' where '.$where.' order by id
asc');
  $mycounter = 0;
  while ($mydata = mysql_fetch_object($news))
  {
   $mycounter++;
  }

Have you ever considered just doing a count()?

$count = @mysql_query(select count(*) from [table(s)] where [criteria
[group by something]]);
$total = mysql_result($count, 0);

That will return the number of rows in your table(s). It's also much quicker
and less resource intensive, particularly with large datasets. :)

James



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




Re: [PHP] Compiling php-4.0.6 with MySQL support

2002-12-18 Thread Igor Shulgin
Re: [PHP] Compiling php-4.0.6 with MySQL supportThank you for your answer, Wico!

I had deleted '=' after '--with-mysql' but it didn't help me. 
All these messages about undefined reference to `mysql... was repeated.

--- 
   With best wishes, 
   Igor Shulgin 
--- --
JSC Uralsvyazinform | Applied Systems Department

  - Original Message - 
  From: Wico de Leeuw 
  To: Igor Shulgin ; [EMAIL PROTECTED] 
  Sent: Wednesday, December 18, 2002 2:51 PM
  Subject: Re: [PHP] Compiling php-4.0.6 with MySQL support


  At 14:44 18-12-02 +0500, Igor Shulgin wrote: 
   Hi! 
   
  I cannot compile php-4.0.6 with MySQL support as static module for 
  apache_1.3.20 on FreeBSD 4.4. 
  Early I successfully build and install 
  /usr/ports/databases/mysql323-server and 
  /usr/ports/databases/mysql323-client with standard configuration. 
  I have done following without problems: 
   
  cd /usr/ports/www/apache13/work/apache_1.3.20 
  ./configure 
  cd /usr/ports/www/mod_php4/work/php-4.0.6 
  rm config.cache 
  ./configure --with-mysql= 
  --with-apache=/usr/ports/www/apache13/work/apache_1.3.20 --enable-track-vars 

  shouldn;t it be 
  ./configure --with-mysql 
  --with-apache=/usr/ports/www/apache13/work/apache_1.3.20 --enable-track-vars 
  (so without the =) 

  Gr, 

  Wico 



  make 
  make install 
  cd /usr/ports/www/apache13/work/apache_1.3.20 
  ./configure --prefix=/usr/local/www 
  --activate-module=src/modules/php4/libphp4.a 
   
  But 
   
  make 
   
  stops with following: 
   
  gcc  -funsigned-char -I/usr/ports/www/mod_php4/work/php-4.0.6 
  -I/usr/ports/www/mod_php4/work/php-4.0.6/main 
  -I/usr/ports/www/mod_php4/work/php-4.0.6/main 
  -I/usr/ports/www/mod_php4/work/php-4.0.6/Zend 
  -I/usr/ports/www/mod_php4/work/php-4.0.6/Zend 
  -I/usr/ports/www/mod_php4/work/php-4.0.6/TSRM 
  -I/usr/ports/www/mod_php4/work/php-4.0.6/TSRM 
  -I/usr/ports/www/mod_php4/work/php-4.0.6 -DUSE_EXPAT -I./lib/expat-lite 
  -DNO_DL_NEEDED `./apaci` -o httpd buildmark.o 
  modules.o  modules/standard/libstandard.a  modules/php4/libphp4.a 
  main/libmain.a  ./os/unix/libos.a  ap/libap.a  lib/expat-lite/libexpat.a 
  -rdynamic -Lmodules/php4 -L../modules/php4 -L../../modules/php4 
  -lmodphp4  -lpam  -lcrypt -lm-lcrypt 
  modules/php4/libphp4.a(php_mysql.lo): In function `_free_mysql_result': 
  php_mysql.lo(.text+0x1c): undefined reference to `mysql_free_result' 
  modules/php4/libphp4.a(php_mysql.lo): In function `_close_mysql_link': 
  php_mysql.lo(.text+0x9d): undefined reference to `mysql_close' 
  modules/php4/libphp4.a(php_mysql.lo): In function `_close_mysql_plink': 
  php_mysql.lo(.text+0xf9): undefined reference to `mysql_close' 
  modules/php4/libphp4.a(php_mysql.lo): In function `php_info_mysql': 
  php_mysql.lo(.text+0x42f): undefined reference to `mysql_get_client_info' 
  modules/php4/libphp4.a(php_mysql.lo): In function `php_mysql_do_connect': 
  php_mysql.lo(.text+0xd0e): undefined reference to `mysql_init' 
  php_mysql.lo(.text+0xd2f): undefined reference to `mysql_real_connect' 
  php_mysql.lo(.text+0xd5c): undefined reference to `mysql_error' 
  php_mysql.lo(.text+0xd89): undefined reference to `mysql_errno' 
  php_mysql.lo(.text+0xe4f): undefined reference to `mysql_stat' 
  php_mysql.lo(.text+0xe8c): undefined reference to `mysql_real_connect' 
  php_mysql.lo(.text+0x105a): undefined reference to `mysql_init' 
  php_mysql.lo(.text+0x107b): undefined reference to `mysql_real_connect' 
  php_mysql.lo(.text+0x10ac): undefined reference to `mysql_error' 
  php_mysql.lo(.text+0x10d9): undefined reference to `mysql_errno' 
  php_mysql.lo(.text+0x10eb): undefined reference to `mysql_error' 
  modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_select_db': 
  php_mysql.lo(.text+0x1550): undefined reference to `mysql_select_db' 
  modules/php4/libphp4.a(php_mysql.lo): In function 
  `php_if_mysql_get_client_info': 
  php_mysql.lo(.text+0x159d): undefined reference to `mysql_get_client_info' 
  modules/php4/libphp4.a(php_mysql.lo): In function 
  `php_if_mysql_get_host_info': 
  php_mysql.lo(.text+0x168d): undefined reference to `mysql_get_host_info' 
  modules/php4/libphp4.a(php_mysql.lo): In function 
  `php_if_mysql_get_proto_info': 
  php_mysql.lo(.text+0x1781): undefined reference to `mysql_get_proto_info' 
  modules/php4/libphp4.a(php_mysql.lo): In function 
  `php_if_mysql_get_server_info': 
  php_mysql.lo(.text+0x184d): undefined reference to `mysql_get_server_info' 
  modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_create_db': 
  php_mysql.lo(.text+0x1a14): undefined reference to `mysql_create_db' 
  modules/php4/libphp4.a(php_mysql.lo): In function `php_if_mysql_drop_db': 
  php_mysql.lo(.text+0x1bcc): undefined reference to `mysql_drop_db' 
  modules/php4/libphp4.a(php_mysql.lo): In function 
  

Re: [PHP] flush output error

2002-12-18 Thread electroteque
no this has been working before, it stopped working ever since i upgraded to
4.3 , whats there to multitask ? i'm simply executing curl and then
executing the funtion after not at the same time but should both be
executing within the same loop , it was working before especially for image
uploads but now it isnt ??

Wico De Leeuw [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 At 20:41 18-12-02 +1100, you wrote:
 hi guys i have a little problem with flushing the buffer output, in this
 loop it should be downloading a file and changing the progress of a
progress
 bar, although it waits until the shell_exec of all the files are done and
 then flushes the buffer which will start @ 95% , so it wont start until
 shell_exec is finished , is this a bug ?

 php can't multitask, so it's not a bug
 what you can try:

 page1: (start process)
 put an ignore_user_abort on it
 put a header location on it to page2
 start the command and let it write to a file where it is

 page 2 :
 read the file and display a processbar
 (with javascript or meta refresh)
 when done goto page3

 page3:
 continue



 foreach ($filename as $file){
   shell_exec(curl -O .$url.$file);
   //shell_exec(wget .$url.$file);
   //echo $file;
 

$bar-progressbar_percentage($i,$filename,'NewWin','Percentage','Downloadin
g
 '.$file);
   $i++;
}
 
 
 
 --
 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




[PHP] Undefined variable error message

2002-12-18 Thread Michael Egan
All of the PHP scripts hosted on a Linux server I'm working with have suddenly begun 
producing an error message:

undefined variable 'variablename'

This occurs wherever a variable name is referred to.  I'm concerned about this for two 
reasons:

1   Will I have to go through each script making substantial alterations?

2   Has the configuration of PHP been altered in some way without my knowledge?

The latter would suggest fairly significant security issues.  Does anybody have any 
ideas as to how this might have occurred and the quickest way of resolving it?  Or of 
links to possible solutions?

This is particularly irritating as last night was the office Christmas party and I'm 
in a rather fragile state this morning :-(

Michael Egan

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




Re: [PHP] Undefined variable error message

2002-12-18 Thread Wico de Leeuw
http://www.php.net/manual/en/function.error-reporting.php

At 10:31 18-12-02 +, Michael Egan wrote:

All of the PHP scripts hosted on a Linux server I'm working with have 
suddenly begun producing an error message:

undefined variable 'variablename'

This occurs wherever a variable name is referred to.  I'm concerned about 
this for two reasons:

1   Will I have to go through each script making substantial alterations?

2   Has the configuration of PHP been altered in some way without my 
knowledge?

The latter would suggest fairly significant security issues.  Does anybody 
have any ideas as to how this might have occurred and the quickest way of 
resolving it?  Or of links to possible solutions?

This is particularly irritating as last night was the office Christmas 
party and I'm in a rather fragile state this morning :-(

Michael Egan

--
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] Undefined variable error message

2002-12-18 Thread Jon Haworth
Hi Michael,

 All of the PHP scripts hosted on a Linux server 
 I'm working with have suddenly begun producing 
 an error message:

   undefined variable 'variablename'

Looks like someone's tweaked the error reporting level so it's on E_ALL,
which can be a somewhat alarmist setting :-)

Read all about it at http://php.net/manual/en/ref.errorfunc.php

 The latter would suggest fairly significant 
 security issues.  Does anybody have any ideas 
 as to how this might have occurred 

Are you on a shared host, or is there someone else who admins your box? If
so, have a word with them and see if they've been fiddling with php.ini -
that's where the error reporting level is set.

Cheers
Jon

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




Re: [PHP] Undefined variable error message

2002-12-18 Thread Chris Hewitt
Michael Egan wrote:


All of the PHP scripts hosted on a Linux server I'm working with have suddenly begun producing an error message:

	undefined variable 'variablename'


Has the code been working on a different server with an earlier version 
of PHP (or this server upgraded)? It sounds as though it needs 
register_globals in php.ini turned on, or the code modified to use the 
$_GET and $_POST super globals.

HTH
Chris





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




Re: [PHP] Undefined variable error message

2002-12-18 Thread Chris Hewitt
Hmm, yes. Why did I not think of error reporting at E_ALL?

Chris Hewitt wrote:


Michael Egan wrote:


All of the PHP scripts hosted on a Linux server I'm working with have 
suddenly begun producing an error message:

undefined variable 'variablename'

Has the code been working on a different server with an earlier 
version of PHP (or this server upgraded)? It sounds as though it needs 
register_globals in php.ini turned on, or the code modified to use the 
$_GET and $_POST super globals.

HTH
Chris




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




[PHP] Javascript var to PHP

2002-12-18 Thread Cesar Aracena
Hi all,

I want one of my links to open a brand-new pre defined window using a
javascript (defined in the header) with javascript: launchinfopage();
but I don't know how to pass a variable so the opened PHP file knows
which info to get from MySQL... if I use
launchinfopage(varname=varvalue) how can I retrieve that info?

Thanks,

Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina




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




RE: [PHP] Javascript var to PHP

2002-12-18 Thread Jon Haworth
Hi Cesar,

 I want one of my links to open a brand-new 
 pre defined window using a javascript 
 but I don't know how to pass a variable so 
 the opened PHP file knows which info to get 
 from MySQL... 

In your launchinfopage() function, presumably you're specifying the url of
the page (foo.php or something)?

If so, just tack the variables on the end of the url as normal:

  foo.php?varname=varvalue

And then, in foo.php, look in the $_GET array:

  echo varname is . $_GET['varvalue'];

I do this quite a lot, I can go and dig up the code if you're still having
problems.

Cheers
Jon

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




RE: [PHP] Javascript var to PHP

2002-12-18 Thread Cesar Aracena
Jon, thanx for the fast response, but the problem is that the link is
made dynamically from a DB and the varvalue changes on every link... if
it helps, I make this link list with a FOR loop in PHP and the varvalues
I want to pass are the IDs of a table elements.

Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina


-Mensaje original-
De: Jon Haworth [mailto:[EMAIL PROTECTED]] 
Enviado el: miércoles, 18 de diciembre de 2002 7:50
Para: 'Cesar Aracena'; Php-General@Lists. Php. Net
Asunto: RE: [PHP] Javascript var to PHP

Hi Cesar,

 I want one of my links to open a brand-new 
 pre defined window using a javascript 
 but I don't know how to pass a variable so 
 the opened PHP file knows which info to get 
 from MySQL... 

In your launchinfopage() function, presumably you're specifying the url
of
the page (foo.php or something)?

If so, just tack the variables on the end of the url as normal:

  foo.php?varname=varvalue

And then, in foo.php, look in the $_GET array:

  echo varname is . $_GET['varvalue'];

I do this quite a lot, I can go and dig up the code if you're still
having
problems.

Cheers
Jon


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




Re: [PHP] Re: Compiling php-4.0.6 with MySQL support

2002-12-18 Thread Igor Shulgin
Should I use
--with-mysl=/usr/ports/databases/mysql323-server/work/mysql-3.23.42 (where sources are 
placed)
or
--with-mysql=/usr/local (I see in Makefile in above directory that 'prefix = 
/usr/local') ?

--- 
   With best wishes, 
   Igor Shulgin 
--- --
JSC Uralsvyazinform | Applied Systems Department

- Original Message - 
From: electroteque [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 18, 2002 2:47 PM
Subject: [PHP] Re: Compiling php-4.0.6 with MySQL support


 i tend not to use the internel mysql lib, install mysql into a prefix
 dir ie
 /usr/local/etc/mysql
 
 then do --with-mysql=/usr/local/etc/mysql
 
 u only had --with-mysql= which will use the  internal lib.
 
 Igor Shulgin [EMAIL PROTECTED] wrote in message
 227601c2a67a$0e5fb750$e964a8c0@ptt">news:227601c2a67a$0e5fb750$e964a8c0@ptt...
 Hi!
 
 I cannot compile php-4.0.6 with MySQL support as static module for
 apache_1.3.20 on FreeBSD 4.4.
 Early I successfully build and install
 /usr/ports/databases/mysql323-server
 and /usr/ports/databases/mysql323-client with standard configuration.
 I have done following without problems:
 
 cd /usr/ports/www/apache13/work/apache_1.3.20
 ./configure
 cd /usr/ports/www/mod_php4/work/php-4.0.6
 rm config.cache
 ./configure --with-mysql=
 --with-apache=/usr/ports/www/apache13/work/apache_
 1.3.20 --enable-track-vars
 make
 make install
 cd /usr/ports/www/apache13/work/apache_1.3.20
 ./configure --prefix=/usr/local/www
 --activate-module=src/modules/php4/libph
 p4.a
 
 But
 
 make
 
 stops with following:
 
 gcc  -funsigned-char -I/usr/ports/www/mod_php4/work/php-4.0.6
 -I/usr/ports/w
 ww/mod_php4/work/php-4.0.6/main
 -I/usr/ports/www/mod_php4/work/php-4.0.6/mai
 n -I/usr/ports/www/mod_php4/work/php-4.0.6/Zend
 -I/usr/ports/www/mod_php4/wo
 rk/php-4.0.6/Zend -I/usr/ports/www/mod_php4/work/php-4.0.6/TSRM
 -I/usr/ports
 /www/mod_php4/work/php-4.0.6/TSRM
 -I/usr/ports/www/mod_php4/work/php-4.0.6 -
 DUSE_EXPAT -I./lib/expat-lite -DNO_DL_NEEDED `./apaci` -o httpd
 buildmark.o modules.o  modules/standard/libstandard.a
 modules/php4/libphp4.a  main/libmain.a  ./os/unix/libos.a  ap/libap.a
 lib/expat-lite/libexpat.a  -rdynamic -Lmodules/php4 -L../modules/php4
 -L../.
 ./modules/php4 -lmodphp4  -lpam  -lcrypt -lm-lcrypt
 modules/php4/libphp4.a(php_mysql.lo): In function `_free_mysql_result':
 php_mysql.lo(.text+0x1c): undefined reference to `mysql_free_result'
 modules/php4/libphp4.a(php_mysql.lo): In function `_close_mysql_link':
 php_mysql.lo(.text+0x9d): undefined reference to `mysql_close'
 modules/php4/libphp4.a(php_mysql.lo): In function `_close_mysql_plink':
 php_mysql.lo(.text+0xf9): undefined reference to `mysql_close'
 modules/php4/libphp4.a(php_mysql.lo): In function `php_info_mysql':
 php_mysql.lo(.text+0x42f): undefined reference to
 `mysql_get_client_info'
 modules/php4/libphp4.a(php_mysql.lo): In function
 `php_mysql_do_connect':
 php_mysql.lo(.text+0xd0e): undefined reference to `mysql_init'
 php_mysql.lo(.text+0xd2f): undefined reference to `mysql_real_connect'
 php_mysql.lo(.text+0xd5c): undefined reference to `mysql_error'
 php_mysql.lo(.text+0xd89): undefined reference to `mysql_errno'
 php_mysql.lo(.text+0xe4f): undefined reference to `mysql_stat'
 php_mysql.lo(.text+0xe8c): undefined reference to `mysql_real_connect'
 php_mysql.lo(.text+0x105a): undefined reference to `mysql_init'
 php_mysql.lo(.text+0x107b): undefined reference to `mysql_real_connect'
 php_mysql.lo(.text+0x10ac): undefined reference to `mysql_error'
 php_mysql.lo(.text+0x10d9): undefined reference to `mysql_errno'
 php_mysql.lo(.text+0x10eb): undefined reference to `mysql_error'
 modules/php4/libphp4.a(php_mysql.lo): In function
 `php_if_mysql_select_db':
 php_mysql.lo(.text+0x1550): undefined reference to `mysql_select_db'
 modules/php4/libphp4.a(php_mysql.lo): In function
 `php_if_mysql_get_client_info':
 php_mysql.lo(.text+0x159d): undefined reference to
 `mysql_get_client_info'
 modules/php4/libphp4.a(php_mysql.lo): In function
 `php_if_mysql_get_host_info':
 php_mysql.lo(.text+0x168d): undefined reference to `mysql_get_host_info'
 modules/php4/libphp4.a(php_mysql.lo): In function
 `php_if_mysql_get_proto_info':
 php_mysql.lo(.text+0x1781): undefined reference to
 `mysql_get_proto_info'
 modules/php4/libphp4.a(php_mysql.lo): In function
 `php_if_mysql_get_server_info':
 php_mysql.lo(.text+0x184d): undefined reference to
 `mysql_get_server_info'
 modules/php4/libphp4.a(php_mysql.lo): In function
 `php_if_mysql_create_db':
 php_mysql.lo(.text+0x1a14): undefined reference to `mysql_create_db'
 modules/php4/libphp4.a(php_mysql.lo): In function
 `php_if_mysql_drop_db':
 php_mysql.lo(.text+0x1bcc): undefined reference to `mysql_drop_db'
 modules/php4/libphp4.a(php_mysql.lo): In function
 `php_mysql_do_query_general':
 php_mysql.lo(.text+0x1ce5): 

RE: [PHP] Undefined variable error message[Scanned]

2002-12-18 Thread Michael Egan
Jon,

Many thanks - the actual problem is now solved.

As to how it occurred I think must be attributable to me at some stage in terms of 
fiddling around with the php.ini file.  Perhaps I've had too many nights like last 
night and the brain cells are depleting past a critical point!

Thanks to everybody else who responded to this query.

Michael Egan

-Original Message-
From: Jon Haworth [mailto:[EMAIL PROTECTED]]
Sent: 18 December 2002 10:39
To: Michael Egan; PHP General (E-mail)
Subject: RE: [PHP] Undefined variable error message[Scanned]


Hi Michael,

 All of the PHP scripts hosted on a Linux server 
 I'm working with have suddenly begun producing 
 an error message:

   undefined variable 'variablename'

Looks like someone's tweaked the error reporting level so it's on E_ALL,
which can be a somewhat alarmist setting :-)

Read all about it at http://php.net/manual/en/ref.errorfunc.php

 The latter would suggest fairly significant 
 security issues.  Does anybody have any ideas 
 as to how this might have occurred 

Are you on a shared host, or is there someone else who admins your box? If
so, have a word with them and see if they've been fiddling with php.ini -
that's where the error reporting level is set.

Cheers
Jon

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




RE: [PHP] Javascript var to PHP

2002-12-18 Thread Jon Haworth
Hi Cesar,

 Jon, thanx for the fast response, but the problem is 
 that the link is made dynamically from a DB and the varvalue 
 changes on every link... if it helps, I make this link 
 list with a FOR loop in PHP and the varvalues
 I want to pass are the IDs of a table elements.

You probably need to do it along these lines:

// assume ids are in $id[1...10]
for ($i = 1; $i = 10; $i++) { 
  echo 'a href=javascript:lauchinfopage(';
  echo $id[$i];
  echo ')click for more info/abr /;
}

and, in your JS function:

function launchinfopage(id)
{
  url = infopage.php?id= + id;
  // open url however you like
}

I imagine you have your url hardcoded in your launchinfopage() function...
this makes it less portable, you may want to consider passing the complete
url to a generic open new window function.

HTH
Jon



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




[PHP] How to upload a file

2002-12-18 Thread Somesh

Hi,

I am using the following code to upload file;
X---
form enctype=multipart/form-data action=load.php method=post
input type=hidden name=MAX_FILE_SIZE value=10
Send the file: input type=file name=userfilebr
input type=submit value=Send 
/form
X---

This works fine for small files of like some Kbs but fails to upload 
larger files near to 1MB.

Can any one help me out from this problem

my file processing code is::
X---
if(is_uploaded_file($userfile)) {
copy($userfile,./upload/$userfile_name);
echo Successfully completed the uploading of the file 
$userfile_name of size $userfile_sizebr;
}else{
echo some error has occured while uploading the file 
$userfile_namebr;
echo $userfile;
}
-X---






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




RE: [PHP] How to upload a file

2002-12-18 Thread Jon Haworth
Hi Somesh,

 This works fine for small files of like some 
 Kbs but fails to upload larger files near to 1MB.

What's your upload_max_size set to in php.ini?

Cheers
Jon

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




Re: [PHP] How to upload a file

2002-12-18 Thread Wico de Leeuw
Look for the limit in php.ini

http://www.php.net/manual/en/configuration.directives.php#ini.upload-max-filesize

Gr,

Wico


At 16:47 18-12-02 +0530, Somesh wrote:


Hi,

I am using the following code to upload file;
X---
form enctype=multipart/form-data action=load.php method=post
input type=hidden name=MAX_FILE_SIZE value=10
Send the file: input type=file name=userfilebr
input type=submit value=Send 
/form
X---

This works fine for small files of like some Kbs but fails to upload
larger files near to 1MB.

Can any one help me out from this problem

my file processing code is::
X---
if(is_uploaded_file($userfile)) {
copy($userfile,./upload/$userfile_name);
echo Successfully completed the uploading of the file
$userfile_name of size $userfile_sizebr;
}else{
echo some error has occured while uploading the file
$userfile_namebr;
echo $userfile;
}
-X---






--
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] How to upload a file

2002-12-18 Thread Somesh

Hi Jon,
It is as follows
; Maximum allowed size for uploaded files.
upload_max_filesize = 8M

On Wed, 18 Dec 2002, Jon Haworth wrote:

 Hi Somesh,
 
  This works fine for small files of like some 
  Kbs but fails to upload larger files near to 1MB.
 
 What's your upload_max_size set to in php.ini?
 
 Cheers
 Jon
 

-- 


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




RE: [PHP] Javascript var to PHP

2002-12-18 Thread Cesar Aracena
Actually Jon, the IDs are not exactly expressed that way, but your
example gave me a nice idea... To tell you the truth (and now that I
have a clearer idea of what to do), the id I need to pass along is from
a random quote (or FAQ) but I'll fetch it before script is being
declared (even before the HTML tag) and then target the script to a
moreinfo.php?var=varvalue page... (does that make any sense?)

thanks a lot.

Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina


-Mensaje original-
De: Jon Haworth [mailto:[EMAIL PROTECTED]] 
Enviado el: miércoles, 18 de diciembre de 2002 8:08
Para: 'Cesar Aracena'; 'Php-General@Lists. Php. Net'
Asunto: RE: [PHP] Javascript var to PHP

Hi Cesar,

 Jon, thanx for the fast response, but the problem is 
 that the link is made dynamically from a DB and the varvalue 
 changes on every link... if it helps, I make this link 
 list with a FOR loop in PHP and the varvalues
 I want to pass are the IDs of a table elements.

You probably need to do it along these lines:

// assume ids are in $id[1...10]
for ($i = 1; $i = 10; $i++) { 
  echo 'a href=javascript:lauchinfopage(';
  echo $id[$i];
  echo ')click for more info/abr /;
}

and, in your JS function:

function launchinfopage(id)
{
  url = infopage.php?id= + id;
  // open url however you like
}

I imagine you have your url hardcoded in your launchinfopage()
function...
this makes it less portable, you may want to consider passing the
complete
url to a generic open new window function.

HTH
Jon



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




Re: [PHP] How to upload a file

2002-12-18 Thread Bogdan Stancescu
Are you sure it's PHP the one that fails? i.e. do you get the some 
error has occured while uploading the file $userfile_namebr message 
or some other message? I had this kind of problem when trying to store 
incoming files in a database, and the link to the database failed, not PHP.

Also, if you have a slow connection, PHP might time out? I'm not sure if 
this is possible though, because I expect Apache to handle the upload 
(well, technically the download) and only run your PHP script after it 
finished that, but who knows?

Bogdan

Somesh wrote:
Hi Jon,
	It is as follows
	; Maximum allowed size for uploaded files.
	upload_max_filesize = 8M

On Wed, 18 Dec 2002, Jon Haworth wrote:



Hi Somesh,



This works fine for small files of like some 
Kbs but fails to upload larger files near to 1MB.

What's your upload_max_size set to in php.ini?

Cheers
Jon







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




RE: [PHP] How to upload a file

2002-12-18 Thread Jon Haworth
Hi Somesh,

   This works fine for small files of like some 
   Kbs but fails to upload larger files near to 1MB.
  
  What's your upload_max_size set to in php.ini?
 
 It is as follows
   ; Maximum allowed size for uploaded files.
   upload_max_filesize = 8M

I don't have a clue then, sorry :-(

Might be a timeout thing, but I can't see how that could affect it... you
could try bumping up max_execution_time and see if anything happens grin

Cheers
Jon

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




[PHP] Random Number Genertation

2002-12-18 Thread shaun
Hi,

Say i have a set of non sequential numbers for example: 1 3 8 12 13 16 19
21.

How can i get php to take a random number from this set?

Thanks for  your help



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




[PHP] Re: Browser Language

2002-12-18 Thread Nenad Djordjevic
Hello Jeff,

Try:

//---
function DetectBrowserLanguage()
{
DEF_LANG = 'en';
global $HTTP_ACCEPT_LANGUAGE;
$arr_lang = preg_split('/(\s*,\s*)/', $HTTP_ACCEPT_LANGUAGE);
if (is_array($arr_lang)) {
$lang_first = strtolower((trim(strval($arr_lang[0];
$lang_first = substr($lang_first, 0, 2);
$lang = $lang_first;
} else {
$lang = DEF_LANG;
}
return $lang;
}
//:-)




Best regards,
 Nenad Djordjevic   mailto:[EMAIL PROTECTED]
   
   Diyomi Soft
   http://www.diyomisoft.com/


Tuesday, December 17, 2002, 6:51:19 PM, you wrote:

J Does anybody know how to get what language (en, fr, it, etc.) the users
J browser is using?

J Jeff


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




Re: [PHP] Random Number Genertation

2002-12-18 Thread Wico de Leeuw
http://www.php.net/manual/en/function.array-rand.php
At 11:35 18-12-02 +, shaun wrote:

Hi,

Say i have a set of non sequential numbers for example: 1 3 8 12 13 16 19
21.

How can i get php to take a random number from this set?

Thanks for  your help



--
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] Random Number Genertation

2002-12-18 Thread Somesh
Hi shaun,
Store all those numbers in an array and use the function 
array_rand.


On Wed, 18 Dec 2002, shaun wrote:

 Hi,
 
 Say i have a set of non sequential numbers for example: 1 3 8 12 13 16 19
 21.
 
 How can i get php to take a random number from this set?
 
 Thanks for  your help
 
 
 
 

-- 


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




[PHP] Security issues with file uploads

2002-12-18 Thread Steve Fitzgerald
Hi,
I was wondering if anyone would care to comment on the following.
I am currently building a business directory using PHPand MySQL for a
client who wants to be able to maintain the site themselves. The site 
will be hosted
on Apache (of course) and I have built an admin section where they can add
or delete entries in the database, and upload image files for the logos 
of listed
businesses. I plan to use HTTP authentication to allow access to this 
area by
the site owner only, however the directory containing the images will need
public write permissions for move_uploaded_file() to work. Both the size
and mime types of the uploaded file will be restricted.

Does anyone have any comments on the security issues involved here?
Is it sufficient to password-protect the admin area? Does the 
permissions for
the images directory compromise the rest of the site or indeed the server,
and would it make any difference if this directory was also 
password-protected?
Is there anything else I have not covered or should be aware of?

Thanks
Steve


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



Re: [PHP] Help needed on CMS Project

2002-12-18 Thread 1LT John W. Holmes
Don't post in HTML and are you paying?

---John Holmes...

- Original Message - 
From: Mike Bowers [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, December 17, 2002 7:15 PM
Subject: [PHP] Help needed on CMS Project


 I'm working on a CMS project. It's based on PHP-Nule but I am re-writing
 it to make the DB less used and to clean the code up a bit.
 Unfortunately I do not have time alone to do all I want and the last
 devs and coders I had quit on me. I'm looking for coders with basic
 experience but I will take almost anyone who can code. If interested
 please email me .. [EMAIL PROTECTED]
  
  
 Mike Bowers
 PlanetModz Gaming Network Webmaster
 [EMAIL PROTECTED]
 ViperWeb Hosting Server Manager
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 All outgoing messages scanned for viruses
 using Norton AV 2002
 

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




[PHP] $_SERVER[PATH_TRANSLATED] returns empty string

2002-12-18 Thread Robert Nedbal
Hi,
I'm having problems with my PHP installation. When I try to get real path
to my script by using $_SERVER[PATH_TRANSLATED], I receive empty string.

$_SERVER[PATH_TRANSLATED]  empty string (why?)
$_SERVER[PHP_SELF] works as expected (ok)
$_SERVER[DOCUMENT_ROOT]works as expected (ok)

OS: RedHat Linux 8.0
Apache: httpd-2.0.40-11
PHP: php-4.2.2-8.0.5 (recompiled from source)

Any ideas how to fix this?

Best regards,
Robert

PS: When replaying please CC me as I'm not subscribed to this list,
thanks.

--

Robert Nedbal - Czech Technical University in Prague, Czech Republic
email: [EMAIL PROTECTED] http://www.sh.cvut.cz/~robik/
  /* Debuggers are evil. Never ever trust them. */



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




Re: [PHP] $_SERVER[PATH_TRANSLATED] returns empty string

2002-12-18 Thread Wico de Leeuw
Maybe basename($_SERVER['SCRIPT_NAME']);

At 14:10 18-12-02 +0100, Robert Nedbal wrote:

Hi,
I'm having problems with my PHP installation. When I try to get real path
to my script by using $_SERVER[PATH_TRANSLATED], I receive empty string.

$_SERVER[PATH_TRANSLATED]  empty string (why?)
$_SERVER[PHP_SELF] works as expected (ok)
$_SERVER[DOCUMENT_ROOT]works as expected (ok)

OS: RedHat Linux 8.0
Apache: httpd-2.0.40-11
PHP: php-4.2.2-8.0.5 (recompiled from source)

Any ideas how to fix this?

Best regards,
Robert

PS: When replaying please CC me as I'm not subscribed to this list,
thanks.

--

Robert Nedbal - Czech Technical University in Prague, Czech Republic
email: [EMAIL PROTECTED] http://www.sh.cvut.cz/~robik/
  /* Debuggers are evil. Never ever trust them. */



--
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




[PHP] Re: AW: [PHP-DEV] PHP Setup / Query

2002-12-18 Thread Wico de Leeuw
Hiya

It's not allowed to put spaces into an url it has to be replaced by a + or 
%20 however apache will fix this
IIS will however not

You could make a header script that looks at $_SERVER['REQUEST_URI'] and 
fix the vars

Gr,

Wico

At 14:19 18-12-02 +0100, you wrote:
Thanks for the information.
I know the urlencode function.
But my PHP application is done already (developed on the linux based PHP)
and it would be very hard to edit the source code again. So the urlencode
function is only a workaround.

-Ursprungliche Nachricht-
Von: Wico de Leeuw [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 18. Dezember 2002 13:51
An: Michael A. Norweh; [EMAIL PROTECTED]
Betreff: Re: [PHP-DEV] PHP Setup / Query


At 13:19 18-12-02 +0100, Michael A. Norweh wrote:
I've installed the newest version of PHP on an ISS 5.0 based System.
The problem I have at the moment:
If post a variable (URL Query) e.g.: xxx.php?errormsg=error message to a
site, php is unable to get these variable. On my linux server the space is
interpreted as %20 in the correct way.
On IIS the variable data is cutted after error.
I think i ve set any wrong parameter in the php.ini file or in the IIS
webserver settings.


in your script do:  a href=xxx.php?errormsg=?=urlencode($errormsg)?




--
PHP Development 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] How to upload a file

2002-12-18 Thread Rich Gray
What does print_r($_FILES) tell you? Is $_FILES['userfile']['error'] set to
a value?
Rich

-Original Message-
From: Somesh [mailto:[EMAIL PROTECTED]]
Sent: 18 December 2002 11:18
To: [EMAIL PROTECTED]
Subject: [PHP] How to upload a file



Hi,

I am using the following code to upload file;
X---
form enctype=multipart/form-data action=load.php method=post
input type=hidden name=MAX_FILE_SIZE value=10
Send the file: input type=file name=userfilebr
input type=submit value=Send 
/form
X---

This works fine for small files of like some Kbs but fails to upload
larger files near to 1MB.

Can any one help me out from this problem

my file processing code is::
X---
if(is_uploaded_file($userfile)) {
copy($userfile,./upload/$userfile_name);
echo Successfully completed the uploading of the file
$userfile_name of size $userfile_sizebr;
}else{
echo some error has occured while uploading the file
$userfile_namebr;
echo $userfile;
}
-X---


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




RE: [PHP] How to upload a file

2002-12-18 Thread Somesh
It is not displaying any thing.
It just gives the browser's error page  
The page cannot be displayed

And the print_r($_FILES) prints an empty array;



On Wed, 18 Dec 2002, Rich Gray wrote:

 What does print_r($_FILES) tell you? Is $_FILES['userfile']['error'] set to
 a value?
 Rich
 
 -Original Message-
 From: Somesh [mailto:[EMAIL PROTECTED]]
 Sent: 18 December 2002 11:18
 To: [EMAIL PROTECTED]
 Subject: [PHP] How to upload a file
 
 
 
 Hi,
 
 I am using the following code to upload file;
 X---
 form enctype=multipart/form-data action=load.php method=post
 input type=hidden name=MAX_FILE_SIZE value=10
 Send the file: input type=file name=userfilebr
 input type=submit value=Send 
 /form
 X---
 
 This works fine for small files of like some Kbs but fails to upload
 larger files near to 1MB.
 
 Can any one help me out from this problem
 
 my file processing code is::
 X---
 if(is_uploaded_file($userfile)) {
 copy($userfile,./upload/$userfile_name);
 echo Successfully completed the uploading of the file
 $userfile_name of size $userfile_sizebr;
 }else{
 echo some error has occured while uploading the file
 $userfile_namebr;
 echo $userfile;
 }
 -X---
 
 
 

-- 



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




[PHP] test

2002-12-18 Thread Wico de Leeuw
test


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




[PHP] Mailling list error

2002-12-18 Thread Wico de Leeuw
Hiya

everytime i send something to the php list i get an error from someone 
@fc.emc.com.ph

stating:
php-list,emc (The name was not found at the remote site. Check that the
name has been entered correctly.)

I can't send the whole email, i tried but then i was unsubscribed from the 
list :)

Can someone fix/test this?

Gr,

Wico 


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



[PHP] Re: Put text matching regex into array?

2002-12-18 Thread achillex
[EMAIL PROTECTED] (Leif K-Brooks) wrote in news:3DFE7849.5050102
@buyer-brokerage.com:

 Is there a way to put each part of a string matching a regex into an 
 array?  Example:
 $string = -_-_--- --_-_-- random text here-_;
 $array = regextoarray($string,[-_]{1,});
 //Produces array of -_-_---,--_-_--,-_
 

or try ereg () with third argument.

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




[PHP] Re: can I mail unlimited in one click?

2002-12-18 Thread achillex
[EMAIL PROTECTED] (Jan GrafströM) wrote in 
[EMAIL PROTECTED]:">news:[EMAIL PROTECTED]:

 Hi,
 
 I wonder if I can mail 300 customers in one click?
 
 part of script:
 
 while($listrow = mysql_fetch_array($listresult))  {
 
 $recipient = $listrow[epost];
 $subject = $subj;
 $message = $mess;
 $headers .= From: $admail\n;
 $headers .= Reply-To: $admail\n;
 $headers .= X-Mailer: PHP\n;
 mail($recipient, $subject, $message, $headers);
 }
 
 or is there a limit?
 
 Thanks for any help
 Jan Grafstrom
 
 

take a look at
set_time_limit (0);

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




Re: [PHP] Re: Put text matching regex into array?

2002-12-18 Thread Wico de Leeuw
At 13:39 18-12-02 +, achillex wrote:

[EMAIL PROTECTED] (Leif K-Brooks) wrote in news:3DFE7849.5050102
@buyer-brokerage.com:

 Is there a way to put each part of a string matching a regex into an
 array?  Example:
 $string = -_-_--- --_-_-- random text here-_;
 $array = regextoarray($string,[-_]{1,});
 //Produces array of -_-_---,--_-_--,-_


if (Preg_Match_All('~([-_]+)~S', $string, $matches)) {
var_dump($matches);
}



or try ereg () with third argument.

--
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




[PHP] preventing sql injections

2002-12-18 Thread Anders Thoresson
Would this function do the trick?

?php

// validate.php - functions that validates form input

function validate_string($unsafe_string) {
	
	// create array containing bad words

	$badwords = array(;,--,select,drop,insert,xp_,delete);
	$goodwords = array(:,---,choose,leave,add, ,remove);
	
	// check for occurences of $badwords

	for($i=0; $i7; $i++) {
		$unsafe_string = str_replace($badwords[$i], 
$goodwords[$i],$unsafe_string);
	}

	$unsafe_string = AddSlashes($unsafe_string);
	$unsafe_string = trim($unsafe_string);
	$safe_string = $unsafe_string;
	Return $safe_string;
}


?

Br,

  Anders


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



Re: [PHP] preventing sql injections

2002-12-18 Thread 1LT John W. Holmes
Why would you do all this? Just use addslashes() and let them send all the
crap they want. All it will do is cause your query to return zero results,
which you should be handling all ready. If you're ever including a variable
in an SQL query that's not enclosed in quotes, then make darn sure you've
validated it's an integer before you put it in there. (int)$value is the
easiest way, so long as a value of zero doesn't return anything from the
database (because a string will evaluate to (int)zero).

---John Holmes...

- Original Message -
From: Anders Thoresson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 18, 2002 8:58 AM
Subject: [PHP] preventing sql injections


 Would this function do the trick?

 ?php

 // validate.php - functions that validates form input

 function validate_string($unsafe_string) {

 // create array containing bad words

 $badwords = array(;,--,select,drop,insert,xp_,delete);
 $goodwords = array(:,---,choose,leave,add, ,remove);

 // check for occurences of $badwords

 for($i=0; $i7; $i++) {
 $unsafe_string = str_replace($badwords[$i],
 $goodwords[$i],$unsafe_string);
 }

 $unsafe_string = AddSlashes($unsafe_string);
 $unsafe_string = trim($unsafe_string);
 $safe_string = $unsafe_string;
 Return $safe_string;
 }


 ?

 Br,

Anders


 --
 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




[PHP] easy spliting

2002-12-18 Thread Alex Ciurea
Hi,

I know it is easy but I can't figure how I should do

I want to split a string from position  1 to 9, from 10 to 36, from 37 to 54 and so 
on...

how can I do this?


is there a function who does this?


Regards,

Alx





Re: [PHP] preventing sql injections

2002-12-18 Thread Wico de Leeuw

addslashes should be enough and put qoutes arround your strings in the sql

At 14:58 18-12-02 +0100, Anders Thoresson wrote:

Would this function do the trick?

?php

// validate.php - functions that validates form input

function validate_string($unsafe_string) {

// create array containing bad words

$badwords = array(;,--,select,drop,insert,xp_,delete);
$goodwords = array(:,---,choose,leave,add, ,remove);

// check for occurences of $badwords

for($i=0; $i7; $i++) {
$unsafe_string = str_replace($badwords[$i], 
$goodwords[$i],$unsafe_string);
}

$unsafe_string = AddSlashes($unsafe_string);
$unsafe_string = trim($unsafe_string);
$safe_string = $unsafe_string;
Return $safe_string;
}


?

Br,

  Anders


--
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] preventing sql injections

2002-12-18 Thread Anders Thoresson


addslashes should be enough and put qoutes arround your strings in the sql


 Meaning that a query like this one is safe, as long as I first have 
$e_namn = addslashes($e_namn);?

$query = INSERT INTO addr (last_name, first_name, email) 
VALUES(\$e_namn\,\$f_namn\,\$email\);


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



Re: [PHP] easy spliting

2002-12-18 Thread 1LT John W. Holmes
Are there specific patterns associated with each range of numbers? If not,
then just use a couple substr() calls to get what you want. That'll be the
fastest method. Or you could use a regular expression like
/(.{9})(.{26})(.{17))/ possibly.

---John Holmes...

- Original Message -
From: Alex Ciurea [EMAIL PROTECTED]
To: php mailing [EMAIL PROTECTED]
Sent: Wednesday, December 18, 2002 8:57 AM
Subject: [PHP] easy spliting


Hi,

I know it is easy but I can't figure how I should do

I want to split a string from position  1 to 9, from 10 to 36, from 37 to 54
and so on...

how can I do this?


is there a function who does this?


Regards,

Alx




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




Re: [PHP] preventing sql injections

2002-12-18 Thread 1LT John W. Holmes
 addslashes should be enough and put qoutes arround your strings in the
sql

   Meaning that a query like this one is safe, as long as I first have
 $e_namn = addslashes($e_namn);?

 $query = INSERT INTO addr (last_name, first_name, email)
 VALUES(\$e_namn\,\$f_namn\,\$email\);

Yeah, as long as you do the same for $f_namn and $email.

---John Holmes...


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




[PHP] Upload status

2002-12-18 Thread Monil Chheda
Hello,

I am using an upload script provided in one of the
PhPScripts sites.

Its working perfectly fine.

The form is used to upload huge files ( 10 - 15 MB ).

The upload takes place without any hassels. But till
the time the file is uploaded , there is no indication
for how much of file has been uploaded .

So can anyone help me setting up a progress (status)
bar showing the upload in progress ie 10% Completed
... 50 % completed ... 100 % completed or something
that would indicate that the file is being uploaded ?

Thanks a zillion for the same.

Waiting for your reply :)

=
Best Regards,
Monil Chheda(INDIA)
http://domains.eliteral.com
===
===

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




RE: [PHP] How to upload a file

2002-12-18 Thread Rich Gray
As others have suggested does it make any difference if you up the script
timeout limit with set_time_limit() or via the max_execution_time in
php.ini?

-Original Message-
From: Somesh [mailto:[EMAIL PROTECTED]]
Sent: 18 December 2002 13:37
To: Rich Gray
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] How to upload a file


It is not displaying any thing.
It just gives the browser's error page
The page cannot be displayed

And the print_r($_FILES) prints an empty array;



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




[PHP] Media library

2002-12-18 Thread GWAD Mailinglist
Hi!

I'm looking a (good) PHP source for media library

reg (eg.).

- user authentication
- user groups
- store pictures / video / audio (database or file)
- easy upload
- php / mysql / apache

and maybe

- simple picture edit, video / audio edit??

Anyone to know something good source?




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




RE: [PHP] Media library

2002-12-18 Thread Cal Evans
since you've not indicated that you've looked around and not found one, I
suggest starting your search at www.freshmeat.net.

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: GWAD Mailinglist [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 8:32 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Media library


Hi!

I'm looking a (good) PHP source for media library

reg (eg.).

- user authentication
- user groups
- store pictures / video / audio (database or file)
- easy upload
- php / mysql / apache

and maybe

- simple picture edit, video / audio edit??

Anyone to know something good source?




--
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




[PHP] URL parsing

2002-12-18 Thread Mako Shark
I've got a URL like this:

http://www.naturalist.com/~fungae/index.php

which is stored in $http_referer (as parse_url from
$HTTP_REFERER).

I'm trying to extract the username (~fungae). I've
read the docs on parse_url(), and have tried to get
$http_referer[user], but it comes up with zilch. I've
also tried to print_r $http_referer, but I only get
scheme, host, path, and query. Any ideas?

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP] URL parsing

2002-12-18 Thread Wico de Leeuw
http://www.php.net/manual/en/function.parse-url.php
At 06:39 18-12-02 -0800, Mako Shark wrote:

I've got a URL like this:

http://www.naturalist.com/~fungae/index.php

which is stored in $http_referer (as parse_url from
$HTTP_REFERER).

I'm trying to extract the username (~fungae). I've
read the docs on parse_url(), and have tried to get
$http_referer[user], but it comes up with zilch. I've
also tried to print_r $http_referer, but I only get
scheme, host, path, and query. Any ideas?

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
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] session variables

2002-12-18 Thread Antti
Justin French wrote:

1. the opposite of 
session_register('varname') is
session_unregister('varname') NOT
unset($varname)


2. Are you on PHP = 4.1 ??

If so, move away from things like:

?
session_start();
$variable = 'foo';
session_register('variable');
session_unregister('variable')
?

and into:

?
session_start();
$_SESSION['variable'] = 'foo';
$_SESSION['variable'] = 'bah';
unset($_SESSION['variable']);
?

MUCH cleaner to work with :)


Justin



on 17/12/02 10:35 PM, Antti ([EMAIL PROTECTED]) wrote:


How can I change the values of session variables
(session_register('variable');) in a session. Do I just
unset($variable); and do session_register() again and give it a new
value. I tried this and it seems that it doesn't work.

Antti




Justin French

http://Indent.com.au
Web Development  
Graphic Design


Neather this seem to work

$_SESSION['some_variable']=$variable;

nor this:

$_SESSION['today']= date('Y-m-d h:m:s');

antti



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




Re: [PHP] $_SERVER[PATH_TRANSLATED] returns empty string

2002-12-18 Thread Robert Nedbal
Hi,
thanks for your reply. But changing source code in my setup is not a long
term option. My problem is that $_SERVER[PATH_TRANSLATED] gives me
empty string.

Does anybody know how to fix my PHP installation, so
$_SERVER[PATH_TRANSLATED] will give me correct file path?

Best regards,
Robert

On Wed, 18 Dec 2002, Wico de Leeuw wrote:
 Maybe basename($_SERVER['SCRIPT_NAME']);

 At 14:10 18-12-02 +0100, Robert Nedbal wrote:
 Hi,
 I'm having problems with my PHP installation. When I try to get real path
 to my script by using $_SERVER[PATH_TRANSLATED], I receive empty string.
 
 $_SERVER[PATH_TRANSLATED]  empty string (why?)
 $_SERVER[PHP_SELF] works as expected (ok)
 $_SERVER[DOCUMENT_ROOT]works as expected (ok)
 
 OS: RedHat Linux 8.0
 Apache: httpd-2.0.40-11
 PHP: php-4.2.2-8.0.5 (recompiled from source)
 
 Any ideas how to fix this?
 
 Best regards,
 Robert
 
 PS: When replaying please CC me as I'm not subscribed to this list,
 thanks.
 
 --
 
 Robert Nedbal - Czech Technical University in Prague, Czech Republic
 email: [EMAIL PROTECTED] http://www.sh.cvut.cz/~robik/
/* Debuggers are evil. Never ever trust them. */
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



--

Robert Nedbal - Czech Technical University in Prague, Czech Republic
email: [EMAIL PROTECTED] http://www.sh.cvut.cz/~robik/
  /* Debuggers are evil. Never ever trust them. */



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




[PHP] list and (array) get_val

2002-12-18 Thread Ns_Andy
a.php

?php
list($a) = $_GET;
print $a;
?

and I typed a.php?b=c

I expected c would be printed, What the problems have I made?
-- 
Regards,
Ns_Andy, [EMAIL PROTECTED]



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




[PHP] Empty textfield

2002-12-18 Thread shaun
Hi,

what is the best way to check if a textfield is empty, and is it the same
for file fields?

thanks for your help



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




Re: [PHP] session variables

2002-12-18 Thread Antti
Justin French wrote:

1. the opposite of 
session_register('varname') is
session_unregister('varname') NOT
unset($varname)


2. Are you on PHP = 4.1 ??

If so, move away from things like:

?
session_start();
$variable = 'foo';
session_register('variable');
session_unregister('variable')
?

and into:

?
session_start();
$_SESSION['variable'] = 'foo';
$_SESSION['variable'] = 'bah';
unset($_SESSION['variable']);
?

MUCH cleaner to work with :)


Justin



on 17/12/02 10:35 PM, Antti ([EMAIL PROTECTED]) wrote:


How can I change the values of session variables
(session_register('variable');) in a session. Do I just
unset($variable); and do session_register() again and give it a new
value. I tried this and it seems that it doesn't work.

Antti




Justin French

http://Indent.com.au
Web Development  
Graphic Design


Neather this seem to work

$_SESSION['ses_name']=$variable;

nor this:

$_SESSION['today']= date('Y-m-d h:m:s');

antti



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




Re: [PHP] URL parsing

2002-12-18 Thread Tim Ward
you could use a combination of the string functions 
(strstr(), substr(), strpos()) or you could work out 
something with regular expressions.

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message - 
From: Mako Shark [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 18, 2002 2:39 PM
Subject: [PHP] URL parsing


 I've got a URL like this:
 
 http://www.naturalist.com/~fungae/index.php
 
 which is stored in $http_referer (as parse_url from
 $HTTP_REFERER).
 
 I'm trying to extract the username (~fungae). I've
 read the docs on parse_url(), and have tried to get
 $http_referer[user], but it comes up with zilch. I've
 also tried to print_r $http_referer, but I only get
 scheme, host, path, and query. Any ideas?
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com
 
 -- 
 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] Empty textfield

2002-12-18 Thread Wico de Leeuw
At 15:33 18-12-02 +, shaun wrote:

Hi,

what is the best way to check if a textfield is empty, and is it the same
for file fields?


if (empty(trim(@$textfield))) {

}



thanks for your help



--
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




[PHP] *Cannot connect to db

2002-12-18 Thread Alexey Lysenkov
mySQL; php running in safe mode; compared to the other code on the same
server. here is mine - I don't get any connection. What could be wrong?
Also, what does this @ sign mean before the mysql_connect?

  function dbopen(){
  $tablename = balzerdez02;
  $dbname = marketingcompany;
  $hostname=localhost;
  $username=tmc;
 $password=t7t7k1k1;
  $dbconn=@mysql_connect($hostname,$username,$password);
  mysql_select_db($dbname) or die (Could not find the table);
  echo($dbconn :- connect);
  }

  dbopen();


Thanks.
-Alex



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




Re: [PHP] URL parsing

2002-12-18 Thread 1LT John W. Holmes
 http://www.php.net/manual/en/function.parse-url.php

If you're going to help, at least read the question. The poster already said
they tried that and it's not even a solution, anyhow. The username it
refers to in parse_url() is for URLs in the format of
http://username:[EMAIL PROTECTED].

 http://www.naturalist.com/~fungae/index.php
 
 which is stored in $http_referer (as parse_url from
 $HTTP_REFERER).
 
 I'm trying to extract the username (~fungae). I've
 read the docs on parse_url(), and have tried to get
 $http_referer[user], but it comes up with zilch. I've
 also tried to print_r $http_referer, but I only get
 scheme, host, path, and query. Any ideas?

Assuming $url is what you have above:

$tilde = strpos($url,~);
$slash = strpos($url,/,$tilde);
$length = $slash - $tilde;

$username = substr($url,$tilde,$length);

Or you can use a regular expression, but the above is probably faster.

preg_match(!(~[^/]*)/!,$url,$match);
or
preg_match(!(~.*)/!U,$url,$match);

In my tests, the first solution (using strpos) was the fastest by 35%.

---John Holmes...


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




[PHP] Re: list and (array) get_val

2002-12-18 Thread Bastian Vogt
As you can read here: http://www.php.net/manual/en/function.list.php
Note: list() only works on numerical arrays and assumes the numerical
indices start at 0.
b is not numerical, I think ;-)

HTH,
Bastian


 a.php

 ?php
 list($a) = $_GET;
 print $a;
 ?

 and I typed a.php?b=c

 I expected c would be printed, What the problems have I made?
 --
 Regards,
 Ns_Andy, [EMAIL PROTECTED]


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




[PHP] Re: *Cannot connect to db

2002-12-18 Thread Bastian Vogt
Hi,

leave out the @, and give us the error message.
@ suppresses error messages of any function.

HTH,
Bastian


 mySQL; php running in safe mode; compared to the other code on the same
 server. here is mine - I don't get any connection. What could be wrong?
 Also, what does this @ sign mean before the mysql_connect?

   function dbopen(){
   $tablename = balzerdez02;
   $dbname = marketingcompany;
   $hostname=localhost;
   $username=tmc;
  $password=t7t7k1k1;
   $dbconn=@mysql_connect($hostname,$username,$password);
   mysql_select_db($dbname) or die (Could not find the table);
   echo($dbconn :- connect);
   }

   dbopen();

 Thanks.
 -Alex


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




Re: [PHP] *Cannot connect to db

2002-12-18 Thread bbonkosk
the '@' sign suppresses the error/warning messages.  Perhaps you would want to 
leave that off in a development environment.  It may lead to some good keys to 
finding the solution..
-Brad

 mySQL; php running in safe mode; compared to the other code on the same
 server. here is mine - I don't get any connection. What could be wrong?
 Also, what does this @ sign mean before the mysql_connect?
 
   function dbopen(){
   $tablename = balzerdez02;
   $dbname = marketingcompany;
   $hostname=localhost;
   $username=tmc;
  $password=t7t7k1k1;
   $dbconn=@mysql_connect($hostname,$username,$password);
   mysql_select_db($dbname) or die (Could not find the table);
   echo($dbconn :- connect);
   }
 
   dbopen();
 
 
 Thanks.
 -Alex
 
 
 
 -- 
 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




[PHP] Re: *Cannot connect to db

2002-12-18 Thread Alexey Lysenkov
Warning: MySQL Connection Failed: Access denied for user: 'tmc@localhost'
(Using password: YES) in e:\~~~\~~~\apache\website\~~~\testdb.php on line 8

The guy at the support says, that everybody else can connect no problems,
sent me the code, which I copy-pasted and I still have this error. :((



Bastian Vogt [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 leave out the @, and give us the error message.
 @ suppresses error messages of any function.

 HTH,
 Bastian



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




Re: [PHP] Re: *Cannot connect to db

2002-12-18 Thread bbonkosk
Can you get into the mysql DB via command line?  If so, try to get in there and 
make sure this user has permissions in the mysql.users table to connect via 
localhost.  Also verufy password they are using.  Try to have this user connect 
via the commandline in MYSQL, which if he is unable to there, it would rule out 
your PHP being the problem...
-Brad

 Warning: MySQL Connection Failed: Access denied for user: 'tmc@localhost'
 (Using password: YES) in e:\~~~\~~~\apache\website\~~~\testdb.php on line 8
 
 The guy at the support says, that everybody else can connect no problems,
 sent me the code, which I copy-pasted and I still have this error. :((
 
 
 
 Bastian Vogt [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi,
 
  leave out the @, and give us the error message.
  @ suppresses error messages of any function.
 
  HTH,
  Bastian
 
 
 
 -- 
 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] How to upload a file

2002-12-18 Thread Somesh

No difference


On Wed, 18 Dec 2002, Rich Gray wrote:

 As others have suggested does it make any difference if you up the script
 timeout limit with set_time_limit() or via the max_execution_time in
 php.ini?
 
 -Original Message-
 From: Somesh [mailto:[EMAIL PROTECTED]]
 Sent: 18 December 2002 13:37
 To: Rich Gray
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] How to upload a file
 
 
 It is not displaying any thing.
 It just gives the browser's error page
   The page cannot be displayed
 
 And the print_r($_FILES) prints an empty array;
 
 

-- 


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




Re: [PHP] $_SERVER[PATH_TRANSLATED] returns empty string

2002-12-18 Thread Chris Hewitt
Robert Nedbal wrote:


Hi,
thanks for your reply. But changing source code in my setup is not a long
term option. My problem is that $_SERVER[PATH_TRANSLATED] gives me
empty string.

Does anybody know how to fix my PHP installation, so
$_SERVER[PATH_TRANSLATED] will give me correct file path?

Best regards,
Robert


Are you implying that it used to work on another computer, or before an 
upgrade? If so, can you compare the php.ini files? Otherwise maybe its a 
bug (php with Apache2 I don't think is stable yet).

HTH
Chris





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




[PHP] ereg.

2002-12-18 Thread Anders Thoresson
What's wrong with the following regular expression? As far as I can se, 
only alphabetic characters including the special swedish ones, should be 
let through, but whatever character passed on in $_REQUEST['f_name'] passes 
the test?

	if(!ereg((^[a-zA-ZåÅäÄöÖ]{4,20}), $_REQUEST['f_name'])) {
		error(Your first name should be between 4 and 20 alphabetic characters);
	}

The next one, used to check valid birthday dates, work. And I can't see 
where they differ!

	if(!ereg(([0-9]{4})-([0-9]{2})-([0-9]{2}), $_REQUEST['birthday']))

Br,

  Anders


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



Re: [PHP] ereg.

2002-12-18 Thread Wico de Leeuw
^ is not in this case
Try
if(!ereg(^([a-zA-ZåÅäÄöÖ]{4,20})\$, $_REQUEST['f_name'])) {

Added the $ at the end else the could be more then 20 chars

Greetz

At 17:20 18-12-02 +0100, Anders Thoresson wrote:

What's wrong with the following regular expression? As far as I can se, 
only alphabetic characters including the special swedish ones, should be 
let through, but whatever character passed on in $_REQUEST['f_name'] 
passes the test?

if(!ereg((^[a-zA-ZåÅäÄöÖ]{4,20}), $_REQUEST['f_name'])) {
error(Your first name should be between 4 and 20 
alphabetic characters);
}

The next one, used to check valid birthday dates, work. And I can't see 
where they differ!

if(!ereg(([0-9]{4})-([0-9]{2})-([0-9]{2}), $_REQUEST['birthday']))

Br,

  Anders


--
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] list and (array) get_val

2002-12-18 Thread Philip Olson

Have another look here:

  http://www.php.net/list

Note that the list construct only works
on numerical arrays and assumes 0-n. You
may want to use import_request_variables()
or extract() though.

Regards,
Philip Olson


On Wed, 18 Dec 2002, Ns_Andy wrote:

 a.php
 
 ?php
 list($a) = $_GET;
 print $a;
 ?
 
 and I typed a.php?b=c
 
 I expected c would be printed, What the problems have I made?
 -- 
 Regards,
 Ns_Andy, [EMAIL PROTECTED]
 
 
 
 -- 
 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] ereg.

2002-12-18 Thread Wico de Leeuw
At 17:26 18-12-02 +0100, Wico de Leeuw wrote:

^ is not in this case


Cancel that, i don't think thats true
anyway

if(!ereg(^[a-zA-ZåÅäÄöÖ]{4,20}\$, $_REQUEST['f_name'])) {

Should work i think

Gr,


Try
if(!ereg(^([a-zA-ZåÅäÄöÖ]{4,20})\$, $_REQUEST['f_name'])) {

Added the $ at the end else the could be more then 20 chars

Greetz

At 17:20 18-12-02 +0100, Anders Thoresson wrote:

What's wrong with the following regular expression? As far as I can se, 
only alphabetic characters including the special swedish ones, should be 
let through, but whatever character passed on in $_REQUEST['f_name'] 
passes the test?

if(!ereg((^[a-zA-ZåÅäÄöÖ]{4,20}), $_REQUEST['f_name'])) {
error(Your first name should be between 4 and 20 
alphabetic characters);
}

The next one, used to check valid birthday dates, work. And I can't see 
where they differ!

if(!ereg(([0-9]{4})-([0-9]{2})-([0-9]{2}), $_REQUEST['birthday']))

Br,

  Anders


--
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




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




Re: [PHP] easy spliting

2002-12-18 Thread Philip Olson

You may want to provide more information like why
is this string being split at these seemingly
random points?  Maybe there is a common separator
or could be? But anyway it sounds like you want 
substr().

  http://www.php.net/substr


Regards,
Philip Olson



On Wed, 18 Dec 2002, Alex Ciurea wrote:

 Hi,
 
 I know it is easy but I can't figure how I should do
 
 I want to split a string from position  1 to 9, from 10 to 36, from 37 to 54 and so 
on...
 
 how can I do this?
 
 
 is there a function who does this?
 
 
 Regards,
 
 Alx
 
 
 


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




Re: [PHP] ereg.

2002-12-18 Thread 1LT John W. Holmes
^ is only NOT when it's the first character within brackets, [ and ]. Also,
don't escape the $ at the end if you really want it to match the end of the
string. Right now your regular expression is matching a literal dollar sign.

As for the original question, it looks correct, providing you can have those
swedish characters in the brackets. What if you just simplify things and
make your ereg look to match a single one of those swedish chacters? Will it
validate correctly if that's all you pass? Play with taking them in and out
and see what works.

---John Holmes...

- Original Message -
From: Wico de Leeuw [EMAIL PROTECTED]
To: Anders Thoresson [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, December 18, 2002 11:26 AM
Subject: Re: [PHP] ereg.


^ is not in this case
Try
if(!ereg(^([a-zA-ZåÅäÄöÖ]{4,20})\$, $_REQUEST['f_name'])) {

Added the $ at the end else the could be more then 20 chars

Greetz

At 17:20 18-12-02 +0100, Anders Thoresson wrote:
What's wrong with the following regular expression? As far as I can se,
only alphabetic characters including the special swedish ones, should be
let through, but whatever character passed on in $_REQUEST['f_name']
passes the test?

 if(!ereg((^[a-zA-ZåÅäÄöÖ]{4,20}), $_REQUEST['f_name'])) {
 error(Your first name should be between 4 and 20
 alphabetic characters);
 }

The next one, used to check valid birthday dates, work. And I can't see
where they differ!

 if(!ereg(([0-9]{4})-([0-9]{2})-([0-9]{2}),
$_REQUEST['birthday']))

Br,

   Anders


--
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


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




Re: [PHP] Re: *Cannot connect to db

2002-12-18 Thread Chris Hewitt
Alexey Lysenkov wrote:


Warning: MySQL Connection Failed: Access denied for user: 'tmc@localhost'
(Using password: YES) in e:\~~~\~~~\apache\website\~~~\testdb.php on line 8

The guy at the support says, that everybody else can connect no problems,
sent me the code, which I copy-pasted and I still have this error. :((


I'd believe the error message. Try to work out what you are doing wrong. 
The error message says you are trying to connect to a mysql database on 
the same computer as the webserver (which seems from the path to be a 
windows box), using the username and password you supplied.

One of these must be wrong, or the database is not running. I can't 
think of any other option. You could go and see how everybody else is 
connecting, there must be some difference.

HTH
Chris


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



Re: [PHP] $_SERVER[PATH_TRANSLATED] returns empty string

2002-12-18 Thread Robert Nedbal
On Wed, 18 Dec 2002, Chris Hewitt wrote:
 Robert Nedbal wrote:

 Hi,
 thanks for your reply. But changing source code in my setup is not a long
 term option. My problem is that $_SERVER[PATH_TRANSLATED] gives me
 empty string.
 
 Does anybody know how to fix my PHP installation, so
 $_SERVER[PATH_TRANSLATED] will give me correct file path?
 
 Best regards,
 Robert
 
 Are you implying that it used to work on another computer, or before an
 upgrade? If so, can you compare the php.ini files? Otherwise maybe its a
 bug (php with Apache2 I don't think is stable yet).

 HTH
 Chris

Yes exactly, it's working on our production server (apache 1.x, php-4.0.6).
On our test server it's _not_ working (apache 2.0.40, php-4.2.2).

/etc/php.ini file is identical on both systems.

So should I try to use apache 1.x instead of apache2?

Best regards,
Robert

--

Robert Nedbal - Czech Technical University in Prague, Czech Republic
email: [EMAIL PROTECTED] http://www.sh.cvut.cz/~robik/
  /* Debuggers are evil. Never ever trust them. */



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




Re: [PHP] Re: mysql_num_rows

2002-12-18 Thread Philip Olson

First, there is no reason to do mycounter like this 
when mysql_num_rows() will work perfectly.  It's not
based on any certain column numbers or primary keys.
Although if you're suggesting this method to simply
print 0-n in the loop (as users may want to know the
row number of output not any id number) then that's
good altough it's not really a counter in this case.

Second, we assume this person wants a count for
informational purposes, to go along with the
data in which case mysql_num_rows() is your best
bet.  It means having a count before the data is
printed/used.  And checking the number or rows
returned before fetching is a form of error handling
as well as if it equals 0 than there is no data to
fetch.  But if one ONLY wants a number of rows count, 
doing SELECT count(*)... works great as suggested 
below.


Regards,
Philip Olson


On Wed, 18 Dec 2002, liljim wrote:

 Hi John,
 
 John Taylor-Johnston  wrote in message:
  I use $mycounter, not saying it is pretty. But if you have a whole bunch
 of stuff deleted, your last id might be worth a lot more than the actual
 number of rows.
 
  $myconnection = mysql_connect($server,$user,$pass);
  mysql_select_db($db,$myconnection);
 
  $news = mysql_query('select * from '.$table.' where '.$where.' order by id
 asc');
   $mycounter = 0;
   while ($mydata = mysql_fetch_object($news))
   {
$mycounter++;
   }
 
 Have you ever considered just doing a count()?
 
 $count = @mysql_query(select count(*) from [table(s)] where [criteria
 [group by something]]);
 $total = mysql_result($count, 0);
 
 That will return the number of rows in your table(s). It's also much quicker
 and less resource intensive, particularly with large datasets. :)
 
 James
 
 
 
 -- 
 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] How to upload a file

2002-12-18 Thread Rich Gray
What are these settings in your php.ini?

post_max_size
upload_tmp_dir

Does the upload_tmp_dir have enough space? Are the permissions on the
directory correct? When you start the upload - how long does it take to fail
immeditaely you click submit or after a delay. If the latter then is there
anything created in the upload directory after teh submit is clicked and
before it fails...?

-Original Message-
From: Somesh [mailto:[EMAIL PROTECTED]]
Sent: 18 December 2002 15:52
To: Rich Gray
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] How to upload a file



No difference


On Wed, 18 Dec 2002, Rich Gray wrote:

 As others have suggested does it make any difference if you up the script
 timeout limit with set_time_limit() or via the max_execution_time in
 php.ini?




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




Re: [PHP] Re: mysql_num_rows

2002-12-18 Thread liljim
I would also tend to do a count(*) as well as the main query if I intend to
use pagination (with the help of LIMIT in the main query).

Suppose, for example, you're limiting to 30 news posts per page, and from
calculations there are only 2 pages that fall into the criteria, then trying
to bring the result set back on page 3 when it doesn't exist will result
in a warning. Also, you'll want to know how many pages of the news post
there are...

Brief Example (assuming $page has already been validated as an integer):

$num = 30; // per page
$total = 49; // result from count(*)
$total_pages = ceil($total/$num);
if($page  $total_pages)
{
$page = $total_pages;
}

// Main query.
// select [whatever] from [table(s)] where [criteria] [whateverelse] limit
 . (($page*$num)-$num) . ,$num;

James

Philip Olson [EMAIL PROTECTED] wrote in message
Pine.BSF.4.10.10212181637090.4483-10@localhost">news:Pine.BSF.4.10.10212181637090.4483-10@localhost...

 First, there is no reason to do mycounter like this
 when mysql_num_rows() will work perfectly.  It's not
 based on any certain column numbers or primary keys.
 Although if you're suggesting this method to simply
 print 0-n in the loop (as users may want to know the
 row number of output not any id number) then that's
 good altough it's not really a counter in this case.

 Second, we assume this person wants a count for
 informational purposes, to go along with the
 data in which case mysql_num_rows() is your best
 bet.  It means having a count before the data is
 printed/used.  And checking the number or rows
 returned before fetching is a form of error handling
 as well as if it equals 0 than there is no data to
 fetch.  But if one ONLY wants a number of rows count,
 doing SELECT count(*)... works great as suggested
 below.


 Regards,
 Philip Olson


 On Wed, 18 Dec 2002, liljim wrote:

  Hi John,
 
  John Taylor-Johnston  wrote in message:
   I use $mycounter, not saying it is pretty. But if you have a whole
bunch
  of stuff deleted, your last id might be worth a lot more than the actual
  number of rows.
  
   $myconnection = mysql_connect($server,$user,$pass);
   mysql_select_db($db,$myconnection);
  
   $news = mysql_query('select * from '.$table.' where '.$where.' order
by id
  asc');
$mycounter = 0;
while ($mydata = mysql_fetch_object($news))
{
 $mycounter++;
}
 
  Have you ever considered just doing a count()?
 
  $count = @mysql_query(select count(*) from [table(s)] where [criteria
  [group by something]]);
  $total = mysql_result($count, 0);
 
  That will return the number of rows in your table(s). It's also much
quicker
  and less resource intensive, particularly with large datasets. :)
 
  James
 
 
 
  --
  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




[PHP] problem with sending pages directly from browser

2002-12-18 Thread Peter Kocnar
I have problem with sending pages directly(by Send-Page
by E-mail...) from browser(ie6) with Outlook 2002. It
tells:The current document type can not be sent as
mail.Would you like to send a Short cut instead?. The
pages use php sessions and it is https with 128 bit
encryption. I found that it is caused by the combination
of https and php session. Is there a solution?
Thanks in advance.
Peter



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




Re: [PHP] Re: *Cannot connect to db

2002-12-18 Thread Alexey Lysenkov
Well, you will laugh, but it worked. :)) Not really, the way you showed -  I
commented out the username and password and it worked! :))
Mang...
So whose fall was it? Definitely not php, right?... okay.
Thanks Gregory! :))

- Original Message -
From: Gregory Hernandez [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 18, 2002 6:05 PM
Subject: [PHP] Re: *Cannot connect to db


 just humor with this:

 try commenting out the lines

 $dbname = marketingcompany;
 $hostname=localhost;

 to appear as

 // $dbname = marketingcompany;
 // $hostname=localhost;

 i had the same problem you are having and for some reason which i still
 don't understand, the solution i proposed above worked.  i don't think
 this is the correct way to solve this.  but, for now (it was a project
 for a class) i'll live with it.

 gregory


  Alexey Lysenkov [EMAIL PROTECTED] - 12/18/02 10:49 AM 
 Warning: MySQL Connection Failed: Access denied for user:
 'tmc@localhost'
 (Using password: YES) in e:\~~~\~~~\apache\website\~~~\testdb.php on
 line 8

 The guy at the support says, that everybody else can connect no
 problems,
 sent me the code, which I copy-pasted and I still have this error. :((



 Bastian Vogt [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi,
 
  leave out the @, and give us the error message.
  @ suppresses error messages of any function.
 
  HTH,
  Bastian



 --
 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




[PHP] problem with sending pages directly from browser

2002-12-18 Thread Kocnár Peter
I have problem with sending pages directly(by Send-Page
by E-mail...) from browser(ie6) with Outlook 2002. It
tells:The current document type can not be sent as
mail.Would you like to send a Short cut instead?. The
pages use php sessions and it is https with 128 bit
encryption. I found that it is caused by the combination
of https and php session. Is there a solution?
Thanks in advance.
Peter



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




Re: [PHP] $_SERVER[PATH_TRANSLATED] returns empty string

2002-12-18 Thread Chris Hewitt
Robert Nedbal wrote:


Are you implying that it used to work on another computer, or before an
upgrade? If so, can you compare the php.ini files? Otherwise maybe its a
bug (php with Apache2 I don't think is stable yet).

HTH
Chris



Yes exactly, it's working on our production server (apache 1.x, php-4.0.6).
On our test server it's _not_ working (apache 2.0.40, php-4.2.2).


I think I'd check the release notes for 4.2.2 first to see if there is 
any change to account for this.

/etc/php.ini file is identical on both systems.


Just being careful (as you compiled from source), does phpinfo() on both 
systems show php.ini located in /etc?

So should I try to use apache 1.x instead of apache2?


Pass on that, I have no experience of Apache 2, but I do not think it is 
intended for production yet. Looking at phpinfo() on my computer here 
(GNU/Linux RedHat 7.3 PHP 4.1.2 and Apache 1.3.23) in the PHP 
Variables at the bottom shows _SERVER[PATH_TRANSLATED} as having the 
value /var/www/html/phpinfo.php, which is correct. If you do not get a 
value by looking at phpinfo() then I suggest there must be some sort of 
bug. You could try searching the bug list, otherwise maybe going back to 
Apache 1.3.x is a good idea.

Hope this helps.

Chris



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



Re: [PHP] ereg.

2002-12-18 Thread liljim
Instead of:
(!ereg(^([a-zA-ZåÅäÄöÖ]{4,20})\$, $_REQUEST['f_name']))

Try:
(!ereg(^[a-zA-ZåÅäÄöÖ]{4,20}$, $_REQUEST['f_name']))

(You don't need the brackets unless you're wanting to get the output of the
matches, which in this case, it doesn't look as though you do)

Better still:
(!preg_match(!^[a-zåÅäÄöÖ]{4,20}$!is, $_REQUEST['f_name']))


James

1lt John W. Holmes [EMAIL PROTECTED] wrote in message
002301c2a6b3$a5a695f0$a629089b@TBHHCCDR">news:002301c2a6b3$a5a695f0$a629089b@TBHHCCDR...
 ^ is only NOT when it's the first character within brackets, [ and ].
Also,
 don't escape the $ at the end if you really want it to match the end of
the
 string. Right now your regular expression is matching a literal dollar
sign.

 As for the original question, it looks correct, providing you can have
those
 swedish characters in the brackets. What if you just simplify things and
 make your ereg look to match a single one of those swedish chacters? Will
it
 validate correctly if that's all you pass? Play with taking them in and
out
 and see what works.

 ---John Holmes...

 - Original Message -
 From: Wico de Leeuw [EMAIL PROTECTED]
 To: Anders Thoresson [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Wednesday, December 18, 2002 11:26 AM
 Subject: Re: [PHP] ereg.


 ^ is not in this case
 Try
 if(!ereg(^([a-zA-ZåÅäÄöÖ]{4,20})\$, $_REQUEST['f_name'])) {

 Added the $ at the end else the could be more then 20 chars

 Greetz

 At 17:20 18-12-02 +0100, Anders Thoresson wrote:
 What's wrong with the following regular expression? As far as I can se,
 only alphabetic characters including the special swedish ones, should be
 let through, but whatever character passed on in $_REQUEST['f_name']
 passes the test?
 
  if(!ereg((^[a-zA-ZåÅäÄöÖ]{4,20}), $_REQUEST['f_name'])) {
  error(Your first name should be between 4 and 20
  alphabetic characters);
  }
 
 The next one, used to check valid birthday dates, work. And I can't see
 where they differ!
 
  if(!ereg(([0-9]{4})-([0-9]{2})-([0-9]{2}),
 $_REQUEST['birthday']))
 
 Br,
 
Anders
 
 
 --
 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




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




Re: [PHP] preventing sql injections

2002-12-18 Thread Bogdan Stancescu
Also, please note that if you're using MySQL you don't have to bother at 
all security-wise - MySQL won't accept more than one query per 
mysql_query(). You do have to bother about regular errors though - if 
$f_namn or $email contain quotes (which $email might well contain) then 
you're going to end up with a database ERROR - but no harm done.

Bogdan

1lt John W. Holmes wrote:
addslashes should be enough and put qoutes arround your strings in the


sql


 Meaning that a query like this one is safe, as long as I first have
$e_namn = addslashes($e_namn);?

$query = INSERT INTO addr (last_name, first_name, email)
VALUES(\$e_namn\,\$f_namn\,\$email\);



Yeah, as long as you do the same for $f_namn and $email.

---John Holmes...




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




[PHP] problem with sending pages directly from browser

2002-12-18 Thread Kocnár Peter
I have problem with sending pages directly(by Send-Page
by E-mail...) from browser(ie6) with Outlook 2002. It
tells:The current document type can not be sent as
mail.Would you like to send a Short cut instead?. The
pages use php sessions and it is https with 128 bit
encryption. I found that it is caused by the combination
of https and php session. Is there a solution?
Thanks in advance.
Peter




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




Re: [PHP] list and (array) get_val

2002-12-18 Thread Ns_Andy
ic,
thanks all.


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




[PHP] *Premature end of script headers

2002-12-18 Thread Alexey Lysenkov
What does THAT mean? My script cannot execute on this goddamn server,
running goddamn safe-damn-mode!
A line in the error.log:

[Wed Dec 18 14:18:55 2002] [error] [client 217.***.*.***] Premature end of
script headers: e:/~~~/~~~/apache/php/php.exe

Regards,
Alex

What should I tell the support guy, who is running this server? He claims,
that every other client is alright and happy with him - and why not, of
course - it's just that I want to be happy too!



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




Re: [PHP] *Premature end of script headers

2002-12-18 Thread Adam Voigt




Calm down. Does it do that same error if you have something simple like:



?php phpinfo(); ?



On a page all by itself?



On Wed, 2002-12-18 at 13:12, Alexey Lysenkov wrote:

What does THAT mean? My script cannot execute on this goddamn server,

running goddamn safe-damn-mode!

A line in the error.log:



[Wed Dec 18 14:18:55 2002] [error] [client 217.***.*.***] Premature end of

script headers: e:/~~~/~~~/apache/php/php.exe



Regards,

Alex



What should I tell the support guy, who is running this server? He claims,

that every other client is alright and happy with him - and why not, of

course - it's just that I want to be happy too!







-- 

PHP General Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


[PHP] Re: Encrypt and decrypt cookie

2002-12-18 Thread J Smith

Note that IVs only affect block cipher modes other than ECB mode. ECB mode 
ignores IVs completely.

J


Titu Kim wrote:

 Hi,
I am using libmcrypt-2.5.3 to do encryption in php.
 I use exactly the steps provided in mcrypt_module_open
 available on php website
 http://php.benscom.com/manual/en/function.mcrypt-module-open.php
 
 I can encrypt and decrypt a string correctly. However,
 if i encrypt a cookie to write to user's browser, the
 decryption is incorrect when i try to decrypt this
 cookie when user comes again. I found out the main
 cause is the function mcrypt_module_open. This
 function return a different resource everytime it is
 called. Eventually it cause the decryption on cookie
 to be incorrect. Can someone give me suggestion on how
 to encrypt and decrypt a cookie?
 
 Thanks very much.
 
 Kim
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com


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




Re: [PHP] *Premature end of script headers

2002-12-18 Thread Alexey Lysenkov
Not that I am really bothered with it... The thing should run in 12 hours, and the guy 
is gone, I guess, to have his late night beer, and me is sitting here and battling 
with either my stupidity or his.
Anyways. phpinfo() runs okay


  Adam Voigt [EMAIL PROTECTED] wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Calm down. Does it do that same error if you have something simple like: 

  ?php phpinfo(); ? 

  On a page all by itself? 

  On Wed, 2002-12-18 at 13:12, Alexey Lysenkov wrote: 
What does THAT mean? My script cannot execute on this goddamn server, 
running goddamn safe-damn-mode! 
A line in the error.log: 

[Wed Dec 18 14:18:55 2002] [error] [client 217.***.*.***] Premature end of 
script headers: e:/~~~/~~~/apache/php/php.exe 

Regards, 
Alex 

What should I tell the support guy, who is running this server? He claims, 
that every other client is alright and happy with him - and why not, of 
course - it's just that I want to be happy too! 



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

-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
   




[PHP] *OK, more eval for today

2002-12-18 Thread Alexey Lysenkov
I know, it's eval = evil, but I don't see any other way I can check for 120 variables 
submitted via post, without making a temp variable, assigning a value of the posted 
Var and checking for it (and deciding on the further run of the script). Anyways, I 
took a classical eval thing and am doing fine with it. It looks like this:

$temp = \$php_q3_.$i; // $i is a loop index
eval (\$temp = \$temp\;);

works alright. Now, how do I eval directly from the $HTTP_POST_VARS?

I am trying to do this:

$tempVar1 = '\$HTTP_POST_VARS[\q4_'.$i.']';
  eval(\$tempVar1=\$tempVar1\;);

and am obviously failing. If you know any other way to validate 120-150 variables in a 
loop and then rewrite the values into the fields (checkboxes, radios and selects) - 
should an error had been made - let me know.

Best Regards,
Alex

p.s. you do help! :)



RE: [PHP] *OK, more eval for today

2002-12-18 Thread John W. Holmes
Why not name your form elements php_q3[] and then just loop through the
array. That would cut the need for eval().

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: Alexey Lysenkov [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, December 18, 2002 2:08 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] *OK, more eval for today
 
 I know, it's eval = evil, but I don't see any other way I can check
for
 120 variables submitted via post, without making a temp variable,
 assigning a value of the posted Var and checking for it (and deciding
on
 the further run of the script). Anyways, I took a classical eval thing
and
 am doing fine with it. It looks like this:
 
 $temp = \$php_q3_.$i; // $i is a loop index
 eval (\$temp = \$temp\;);
 
 works alright. Now, how do I eval directly from the $HTTP_POST_VARS?
 
 I am trying to do this:
 
 $tempVar1 = '\$HTTP_POST_VARS[\q4_'.$i.']';
   eval(\$tempVar1=\$tempVar1\;);
 
 and am obviously failing. If you know any other way to validate
120-150
 variables in a loop and then rewrite the values into the fields
 (checkboxes, radios and selects) - should an error had been made - let
me
 know.
 
 Best Regards,
 Alex
 
 p.s. you do help! :)



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




  1   2   >