Re: [PHP] Php lib?

2002-08-13 Thread Andrey Hristov

Hi,
sets the value of the var to be parsed later.

HTH

Andrey

- Original Message -
From: John Wards [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 13, 2002 12:58 PM
Subject: Re: [PHP] Php lib?


 Thanks for that rather handy!

 Does anyone know what the function set_var() does in template.inc in
phplib?
 I persume it has something to do with the template system.but thats as
 much as I have figured out!!

 I am going to replace the phplib template system with Smarty there is not
a
 converter for this(wishful thinking! anything for an easy life)

 My boss set me this task before he went on holiday...I am sure he is
bloody
 laghing his socks off right now! I wondered why he never bothered porting
 this for PHP4!

 Arrgh!

 John
   Anyone got any handy hints on how to convert scripts running
   on PHP3 and
   PHPlib?
 
  1. Roughly speaking, page_open() goes to session_start():
 
  Old:
  page_open(array(sess = my_web_Session));
 
  New:
  session_start();
 
  2. page_close() goes away; if you don't have time to remove all those
 calls,
  write your own page_close() function that simply returns true.
 
  3. Use functions instead of methods for managing the session variables.
 For
  example, for the object $sess created in step 1 above:
 
  Old:
  $sess-register('firstName');
 
  New:
  session_register('firstName');
 
  Brings back fond memories - not! ;)
 
  Kirk
 
  --
  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] Linux PHP editor

2002-08-09 Thread Andrey Hristov

gedit - for gnome. nedit. - for X
joe - for console. use joe if you had used Borland's editors. The key
combinations are almost the same.

Regards,
Andrey

- Original Message -
From: JJ Harrison\ [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 09, 2002 1:40 PM
Subject: [PHP] Linux PHP editor


 I just switched over to Red Hat Linux from Win2k...

 Only to find my fav editor only works on windows systems...

 could someone suggest a good replacement?


 --
 JJ Harrison
 [EMAIL PROTECTED]
 www.tececo.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] Re: Protect PHP coding

2002-08-03 Thread Andrey Hristov

 So...
 Is this equivalent to Zend Encoder?
 
 Not exactly, but in some aspects it is/will be better like the ability
 to generate executable standalone PHP programs that you can distribute
 independently. There is also the question of the price that for Zend
 Encoder is ridiculously expensive.
 
 The people for Zend have to eat to live.
People, if there is no Zend there is no core for PHP. This is the same as
with MySQL. MySQL is free under GPL
but has no subselects because the companies that has commercial licenses
didn't wanted that - Monty has
to eat and he codes other features.
IMO Zend must exist and this is only possible by selling its products.
If the company we work for has the money to buy Zend Accelerator licenses
why not do that instead of using
other Open Source accelerators. I just want the people from Zend to continue
their tremendous work and
we will have PHP5 and PHP6 and so on otherwise start learning ASP or JSP.


My 2 cents.

Regards,
Andrey


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




Re: [PHP] Reg- array_unique

2002-08-02 Thread Andrey Hristov

Post that on [EMAIL PROTECTED]

Andrey

- Original Message -
From: SenthilVelavan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 02, 2002 10:54 AM
Subject: [PHP] Reg- array_unique


Hello All,

I tried a program using array_unique.It shows different outputs
in PHP4.06 and PHP4.22

Program:

?php
$employee[0]='snp';
$employee[1]='snp';
$employee[2]='snp';
$yee=array_unique($employee);
while(list($i,$c)=each($yee))
{
echo Index .$i.  Content.$c;
}
?

Output:

PHP4.06
Index 0 Content snp
PHP4.22
Index 2 Content snp

Why the index is differed in two version?
Whether the function array_unique is handled in a different way in PHP4.22.
Any help is appreciated.

Advance thanks and regards,
SenthilVelavan.P




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




Re: [PHP] Re: Need help to choose hosting!

2002-08-02 Thread Andrey Hristov

http://ispcheck.com is the place. Listing of many webhostings. Go and see.

Regards,
Andrey

  Hey php-general,
 
i want to buy hosting. but i can't find good one for me. maybe
someone could point some links. but this is what i need!
 
Storage up to 100MB
normal transfer limit(best would be without)
CGI/Perl/PHP/ASP/SSI/SSL
MySQL database (can be only 1)
some pop3 mailboxes
free domain transfer (maybe free domain if i pay for 1 year ahead)
FTP access
SSH access
Shell capability
up to 3 background processes
 
if anyone know combination like that i would appreaciate your help!
thanks
 
  --
  Best regards,
   Mantas
 
  Contacts:
  [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] .htaccess

2002-08-02 Thread Andrey Hristov

The password that user used is available in some var
var_dump($HTTP_SERVER_VARS); or var_dump($GLOBALS);

Andrey
 
- Original Message - 
From: Oliver Witt [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 02, 2002 5:21 PM
Subject: [PHP] .htaccess


 Hi!
 Using an .htaccess file to limit access to some web files, is there a
 way to get the name and password into a variable used by a user to log
 on?
 Kind regards,
 Oliver
 
 
 -- 
 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] include()

2002-08-01 Thread Andrey Hristov

  I suppose include() can be used to include files from remote
  systems(not on
  WINDOWS).

 Only if the sysadmin running your web server allows it, which they should
 not.


  A webmaster on the same server can always use a path like
  /home/htdocs/.../config.php and include my config .php which contains
my
  database password !!

 Not quite, but if you are on a shared server hosted by somebody else,
there
 is a potential problem.  If somebody can figure out the name of the
function
 that opens the database, they could call it, potemtially giving access to
 the data.  You could use the solution posted by Justin French to make sure
 that the function does nothing for them when they call it.
But probably the password is in variable so if you can include() the file
with the password and cored dump
the php you can view it. I've found a bug or two that core dump PHP and saw
my secrets there. Even
function or variables with mangled names will not help you.

 If you run your own server, you can set it up so that each webmaster is
 locked into a private environment, but it's messy.  According to me, you
 would need a separate copy of apache for each site, each running under a
 different user, and they would need to run on separate ports, which is a
 nuisance.

This is called SAFE mode (easy to be done) and the other restriction is
open_basedir directive in php.ini

Andrey


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




Re: [PHP] web services and PHP

2002-07-31 Thread Andrey Hristov


 There are two ways (SOAP) to use SOAP library written in PHP such as NuSOAP
by Dietrich Ayala or to use
PHP-SOAP toolkit (module for PHP written in C)by Brad Lafountain(coding) and
Shane Caraveo(testing) (available at sourceforge.net).

Regards,
Andrey

 Bob Lockie [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 
  I'd like to know if it's possible to use PHP to develop and implement
  Web Services. If so, please point me to sites, articles, or tutorials
  that discuss this topic in more detail. Thanks.
 
  How do you define web services?
 
 
 



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




Re: [PHP] Dates and Date()

2002-07-29 Thread Andrey Hristov



- Original Message -
From: Christopher J. Crane [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 29, 2002 5:51 PM
Subject: [PHP] Dates and Date()


 I believethisto be one way to find out yesterday's date:
 $tomorrow  = mktime (0,0,0,date(m)  ,date(d)-1,date(Y));

 However, I would like to have a snippet of code to tell me how to get the
 date of today - 10 days ago.

 if today is jul 29, 2002, how do I get the date funtion to tell me 10 days
 ago. with jul 29, 2002 as the date it would be easy, just subtract 10 from
 29, but what happens if the date was jul 2, 2002. How do I get the correct
 date returned

All date functions handle correctly this case
 so echo strftime('%m:%d:%Y', gmmktime(0,0,0,7,2-10,2002));
will be:
06:22:2002
You can add/substract what you wish and will get correct results in case the
the resulting timestamp is between 1.1.1970 and somewhere in year 2038.


Best regards,
Andrey Hristov


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




Re: [PHP] Dates and Date()

2002-07-29 Thread Andrey Hristov

Use while() with some counter that increments when you have bussiness day/
$counter = 0;
$bdays = 0;
while ($bdays10){
  if
(in_array(gmstrftime('%u',gmmktime(0,0,0,7,2-($counter++),2002),array(1,2,3,
4,5)){
  $bdays++;
echo gmstrftime('%m/%d/%Y',gmmktime(0,0,0,7,2-($counter-1),2002);
}
}

HTH

Regards,
Andrey

- Original Message -
From: Christopher J. Crane [EMAIL PROTECTED]
To: Andrey Hristov [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, July 29, 2002 7:00 PM
Subject: Re: [PHP] Dates and Date()


 Ok here is what I did.
  $Hist_Time = gmstrftime('%m:%d:%Y', strtotime(-10 days));

 Now I am wondering if there is a way to look for only the last day
business
 days and be returned in an array?
 - Original Message -
 From: Andrey Hristov [EMAIL PROTECTED]
 To: Christopher J. Crane [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Monday, July 29, 2002 10:59 AM
 Subject: Re: [PHP] Dates and Date()


 
 
  - Original Message -
  From: Christopher J. Crane [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, July 29, 2002 5:51 PM
  Subject: [PHP] Dates and Date()
 
 
   I believethisto be one way to find out yesterday's date:
   $tomorrow  = mktime (0,0,0,date(m)  ,date(d)-1,date(Y));
  
   However, I would like to have a snippet of code to tell me how to get
 the
   date of today - 10 days ago.
  
   if today is jul 29, 2002, how do I get the date funtion to tell me 10
 days
   ago. with jul 29, 2002 as the date it would be easy, just subtract 10
 from
   29, but what happens if the date was jul 2, 2002. How do I get the
 correct
   date returned
 
  All date functions handle correctly this case
   so echo strftime('%m:%d:%Y', gmmktime(0,0,0,7,2-10,2002));
  will be:
  06:22:2002
  You can add/substract what you wish and will get correct results in case
 the
  the resulting timestamp is between 1.1.1970 and somewhere in year 2038.
 
 
  Best regards,
  Andrey Hristov
 
 
 






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




Re: [PHP] Dates and Date()

2002-07-29 Thread Andrey Hristov

No problema.
If you have access to icq you can use irc.php.net or capek.openprojects.net
(or any other openproject's irc server)
on #php channel.

Andrey

- Original Message -
From: Christopher J. Crane [EMAIL PROTECTED]
To: Andrey Hristov [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, July 29, 2002 7:08 PM
Subject: Re: [PHP] Dates and Date()


 very nice... thank you!
 - Original Message -
 From: Andrey Hristov [EMAIL PROTECTED]
 To: Christopher J. Crane [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Monday, July 29, 2002 12:04 PM
 Subject: Re: [PHP] Dates and Date()


  Use while() with some counter that increments when you have bussiness
day/
  $counter = 0;
  $bdays = 0;
  while ($bdays10){
if
 

(in_array(gmstrftime('%u',gmmktime(0,0,0,7,2-($counter++),2002),array(1,2,3,
  4,5)){
$bdays++;
  echo gmstrftime('%m/%d/%Y',gmmktime(0,0,0,7,2-($counter-1),2002);
  }
  }
 
  HTH
 
  Regards,
  Andrey
 
  - Original Message -
  From: Christopher J. Crane [EMAIL PROTECTED]
  To: Andrey Hristov [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Sent: Monday, July 29, 2002 7:00 PM
  Subject: Re: [PHP] Dates and Date()
 
 
   Ok here is what I did.
$Hist_Time = gmstrftime('%m:%d:%Y', strtotime(-10 days));
  
   Now I am wondering if there is a way to look for only the last day
  business
   days and be returned in an array?
   - Original Message -
   From: Andrey Hristov [EMAIL PROTECTED]
   To: Christopher J. Crane [EMAIL PROTECTED]
   Cc: [EMAIL PROTECTED]
   Sent: Monday, July 29, 2002 10:59 AM
   Subject: Re: [PHP] Dates and Date()
  
  
   
   
- Original Message -
From: Christopher J. Crane [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 29, 2002 5:51 PM
Subject: [PHP] Dates and Date()
   
   
 I believethisto be one way to find out yesterday's date:
 $tomorrow  = mktime (0,0,0,date(m)  ,date(d)-1,date(Y));

 However, I would like to have a snippet of code to tell me how to
 get
   the
 date of today - 10 days ago.

 if today is jul 29, 2002, how do I get the date funtion to tell me
 10
   days
 ago. with jul 29, 2002 as the date it would be easy, just subtract
 10
   from
 29, but what happens if the date was jul 2, 2002. How do I get the
   correct
 date returned
   
All date functions handle correctly this case
 so echo strftime('%m:%d:%Y', gmmktime(0,0,0,7,2-10,2002));
will be:
06:22:2002
You can add/substract what you wish and will get correct results in
 case
   the
the resulting timestamp is between 1.1.1970 and somewhere in year
 2038.
   
   
Best regards,
Andrey Hristov
   
   
   
  
  
  
  
 
 
 




 --
 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] Dates and Date()

2002-07-29 Thread Andrey Hristov

 The guy just wanted fast help. It is obvious that he is not advanced it
time transformations and functions. I think that he didn't ask bad question.
WHich are bad - his questions or What the  is php?.
When he has more time he will take better look at the docs :)) Some people
always experiment some not.

Kind regards,
Andrey Hristov


- Original Message -
From: 1LT John W. Holmes [EMAIL PROTECTED]
To: Christopher J. Crane [EMAIL PROTECTED]; Andrey Hristov
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, July 29, 2002 7:12 PM
Subject: Re: [PHP] Dates and Date()


  Ok here is what I did.
   $Hist_Time = gmstrftime('%m:%d:%Y', strtotime(-10 days));
 
  Now I am wondering if there is a way to look for only the last day
 business
  days and be returned in an array?

 What have you tried? How much longer do we have to hold your hand?

 Not to be too rude or anything, but at least give it a few tries on your
 own, then post your code, what you thought would happen, what actually
 happened, and what help you need. That's how these things are supposed to
 work...

 ---John Holmes...


 --
 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] php.exe from command line

2002-07-29 Thread Andrey Hristov

Inspect $argc  $argv arrays (var_dump() them).


Andrey

- Original Message -
From: Evan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 29, 2002 8:06 PM
Subject: [PHP] php.exe from command line


 I've made a simple php file that creates a file named 'agent_1.txt' where
 the number is taken from $_GET[num].

 I've tried to run it in this way:
 http://localhost/agent.php?num=1
 And it works perfectly

 I thought that from from command line it would work so i tried this (WinXP
+
 PHP 4.1.2):

 c:\php\php.exe c:\Inetpub\webpub\PHP\agent.php?num=1

 BUT IT DOESN'T WORK! ?

 Can someone help, please?
 Thenks in advance,
 Evan



 --
 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] filling an array

2002-07-26 Thread Andrey Hristov

 for($m=1;$m=5;$m++){
 $div_id[$m]=${'divid'.$m};
 }

Regards,
Andrey


- Original Message -
From: Steve Buehler [EMAIL PROTECTED]
To: PHP [EMAIL PROTECTED]
Sent: Friday, July 26, 2002 10:48 PM
Subject: [PHP] filling an array


 Can anyone tell me what I am doing wrong?

 I am essentially trying to do this:
 $divid[1] = $div_id1;
 $divid[2] = $div_id2;
 $divid[3] = $div_id3;
 $divid[4] = $div_id4;
 $divid[5] = $div_id5;

 But I was looking for a tighter way, like the following (which does not
work):
 for($m=1;$m=5;$m++){
 $div_id[$m]=$divid$m;
 }

 Can anybody tell me how to do this in a for statement?

 Thanks In Advance
 Steve


 --
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.
 ow3


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

2002-07-26 Thread Andrey Hristov

unset($_SESSION['variavble']);
 

Andrey


- Original Message - 
From: Tyler Durdin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 26, 2002 10:14 PM
Subject: Re: [PHP] Re: sessions


 So doing it the new way ($_SESSION['variable']) how do you close or 
 unregister a session?
 
 
 
 
 _
 Chat with friends online, try MSN Messenger: http://messenger.msn.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] Re: sessions

2002-07-26 Thread Andrey Hristov

do the following

function a(){
var_dump('pre',$GLOBALS,'/pre');
}
a();


and see what variables you have and whether your variables are set
somewhere.

HTH

Andrey

- Original Message -
From: Tyler Durdin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 26, 2002 9:28 PM
Subject: Re: [PHP] Re: sessions


 Still the same message. It has been actually logging me out all along, but
 it will not run through that if statement.

 Could you trye
 if (!empty($HTTP_SESSION_VARS['valid_user'])
 use $HTTP_SESSION_VARS





 _
 Chat with friends online, try MSN Messenger: http://messenger.msn.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] trim away x 1 number of spaces from a strin

2002-07-24 Thread Andrey Hristov


 $new = preg_replace('/[ ]{2,}/',$old);

HTH
Andrey

- Original Message -
From: Victor Spång Arthursson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 24, 2002 12:05 PM
Subject: [PHP] trim away x  1 number of spaces from a strin


Hi!

Could someone help me with a replace that takes all occurances of  ,
that is space more than one, and replaces them with …?

Sincerely

Victor


--
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] is php.net down ?

2002-07-22 Thread Andrey Hristov

 They are moving to another machine. The intention is to move the download
resource to another resource to free the resources ot the current machine
because there are too many working apache processes. And this is a problem
for other applications. It will be fine soon.

Regards,
Andrey

- Original Message -
From: R'twick Niceorgaw [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 22, 2002 6:51 PM
Subject: [PHP] is php.net down ?


 Hi guys,
 any one else able to get into www.php.net ?

 I'm getting this

 Warning: main(geoip.inc) - No such file or directory in
 /local/Web/sites/phpweb/include/prepend.inc on line 6

 Fatal error: Failed opening required 'geoip.inc'
 (include_path='.:/local/Web/sites/phpweb/include') in
 /local/Web/sites/phpweb/include/prepend.inc on line 6





 --
 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] Require some help about the date comparison

2002-07-17 Thread Andrey Hristov

I think that it is better to use unixtimestamps and if you save them to a
RDBMS then save according to GMT. When retrieving use timezone to convert to
your local time -
ex

define('MY_TIMEZONE',-2);
list($time) = mysql_fetch_array(mysql_query('select tstamp from table where
user='.$user_id.';'));
$tt_ar = explode(':',gmstrftime('%H:%M:%S:%m:%d:%Y',$time));
$local_time = gmmktime($tt_ar[0]+MY_TIMEZONE, $tt_ar[1],
$tt_ar[2],$tt_ar[3],$tt_ar[4],$tt_ar[5]);

Regards,
Andrey

- Original Message -
From: Manisha [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 17, 2002 9:55 AM
Subject: [PHP] Require some help about the date comparison


 I am writing one program -

 I want to display some text on web. This text should appear for limited
 period e.g from 20th July 12pm till 25th July 3pm. After 25th July 3pm the
 text should disappear from screen.

 I tried to look for date comparison / string conversion to date etc, I got
 lot info but could not figure out which would be best for above (rather
how
 can I do it).

 Anybody can share some expert comments please ?

 Thanking in advance,
 Manisha


 --
 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] To fill an Array

2002-07-17 Thread Andrey Hristov


 $xy = array_values($_POST);


HTH

Regards,
Andrey Hristov

- Original Message - 
From: Gabor Niederlaender [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 17, 2002 1:19 PM
Subject: [PHP] To fill an Array


 Hi all!
 
 I would like to fill the values from my $_POST array to another array
 called xy which is not an associative array.
 
 F.Ex:
 
 $_POST['smthing'] should be $xy[0]  etc...
 
 How do I do this?
 
 Best regards,
 Gabor
 
 -- 
 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] Regular expression

2002-07-17 Thread Andrey Hristov

Something like this.
$your_string = preg_replace('/[\d\w]+@([\w\d]{3,}\.)+([\w]{2,4})/','',
$your_string);

HTH

Best regards,
Andrey Hristov

- Original Message -
From: Michal Albrecht [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 17, 2002 1:08 PM
Subject: [PHP] Regular expression


 Hi,

 Could anyone help me with the following:

 I have to strip the domain from string only if it is not preceded with @
 which means - when it is not an e-mail address.

 Examples:

 1. blah blah blah [EMAIL PROTECTED] blah blah

 should result in:

 blah blah blah [EMAIL PROTECTED] blah blah

 2. blah blah blah something.org blah blah

 should result in:

 blah blah blah  blah blah

 Thanks a lot,


 Michal


 --
 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 - autostart, or session_start() ?

2002-07-17 Thread Andrey Hristov

Try with output buffering.

Regards,
Andrey Hristov
 
- Original Message - 
From: Matt Babineau [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 17, 2002 6:20 PM
Subject: [PHP] $_SESSION - autostart, or session_start() ?


 If I set the SESSION autostart = 1 in the PHP config, would that
 eliminate my need to use session_start() in my code? I have some PHP
 inline with some HTML, and the PHP is telling me:
  
 Warning: Cannot send session cookie - headers already sent
  
 Any ideas how to remedy this?
  
 Matt Babineau
 MCWD / CCFD
 -
 e:  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
 p: 603.943.4237
 w:  http://www.criticalcode.com/ http://www.criticalcode.com
 PO BOX 601
 Manchester, NH 03105
  
 


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




Re: [PHP] read a text file

2002-07-16 Thread Andrey Hristov

$contents = implode('',file($filename));

Regards,
Andrey


Edgar [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 I was looking for in the news, but i did not encounter any thing.

 Where can I get an example or the way to read a text file into a variable
 and how identify the carriage return and special characters.


 Thank you


 Edgar



 --
 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] Purpose of $$var ?????

2002-07-16 Thread Andrey Hristov

Variable variable. Read the docs.

$v = 'foo';
$foo = 'bar';
echo $$v;

Regards,
Andrey

P.S.
Sometimes {} are used : ${$v}




Scott Fletcher [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 The script was working great before PHP 4.2.x and not after that.  So, I
 looked through the code and came upon this variable, $$var.  I have no
 idea what the purpose of the double $ is for a variable.  Anyone know?

 --clip--
 $var = v.$counter._high_indiv;
 $val3 = $$var;
 --clip

 Thanks,
  FletchSOD



 --
 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 works the garbage collector

2002-04-16 Thread Andrey Hristov

There is another php option about the lifetime. If a session is not used for some 
amount of time it will be deleted when the GC
starts. GC starts wih some probability. For example GC can be started 1 time on every 
100 request, then it checks if there are
expired sessions( not sure but maybe based on atime of the file - for files) they are 
deleted.

Regards,

Andrey


- Original Message -
From: oje [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 15, 2002 11:51 AM
Subject: [PHP] How works the garbage collector


 Hi,

 I cannot figure out how the garbage collector works. If we set
 session.cookie_lifetime to 0, the session remains valid until the
 browser is closed. That's OK and it works. My question is : how the
 garbage collector knows that the browser is closed and that the session
 can be destroyed ?
 I found nothing in the session.c file. I am not an expert in C, however.

 Thanks

 Olivier


 --
 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] str_replace question

2002-04-16 Thread Andrey Hristov

preg_replace('/\d+/','',$the_string);

Hope this helps.

Andrey

- Original Message - 
From: Andras Kende [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 16, 2002 4:29 AM
Subject: [PHP] str_replace question


 Is a nicer way to remove any number 1-0 from a string???
 
 Currently:
 $metakeywords=str_replace(1,'',strtolower($metakeywords));
 $metakeywords=str_replace(2,'',strtolower($metakeywords));
 $metakeywords=str_replace(3,'',strtolower($metakeywords));
 $metakeywords=str_replace(4,'',strtolower($metakeywords));
 $metakeywords=str_replace(5,'',strtolower($metakeywords));
 $metakeywords=str_replace(6,'',strtolower($metakeywords));
 ..
 
 Thanks :)
 
 Andras Kende
 
 
 
 -- 
 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: [PHP-DB] Re: Cross DB application

2002-04-16 Thread Andrey Hristov


 Arcadius A. wrote:
 
  Hello !
  I'm planning to write a database application for  MySQL, and then port it to
  PostrgeSQL.
  Is there any library or class that could help me to write/maintain just one
  source code for both MySQL and PostgreSQL ?
 
Try the dbx extension.

Andrey


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




Re: [PHP] Seeing if a value matches anything in an array

2002-04-16 Thread Andrey Hristov

$pharray = array(php,the best language ever);
preg_match(/(?=What is )(\w+)(?:\?)/,$question,$matches);
if (in_array($matches[0],$phparray)){
// your stuff here
}

Regards,
Andrey

- Original Message - 
From: Leif K-Brooks [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 16, 2002 12:54 AM
Subject: [PHP] Seeing if a value matches anything in an array


 I'm trying to build some sort of AI chat bot in php (yes, I know I'm crazy).
 To do this, I need some way to check for the presence of any value from an
 array.  Example:
 
 $pharray = array(php,the best language ever);
 if($question == What is .anything_in_array_function($phparray).?){
 print Php is a programming language used mostly as a web scripting
 language.  (put some more stuff about php here);
 }
 
 What is the best way to do something like this? 
 
 -- 
 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 sort by 3rd row in an 2d-Array

2002-04-15 Thread Andrey Hristov

usort() /uksort()/uasort()

look here :
http://www.php.net/manual/en/function.uasort.php
There is an example in the user notes.

Andrey

- Original Message - 
From: SED [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 12, 2002 7:25 PM
Subject: [PHP] How to sort by 3rd row in an 2d-Array


 Hi,
 
 I'm trying to sort an array like following
 
 myArray[1][firstname] = Joe;
 myArray[1][lastname] = Smith;
 myArray[1][company] = Bullock;
 myArray[1][email] = [EMAIL PROTECTED];
 myArray[2][firstname] = Jim;
 myArray[2][lastname] = Cords;
 myArray[2][company] = Jamen;
 myArray[2][email] = [EMAIL PROTECTED];
 etc...
 
 by the company name. How can I do it?
 
 I found the solution on php.net
 (http://www.php.net/manual/en/function.array-multisort.php) but it sorts
 only the first row:
 
 foreach ($myArray as $val) {
 $sortarray[] = $val['nafn'];
 echo $val['stadur'];
 }
 array_multisort($myArray, $sortarray);
 
 Thanks in advance!
 
 SED
 
 
 -- 
 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] String termination

2002-04-12 Thread Andrey Hristov

the zval struct in PHP is multifunctional and its string branch has length member. 
Much of the operations on string are with
*_STRINGL() L comes from length. It is preferable php function to use the length 
instead of *_STRING macros which looks throug the
string to find its end.

Andrey
- Original Message -
From: Marco Laponder [EMAIL PROTECTED]
To: 'Php-General (E-mail) [EMAIL PROTECTED]
Sent: Friday, April 12, 2002 9:49 AM
Subject: [PHP] String termination


 Hi All,

 I have the following question. I have been developing with C for a
 while and I was used that the \0 indicated the end of a string. So if
 I had a variable containing 1234\056789 and the variable was printed,
 only 1234 was printed.

 As I can see in PHP (version  4.0.6 ), when I echo such a variable
 also the characters are printed, even the characters after \0. Is this
 the case PHP should work or is it a bug ? Isn't \0 really a string
 termination character in PHP ?

 I have been searching for documentation on this matter so if anyone
 could help me...

 Kind Regards,


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

2002-04-12 Thread Andrey Hristov

?php
function say_hello(){ print Hello; }

function welcome() { say_hello(); }
welcome();
?

HTH

Regards,
Andrey Hristov

- Original Message - 
From: Alia Mikati [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 12, 2002 4:37 PM
Subject: [PHP] functions


 hi
 i would like now how can we call a function within another function in 
 php?
 thx a lot
 
 
 
 -- 
 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] Soring an array

2002-04-09 Thread Andrey Hristov

select distinct member_id from mails_sent left join member_info using(member_id) left 
join stats_done using(member_id)...
so

select distinct number_number from table1 left join table2 using(you_foreign_key) left 
join table3 using(your_foreign_key2) 

your_foreign_key* is a field common to table(x) and table(x+1)

HTH

Regards,
Andrey Hristov

- Original Message - 
From: Vasoczki Ferenc [EMAIL PROTECTED]
To: Php Mailing List (E-mail) [EMAIL PROTECTED]
Sent: Tuesday, April 09, 2002 11:26 AM
Subject: [PHP] Soring an array


 Hi!
 
 I am new on this list, so i welcome everybody!
 /sorry if my english is not too good/
 
 My problem is:
 I want to sort an array.
 I found the array_multisort funciton in the help, but that is for
 multidimensional arrays, or 2 or more arrays.
 
 What i need exactly.
 
 I have 5 MySQL tables, and i want to collect some informations from all
 theese tables, and then get out only the different items.
 Like: 1st table: 1,2,3  2nd: 2,4,3  3rd: 5,1,5
 
 I need an array, what will include 1,2,3,4,5
 
 So i thought, i collect all the numbers in 1 array, then sort it, and then
 get out the duplicat items.
 
 Any suggestion ?
 
 Thx
 
 Vaso
 
 
 -- 
 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] Soring an array

2002-04-09 Thread Andrey Hristov

So you have several table for the teachers.
make the join and instead of using  use on
so:
select disctinct * from table1 left join table2 on table1.for_key12=table2.for_key21 
left join table3 on
table2.for_key23=table3.for_key32 
Example :
select disctinct * from teacher1 left join teacher2 on teacher1.shool=teacher2.kindga;

Regards,
Andrey

- Original Message -
From: Vasoczki Ferenc [EMAIL PROTECTED]
To: 'Andrey Hristov' [EMAIL PROTECTED]
Sent: Tuesday, April 09, 2002 11:47 AM
Subject: RE: [PHP] Soring an array


hm, maybe, just i don't understand this join exactly...
as i said i have 5 tables. every table have a primary key. The 1-3 this
called school, in the 4-5 this called: kindergarten. And i want to get
out, all the different month, and year.

like:
Teacher table:

shool | month |year |
25485 04 2001
etc...

Teacher table:

kindga| month |year |
25485 04 2001
25485 03 2002
etc...

imagine the rest of..

and i need only 2 items:
042001
032002

Vaso

-Original Message-
From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
Sent: 2002. április 9. 10:39
To: Vasoczki Ferenc
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Soring an array


select distinct member_id from mails_sent left join member_info
using(member_id) left join stats_done using(member_id)...
so

select distinct number_number from table1 left join table2
using(you_foreign_key) left join table3 using(your_foreign_key2) 

your_foreign_key* is a field common to table(x) and table(x+1)

HTH

Regards,
Andrey Hristov

- Original Message -
From: Vasoczki Ferenc [EMAIL PROTECTED]
To: Php Mailing List (E-mail) [EMAIL PROTECTED]
Sent: Tuesday, April 09, 2002 11:26 AM
Subject: [PHP] Soring an array


 Hi!

 I am new on this list, so i welcome everybody!
 /sorry if my english is not too good/

 My problem is:
 I want to sort an array.
 I found the array_multisort funciton in the help, but that is for
 multidimensional arrays, or 2 or more arrays.

 What i need exactly.

 I have 5 MySQL tables, and i want to collect some informations from all
 theese tables, and then get out only the different items.
 Like: 1st table: 1,2,3  2nd: 2,4,3  3rd: 5,1,5

 I need an array, what will include 1,2,3,4,5

 So i thought, i collect all the numbers in 1 array, then sort it, and then
 get out the duplicat items.

 Any suggestion ?

 Thx

 Vaso


 --
 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] printing and ?

2002-04-09 Thread Andrey Hristov

htmlspecialchars()

Andrey
- Original Message - 
From: Hawk [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 09, 2002 8:33 PM
Subject: [PHP] printing  and  ?


 I have a clan database, and some clans use  in their tags, my problem
 right now it how the best way to print these as characters, and not code..
 any easy suggestions?
 
 
 
 -- 
 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] urlencode and decode are producing \\\' instead of \'

2002-03-29 Thread Andrey Hristov

try to do double rawurldecode().

Andrey

- Original Message - 
From: andy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 29, 2002 2:36 PM
Subject: Re: [PHP] urlencode and decode are producing \\\' instead of \'


 does not help, any other ideas?
 
 
 Bogdan Stancescu [EMAIL PROTECTED] schrieb im Newsbeitrag
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  You don't have to rawurlDEcode again - that's done automatically. You
  have to encode so you're HTTP compliant, but the decoding is done by PHP
  (or even Apache? I'm not sure) when receiving urlencoded strings via URL
  and form data.
 
  Bogdan
 
  andy wrote:
 
  Hi there,
  
  I am trying to fill a form again when an error occures, therefore I
 redirect
  to the form and pass the values via url like this:
  
 
 HEADER(Location:/profiles/6.$recipient_id.2.html?subject=.rawurlencode(
 $
  subject).message=.rawurlencode($message).);
  
  then I put it in again like this
   textarea name=message rows=10 style=width:485px; cols=58
  wrap=virtual'.rawurldecode($message).'/textarea
  
  The problem is, that this is causing a message like this:
  test  \\\'
  
  So what's wrong? Can anybody help on this?
  
  Thank you,
  
  Andy
  
  
  
 
 
 
 
 
 
 -- 
 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] login library

2002-03-27 Thread Andrey Hristov

For example use session_ids. This does not mean that use MUST use PHP session module. 
Store a unique string in the DB and set it as
cookie for the user. When someone logs generate a string, write it in the members 
table and old session is removed, so the user with
old session will be not able to access pages except if relogging and thus expiring 
second login.

Best regards,
Andrey


- Original Message -
From: Michal Dvoracek [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 28, 2002 9:58 AM
Subject: [PHP] login library


 Hello,

 i want to write some application that requires users login.

 So i have question how i can check duplicity login (eg. browser crash,
 login from one computer using two browsers, ...). I need some idea
 (the best will be some example code :) ).

 Thank you.

 Michal Dvoracek  [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] module startup and shutdown functions

2002-03-26 Thread Andrey Hristov

You may start your search here : http://php.net/manual/en/zend.startup-and-shutdown.php


Andrey

- Original Message -
From: Jason Goodman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 26, 2002 5:40 PM
Subject: [PHP] module startup and shutdown functions


 Can someone tell me about the shutdown functions or give me a URL to read about 
them?  I have a couple of things I would like to
have happen, only once, right before the PHP page is closed.

 Thanks,
 Jason Goodman

 --
 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] GIF support in PHP

2002-03-25 Thread Andrey Hristov

This is the way under windows. Hmm, possibly you want GD extension but GIF format was 
excluded from the supported in the past but
you can apply a crack over the GD and then recompile. For *nix : Get the sources, 
compile GD as a module and edit php.ini so PHP
(possibly libphp4.so) will load the extension on Apache restart. Restart Apache.


Best regards,
Andrey Hristov

- Original Message -
From: Todor Stoyanov [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 25, 2002 3:43 PM
Subject: [PHP] GIF support in PHP


 Is there a way to add GIF support in PHP without recompiling?
 Just adding as an extension.

 Tanks a lot.



 --
 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] localization - internationalization

2002-03-25 Thread Andrey Hristov

use setlocale() to set locale in every script.
then the output from different functions - number_format(), strftime(), etc. will be 
according to the locale.
I've not tried this but it have to work.

Best regards,
Andrey


- Original Message - 
From: Matt Friedman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 25, 2002 5:03 PM
Subject: [PHP] localization - internationalization


 Hi,
 
 Just wondering how many folks are working on localization issues. I am
 building an application and have built in support for multi-languages,
 but I do not yet have anything set up for handling different monetary
 and date formatting. What other issues should I consider?
 
 Any pointers to help on this subject and your input are appreciated as
 always.
 
 Many thanks,
 Matt Friedman
 www.SpryNewMedia.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] comparisons

2002-03-22 Thread Andrey Hristov


 if (ereg(john,$jeff) ) { }
 
ok
 or:
 
 if( strstr( $jeff, john) ) { }
 
ok
 or:
 
 if( strpos( $jeff, john) ) { }
error

if  (strpos($jeff, john) !== FALSE)

Best regards,
Andrey Hristov



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




Re: [PHP] comparisons

2002-03-22 Thread Andrey Hristov

From the docs :
Note: It is easy to mistake the return values for character found at position 0 and 
character not found.  Here's how to detect
the difference:

// in PHP 4.0b3 and newer:
$pos = strpos($mystring, b);
if ($pos === false) { // note: three equal signs
// not found...
}

// in versions older than 4.0b3:
$pos = strpos($mystring, b);
if (!is_integer($pos)) {
// not found...
}

Andrey

- Original Message -
From: Rick Emery [EMAIL PROTECTED]
To: 'Andrey Hristov' [EMAIL PROTECTED]; Rick Emery [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, March 22, 2002 3:58 PM
Subject: RE: [PHP] comparisons


 Andrey, you are incorrect.

 From the manual on strpos():
 int strpos (string haystack, string needle [, int offset])
 If needle is not found, returns FALSE.

 -Original Message-
 From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
 Sent: Friday, March 22, 2002 7:47 AM
 To: Rick Emery
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] comparisons



  if (ereg(john,$jeff) ) { }
 
 ok
  or:
 
  if( strstr( $jeff, john) ) { }
 
 ok
  or:
 
  if( strpos( $jeff, john) ) { }
 error

 if  (strpos($jeff, john) !== FALSE)

 Best regards,
 Andrey Hristov


 --
 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: [PHP-DEV] - Looking for good php-editor

2002-03-21 Thread Andrey Hristov

Komodo by ASPN - commercial. Code completion, debugging, syntaxt highlighting, syntaxt 
checking.
AnyEdit - Editor. Crashes on my Win2k but may work on yours. On http://sourceforge.net
UltraEdit - Commercial. Syntaxt highlighting with a additional info in a text file. 
The additional info about syntax highlighting
can be found on Sourceforge. Look for : php syntaxt highlighting.
PHPMole - Written in PHP requires GTK. Instructions for installation on the PHPMole's 
site.
EditPlus - commercial. One of my colleagues prefers it.
Suggestion : Look on freshmeat.net and sourceforge.net for IDE or editor syntax 
highlighting

Best regards,
Andrey Hristov

- Original Message -
From: Krister Hansson [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 21, 2002 10:20 AM
Subject: [PHP-DEV] - Looking for good php-editor


Hi there!!

I'm fairly new as a php developer and I can't seem to find a good editor. I've 
installed and uninstalled about 20 of them and now
I'm tired of it. Is there anyone (and there should be ;) ) who know of an editor I can 
use. If you do please mail me a link or
something

I'm working in Win2k

regards

Krister


--
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] variable test

2002-03-21 Thread Andrey Hristov

 
 if($x)
echo $x;

if $x is not defined you will get a warning but that depends on error settings in 
php.ini.
This construction checks whether $x is defined or $x is true.

 
 if(!empty($x))
echo $x;

$x must be defined.
 
 -- 
 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] Returning mutliple matches of a regex with preg_match()

2002-03-20 Thread Andrey Hristov

use preg_match_all();
the var_dump($matches); to see what happened.

Best regards,
Andrey Hristov



- Original Message - 
From: Stefen Lars [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 21, 2002 7:27 AM
Subject: [PHP] Returning mutliple matches of a regex with preg_match()


 Hello all
 
 I have been scratching my head for the last two days about this regular 
 expression problem. I would be really VERY happy if someone could help me!
 
 I have the following text in the file 'text.htm', for example:
 
 --
 
 BLOCKQUOTEP
 Cow, Cow, Cow, Cow, Cow
 Cow, Cow, Cow, Cow, Cow
 Cow, Cow, Cow, Cow, Cow
 a lot of lines
 /P/BLOCKQUOTE
 
 pboring stuff - we are not interested in this/p
 
 BLOCKQUOTEP
 Chicken, Chicken, Chicken
 Chicken, Chicken, Chicken
 Chicken, Chicken, Chicken
 more lines
 /P/BLOCKQUOTE
 
 pmore boring stuff - we are not interested in this/p
 
 BLOCKQUOTEP
 Rabbit, Rabbit, Rabbit, Rabbit
 
 /P/BLOCKQUOTE
 
 peven more boring stuff - we are not interested in this/p
 
 BLOCKQUOTEP
 Pig, Pig, Pig, Pig, Pig
 /P/BLOCKQUOTE
 
 --
 
 I want to return all the stuff between BLOCKQUOTEP ... /P/BLOCKQUOTE 
 in an array. One element per match. For example, for the above text, I would 
 like to get back an array back like this:
 
 array(
 Cow, Cow, Cow, Cow, Cow Cow, Cow, Cow, Cow, Cow Cow, Cow, Cow, Cow, Cow a 
 lot of lines,
 Chicken, Chicken, Chicken Chicken, Chicken, Chicken Chicken, Chicken, 
 Chicken more lines,
 Rabbit, Rabbit, Rabbit, Rabbit,
 Pig, Pig, Pig, Pig, Pig
 )
 
 I have been trying to do this with (many variations of) the following code:
 
 --
 
 ?PHP
 
 // open file
 $fd = fopen (./text.htm, r);
 
 // load contents into a variable
 while (!feof ($fd))
 {
 $content .= fgets($fd, 4096);
 }
 
 // close file
 fclose ($fd);
 
 // remove char returns and co.
 $content = preg_replace(/(\r\n)|(\n\r)|(\n|\r)/,  ,$content);
 
 // match agains regex -- this does not work correctly
 if 
 (preg_match(/BLOCKQUOTEP(.*)\/P\/BLOCKQUOTE/i,$content,$matches))
 {
 echo pre;
 var_dump($matches);
 echo /pre;
 }
 
 ?
 
 --
 
 For the above, var_dump() returns this:
 
 --
 
 array(2) {
   [0]=
   string(556) BLOCKQUOTEP Cow, Cow, Cow, Cow, Cow Cow, Cow, Cow, Cow, 
 Cow Cow, Cow, Cow, Cow, Cow a lot of lines /P/BLOCKQUOTE  pboring 
 stuff - we are not interested in this/p  BLOCKQUOTEP Chicken, 
 Chicken, Chicken Chicken, Chicken, Chicken Chicken, Chicken, Chicken more 
 lines /P/BLOCKQUOTE  pmore boring stuff - we are not interested in 
 this/p  BLOCKQUOTEP Rabbit, Rabbit, Rabbit, Rabbit  
 /P/BLOCKQUOTE  peven more boring stuff - we are not interested in 
 this/p  BLOCKQUOTEP Pig, Pig, Pig, Pig, Pig /P/BLOCKQUOTE
   [1]=
   string(524)  Cow, Cow, Cow, Cow, Cow Cow, Cow, Cow, Cow, Cow Cow, Cow, 
 Cow, Cow, Cow a lot of lines /P/BLOCKQUOTE  pboring stuff - we are not 
 interested in this/p  BLOCKQUOTEP Chicken, Chicken, Chicken 
 Chicken, Chicken, Chicken Chicken, Chicken, Chicken more lines 
 /P/BLOCKQUOTE  pmore boring stuff - we are not interested in 
 this/p  BLOCKQUOTEP Rabbit, Rabbit, Rabbit, Rabbit  
 /P/BLOCKQUOTE  peven more boring stuff - we are not interested in 
 this/p  BLOCKQUOTEP Pig, Pig, Pig, Pig, Pig 
 }
 
 --
 
 Clearly not what I want.
 
 Is my approach here incorrect? Or is it indeed possible to construct a regex 
 to do what I want (with just one pass of the text)?
 
 Thank you in advance.
 
 :-))
 
 S.
 
 
 
 
 
 
 _
 Send and receive Hotmail on your mobile device: http://mobile.msn.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] Please explain...

2002-03-19 Thread Andrey Hristov

AFAIK the problem reported comes from that $x is on the left but foo is on the right.
so you convert foo to int, and because there is not digit in foo it is 0.
?php
$a=4some;
$b=$a+2;
var_dump($b);
?
int(6)

?php
$x=0;
if ($x==foo) echo foobar;
?
?php
$x=1;
if (foo==$x) echo fubar; // same with ===
?
Output:
foobar

foo evaluates as 0 in the comparison.

Andrey


- Original Message -
From: Rudolf Visagie [EMAIL PROTECTED]
To: Alexander Skwar [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, March 19, 2002 1:01 PM
Subject: RE: [PHP] Please explain...


For interest's sake the following code:

$x = 0;
if ($x == foo) {
echo This is an integer comparison with foo being .$x.br;
}
$y = true;
if ($y == foo) {
echo This is a boolean comparison with foo being .$y.br;
}

prints:

This is an integer comparison with foo being 0
This is a boolean comparison with foo being 1

Cheers

-Original Message-
From: Alexander Skwar [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 19, 2002 12:51 PM
To: Rudolf Visagie
Cc: Jan Rademaker; [EMAIL PROTECTED]
Subject: Re: [PHP] Please explain...


»Rudolf Visagie« sagte am 2002-03-19 um 12:19:04 +0200 :
 I would guess that the string foo evaluates to integer 0 in the
comparison

Hmm, shouldn't a filled string (foo) evaluate to TRUE, ie. to 1?

Alexander Skwar
--
How to quote: http://learn.to/quote (german) http://quote.6x.to (english)
Homepage: http://www.iso-top.de  | Jabber: [EMAIL PROTECTED]
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
   Uptime: 1 day 23 hours 44 minutes

--
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: [PHP-DB] How to add 2 years to todays date ?

2002-03-18 Thread Andrey Hristov

$your_timestamp+=gmmktime(0,0,0,1,1,1972);

Regards,
Andrey

- Original Message - 
From: Dave Carrera [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 18, 2002 10:11 AM
Subject: [PHP-DB] How to add 2 years to todays date ?


 Hi All
 I think the subject line says it all.
  
 How to add 2 years to today's date ?
  
 Any helps as always most appreciated.
  
  
  
 Dave Carrera
 Php Developer
 http://davecarrera.freelancers.net
 http://www.davecarrera.com
  
  
 


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




Re: [PHP] Re: [PHP-DB] How to add 2 years to todays date ?

2002-03-18 Thread Andrey Hristov

Isn't the hack with gmmktime() faster? It is clean if the code knows what is 1,1,1970 
and how Unixtime is measured.

Andrey

- Original Message - 
From: Martin Schichl [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 18, 2002 10:29 AM
Subject: Re: [PHP] Re: [PHP-DB] How to add 2 years to todays date ?


 
 
 At 10:19 18.03.02 +0200, Andrey Hristov [EMAIL PROTECTED] wrote:
 $your_timestamp+=gmmktime(0,0,0,1,1,1972);
 
 Try:
 
 $your_timestamp =
 mktime(date(H),date(i),date(s),date(m),date(d),(date(Y)+2));
 
 Is there anything why this would not work?
 
 Martin
 
 
 
 -
 Dipl.-Ing. Martin Schichl
 SCC Software, Communication  Consulting GmbH  Co KEG
 Grottenhofstr. 3, A-8053 Graz
 Tel. +43/(0)316/265-205, Fax +43/(0)316/265-234
 [EMAIL PROTECTED], http://scc.co.at
 
 
 -- 
 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] Store data in array

2002-03-18 Thread Andrey Hristov

If it is possible do the sorting in the SQL statement by using ORDER BY. SQL sorting 
is much faster than in PHP.
However
while ($row= mysql_fetch_assoc($res)){ $rows[] = $row; }

Then you have many ways to sort. Look at : sort(), asort(), arsort(), usort(), 
uasort() etc.

Best regards,
Andrey Hristov

- Original Message - 
From: Uma Shankari T. [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 18, 2002 12:25 PM
Subject: [PHP] Store data in array


 
 
 Hello,
 
 Anyone can please tell me how to store the row details fetched from
 database to array so that to sort the same array after storing
 
 
 -Uma
 
 
 -- 
 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] Store data in array

2002-03-18 Thread Andrey Hristov

It is showing Array probably because you do
echo $rows; 
and because $rows is array you receive Array;
try
foreach($rows as $k=$v){
print \n[$k][$v]br;
}

Regards,
Andrey
- Original Message - 
From: Uma Shankari T. [EMAIL PROTECTED]
To: Andrey Hristov [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, March 18, 2002 1:24 PM
Subject: Re: [PHP] Store data in array


 
 
 On Mon, 18 Mar 2002, Andrey Hristov wrote:
 
 AHIf it is possible do the sorting in the SQL statement by using ORDER BY. SQL 
sorting is much faster than in PHP.
 AHHowever
 
 I have gone through that manual alreadybut i need to sort by php
 sorting.
 
 AHwhile ($row= mysql_fetch_assoc($res)){ $rows[] = $row; }
 AH
 
 I have tried this but while sorting using php sort it is displaying array
 only.If the elements are stored in the array properly i can perform 
 sorting.
 
 please tell me how to extract a specific field from mysql database and
 store it in array...
 
 AHThen you have many ways to sort. Look at : sort(), asort(), arsort(), usort(), 
uasort() etc.
 AH
 AHBest regards,
 AHAndrey Hristov
 AH
 AH- Original Message - 
 AHFrom: Uma Shankari T. [EMAIL PROTECTED]
 AHTo: [EMAIL PROTECTED]
 AHSent: Monday, March 18, 2002 12:25 PM
 AHSubject: [PHP] Store data in array
 AH
 AH
 AH 
 AH 
 AH Hello,
 AH 
 AH Anyone can please tell me how to store the row details fetched from
 AH database to array so that to sort the same array after storing
 AH 
 AH 
 AH -Uma
 AH 
 AH 
 AH -- 
 AH PHP General Mailing List (http://www.php.net/)
 AH To unsubscribe, visit: http://www.php.net/unsub.php
 AH 
 AH 
 AH
 
 
 -- 
 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] object reflection in php?

2002-03-18 Thread Andrey Hristov

get_object_vars(),
get_class_vars(),
get_class_methods()


Andrey

- Original Message - 
From: Filippo Veneri [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 18, 2002 1:28 PM
Subject: [PHP] object reflection in php?


 Is there a way to get the name of a filed
 from a variable pointing to some object?
 
 Just to make myself understood:
 
 class obj {
var $field;
function obj( $value ) {
  $this-field = $value;
}
 }
 
 $o = new obj( field value );
 
 How can i know, if possible,  that the instance of
 obj pointed to by $o has a field named field?
 
 This would be useful to write an object to a database
 without knowing its structure 'a-priori'.
 
 Thanks
 
 fbv
 
 
 -- 
 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] Sessions

2002-03-18 Thread Andrey Hristov

not the session is registered but a variable in the session jar.


Andrey

- Original Message - 
From: Morten Nielsen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 18, 2002 7:45 PM
Subject: [PHP] Sessions


 Hi,
 
 I got a page that is being reloaded a lot. In the bigging I register a
 Session variable with the SESSION_START and SESSION_REGISTER functions.
 Is it wrong that I keep registering the session?
 Should I also unregister the session at the bottom of the page?
 
 Regards,
 Morten
 
 
 
 -- 
 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] Testing for NULL

2002-03-18 Thread Andrey Hristov

if (!isset($login)){
echo login undefined;
}

Best regards,
Andrey Hristov

- Original Message - 
From: Jesse Warden [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 18, 2002 9:09 PM
Subject: [PHP] Testing for NULL


 Hi, I am new... hope I am using this list correctly.
 
 I am trying to test for a null value, and if it is null, then to use a
 default value instead.  The login page that I have, I want to show nothing
 in the username field unless it is passed a username from another PHP page
 via the header function.  However, every time I write:
 
 if($username == null){
 echo Username is null;
 }
 
 It executes the echo, but only after giving me an error.  Is there a way to
 suppress this error or check for an undefined instead?
 
 J
 
 
 ** Scanned for Viruses **
 
 -- 
 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] server load

2002-03-16 Thread Andrey Hristov

Flex - the tools that parses the code skips everything between /* and */ and for this 
no token is given back. Of course if you don't
have 5kb comments Flex will be a little faster but possibly few %.

Regards,
Andrey

- Original Message -
From: caspar kennerdale [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Saturday, March 16, 2002 7:13 PM
Subject: [PHP] server load


 Would a 10kb file which has 5kb of comments take longer to process in php
 than the same file wihout the comments which is 5kb?

 Or are the comments ignored as far as server load and speed to delivery are
 concerned?


 --
 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] server load

2002-03-16 Thread Andrey Hristov

However write short but meaningful comments. Keep in mind that the scripts has to be 
loaded in the memory from the disk. Although
after first request it is in some cache.


Andrey


- Original Message -
From: caspar kennerdale [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 16, 2002 7:24 PM
Subject: RE: [PHP] server load


 So you could have as much commented text without any detriment to the pages
 performance?

 great



 -Original Message-
 From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
 Sent: 16 March 2002 17:17
 To: caspar kennerdale
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] server load


 Flex - the tools that parses the code skips everything between /* and */ and
 for this no token is given back. Of course if you don't
 have 5kb comments Flex will be a little faster but possibly few %.

 Regards,
 Andrey

 - Original Message -
 From: caspar kennerdale [EMAIL PROTECTED]
 To: PHP General [EMAIL PROTECTED]
 Sent: Saturday, March 16, 2002 7:13 PM
 Subject: [PHP] server load


  Would a 10kb file which has 5kb of comments take longer to process in php
  than the same file wihout the comments which is 5kb?
 
  Or are the comments ignored as far as server load and speed to delivery
 are
  concerned?
 
 
  --
  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] server load

2002-03-16 Thread Andrey Hristov

I have :)))

Andrey

- Original Message - 
From: caspar kennerdale [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 16, 2002 7:40 PM
Subject: RE: [PHP] server load


 I am thinking of using a documentation parser such as javadoc (called
 phpdoc) which will create a separate html document on the functions and
 feastures of the classes I am writing,as well as examples and tutorial info.
 
 I am just considering whether or no I have two versions - a no comments
 version which goes live and a commented version which I compile the html
 fromand also distribute.
 
 Does anyone here have experience with phpdoc?
 
 -Original Message-
 From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
 Sent: 16 March 2002 17:29
 To: caspar kennerdale
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] server load
 
 
 However write short but meaningful comments. Keep in mind that the scripts
 has to be loaded in the memory from the disk. Although
 after first request it is in some cache.
 
 
 Andrey
 
 
 - Original Message -
 From: caspar kennerdale [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, March 16, 2002 7:24 PM
 Subject: RE: [PHP] server load
 
 
  So you could have as much commented text without any detriment to the
 pages
  performance?
 
  great
 
 
 
  -Original Message-
  From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
  Sent: 16 March 2002 17:17
  To: caspar kennerdale
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] server load
 
 
  Flex - the tools that parses the code skips everything between /* and */
 and
  for this no token is given back. Of course if you don't
  have 5kb comments Flex will be a little faster but possibly few %.
 
  Regards,
  Andrey
 
  - Original Message -
  From: caspar kennerdale [EMAIL PROTECTED]
  To: PHP General [EMAIL PROTECTED]
  Sent: Saturday, March 16, 2002 7:13 PM
  Subject: [PHP] server load
 
 
   Would a 10kb file which has 5kb of comments take longer to process in
 php
   than the same file wihout the comments which is 5kb?
  
   Or are the comments ignored as far as server load and speed to delivery
  are
   concerned?
  
  
   --
   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
 
 


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




Re: [PHP] server load

2002-03-16 Thread Andrey Hristov

I've just tested on the productional test server a sample php consisting from 62kb 
comment. Benchmarked with ab
1-st bench - ten connections
Server Port:80

Document Path:  /test.php
Document Length:0 bytes

Concurrency Level:  10
Time taken for tests:   0.552 seconds
Complete requests:  100
Failed requests:0
Total transferred:  17992 bytes
HTML transferred:   0 bytes
Requests per second:181.16
Transfer rate:  32.59 kb/s received

2-nd bench:
Server Port:80

Document Path:  /test.php
Document Length:0 bytes

Concurrency Level:  10
Time taken for tests:   100.601 seconds
Complete requests:  1
Failed requests:0
Total transferred:  1730173 bytes
HTML transferred:   0 bytes
Requests per second:99.40
Transfer rate:  17.20 kb/s received

3rd bench:  - one connection
Server Port:80

Document Path: /test.php
Document Length:0 bytes

Concurrency Level:  1
Time taken for tests:   280.047 seconds
Complete requests:  1
Failed requests:0
Total transferred:  173 bytes
HTML transferred:   0 bytes
Requests per second:35.71
Transfer rate:  6.18 kb/s received

Connnection Times (ms)
  min   avg   max
Connect:0 3  3000
Processing: 924   209
Total:  927  3209

Keep in mind that I've started ab from another machine on the same 100Mbit network.

Regards,
Andrey

- Original Message - 
From: caspar kennerdale [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 16, 2002 7:40 PM
Subject: RE: [PHP] server load


 I am thinking of using a documentation parser such as javadoc (called
 phpdoc) which will create a separate html document on the functions and
 feastures of the classes I am writing,as well as examples and tutorial info.
 
 I am just considering whether or no I have two versions - a no comments
 version which goes live and a commented version which I compile the html
 fromand also distribute.
 
 Does anyone here have experience with phpdoc?
 
 -Original Message-
 From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
 Sent: 16 March 2002 17:29
 To: caspar kennerdale
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] server load
 
 
 However write short but meaningful comments. Keep in mind that the scripts
 has to be loaded in the memory from the disk. Although
 after first request it is in some cache.
 
 
 Andrey
 
 
 - Original Message -
 From: caspar kennerdale [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, March 16, 2002 7:24 PM
 Subject: RE: [PHP] server load
 
 
  So you could have as much commented text without any detriment to the
 pages
  performance?
 
  great
 
 
 
  -Original Message-
  From: Andrey Hristov [mailto:[EMAIL PROTECTED]]
  Sent: 16 March 2002 17:17
  To: caspar kennerdale
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] server load
 
 
  Flex - the tools that parses the code skips everything between /* and */
 and
  for this no token is given back. Of course if you don't
  have 5kb comments Flex will be a little faster but possibly few %.
 
  Regards,
  Andrey
 
  - Original Message -
  From: caspar kennerdale [EMAIL PROTECTED]
  To: PHP General [EMAIL PROTECTED]
  Sent: Saturday, March 16, 2002 7:13 PM
  Subject: [PHP] server load
 
 
   Would a 10kb file which has 5kb of comments take longer to process in
 php
   than the same file wihout the comments which is 5kb?
  
   Or are the comments ignored as far as server load and speed to delivery
  are
   concerned?
  
  
   --
   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
 
 


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




Re: [PHP] Deleteing folders containing files...

2002-03-15 Thread Andrey Hristov

Linux /Unix - 

$some=`rm -rf your_dir`;

Regards,
Andrey

- Original Message - 
From: Philip Jeffs [EMAIL PROTECTED]
To: PHP LIST [EMAIL PROTECTED]
Sent: Friday, March 15, 2002 11:36 AM
Subject: [PHP] Deleteing folders containing files...


Hi,

Does anyone know of an 'easy' way to delete folders that contain files and sub-folders?

Thanks,

Phil
-
 
Philip Jeffs
 
The Tickle Group
The Gate House
Summerseat
Bury
Lancashire
BL9 5PE
United Kingdom
W: http://www.tickle.co.uk
T: 01706 823456
F: 01706 829500
E: [EMAIL PROTECTED] (daytime)
[EMAIL PROTECTED] (evening)
 
-




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




Re: [PHP] multiple variables

2002-03-15 Thread Andrey Hristov

if (in_array($arbitraryValue,array(1,2,3,4))){


}
- Original Message - 
From: Ralph Jarvis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 15, 2002 4:50 PM
Subject: [PHP] multiple variables


 Hi;
 
 An obvious question for some, but I am stumped:
 
 I want to use multiple optins in an if statement...
 
 if(user($arbitraryVariable)==(1 or 2 or 3 or 4))
 
 What would be the proper syntax for this?
 
 Thanks
 
 
 
 -- 
 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] Opera broswer file upload

2002-03-14 Thread Andrey Hristov

This problem was fixed in the CVS.

Best regards,
Andrey Hristov

- Original Message - 
From: Vlad Kulchitski [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 14, 2002 5:57 PM
Subject: [PHP] Opera broswer  file upload



Also another question, my fileupload works everywhere (IE, Netscape) but
Opera. Does Opera support it at all?

My fileupload is very simple. It checks is the file is JPEG/GIF/BMP and
then
saves it, if not, gives an error message.

Vlad


-- 
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] Opera broswer file upload

2002-03-14 Thread Andrey Hristov

CVS is the code repository. The PHP code is developed by many programmers and the CVS 
is used to store the code.
CVS = concurent versioning systems. It is used to prevent race conditions when two or 
more programmers are writing/patching a code.
Also there are many other pretty things.
So when bug is reported it is patched in the CVS and after some time new version is 
released at some time.

Andrey

- Original Message -
From: Vlad Kulchitski [EMAIL PROTECTED]
To: Andrey Hristov [EMAIL PROTECTED]
Sent: Thursday, March 14, 2002 6:06 PM
Subject: RE: [PHP] Opera broswer  file upload



Andrey what is CVS?

- Original Message -

This problem was fixed in the CVS.

Best regards,
Andrey Hristov

- Original Message -
From: Vlad Kulchitski [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 14, 2002 5:57 PM
Subject: [PHP] Opera broswer  file upload



Also another question, my fileupload works everywhere (IE, Netscape) but
Opera. Does Opera support it at all?

My fileupload is very simple. It checks is the file is JPEG/GIF/BMP and
then
saves it, if not, gives an error message.

Vlad


--
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] Opera broswer file upload

2002-03-14 Thread Andrey Hristov

Look here for more info about file upload problems with Opera:
http://bugs.php.net/search.php?cmd=displaysearch_for=operax=0y=0

Andrey

- Original Message - 
From: Vlad Kulchitski [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 14, 2002 5:57 PM
Subject: [PHP] Opera broswer  file upload



Also another question, my fileupload works everywhere (IE, Netscape) but
Opera. Does Opera support it at all?

My fileupload is very simple. It checks is the file is JPEG/GIF/BMP and
then
saves it, if not, gives an error message.

Vlad


-- 
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 access arrays from $GLOBAL?

2002-03-13 Thread Andrey Hristov

IMO it is not weird. Think about $GLOBALS['mtxt'] as a pointer to array(it is not but 
this is a good example).
$GLOBALS is a hash list. So it has sub elements - zvals (internal _zend_value ). Every 
from these zvals can hold zvals. In C the
syntax is arFooBar[1][2], not arFooBar[[1][2]]

I am not nagging(not sure for the word) at you.


Best regards,
Andrey Hristov
- Original Message -
From: Richard Davey [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 13, 2002 6:52 PM
Subject: Re: [PHP] How to access arrays from $GLOBAL?


 Mike Ford [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  $GLOBALS['mtxt'][1]

 Fantastic :)

 That's totally illogical but it works a treat.
 PHP has some weird syntax rules sometimes!

 Cheers,

 Rich
 --
 Fatal Design
 http://www.fatal-design.com
 Atari / DarkBASIC / Coding / Since 1995



 --
 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 access arrays from $GLOBAL?

2002-03-13 Thread Andrey Hristov

Sources.

Andrey 

- Original Message - 
From: Hunter, Ray [EMAIL PROTECTED]
To: 'Rasmus Lerdorf' [EMAIL PROTECTED]; Richard Davey [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, March 13, 2002 6:59 PM
Subject: RE: [PHP] How to access arrays from $GLOBAL?


 Where is some good documentation on how $GLOBALS works and what is really
 going on in the background?
 
 
 Thank you,
 
 Ray Hunter
 Firmware Engineer
 
 ENTERASYS NETWORKS
 
 
 -Original Message-
 From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, March 13, 2002 9:53 AM
 To: Richard Davey
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] How to access arrays from $GLOBAL?
 
 
 I don't understand why you think it is illogical.  How else would you
 dereference a multi-dimensional array?
 
 On Wed, 13 Mar 2002, Richard Davey wrote:
 
  Mike Ford [EMAIL PROTECTED] wrote in message 
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED].
  ..
   $GLOBALS['mtxt'][1]
 
  Fantastic :)
 
  That's totally illogical but it works a treat.
  PHP has some weird syntax rules sometimes!
 
  Cheers,
 
  Rich
  --
  Fatal Design
  http://www.fatal-design.com
  Atari / DarkBASIC / Coding / Since 1995
 
 
 
  --
  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] How to access arrays from $GLOBAL?

2002-03-13 Thread Andrey Hristov

to add that $GLOBALS has reference to itself but when used in non-function context. 
Try ?php var_dump($GLOBALS);? and ?php
function a(){ var_dump($GLOBALS); } a(); ?

Regards,
Andrey Hristov

- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Hunter, Ray [EMAIL PROTECTED]
Cc: Richard Davey [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, March 13, 2002 7:09 PM
Subject: RE: [PHP] How to access arrays from $GLOBAL?


 I am not sure there is any.  $GLOBALS is simply an array that contains
 individual references to each global variable.

 For example:

   $a = 1;
   $GLOBALS['a'] = 2;
   echo $a;

 gives you 2

 The best documentation is probably the basic explanation of how references
 work.  http://php.net/references

 -Rasmus

 On Wed, 13 Mar 2002, Hunter, Ray wrote:

  Where is some good documentation on how $GLOBALS works and what is really
  going on in the background?
 
 
  Thank you,
 
  Ray Hunter
  Firmware Engineer
 
  ENTERASYS NETWORKS
 
 
  -Original Message-
  From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, March 13, 2002 9:53 AM
  To: Richard Davey
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] How to access arrays from $GLOBAL?
 
 
  I don't understand why you think it is illogical.  How else would you
  dereference a multi-dimensional array?
 
  On Wed, 13 Mar 2002, Richard Davey wrote:
 
   Mike Ford [EMAIL PROTECTED] wrote in message
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED].
   ..
$GLOBALS['mtxt'][1]
  
   Fantastic :)
  
   That's totally illogical but it works a treat.
   PHP has some weird syntax rules sometimes!
  
   Cheers,
  
   Rich
   --
   Fatal Design
   http://www.fatal-design.com
   Atari / DarkBASIC / Coding / Since 1995
  
  
  
   --
   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




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




Re: [PHP] PHP IDE

2002-03-12 Thread Andrey Hristov

on gtk.php.net there is a link to PHPMole. Built with PHP requires GTK. Not sure but I 
think that there is gtk lib for OSX since it
is BSD.

Best reagrds,
Andrey Hristov

- Original Message -
From: Jordan S. Jones [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 12, 2002 2:23 PM
Subject: [PHP] PHP IDE


 Hey all,

 I am, and have been for some time, in search of a PHP IDE that allows me to
 view things more on a project basis.  Meaning, that I would like to have
 some sort of Class browsing capabilities along with file browsing
 capabilities.  I am also looking for a decent freeware Texteditor/Web
 Development environment for OS X.. If anyone can help me out in these areas,
 I would be greatly appreciative.

 Thank You,

 Jordan



 --
 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] Is there a faster way to escape special characters in a regex?

2002-03-12 Thread Andrey Hristov

In PHP 4.0.5 and later, every parameter to str_replace() can be an array.If search and
 replace are arrays, then str_replace() takes a value from each array and uses them to 
do search and replace on
subject.  If replace has fewer values than search, then an empty string is used for 
the rest of replacement values.  If search is an
array and replace is a string; then this replacement string is used for every value of 
search.  The converse would not make sense,
though.

BTW /abc/ and ~abc~ are equivalent regexes. So get a character which will not occur in 
the string and put in the front and the end.

Regards,
Andrey Hristov

- Original Message -
From: Richard Davey [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 12, 2002 3:57 PM
Subject: [PHP] Is there a faster way to escape special characters in a regex?


 Hi all,

 At the moment I'm doing this to escape all special regular expression
 characters from my regex string:

$badwordtest = str_replace(/,,$badwordtest);
$badwordtest = str_replace(\\,,$badwordtest);
$badwordtest = str_replace(^,\^,$badwordtest);
$badwordtest = str_replace(.,\.,$badwordtest);
$badwordtest = str_replace([,\[,$badwordtest);
$badwordtest = str_replace($,\$,$badwordtest);
$badwordtest = str_replace((,\(,$badwordtest);
$badwordtest = str_replace(),\),$badwordtest);
$badwordtest = str_replace(|,\|,$badwordtest);
$badwordtest = str_replace(*,\*,$badwordtest);
$badwordtest = str_replace(+,\+,$badwordtest);
$badwordtest = str_replace(?,\?,$badwordtest);
$badwordtest = str_replace({,\{,$badwordtest);
$badwordtest = str_replace(},\},$badwordtest);
$badwordtest = str_replace(\\,\\,$badwordtest);
$badwordtest = / . $badwordtest . /i;

if (preg_match($badwordtest,$word)) {
 $directmatch = TRUE;
}

 Is there a way to either do this all in one go or even better, have the ereg
 itself ignore those characters if they are contained in the string? The idea
 is that I want to check a word for swearing by doing a direct comparison
 with a list of swear words, however the word I check could easily contain a
 special character so I need to escape it before the test commences.

 Suggestions very welcome!

 Cheers,

 Richard
 --
 Fatal Design
 http://www.fatal-design.com
 Atari / DarkBASIC / Coding / Since 1995



 --
 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] Is there a faster way to escape special characters in a regex?

2002-03-12 Thread Andrey Hristov

Yes they are identical. The rule is that the first and the last(excluding 
modificators) symbol must be identical so
|abc|
~abc~
/abc/
%abc%(not sure for that)
are equivalent. The docs uses // syntax because it is the most popular.

Regards,
Andrey Hristov

- Original Message - 
From: Richard Davey [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 12, 2002 4:26 PM
Subject: Re: [PHP] Is there a faster way to escape special characters in a regex?


 Andrey Hristov [EMAIL PROTECTED] wrote in message
 053801c1c9d0$5b4da400$0b01a8c0@ANDreY">news:053801c1c9d0$5b4da400$0b01a8c0@ANDreY...
 
  In PHP 4.0.5 and later, every parameter to str_replace() can be an
 array.If search and
 
 Thank you for pointing that out :)
 
 I've now changed my code from the (rather lengthy) version to the following
 which worked perfectly for me:
 
 $regcheck = array(/,\\,^,.,[,],$,(,),*,?,{,});
 $regreplace =
 array(,,\^,\.,\[,\],\$,\(,\),\*,\?,\{,\});
 $badwordtest = / . str_replace($regcheck,$regreplace,$badwords[$i]) .
 /i;
 
  BTW /abc/ and ~abc~ are equivalent regexes. So get a character which will
 not occur in the string and put in the front and the end.
 
 Does this mean that ~myword~ and /myword/ are identical?
 I only used /myword/ because it's in the php manual example like that.
 
 Cheers,
 
 Rich
 --
 Fatal Design
 http://www.fatal-design.com
 Atari / DarkBASIC / Coding / Since 1995
 
 
 
 -- 
 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] Help in PHPDoc

2002-03-12 Thread Andrey Hristov

I used it few times. You have to make modifications to index.php, so the engine will 
know where to look to for .php scripts that
have to be documented.
I've attached my index.php

- Original Message -
From: S.Murali Krishna [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 12, 2002 4:35 PM
Subject: [PHP] Help in PHPDoc



 Is anybody using PHPDoc for creating documentation, if yes could
 you tell me how to create documentation for a single php file which
 has enough comments needed by PHPDoc.


 [EMAIL PROTECTED]
 ---
 We must use time wisely and forever realize that the time is
 always ripe to do right.

 -- Nelson Mandela
 ---


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

2002-03-12 Thread Andrey Hristov

Probably the value you want to sent to the php page is on the page but not between 
form and /form.

Regards,
Andrey Hristov

- Original Message - 
From: John Gurley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 12, 2002 5:26 PM
Subject: [PHP] question


 don't know exactly if anybody will understand what I am asking, but any help 
 would be appreciated.
 
 I am taking a value off a web page, posting this value to another web page, 
 where more values are taken and submitted to a php page. The problem is that 
 the first value (taken from the initial web page) is not known on the php 
 page. Is there a way to submit this value from the second page, to the php 
 page. All the other values (from the second page) are known on the php page. 
 i.e. if I echo $inp (the value from the first web page) on the php page, 
 there is no value. sorry if I did not explain that very well, any ideas.
 Thanks a million
 John
 
 _
 Chat with friends online, try MSN Messenger: http://messenger.msn.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] archive

2002-03-12 Thread Andrey Hristov

http://marc.theaimsgroup.com/?l=php-generalr=1w=2

Regards,
Andrey
- Original Message - 
From: Jim Long [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 12, 2002 8:51 PM
Subject: [PHP] archive


 Hello,
 
 Is there a searchable archive of this PHP- general subscriber list?
 
 Thanks in Advance,
 Jim Long
 
 -- 
 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] Help in PHPDoc

2002-03-12 Thread Andrey Hristov

From  PhpdocSetupHandler.php
*
 * By default only files with the suffix .php are recognized as
 * php source code files and parsed. If you used other
 * suffixes such as .inc you have to tell phpdoc to parse
 * them.

$doc-setSourceFileSuffix( array (php, inc) ); in index.php


Regards,
Andrey Hristov

- Original Message -
From: S.Murali Krishna [EMAIL PROTECTED]
To: Andrey Hristov [EMAIL PROTECTED]
Cc: S.Murali Krishna [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, March 13, 2002 7:41 AM
Subject: Re: [PHP] Help in PHPDoc



 Hi Andrey
 Thanks for your kind response first. I did the way you told
 but still after executing index.php, there is nothing in my doc directory
 just see the following snap of my code. I want to create documentation for

 ./xPage/xPagedoc.inc file and want the documentation to be in ./xPagedoc/
 directory. I think the following code is right for this.

  $doc-setApplication(xPage Repository);

 // directory where your source files reside:
 $doc-setSourceDirectory(./xPage);

 // save the generated docs here:
 $doc-setTarget(./xPagedoc);

 even I tried with absolute pathname for the above.


 Thanks


 On Tue, 12 Mar 2002, Andrey Hristov wrote:

  I used it few times. You have to make modifications to index.php, so the engine 
will know where to look to for .php scripts that
  have to be documented.
  I've attached my index.php
 
  - Original Message -
  From: S.Murali Krishna [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Tuesday, March 12, 2002 4:35 PM
  Subject: [PHP] Help in PHPDoc
 
 
  
   Is anybody using PHPDoc for creating documentation, if yes could
   you tell me how to create documentation for a single php file which
   has enough comments needed by PHPDoc.
  
  
   [EMAIL PROTECTED]
   ---
   We must use time wisely and forever realize that the time is
   always ripe to do right.
  
   -- Nelson Mandela
   ---
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 

 [EMAIL PROTECTED]
 ---
 We must use time wisely and forever realize that the time is
 always ripe to do right.

 -- Nelson Mandela
 ---




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




Re: [PHP] Installing PHP 4.1.2

2002-03-11 Thread Andrey Hristov

There was a discussion on PHP-DEV. Win32 binaries will be available soon.

Best regards,
Andrey Hristov

- Original Message - 
From: Marcel Besancon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 11, 2002 6:43 PM
Subject: [PHP] Installing PHP 4.1.2


 Hi everybody,
 
 i've got a problem again. I want to install PHP 4.1.2. Now my problem:
 There's only a source code distribution on php.net. How do I install it on
 Windows XP? I read the documentation, but I all I understood was bla. So,
 you see I understood nothing. Is there anyone who can explain it an easy way
 ???
 
 Thanks.
 
 Marcel
 
 --
 registered Fli4l-User #0388
 
 
 
 -- 
 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] removing ALL whitespace from a string

2002-03-11 Thread Andrey Hristov

$new=preg_replace('/\s/','',$old);

Best regards,
Andrey Hristov

- Original Message - 
From: Lee P Reilly [EMAIL PROTECTED]
To: PHP List [EMAIL PROTECTED]
Sent: Monday, March 11, 2002 6:56 PM
Subject: [PHP] removing ALL whitespace from a string


 Can somebody tell me if there is a function that will remove *all*
 whitespace (\n, \r, \t, \w, etc) from a string i.e. from the beginning,
 the end, and the middle?. Something like chop(), trim()?
 
 e.g. input =12 3ad 
 e.g. output = 123ad
 
 Thanks,
 
 Lee
 
 
 -- 
 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] limiting the livetime of a session possible?

2002-03-11 Thread Andrey Hristov

PHP4 sessions or self made sessions. If PHP4 there is an option in php.ini to set 
about how frequently the GC(garbage collector)
will be started. Otherwise if self made and using a DB for backend - add new field 
last_time , and on every page request do Delete
from session_table where last_timenow() interval 60 min; not sure for the query but 
that is the idea.


Best regards,
Andrey Hristov

- Original Message -
From: Andy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 11, 2002 6:46 PM
Subject: [PHP] limiting the livetime of a session possible?


 Hi there,

 I am building a user registering module and now I am wondering if there
 would be a way to destroy the session if the user was inactive for an
 specified amount of time.

 I found an article on that with following line:
 If you propagate the session ID via cookies, you can influence the cookies
 lifetime with the configuration value lifetime.

 Which configuration? I tryed session_set_cookie_params(10); But this is only
 valid for the same script.

 Does anybody have a good idea, or possibly a hint?

 Thanx for any help,

 Andy



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

2002-03-10 Thread Andrey Hristov

Hi
I've tried the SOAPx4 by Dietriech. Looks good ('m not very profocent in SOAP).
Firstly I tried to use XMLRPC for my stuff but found the UsefulInc implementation by 
Edd Dumbill is so slow -
For array with 100 elements I 've to wait 4 seconds to transfer for the server to the 
client(in my case on one machine).
Then looked for alternative and found SOAP. After a little big search on the net I 
found SOAPx4. As far as I can remember
there are one or two more implementations but I cannot find them (phpclasses changed 
their adress to www.phpclasses.org).
At last I found that 4.1.x versions are shipped with extension for XMLRPC and I 
started to use it. Interesting is that this extension
supports SOAP 1.1 specification(by the words of his author). I've not tried the SOAP 
part but after looking at the source I found that
when receiving a packet the extension tries to distinguish whether this is xmlrpc 
packet or soap envelope.It is bad that the extension
is compilable only under Linux. There is no version for windows. I was forced to 
switch to Linux to use it.
Hope that helps.

Best regards,
Andrey Hristov

On Monday 11 March 2002 06:52 am, you wrote:
 Who has had a crack at using SOAP with PHP (both client and server)?

 What have you learned that you would recommend to someone just starting out
 with soap?

 I've noticed that there are a few options on the horizon, I'm busy checking
 out the scripts written by Manuel Lemos.

 For all those who don't know WTF I am talking about
 http://www.w3.org/TR/2001/WD-soap12-20010709/
 http://www.soapware.org/directory/4/implementations

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




[PHP] Re: [PHP-DEV] PHP 4.1.2 for windows

2002-03-10 Thread Andrey Hristov

AFAIK the problem is not afecting windows users. Because of that there is no windows 
binary.

Best regards,
Andrey Hristov

- Original Message - 
From: Gabor Hojtsy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 11, 2002 9:42 AM
Subject: [PHP-DEV] PHP 4.1.2 for windows


 Hi!
 
 From hour to hour we receive questions at [EMAIL PROTECTED]
 about the availability of PHP 4.1.2 for Windows. First I
 tried to give an estimate, but now I don't know what to say.
 Will there ever be a PHP 4.1.2 for windows, or a 4.1.3???
 
 Guys are waiting for the security fix... Why to kick out
 windows users from installing a more secure version of PHP?
 
 Goba
 
 
 
 -- 
 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 calculate frequency of words in array?

2002-03-08 Thread Andrey Hristov

array_count_values()

Best regards,
Andrey Hristov

On Friday 08 March 2002 04:45 pm, you wrote:
 Does anybody has a clever way to summarize the
 number of different words (with multiple occurences)
 from an array into an  array with all the different words
 and the times they occured?

 Thanks a lot!
 Simon

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




Re: [PHP] Replacing words

2002-03-08 Thread Andrey Hristov

Read the docs. Look at the assertion part. ?= and the opposite of it.

Best regards,
Andrey Hristov

On Friday 08 March 2002 05:51 pm, you wrote:
 Hello!

 I use

 $txt = preg_replace(#((?php .*?/A)|$search)#se, '\2==\1?
 \1:$replace', $txt);

 to replace some text in $txt. The problem: Parts of words are replaced,
 too. How can I make preg_replace replace only words, which  means, that
 the word is followed by space . , -, but not by other letters/numbers?

 Martin

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




[PHP] emulation of foreach with reference

2002-03-07 Thread Andrey Hristov

The code below is too weird. I spent 15 min writing it but now works:

for(reset($ar),list($k,)=each($ar),$v=$ar[$k];$k;list($k,)=each($ar),$v=$ar[$k]){
var_dump($k,$v);
$v='ather'.($j+++0);
var_dump($k,$v);
}

The $ar array is generated in this way :

for ($i=0;$i10;$i++){
$ar['foo'.$i] = 'bar'.$i;   
}



Best regards,
Andrey Hristov

P.S.
There is in PHP's ToDo list such feature.

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




Re: [PHP] Why session is not deleted ???

2002-03-07 Thread Andrey Hristov

Yes.
If you know what is garbage collector then you will understand why it is 
there. The GC is started from time to time and cleans expired session data.

Best regards,
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com

On Thursday 07 March 2002 07:54 pm, you wrote:
 Firstly i create a session, After that when i close the browser the sesion
 can still be seen in tmp directory in apache webserver.
 I just wanted to know that If i close the browser, Does the session
 terminates ?

 Beta

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




Re: [PHP] require v. includes

2002-03-07 Thread Andrey Hristov

require includes code only once(on the parse), include includes code 
everytime it is called. if you have some libs and in two or more you do 
require or include of some core lib you have to use require_once or to define 
some constant and use it to check. I am sure when but require changed its 
behaviour. Before it leaded to fatal error if some the file that has to be 
required is not found. Now it works just like include (just notice or warning 
- not sure).

For more info read the docs ar : http://www.php.net/

Best regards,
Andrey Hristov
On Thursday 07 March 2002 07:25 pm, you wrote:
 I was just wondering if anyone could tell me when would be the time to
 choose require(), require_once(), or include().  I know a little bit about
 using each one, but I am just not sure if there is one that is better than
 the other in certain situations.

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




Re: [PHP] php, text file, and mysql

2002-03-07 Thread Andrey Hristov

You can use a string to keep the file content. And then put it the 
mysql(probably a BLOB field)

Best regards,
Andrey Hristov
IcyGEN Corporation


On Thursday 07 March 2002 11:30 pm, you wrote:
 hello everyone.

 i'm wondering if i can do the following:

 FIRST,
 using php, can i create/generate a text file  on-the-fly (not saved to a
 server)

 THEN,
 insert the actual text file (and not its contents) into a mysql database.



 many thanks in advance,


 gregory hernandez
 [EMAIL PROTECTED]

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




Re: [PHP] emulation of foreach with reference

2002-03-07 Thread Andrey Hristov

try this:
?php
 echo foo.$i++;
  echo \n;
  echo bar.($+++0);
?
Thanks for showing that I add new element to the array. This is because on last 
iteration $k is null and I access $ar[$k] which automatically adds the new element. 
Why? I don't know? Maybe because I refer it by reference!
The fixed code is

pre
?php
for ($i=0;$i10;$i++) $ar['foo'.$i] = 'bar'.$i; 
var_dump($ar);  

for(reset($ar),list($k,)=each($ar),$v=$ar[$k];$k;list($k,)=each($ar),($k)?$v=$ar[$k]:''){
var_dump($k,$v);
$v='ather'.($j+++0);
var_dump($k,$v);
}
var_dump($ar);
?

This will not add new element to the array.
You ask why I did that.
First to say that I wanted to make something really weird to happy my day :))
Second I wanted to implement a feature from PHP's(Zend's) ToDo list.
Third think about if the array is so big (some megabytes) since I hold really big 
strings in every $v. Then if I use the standart foreach() statement PHP will have to 
copy $ar[$k] to $v :)))

Best regards and fun with PHP,
Andrey Hristov

On Thursday 07 March 2002 08:48 pm, you wrote:
 On Thu, 2002-03-07 at 09:53, Andrey Hristov wrote:
  The code below is too weird. I spent 15 min writing it but now works:
 
  for(reset($ar),list($k,)=each($ar),$v=$ar[$k];$k;list($k,)=each($ar),$v=
 $ar[$k]){ var_dump($k,$v);
  $v='ather'.($j+++0);
  var_dump($k,$v);
  }
 
  The $ar array is generated in this way :
 
  for ($i=0;$i10;$i++){
  $ar['foo'.$i] = 'bar'.$i;
  }

 Hi there,

 I'm not sure exactly what the above code is for--but it seems to be
 going to an awful lot of trouble to do it. :) If I start with the array:

 Array
 (
 [foo0] = bar0
 [foo1] = bar1
 [foo2] = bar2
 [foo3] = bar3
 [foo4] = bar4
 [foo5] = bar5
 [foo6] = bar6
 [foo7] = bar7
 [foo8] = bar8
 [foo9] = bar9
 )

 ...and run the first for() loop above over it, I get this:

 Array
 (
 [foo0] = ather0
 [foo1] = ather1
 [foo2] = ather2
 [foo3] = ather3
 [foo4] = ather4
 [foo5] = ather5
 [foo6] = ather6
 [foo7] = ather7
 [foo8] = ather8
 [foo9] = ather9
 [] =
 )

 Note the extra null element at the end.

 Why not just do this?

 $j = 0;
 foreach ($ar as $key = $val) {
 $ar[$key] = 'ather' . $j++;
 }

 ...which results in:

 Array
 (
 [foo0] = ather0
 [foo1] = ather1
 [foo2] = ather2
 [foo3] = ather3
 [foo4] = ather4
 [foo5] = ather5
 [foo6] = ather6
 [foo7] = ather7
 [foo8] = ather8
 [foo9] = ather9
 )

 Also, I'm unsure what you're going for with the ($j+++0). It just
 increments $j and adds 0, which doesn't seem to do anything.

 Please forgive me if I have misunderstood.


 Cheers,

 Torben

  Best regards,
  Andrey Hristov
 
  P.S.
  There is in PHP's ToDo list such feature.

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




Re: [PHP] emulation of foreach with reference

2002-03-07 Thread Andrey Hristov

ooops
 ?php
  echo foo.$i++;
   echo \n;
   echo bar.($j+++0);
 ?
On Thursday 07 March 2002 09:09 pm, Andrey Hristov wrote:
 try this:
 ?php
  echo foo.$i++;
   echo \n;
   echo bar.($+++0);
 ?


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




Re: [PHP] How to validate this date: 2002-02-31

2002-03-05 Thread Andrey Hristov

First but may be not probably the best decision is to use (gm)strftime() and 
(gm)mktime().
So parse your string put the data into mktime() with hour/minute/second for exmaple 
12,0,0 . Strftime() will return a unix
timestamp.
Use that timestamp with strftime() to get the year,month and date. If they are the 
same as the parsed the date is valid, otherwise
not.

Best regards,
Andrey Hristov

- Original Message -
From: Andy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 05, 2002 11:27 AM
Subject: [PHP] How to validate this date: 2002-02-31


 Hi there,

 I am still lacking of one error the user can provide:

 Desired format: .mm.dd

 Asuming he enters a date: 2002-02-31 (There is no Feb 31)

 Is there a function which check is the date is ok?

 Thanx guys,

 Andy

 PS: I wrote this function which has the whole:
 /*
  * Validates the format of date
  * requested format: -mm-dd.
  * Return false if not valid
 */
 function validate_date($date){
  return ereg (([0-9]{4})-([0-1]{1})([0-2]{1})-([0-3]{1})([0-9]{1}),$date);
 }





 --
 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] Bizarre mail() problem

2002-03-02 Thread Andrey Hristov

check you php.ini if you need to change sendmail -t -i to something other.

Regards,
Andrey

- Original Message - 
From: andy thomas [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 02, 2002 11:04 AM
Subject: [PHP] Bizarre mail() problem


 I have written a script to do some massmailing - it extracts an email
 address from a MySQL database and uses it to send a text file as a mail
 message. It works but there is a 75 second delay between each message
 being sent out!
 
 This is baffling - there are no delays built into the script and nothing
 obvious in our sendmail configuration. As I've got over 38000 addresses to
 mail out to, this is a problem - I've got round it for now by running 10
 scripts simultaneously, each handling 1000 addresses and this has got mail
 moving.
 
 The mail() function seems to call sendmail -t -i. This just sits there for
 75 seconds, then sends a message and then waits for another 75 seconds.
 Surely this should not happen?
 
 Here's the relevant parts of the script - the email address is in column
 15 of the MySQL table, so it just extracts field 14 for the email address
 data:
 
 $msg_txt=message.txt;
 
 mysql_connect(localhost,$mysql_user,$mysql_pwd);
 $query=select * from $table;
 $result=mysql($dbname, $query);
 $rows=mysql_numrows($result);
 
 $r=0;
 $f=14;
 while ($r  $rows ) {
 $address=mysql_result($result,$r,$f);
 mail($address,$subject,$message,From:$MailFromAddress);
 $r++;
 }
 
 
 Any suggestions or pointers to where I'm going wrong will be warmly
 received.
 
 Andy
 
 
 -- 
 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] Threads and PHP

2002-03-02 Thread Andrey Hristov

pcntl extension. But only *nix.

Best regards,
Andrye Hristov

- Original Message - 
From: Gaylen Fraley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, March 02, 2002 6:33 PM
Subject: [PHP] Threads and PHP


 Is it possible to use threads to perform an operation while another takes
 place with PHP?  I have a situation where a process calls the mail()
 function and then must wait until that completes before going on to the next
 step.  What I would like to happen is that the mail() function is handled by
 its own thread and the next screen refreshes immediately as the next screen
 is not dependent on the success/failure of the mail() call.  Possible?
 
 --
 Gaylen
 PHP KISGB v4.0.1 Guest Book http://www.gaylenandmargie.com/phpwebsite/
 
 
 
 
 -- 
 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 compile PHP with APXS

2002-03-02 Thread Andrey Hristov

Untared php 4.1.1 into /usr/local/src/php4.1.1
Untared apache 1.3.22 into /usr/local/src/apache-1.3.22
ran ./configure in apache
there is /var/www/bin/apxs
When configuring php : ./configure --with-mysql --with-apxs=/var/www/bin/apxs 
--with-xml
error occurs that says either perl is not installed(but it is) or Apache was not 
compiled with DSO support(I built one with DSO) or
apxs is not in the path but an output from apxs is shown.
What to do?

BTW I don't know how but succeeded to compile Apache with mod_php4.c(static module). 
Added AddType in /etc/httpd/conf/httpd.conf but
apache do not recognize .php files.

TIA

Andrey


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




Re: [PHP] ImageMagick and Convert In PHP

2002-03-01 Thread Andrey Hristov

Hi,
I had problem with ImageMagick's identify. When trying to use with a shell command in 
PHP big problems!
Why. Trace of identify showed that it wants to create a temporary file in the 
directory where the scripts is but the apache/php runs
under nobody:nobody but the web directories are owned by andy:web . so identify fails. 
Maybe my problem and yours have something in
commong.
try :
strace your_command_here
and see the output.

Best regards,
Andrey Hristov

- Original Message -
From: Nicke [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 12:06 PM
Subject: [PHP] ImageMagick and Convert In PHP


 I have exactly the same problem! Anyone who can help?

 /nicke

 Rick [EMAIL PROTECTED] wrote in message
 news:003701c1bb50$bda0e2e0$[EMAIL PROTECTED];
 Hello All,

 Ok , I am about to loose my mind... this list is my last option i think  :)

 this is what i have tried :
 system(convert -pen black -draw 'text 120,60 YourText Here'  imageA.jpg
 imageB.jpg);
 The above does not work , the most i can get it imageA.jpg Becomes
 imageB.jpg but the text does not get drawn

 I striped the slashes, this does not work either, i su - to what my
 webserver runs on to see if i can run the system command
 via console, it works just fine , so i tried :

 $a = escapeshellcmd('-pen black -draw');
 $b = escapeshellarg('text 120,20  YourTextHere);
 $c = escapeshellcmd(test.jpg doggy.jpg);
 system(convert $a $b $c);

 Same as the above, imageA becomes imageB and thats it. Permissions for
 testing are -rwxrwxrwx

 a basic test with system(convert -scale 500x600 imageA.jpg imageB.jpg); =
 Works Perfect

 I am sorry for coming to the list for help , but i am at a final loss, i
 have also tried shell_exec and exec to clear anything up. I have hit the
 imagemagick mail list and i got  Php Might have some issues so if anyone
 can lend a hand to get that system command to work , i would be most
 appreciative.

 Best Wishes
 Rick Wilson






 --
 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() texarea

2002-03-01 Thread Andrey Hristov

When register_globals is on try this:

if ($open_why_good_consult){

}

Regards,
Andrey
- Original Message - 
From: John Fulton [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 6:45 PM
Subject: [PHP] empty()  texarea


 
 I can't seem to get empty() to check if someone has left
 a textarea unanswered in an online form with code like
 the following:
 
 textarea rows=8 cols=50 name=open_why_good_consult
 ?echo $open_why_good_consult?
 /textarea 
 
 if(empty($open_why_good_consult)) {
 print Please fill in why you would be a good consultant;
 }
 
 
 Any ideas?  It seems to work for things like this:
 
 input type=text name=user_name size=8 value=?echo $user_name?
 
 if empty($user_name) {
 print Please fill in a username;
 }
 
 I suppose it is because the variable is not getting posted.  Is
 there a way to post the variable?   
 
 Thanks.  
 
   John
 
 
 -- 
 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] passing array of variables in a query string

2002-03-01 Thread Andrey Hristov

It is in the TODO list of PHP. The behaviour will be changed in such a case.
You can get the string from $QUERY_STRING
explode it with $ar=explode('',$QUERY_STRING);
and some other small things to get all stuff with same name in an array

Regards,
Andrey
- Original Message - 
From: Diana Castillo [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 6:42 PM
Subject: [PHP] passing array of variables in a query string


 I was wondering if someone could help me
 with this:
  what I need to know is how to pick up an array of variables from
  a query string such as:
  http://www.archipro.com/test.php?state=ABstate=BC
  If I use $state, I get only the last one.
 
 
 
 
 -- 
 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() texarea

2002-03-01 Thread Andrey Hristov

Hi Erik,
I think that you look for array_count_values().

Regards,
Andrey
- Original Message - 
From: Erik Price [EMAIL PROTECTED]
To: John Fulton [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 6:58 PM
Subject: Re: [PHP] empty()  texarea


 
 On Friday, March 1, 2002, at 11:45  AM, John Fulton wrote:
 
 
  I can't seem to get empty() to check if someone has left
  a textarea unanswered in an online form with code like
  the following:
 
  textarea rows=8 cols=50 name=open_why_good_consult
  ?echo $open_why_good_consult?
  /textarea
 
 In cases where you have provided a default value to fill in the form, 
 you can't use empty() to test the value of the result.  What I would 
 recommend that you do is you test to see if the value is the same as 
 what it was filled in by default, and if so, you know the user hasn't 
 changed anything.
 
 ?php
 $original_good_consult = $_POST['openWhyGoodConsult'];
 ?
 textarea rows=8 cols=50 name=openWhyGoodConsult
 ?php echo $openWhyGoodConsult; ?
 /textarea
 input type=hidden name=originalGoodConsult value=?php echo 
 $original_good_consult; ? /
 
 ...later in the script
 
 if ($_POST['openWhyGoodConsult'] == $_POST['originalGoodConsult']) {
 // then you know nothing has changed, the values are the same,
 // so take some action to remind them such as echoing Please
 // fill in the Good Consult field or whatever
 } else {
 // then you know they have entered a new value, so you can
 // perform whatever code you need to on that
 }
 
 
 
 HTH
 
 Erik
 
 
 
 
 Erik Price
 Web Developer Temp
 Media Lab, H.H. Brown
 [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] trouble with telnet.

2002-03-01 Thread Andrey Hristov

locate mysqld
whereis mysql

Regards,
Andrey

- Original Message -
From: Sean Kennedy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 7:05 PM
Subject: [PHP] trouble with telnet.


Hello,

I telneted to my web server and I would like to see if they have MySQL. Is there a 
certain sentence I type to see if they have
MySQL? Thank you,

-Sean



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




Re: [PHP] hmm.. more trouble with telnet.

2002-03-01 Thread Andrey Hristov

I think -  no mysql is available
what did locate mysql returned?

Regards,
Andrey
- Original Message - 
From: Sean Kennedy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 7:27 PM
Subject: [PHP] hmm.. more trouble with telnet.


Hello,

When I type in 'whereis mysql' it says 'mysql:' so what does that mean?

-Sean



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




Re: [PHP] mysql and telnet.

2002-03-01 Thread Andrey Hristov

.cfm are ColdFusion files(like .php or .pl)

Regards,
Andrey
- Original Message - 
From: Sean Kennedy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 01, 2002 7:36 PM
Subject: [PHP] mysql and telnet.


Hello,

Thanks for the advice... But now I need to know what all this means:

/home/chiliasp/odbc/direct/locale/en_US/LC_MESSAGES/ivmysql15.po
/home/sites/home/web/CFIDE/administrator/datasources/drivers/myodbc_mysql.cfm
/home/sites/home/web/CFIDE/administrator/datasources/drivers/mysql.cfm
/home/sites/home/web/CFIDE/administrator/server_settings/drivers/mysql.cfm
/home/coldfusion/lib/locale/en_US/LC_MESSAGES/CFmysql15.mo
/home/coldfusion/lib/CFmysql15.so
/home/coldfusion/scripts/mysql_expire.cfm

Thanks,

-Sean



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




[PHP] Web Services

2002-02-28 Thread Andrey Hristov

 Hi,
Is there someone who knows good places with information about Web Services? Such as 
SOAP, XML-RPC, WSDL etc.
TIA
 
Andrey Hristov



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




Re: [PHP] unsetting global variables from an function

2002-02-27 Thread Andrey Hristov

Try unset($GLOBALS[var]);

Best regards,
Andrey Hristov

- Original Message - 
From: Enrico Weigelt [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 28, 2002 9:44 AM
Subject: [PHP] unsetting global variables from an function


 
 hi folks,
 
 is there a way for unsetting an global variable from an function ?
 
 global $var; unset ( $var );
 
 does not work since, unset only removes the reference in from 
 local namespace. but i need to remove it from the global one.
 
 any chance to do it ?
 
 ~-n
 
 --
  Enrico Weigelt==   meTUX IT services 
  software development, IT service, internet security solutions
  www: http://www.metux.de/phone: +49 36207 519931
  email:   [EMAIL PROTECTED]cellphone: +49 174 7066481
 
 -- 
 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] Inserting leading 0 infront of a variable

2002-02-27 Thread Andrey Hristov

This seems an endless loop for me. You do not alter the $myrowp[topic_id] so its 
length is untouched = if it is 6 you will never
get away from the loop. May be you want this.

   # create topic number  6 digit
$count=strlen($myrow[topic_id]) ;
   while ($count--  6){
$leading_digits .= '0';
   }
   $topic_id = $leading_digits.$myrow[topic_id] ;

Best regards,
Andrey Hristov

- Original Message -
From: Andy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 28, 2002 9:56 AM
Subject: [PHP] Inserting leading 0 infront of a variable


 Hi guys,

 is there a possibility to add a string in front of a veriable like the .=
 commands adds it to the end? I would like to create a 6 digit number out of
 a e.g. 2 digit one. Underneath is my not working code. Maybe someone knows
 how to solve that.

 Thanx Andy

   # create topic number  6 digit
   while (strlen($myrow[topic_id])  6){
$leading_digits .= '0';
   }
   $topic_id = $leading_digits.$myrow[topic_id] ;




 --
 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] Entering data into MySQL

2002-02-24 Thread Andrey Hristov

Try doing it by yourself.
$the_str = str_replace('','\',$the_str);
$the_str = str_replace(',\\',$the_str);

This is a little hack until you find what is the problem with addslashes();

Best regards,
Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
BALANCED SOLUTIONS

- Original Message - 
From: Tim Thorburn [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 25, 2002 9:39 AM
Subject: [PHP] Entering data into MySQL


 Hi,
 
 I'm having troubles entering information from a form into a MySQL 
 database.  Specifically if the user enters an apostrophe anywhere in the 
 form, all the information is rejected and nothing is entered into the database.
 
 After researching a little on php.net I found the addslashes() command - 
 this did help briefly and I was able to use apostrophe's in the form ... 
 but it seems as the problem has resurfaced.
 
 To make matters more frustrating, the addslashes() command works perfectly 
 well on my local test machine (Win2k Pro, PHP 4.1.1, MySQL 3.23.44, Apache 
 1.3.23) but not at all on the server which is hosted by another company 
 (Sun Solaris, PHP 3.0.16, MySQL 3.22.32, Apache 1.3.12).
 
 Does anyone have any suggestions as to why the addslashes() command worked 
 for a short time on the webserver and why it stopped?  Or better yet, is 
 there a variation of addslashes() that will work on an older version of PHP 
 such as 3.0.16?
 
 I'd be eternally grateful for any prompt replies as its already 2.38am and 
 my deadline is 9am :P
 
 Thank you
 -Tim Thorburn
 
 
 
 -- 
 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] fork?

2002-02-23 Thread Andrey Hristov

Vulcan Logic SRM
www.vl-srm.net

Every your task is a banana.

Regards,
Andrey Hristov

- Original Message - 
From: Paul Roberts [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, February 23, 2002 1:05 PM
Subject: [PHP] fork?


how do i do two things at the same time, i'm thinking of the equivalent of fork in perl


Paul Roberts
[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




  1   2   3   4   >