Re: [PHP] reading excel file

2002-04-03 Thread EMIN CALIKLI


Hi ,
I converted .CSV (comma delimited) file to MySQL it 's easy to use it...



   

Tyler 

Longren To: php-general 
[EMAIL PROTECTED] 
tyler@captaicc: (bcc: EMIN CALIKLI/FINANSBANK)

njack.com   Subject: [PHP] reading excel file 

   

03.04.2002 

04:30  

   

   





Hello List,

Has anyone ever converted an excel file over to a MySQL database via PHP?
I'm currently doing it with perl, and this isn't a very good option for me.
The client needs to login to a server via ssh every time they want to put
data from their excel file to mysql.  I'd like to find some way to do it
through a web browser.

Thanks for any suggestions,
Tyler Longren
Captain Jack Communications
[EMAIL PROTECTED]
www.captainjack.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




[PHP] RE: simple question

2002-04-03 Thread Tim Ward

Try http://www.idocs.com/tags/forms/ http://www.idocs.com/tags/forms/ 

Also (as the definitive reference for html) http://www.w3.org/MarkUp/
http://www.w3.org/MarkUp/ 

Once you've got html forms working okay, then the fields you've named in
your form are available as variables in the php page the form submits to
(the action property of the form tag, which can be the same page).

Tim Ward
Internet Chess www.chessish.com http://www.chessish.com 

--
From:  Denis L. Menezes [SMTP:[EMAIL PROTECTED]]
Sent:  02 April 2002 17:34
To:  [EMAIL PROTECTED]
Subject:  simple question

Hello friends.

I am able to add and query my database using php. I now wish to
build
webpages with textboxes and search the database with criteria from
the
textboxes.

Can someone tell me the resources for building these pages?

Thanks
Denis


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




Re: [PHP] Evaluating php code.

2002-04-03 Thread Rasmus Lerdorf

 Ideally, i'd like to evaluate the code the user has submitted, and if an
 error is generated, notify the user of that fact.
 Eval always returns false, and I'd like no runtime error to be generated.
 Perhaps an error-handler is what's needed?

 What can you suggest?

I think this should illustrate how to do that:

?
$code = '

?
$a = 1;
print $a;
?

';

error_reporting(0);
ini_set('track_errors',true);
$php_errrormsg='';
ob_start();
eval('?'.$code);
$output = ob_get_contents();
ob_end_clean();
if($php_errormsg) echo Error was: $php_errormsgbr\n;
else echo Output was: $outputbr\n;
?

A couple of tricks:

1. Turning off PHP's error_reporting makes sure no errors are shown by PHP
2. Turning on track_errors puts any errors into the $php_errormsg variable
3. Turning on output buffering lets you catch the output from the code you
   are testing
4. Preceding the eval()'ed code with ? makes sure you start the code off
   in normal HTML mode since eval() actually assumes what you feed it
   starts in PHP mode which is likely not the case for you.

-Rasmus


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




[PHP] Can't AddType .htm

2002-04-03 Thread Dan

I run Linux, Apache and PHP4.06.
I want PHP to parse .htm documents.
I have done this before on other servers with no problem by editing the
following line in my httpd.conf.

AddType application/x-httpd-php .htm .php .php4 .php3

But after restarting it doesn't do anything.
.php files still work and .htm files don't work.
If I try other suffixes other than .htm say .dog for example that works.
So it seems something elsewhere is over riding it.
Anyone got any suggestions.

Regards

Dan




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




[PHP] auto submit

2002-04-03 Thread Martin Kampherbeek

Is the folowing possible to do?

I fill in a form and press submit.
Then I read a record from a database. With this data it submits to the read submits 
url. After 10 seconds, it reads the next record and submits that data. etc etc

So I don't have to push submit each time I want to submit. After 10 seconds it read 
the next record and submits again.

Could this be done? So yes, how?





Re: [PHP] not about php... about server for php .. its apache question if anybody feelin like answering , thanks

2002-04-03 Thread heinisch

At 03.04.2002  01:59, you wrote:

Hey [EMAIL PROTECTED],

   Im new at this so i got some problems that i would like to solve.
   First i have Linux Debian 2.2.19 version running on my poor server
   :) and i installed apache web server...everything goes well... i can
   access peoples websites like this Http://localhost/~user/ but
   uploading is terrible. Because you have to send though SSH. I wanted
   to do FTP server but i don't know how to do it.. i looked at some
   manuals of apache and didn't fount how to do like this:

   user goes to ftp://localhost/ then he writes his user name and
   password and he can access his public_html folder to upload files or
   delete them. How to do this thing? is there some tutorials that i
   couldn't find? or anybody can help me directly? i would appreciate
   it.
Did you install a ftp-server , and is it running?

If your clients are window based
If you do, you can use f.e. wincommander (www.ghisler.com)
to connect and send/receive/delete data.

Or you build a php page, which let the people store their webpages
inside the webserver.
About storing pages, there has been a thread, last week or so.

About ftp  you could look at www.xbill.org/sftp/ for a secure ftp.
But have a look first on linux.org or somewhere what about
security. Ftp on your server makes a big hole ;-)


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




Re: [PHP] Can't AddType .htm

2002-04-03 Thread heinisch

At 02.04.2002  23:44, you wrote:
I run Linux, Apache and PHP4.06.
I want PHP to parse .htm documents.
I have done this before on other servers with no problem by editing the
following line in my httpd.conf.

AddType application/x-httpd-php .htm .php .php4 .php3

But after restarting it doesn't do anything.
.php files still work and .htm files don't work.
If I try other suffixes other than .htm say .dog for example that works.
So it seems something elsewhere is over riding it.
Anyone got any suggestions.

should work, do you have something like .htaccess enabled which overrides 
these settings
My httpd.conf has every AddType on a separate line.
Are these .htm pages in a directory which is available to apache/php - 
'rights'
HTH Oliver


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




[PHP] anyone using CVS for PHP dev?

2002-04-03 Thread Michael Zornek

I've been learning a little bit about CVS and am considering using it  for
dev of some group PHP sites.

Anyone doing this? comments?

~ Mike
-- 
Mike Zornek | Project Leader
Apple Student Developers
The Insanely Great Site with the Insanely Long URL
http://www.applestudentdevelopers.org

Personal Site: 
http://www.mikezornek.com


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




Re: [PHP] Can't AddType .htm

2002-04-03 Thread Richard Baskett

Try adding both of these lines:

AddType application/x-httpd-php .php .php4 .phtml .htm .html
AddType application/x-httpd-php-source .phps

Rick

I regard as a mortal sin not only the lying of the senses in matters of
love, but also the illusion which the senses seek to create where love is
only partial. I say, I believe, that one must love with all of one's being,
or else live, come what may, a life of complete chastity. - George Sand


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




Re: [PHP] auto submit

2002-04-03 Thread heinisch

At 03.04.2002  11:22, you wrote:

Is the folowing possible to do?

I fill in a form and press submit.
Then I read a record from a database. With this data it submits to the 
read submits url. After 10 seconds, it reads the next record and submits 
that data. etc etc

So I don't have to push submit each time I want to submit. After 10 
seconds it read the next record and submits again.

Could this be done? So yes, how?


You can do this, if your clients browser has JavaScript enabled.
Then you could use JavaScript - www.javascript.com.

And again, PHP is on your server and is not able to push something to your 
client
except he/she asked for it (that´s why you have to use JavaScript).

To get your page refreshed (thi only askes about a new copy of your page)
you could use header() or a metatag  like
meta http-equiv=refresh content=10; URL=yourpage
You can place this meta anywhere in your code (BUT that´s not html-conform, 
but works on the main
browsers, (don´t know about NS 6 and mozilla))
HTH Oliver


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




Re: [PHP] Evaluating php code.

2002-04-03 Thread Scott Houseman

Hi Rasmus.

Thanks for the help.
I've implemented your code in a method in class 'RendererParam' as follows:
//--
---
// evaluateParameter
//--
---
/**
Evaluate the parameter's code.
*/
function evaluateParameter ( ) {
// Give variable containing error message global scope.
global $php_errormsg;
echo Evaluate code...BR;
// Supress error reporting.
error_reporting( 0 );
// Set 'track_errors' on.
ini_set( 'track_errors', true );
// Clean out error variable.
$php_errormsg = ;
// Start output buffering.
echo eval( $this-sParamName.' = '.$this-sParamValue.';' )BR;
ob_start( );
// Evaluate this parameter.
eval( $this-sParamName.' = '.$this-sParamValue.';' );
// Get the output buffer contents.
$sBufferOutput = ob_get_contents( );
// End output buffering.
ob_end_clean( );
echo '$sBufferOutput = '.$sBufferOutput.'BR';
if ( trim( $php_errormsg ) != '' ) {
echo Error was: $php_errormsgbr\n;
return false;
}
else {
echo Output was: $sBufferOutputbr\n;
return true;
}
}
//--
---
Example output:

Evaluate code...
eval( $AUTHOR.' = '.$oArticle-oAuthor-getName( ).';' )

This works greate for parse errors, which is all I really want to check for.
But I have picked up a problem.
As the parameters (read variables )  their values entered by the user may
not be in scope at the time they are entered,
in the above case I would get a fatal error:

Fatal error: Call to a member function on a non-object
in /var/www/vne/vne_classes/entity/RendererParam.inc(350) : eva()'d
code on line 1

This is most obviously because I am trying to call a method of an object
which does not exist
If I understand correctly, 'error_reporting( 0 );' will supress error
messages, but this fatal error will still cause
the php preprocessor to die.

Doing a 'global $$this-sParamName, $$this-sParamValue;' will not help
either, as these given variables/objects
will not necessarly be available in the scope outside of this method either.

So...
Is there any way of telling the parser to ignore this fatal error and carry
on, or alernatively,
a way of parsing a string at face value for parse errors ie. 'Look for
syntax errors, but don't evaluate the code.'?

Thanks again for the help, it is much appreciated

Regards

Scott

- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Scott Houseman [EMAIL PROTECTED]
Cc: php-general [EMAIL PROTECTED]
Sent: Wednesday, April 03, 2002 10:33 AM
Subject: Re: [PHP] Evaluating php code.


  Ideally, i'd like to evaluate the code the user has submitted, and if an
  error is generated, notify the user of that fact.
  Eval always returns false, and I'd like no runtime error to be
generated.
  Perhaps an error-handler is what's needed?
 
  What can you suggest?

 I think this should illustrate how to do that:

 ?
 $code = '

 ?
 $a = 1;
 print $a;
 ?

 ';

 error_reporting(0);
 ini_set('track_errors',true);
 $php_errrormsg='';
 ob_start();
 eval('?'.$code);
 $output = ob_get_contents();
 ob_end_clean();
 if($php_errormsg) echo Error was: $php_errormsgbr\n;
 else echo Output was: $outputbr\n;
 ?

 A couple of tricks:

 1. Turning off PHP's error_reporting makes sure no errors are shown by PHP
 2. Turning on track_errors puts any errors into the $php_errormsg variable
 3. Turning on output buffering lets you catch the output from the code you
are testing
 4. Preceding the eval()'ed code with ? makes sure you start the code off
in normal HTML mode since eval() actually assumes what you feed it
starts in PHP mode which is likely not the case for you.

 -Rasmus




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




[PHP] newbie question: how to recompile PHP?

2002-04-03 Thread Bogdan Popescu

Hello all,

  I hope my newbie question don't bother you
  too much.

  I've downloaded the latest PHP for windows
  but when I try to use it I get a message
  that I have to re-compile it.

(You may disable this restriction by recompiling the PHP binary
with the --disable-force-cgi-redirect switch.)

  Can anybody tell me a couple of words about
  how to recompile PHP? Or this error message
  is just an issue of php.ini?
  I got the sources but what kind a compiler
  do I need, where from I can get it?

--
TIA,
Bogdan  mailto:[EMAIL PROTECTED]


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




[PHP] intelligent mailing list?

2002-04-03 Thread Denis L. Menezes

Hello friends.

I do not think I have put the right term in the subject of this message.

What I wish to do is develop a mailinmg list which , among the normal
functions, can give a list of failed email messages. Can anyone please help
me find such an application code?


Thanks
Denis



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




Re: [PHP] Warning: Undefined variable

2002-04-03 Thread DL Neil

Erik,
My two cents' (with allowance for inflation...)

  If you're distributing code in cyberspace it's a good
  idea to make it error free too, E_NOTICE or otherwise.

To get the maximum help when coding, and to ensure the minimum of
confusion for your users, I recommend:

1 set the dev server's PHP error setting to catch every single
error/warning msg, and code well (?code Shell)
2 set the prod server to not report any errors except a complete
disaster to the user (?catastrophe theory)

If they are one and the same machine/server, then use 'debug' code to
reset options at the beginning of dev code (and remove it when the
routine is 'promoted' to prod).

 I got back quite a few responses on this list on the subject of having
 variables that are not defined before they are used.  That's
 interesting -- it's nice to know that I can take shortcuts and conjure
 them up on the fly, but I didn't realize that it was good practice to
 declare the variable before you actually use it in a script.  (I never
 studied programming in any formal sense, as anyone who has seen my
 source code can attest :).

 Sometimes I create variables dynamically, such that I could never
 declare/initialize them in any realistic sense -- for instance, I
might
 have a while loop that executes a number of times equal to the number
of
 rows pulled from a database query.  And in this while loop, I might
 generate a new variable (assigning it a name like $variable$i, using
the
 old $i++ trick to give it a unique numeric suffix).

 If I use this trick, does this doom me to never having
fully-error-free
 code?  Or is there something that I'm not getting here... The short of
 it is that, as a novice programmer, I'd like to make sure I'm writing
 the most legitimate code that I can.  Thanks for any input on this
 thread, past or future.

In strongly typed languages, I think there are (?have been historically)
two objectives in defining variables prior to their use:
1 to set aside the storage space, and
2 to define the variable type

1 in the case of a scalar variable this seems trivial, eg
INTEGER J
Dim intJ As Integer

In the case of an array or var/set length string, then replication needs
to be added into the equation for calculating both an individual
component's address and working out how much storage to set aside, eg
INTEGER K(10)

2 Somewhat obviously a double-precision floating point number will
require more space/bytes to store its value than a simple integer.
However a common error made when programming is that you think a
variable holds data of a certain type, when in fact you earlier used it
in some other (very similar, but not quite the same) manner. eg

//don't use this code
$User = Fred;
later on we do (say) a db call and pull out a row of personal data:
$query = SELECT * FROM persTbl WHERE persId = '$User' ;
//I'm assuming that persId is likely some sort of personnel/membership
number

PHP is a 'little ripper' when it comes to quick and dirty usage, because
you don't have to type a declaration line before using a
variable/assigning storage (per part (1)) - PHP works it out for
you/from context, so it can 'very fast' (from a coder's point of view).
However such does leave one open to the problems described in part (2) -
which a strongly typed language would flag as an error! To this end,
some people decide to describe the usage of each variable as part of the
name. For example I was reading some Microsoft Excel macro/VBA stuff and
there's talk of intCounter and txtNameEntered - for an integer value and
the contents of a data-entry form's text box (resp).

You have gone on to describe how the PHP attitude to typing enables the
creation of dynamic variables/variable names. This is a really powerful
feature, and has an important place in certain functions. However it is
not something I would put into an intro tutorial, because with such
power comes the potential to greatly expand the size of feet before
bringing them into close proximity with one's mouth!

One of your correspondents pointed out that a really good compromise is
the associative array - the variable name (array name) stays 'constant',
but the array argument/pointer can be almost anything as a 'label'. As
another aside, it is also an 'advance' to know that the various contents
of an array in PHP do not have to be all the same datatype (as they
do/did in other languages)! Thus:

$aPersRow[ persId ] = 12345; //integer
$aPersRow[ persNm ] = Fred; //string
$aPersRow[ persDoB ] = 1970-01-01; //date

cf INTEGER K(10) setting aside space only for a collection of integers!

One way that I have utilised this technique is to keep a set of counters
for system/logging/reporting purposes in an associative array. The array
element/label is self-documenting, and the ability to pass them all into
a reporting sub-procedure as a single parameter/array name provides an
easy cohesion/grouping!

In PHP I have found it helpful to do something similar to the M$
conventions mentioned 

[PHP] Passing Values

2002-04-03 Thread Sebastian A.

Hello,
Today I was working on an object that will create all of the columns and
tables in my DataBase for my upcoming application. I however, did run into
trouble. I am having problems because I cannot pass the name of the database
from the form to the function that needs it. Everything is on the same page
(sql_create.php), and the functions that gets the data (the form function)
and the function that needs the Database name are both within an object.
Does anyone have any ideas? I can post some code samples if it will help.

Thanks in Advnace


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




[PHP] Re: newbie question: how to recompile PHP?

2002-04-03 Thread Craig Donnelly

Strange..U sure you got the Win32 version??

Heres a mirror where u can get the installer:
http://www.evilwalrus.com/downloads/php/4.1.2/php-4.1.2-installer.exe

All the best,

Craig

Bogdan Popescu [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello all,

   I hope my newbie question don't bother you
   too much.

   I've downloaded the latest PHP for windows
   but when I try to use it I get a message
   that I have to re-compile it.

 (You may disable this restriction by recompiling the PHP binary
 with the --disable-force-cgi-redirect switch.)

   Can anybody tell me a couple of words about
   how to recompile PHP? Or this error message
   is just an issue of php.ini?
   I got the sources but what kind a compiler
   do I need, where from I can get it?

 --
 TIA,
 Bogdan  mailto:[EMAIL PROTECTED]




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




Re: [PHP] Evaluating php code.

2002-04-03 Thread Rasmus Lerdorf

I'd leave the code checker in the global scope.  In testing here I am not
getting a fatal error on a call to a method on a non-existing object.
This code returns nothing:

?
$code = '
?
$a = 1;
$b-foo();
?
';
error_reporting(0);
ini_set('track_errors',true);
$php_errrormsg='';
ob_start();
eval('?'.$code);
$output = ob_get_contents();
ob_end_clean();
if($php_errormsg) echo Error was: $php_errormsgbr\n;
else echo Output was: $outputbr\n;
?

Does this give you a fatal error?  If so, you may want to look at updating
your PHP.

-Rasmus

On Wed, 3 Apr 2002, Scott Houseman wrote:

 Hi Rasmus.

 Thanks for the help.
 I've implemented your code in a method in class 'RendererParam' as follows:
 //--
 ---
 // evaluateParameter
 //--
 ---
 /**
 Evaluate the parameter's code.
 */
 function evaluateParameter ( ) {
 // Give variable containing error message global scope.
 global $php_errormsg;
 echo Evaluate code...BR;
 // Supress error reporting.
 error_reporting( 0 );
 // Set 'track_errors' on.
 ini_set( 'track_errors', true );
 // Clean out error variable.
 $php_errormsg = ;
 // Start output buffering.
 echo eval( $this-sParamName.' = '.$this-sParamValue.';' )BR;
 ob_start( );
 // Evaluate this parameter.
 eval( $this-sParamName.' = '.$this-sParamValue.';' );
 // Get the output buffer contents.
 $sBufferOutput = ob_get_contents( );
 // End output buffering.
 ob_end_clean( );
 echo '$sBufferOutput = '.$sBufferOutput.'BR';
 if ( trim( $php_errormsg ) != '' ) {
 echo Error was: $php_errormsgbr\n;
 return false;
 }
 else {
 echo Output was: $sBufferOutputbr\n;
 return true;
 }
 }
 //--
 ---
 Example output:

 Evaluate code...
 eval( $AUTHOR.' = '.$oArticle-oAuthor-getName( ).';' )

 This works greate for parse errors, which is all I really want to check for.
 But I have picked up a problem.
 As the parameters (read variables )  their values entered by the user may
 not be in scope at the time they are entered,
 in the above case I would get a fatal error:

 Fatal error: Call to a member function on a non-object
 in /var/www/vne/vne_classes/entity/RendererParam.inc(350) : eva()'d
 code on line 1

 This is most obviously because I am trying to call a method of an object
 which does not exist
 If I understand correctly, 'error_reporting( 0 );' will supress error
 messages, but this fatal error will still cause
 the php preprocessor to die.

 Doing a 'global $$this-sParamName, $$this-sParamValue;' will not help
 either, as these given variables/objects
 will not necessarly be available in the scope outside of this method either.

 So...
 Is there any way of telling the parser to ignore this fatal error and carry
 on, or alernatively,
 a way of parsing a string at face value for parse errors ie. 'Look for
 syntax errors, but don't evaluate the code.'?

 Thanks again for the help, it is much appreciated

 Regards

 Scott

 - Original Message -
 From: Rasmus Lerdorf [EMAIL PROTECTED]
 To: Scott Houseman [EMAIL PROTECTED]
 Cc: php-general [EMAIL PROTECTED]
 Sent: Wednesday, April 03, 2002 10:33 AM
 Subject: Re: [PHP] Evaluating php code.


   Ideally, i'd like to evaluate the code the user has submitted, and if an
   error is generated, notify the user of that fact.
   Eval always returns false, and I'd like no runtime error to be
 generated.
   Perhaps an error-handler is what's needed?
  
   What can you suggest?
 
  I think this should illustrate how to do that:
 
  ?
  $code = '
 
  ?
  $a = 1;
  print $a;
  ?
 
  ';
 
  error_reporting(0);
  ini_set('track_errors',true);
  $php_errrormsg='';
  ob_start();
  eval('?'.$code);
  $output = ob_get_contents();
  ob_end_clean();
  if($php_errormsg) echo Error was: $php_errormsgbr\n;
  else echo Output was: $outputbr\n;
  ?
 
  A couple of tricks:
 
  1. Turning off PHP's error_reporting makes sure no errors are shown by PHP
  2. Turning on track_errors puts any errors into the $php_errormsg variable
  3. Turning on output buffering lets you catch the output from the code you
 are testing
  4. Preceding the eval()'ed code with ? makes sure you start the code off
 in normal HTML mode since eval() actually assumes what you feed it
 starts in PHP mode which is likely not the case for you.
 
  -Rasmus
 
 



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




[PHP] Including Files

2002-04-03 Thread Craig Donnelly

Is there a way to setup either the apache/php directives to produce a custom
404 if an include file fails to be included ??

Or is this a job for .HTACCESS??

Regards,

~Craig




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




Re: [PHP] anyone using CVS for PHP dev?

2002-04-03 Thread Michael Sims

On Wed, 2002-04-03 at 04:00, Michael Zornek wrote:
 I've been learning a little bit about CVS and am considering using it
 for dev of some group PHP sites.
 
 Anyone doing this? comments?

I've been using CVS for all of my PHP projects for the past several
months.  Now that I have been using it I can't imagine how I ever got
along without it.  It is a lifesaver when it comes to stamping out bugs
since it's very easy to see changes you have made between revisions and
roll them back if necessary.  If you have multiple developers working on
the same project (as I do at my company) then it is a necessity IMHO as
it keeps the developers from stepping on each others toes for the most
part.  Coding projects in CVS and testing them on different servers also
helps you to ensure that your code is portable enough to be installed
on different servers (it's somewhat embarrassing, but before CVS I would
sometimes hard-code variables with the current hostname of my server,
for example, forgetting that it would cause a problem if the hostname
ever changes, etc.)

CVS is a complex piece of software, at least when you consider all of
it's applications.  The best way to start using it and to learn it is to
just use it's basic functions at first and then later on start picking
up the more advanced applications (such as tags, branches, merging,
diffing between arbitrary revisions, sticky tags, etc. etc.).

Anyway, hope this helped.  If you have specific questions about using
CVS for PHP development feel free to ask...


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




Re: [PHP] Warning: Undefined variable

2002-04-03 Thread Rasmus Lerdorf

 I got back quite a few responses on this list on the subject of having
 variables that are not defined before they are used.  That's
 interesting -- it's nice to know that I can take shortcuts and conjure
 them up on the fly, but I didn't realize that it was good practice to
 declare the variable before you actually use it in a script.  (I never
 studied programming in any formal sense, as anyone who has seen my
 source code can attest :).

You don't need to declare variables, simply initialize them before using
them in a way that wouldn't auto-initialize.

For example:

   $foo = $i++;

In this case $foo is auto-initialized, but you are incrementing $i without
explicitly initializing it to 0.  This code should be:

   $i = 0;
   $foo = $i++;

It is common sense really.

-Rasmus


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




RE: [PHP] Passing Values

2002-04-03 Thread Rick Emery

show us code

-Original Message-
From: Sebastian A. [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 6:02 AM
To: PHP General List (PHP.NET)
Subject: [PHP] Passing Values


Hello,
Today I was working on an object that will create all of the columns
and
tables in my DataBase for my upcoming application. I however, did run into
trouble. I am having problems because I cannot pass the name of the database
from the form to the function that needs it. Everything is on the same page
(sql_create.php), and the functions that gets the data (the form function)
and the function that needs the Database name are both within an object.
Does anyone have any ideas? I can post some code samples if it will help.

Thanks in Advnace


-- 
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] mail tag

2002-04-03 Thread hamish

hello,
I have coded a typical mail process for sending a mail from a form. It works 
fine except for anytime any one puts a ' or a  in the content of the mail, 
the tag places a \ infront of it. I have tried to stripslashes and the mail 
is being sent as html. Has any one got the answer? 

code below:
(description is my variable on a previous page where the user types in the 
content of the mail) 

$subject = 'Email from me'; 

$message = 
This email is regards a question / query that you put to me.
This email is for reference purposes only.
brbr
You asked:
brbr
.stripslashes ($description); 

$headers  = MIME-Version: 1.0\r\n;
$headers .= Content-type: text/html; charset=iso-8859-1\r\n;
$headers .= from: Help Desk [EMAIL PROTECTED]\r\n; 

mail($usersemail, $subject, $message, $headers); 


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




RE: [PHP] mail tag

2002-04-03 Thread Rick Emery

stripslashes() failed???

I've used stripslahses in this situation, and it's worked perfectly.  Wonder
what else is going on here?  Go without quotes.
Try:

mail($usersemail, $subject, $message, $headers); 

-Original Message-
From: hamish [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 7:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] mail tag


hello,
I have coded a typical mail process for sending a mail from a form. It works

fine except for anytime any one puts a ' or a  in the content of the mail, 
the tag places a \ infront of it. I have tried to stripslashes and the mail 
is being sent as html. Has any one got the answer? 

code below:
(description is my variable on a previous page where the user types in the 
content of the mail) 

$subject = 'Email from me'; 

$message = 
This email is regards a question / query that you put to me.
This email is for reference purposes only.
brbr
You asked:
brbr
.stripslashes ($description); 

$headers  = MIME-Version: 1.0\r\n;
$headers .= Content-type: text/html; charset=iso-8859-1\r\n;
$headers .= from: Help Desk [EMAIL PROTECTED]\r\n; 

mail($usersemail, $subject, $message, $headers); 


-- 
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] some kind of library loader

2002-04-03 Thread Arpad Tamas

Hi Everyone!

I have an idea, but I don't know how to realise it, if it can be at 
all.
We have a relatively big system, with 52k lines of php code without 
much html, and many classes (1138) that depend on each other.
And I think I don't need to say that php parses the code somewhat 
slow. That's what I'm trying to solve. I know there are code caches, 
but none of them suits all of our customers or our needs (price, 
effectiveness).
Of course not all classes are needed on every page request, so I'm 
trying to separate them, and require them when they are really 
needed, but that's not easy with 1100 classes.

So I thought I'd write a custom error handler, and when an unloaded 
class is created or it's static method is accessed an error would 
be triggered and I'd require it in the error handler. The only 
problem is, that after the error handler finished the main code is 
executed *after* the statement that triggered the error, so I can't 
tell php to give one more try for the previously faulty code.

Is there any chance for this to work with some trick, or do you know 
of a better sollution for the problem?

Thanks for your help,

Arpi

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




[PHP] PHP FAQ (again)

2002-04-03 Thread Justin French

I saw this mentioned a few times recently, but I'd really like to put out
the call again.

This group needs an FAQ *specific to this list* which helps new members /
posters integrate seamlessly... really, I'm sick of seeing non specific
subject lines like please help, and I'm sure we're all sick of typing
replies to frequent questions, usually with a response like I think you
should check the manual before posting.

I'm sure we're also sick of posts which don't ask specific questions
(what's wrong with my 150 lines of code??).


When I first joined this group, I too was unaware of what was considered a
good post (and perhaps still, I don't know!!), but some form of welcome
email when people join the group, or a reminder email sent weekly which
keeps the peace on this list will not go astray.


Perhaps it could:

- include some information on how to use the online manual/website (and the
simplicity of searching)

- cover some frequently asked topics which can be summarised with a link to
a few manual pages or external references (how many times do we see user
authentication, sessions, mail attachments, html email, header
redirect and javascript in the subject line  Usually, the writer asks
a very generic question, seeks references and tutorials, or doesn't know
what function to search for in the manual, or they're just lazy.  A quick
reference to these frequent topics will save a heap of time for all
concerned.

- remind people that there is an archive to this list that can be searched
(and include the URL)


Some of the posts (including OT posts, ones with meaningless subject lines,
ones which ask insane questions, etc etc) in this group would be laughed at
by members of other programming language groups (Perl for example).

As PHP grows as a language, and as the community of users grows with it,
this list is going to become higher volume.  The FAQs are going to become
more frequent, and the poor use / misuse of this list will grow with it.

I can already see frustration growing in this list.


I'd like to think that the list and it's standards can be raised a little,
to make it a more valuable resource for all users, without the grief.

I attach as a reference a text file FAQ which is posted frequently to the
newsgroup comp.infosystems.www.authoring.stylesheets.  It provided me with
an excellent resource when I first joined the group, and does help the list
stay somewhat moderated and clean.

I'm not saying it's exactly what we need, but I do feel it's time we do
something.


Sure, new users *could* find the archive by hunting, the *could* get flammed
for a bad post, poor question, or for not checking the manual first, but
wouldn't it be a smarter move long term for some sort of guideline/FAQ to be
incorporated into the list upon subscription, and perhaps on a weekly
basis??


I'm happy to help in any way I can, but don't consider myself guru enough
to develop this from scratch.


Apologies for the long post, especially since this topic has been kicked
around before.


Regards,

Justin French

Creative Director
http://Indent.com.au





CSS FAQ.txt
Description: application/applefile

From: Jan Roland Eriksson [EMAIL PROTECTED]
Reply-To: Jan Roland Eriksson [EMAIL PROTECTED]
Organization: The CSS Pointers Group
Newsgroups: 
comp.infosystems.www.authoring.stylesheets, comp.answers, news.answers
Followup-To: comp.infosystems.www.authoring.stylesheets
Date: Friday, 22 March 2002 
7:17 AM
Subject: Welcome to 'ciwas',this is our FAQ for stylesheet authors v1.14


Archive-name: www/stylesheets/authoring-faq
Posting-Frequency: twice a week (Mondays 
and Thursdays)
Last-modified: March 10, 2001
Version: 1.14
URL: 
http://css.nu/faq/ciwas-aFAQ.html
Maintainer: Jan Roland Eriksson [EMAIL PROTECTED]

ciwas 
stylesheet authoring FAQ v1.14
__

The Purpose, 
Scope and Notation of this FAQ-list.

This FAQ-list contains the edited result of a 
collective effort among
regular participants in the Usenet newsgroup...
  
comp.infosystems.www.authoring.stylesheets

The purpose of this document is to provide 
answers to a few of the
most frequent questions raised in the 'ciwas' Usenet 
newsgroup.

At the moment, almost all discussion on this group relates to CSS,
although that might not always be so. This document does not aim to be
a complete 
tutorial in stylesheets or in CSS.

There is a separate FAQ-list about the Usenet 
group itself, its
charter, customs and posting conventions. For further information
about stylesheets and about CSS see the resources listed in the
resource sections of  
http://css.nu/faq/ciwas-mFAQ.html

The following notational convention is used in this 
FAQ.

Single quote marks are used to denote keywords,
  e.g. 'font-family'
and those 
quote marks are not a part of the keyword.

Double quote marks are used to denote text 
that is quoted from
another source, and/or to mark jargon.
  

Re: [PHP] PHP FAQ (again)

2002-04-03 Thread Andrew Brampton

Small flaw in this. The new user would have to actually go and read the
FAQ... I'm a member of many lists, and I've never read the FAQ about the
list... but I've allways been aware that posting newbish questions is
frowned on, so I never did so.

So unless the FAQ was placed infront of them when signing up to this list
(if they actually sign up), then it might not get the results you expect.

But if it stops just 1 newbish post a year, then its worth it..

Andrew
- Original Message -
From: Justin French [EMAIL PROTECTED]
To: php [EMAIL PROTECTED]
Sent: Wednesday, April 03, 2002 1:57 PM
Subject: [PHP] PHP FAQ (again)


 I saw this mentioned a few times recently, but I'd really like to put out
 the call again.

 This group needs an FAQ *specific to this list* which helps new members /
 posters integrate seamlessly... really, I'm sick of seeing non specific
 subject lines like please help, and I'm sure we're all sick of typing
 replies to frequent questions, usually with a response like I think you
 should check the manual before posting.

 I'm sure we're also sick of posts which don't ask specific questions
 (what's wrong with my 150 lines of code??).


 When I first joined this group, I too was unaware of what was considered a
 good post (and perhaps still, I don't know!!), but some form of welcome
 email when people join the group, or a reminder email sent weekly which
 keeps the peace on this list will not go astray.


 Perhaps it could:

 - include some information on how to use the online manual/website (and
the
 simplicity of searching)

 - cover some frequently asked topics which can be summarised with a link
to
 a few manual pages or external references (how many times do we see user
 authentication, sessions, mail attachments, html email, header
 redirect and javascript in the subject line  Usually, the writer
asks
 a very generic question, seeks references and tutorials, or doesn't know
 what function to search for in the manual, or they're just lazy.  A quick
 reference to these frequent topics will save a heap of time for all
 concerned.

 - remind people that there is an archive to this list that can be searched
 (and include the URL)


 Some of the posts (including OT posts, ones with meaningless subject
lines,
 ones which ask insane questions, etc etc) in this group would be laughed
at
 by members of other programming language groups (Perl for example).

 As PHP grows as a language, and as the community of users grows with it,
 this list is going to become higher volume.  The FAQs are going to become
 more frequent, and the poor use / misuse of this list will grow with it.

 I can already see frustration growing in this list.


 I'd like to think that the list and it's standards can be raised a little,
 to make it a more valuable resource for all users, without the grief.

 I attach as a reference a text file FAQ which is posted frequently to the
 newsgroup comp.infosystems.www.authoring.stylesheets.  It provided me with
 an excellent resource when I first joined the group, and does help the
list
 stay somewhat moderated and clean.

 I'm not saying it's exactly what we need, but I do feel it's time we do
 something.


 Sure, new users *could* find the archive by hunting, the *could* get
flammed
 for a bad post, poor question, or for not checking the manual first, but
 wouldn't it be a smarter move long term for some sort of guideline/FAQ to
be
 incorporated into the list upon subscription, and perhaps on a weekly
 basis??


 I'm happy to help in any way I can, but don't consider myself guru
enough
 to develop this from scratch.


 Apologies for the long post, especially since this topic has been kicked
 around before.


 Regards,

 Justin French
 
 Creative Director
 http://Indent.com.au
 








 --
 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 FAQ (again)

2002-04-03 Thread Hunter, Ray

I am in total agreement with Justin on this one.  Many of the posters use
need help,  newbie needs help , etc.  We need to have some form of FAQ
with detailed instructions on how to post so that I do not have to ask;
What OS are you using, what version of php, which database, etc  This gets
tedious and time consuming.  Not to mention the amount of posts.  

I've been watching Rick Emery give out tons of help, but many of his first
questions are about clarifications on what a users is needing help on.  Some
extra detail will provide faster and reliable help.

Just some extra thoughts here...

I now some mailing lists will not even reply if you do not follow specific
criteria when you post...



Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


 -Original Message-
 From: Justin French [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, April 03, 2002 5:58 AM
 To: php
 Subject: [PHP] PHP FAQ (again)
 
 
 I saw this mentioned a few times recently, but I'd really 
 like to put out the call again.
 
 This group needs an FAQ *specific to this list* which helps 
 new members / posters integrate seamlessly... really, I'm 
 sick of seeing non specific subject lines like please help, 
 and I'm sure we're all sick of typing replies to frequent 
 questions, usually with a response like I think you should 
 check the manual before posting.
 
 I'm sure we're also sick of posts which don't ask specific 
 questions (what's wrong with my 150 lines of code??).
 
 
 When I first joined this group, I too was unaware of what was 
 considered a good post (and perhaps still, I don't know!!), 
 but some form of welcome email when people join the group, or 
 a reminder email sent weekly which keeps the peace on this 
 list will not go astray.
 
 
 Perhaps it could:
 
 - include some information on how to use the online 
 manual/website (and the simplicity of searching)
 
 - cover some frequently asked topics which can be summarised 
 with a link to a few manual pages or external references (how 
 many times do we see user authentication, sessions, mail 
 attachments, html email, header redirect and 
 javascript in the subject line  Usually, the writer 
 asks a very generic question, seeks references and tutorials, 
 or doesn't know what function to search for in the manual, or 
 they're just lazy.  A quick reference to these frequent 
 topics will save a heap of time for all concerned.
 
 - remind people that there is an archive to this list that 
 can be searched (and include the URL)
 
 
 Some of the posts (including OT posts, ones with meaningless 
 subject lines, ones which ask insane questions, etc etc) in 
 this group would be laughed at by members of other 
 programming language groups (Perl for example).
 
 As PHP grows as a language, and as the community of users 
 grows with it, this list is going to become higher volume.  
 The FAQs are going to become more frequent, and the poor use 
 / misuse of this list will grow with it.
 
 I can already see frustration growing in this list.
 
 
 I'd like to think that the list and it's standards can be 
 raised a little, to make it a more valuable resource for all 
 users, without the grief.
 
 I attach as a reference a text file FAQ which is posted 
 frequently to the newsgroup 
 comp.infosystems.www.authoring.stylesheets.  It provided me 
 with an excellent resource when I first joined the group, and 
 does help the list stay somewhat moderated and clean.
 
 I'm not saying it's exactly what we need, but I do feel it's 
 time we do something.
 
 
 Sure, new users *could* find the archive by hunting, the 
 *could* get flammed for a bad post, poor question, or for not 
 checking the manual first, but wouldn't it be a smarter move 
 long term for some sort of guideline/FAQ to be incorporated 
 into the list upon subscription, and perhaps on a weekly basis??
 
 
 I'm happy to help in any way I can, but don't consider myself 
 guru enough to develop this from scratch.
 
 
 Apologies for the long post, especially since this topic has 
 been kicked around before.
 
 
 Regards,
 
 Justin French
 
 Creative Director
 http://Indent.com.au
 
 
 



RE: [PHP] PHP FAQ (again)

2002-04-03 Thread Hunter, Ray

It's not so much the newbish questions but the determination of the part of
the newbie to find an answer.  I have found many of my answers on google or
the web.  Some extra searching is required.  Many of the questions can be
answered if some extra searching where involved.  However, when you ask if
they have researched some of the information and the reply is no...Then I
say RTFM and STFI...

This is a general list and newbie questions should be asked here...However,
newbies need to post adequate information for an adequate response...

Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


 -Original Message-
 From: Andrew Brampton [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, April 03, 2002 7:04 AM
 To: php
 Subject: Re: [PHP] PHP FAQ (again)
 
 
 Small flaw in this. The new user would have to actually go 
 and read the FAQ... I'm a member of many lists, and I've 
 never read the FAQ about the list... but I've allways been 
 aware that posting newbish questions is frowned on, so I never did so.
 
 So unless the FAQ was placed infront of them when signing up 
 to this list (if they actually sign up), then it might not 
 get the results you expect.
 
 But if it stops just 1 newbish post a year, then its worth it..
 
 Andrew
 - Original Message -
 From: Justin French [EMAIL PROTECTED]
 To: php [EMAIL PROTECTED]
 Sent: Wednesday, April 03, 2002 1:57 PM
 Subject: [PHP] PHP FAQ (again)
 
 
  I saw this mentioned a few times recently, but I'd really 
 like to put 
  out the call again.
 
  This group needs an FAQ *specific to this list* which helps new 
  members / posters integrate seamlessly... really, I'm sick 
 of seeing 
  non specific subject lines like please help, and I'm sure 
 we're all 
  sick of typing replies to frequent questions, usually with 
 a response 
  like I think you should check the manual before posting.
 
  I'm sure we're also sick of posts which don't ask specific 
 questions 
  (what's wrong with my 150 lines of code??).
 
 
  When I first joined this group, I too was unaware of what was 
  considered a good post (and perhaps still, I don't 
 know!!), but some 
  form of welcome email when people join the group, or a 
 reminder email 
  sent weekly which keeps the peace on this list will not go astray.
 
 
  Perhaps it could:
 
  - include some information on how to use the online manual/website 
  (and
 the
  simplicity of searching)
 
  - cover some frequently asked topics which can be summarised with a 
  link
 to
  a few manual pages or external references (how many times do we see 
  user authentication, sessions, mail attachments, 
 html email, 
  header redirect and javascript in the subject line  
 Usually, 
  the writer
 asks
  a very generic question, seeks references and tutorials, or doesn't 
  know what function to search for in the manual, or they're 
 just lazy.  
  A quick reference to these frequent topics will save a heap of time 
  for all concerned.
 
  - remind people that there is an archive to this list that can be 
  searched (and include the URL)
 
 
  Some of the posts (including OT posts, ones with meaningless subject
 lines,
  ones which ask insane questions, etc etc) in this group would be 
  laughed
 at
  by members of other programming language groups (Perl for example).
 
  As PHP grows as a language, and as the community of users 
 grows with 
  it, this list is going to become higher volume.  The FAQs 
 are going to 
  become more frequent, and the poor use / misuse of this 
 list will grow 
  with it.
 
  I can already see frustration growing in this list.
 
 
  I'd like to think that the list and it's standards can be raised a 
  little, to make it a more valuable resource for all users, 
 without the 
  grief.
 
  I attach as a reference a text file FAQ which is posted 
 frequently to 
  the newsgroup comp.infosystems.www.authoring.stylesheets.  
 It provided 
  me with an excellent resource when I first joined the 
 group, and does 
  help the
 list
  stay somewhat moderated and clean.
 
  I'm not saying it's exactly what we need, but I do feel 
 it's time we 
  do something.
 
 
  Sure, new users *could* find the archive by hunting, the *could* get
 flammed
  for a bad post, poor question, or for not checking the 
 manual first, 
  but wouldn't it be a smarter move long term for some sort of 
  guideline/FAQ to
 be
  incorporated into the list upon subscription, and perhaps 
 on a weekly 
  basis??
 
 
  I'm happy to help in any way I can, but don't consider myself guru
 enough
  to develop this from scratch.
 
 
  Apologies for the long post, especially since this topic has been 
  kicked around before.
 
 
  Regards,
 
  Justin French
  
  Creative Director
  http://Indent.com.au
  
 
 
 
 
 --
 --
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: 

Re: [PHP] PHP FAQ (again)

2002-04-03 Thread Nick Winfield

On Wed, 3 Apr 2002, Justin French wrote:

?php snip(); ?

 When I first joined this group, I too was unaware of what was considered a
 good post (and perhaps still, I don't know!!), but some form of welcome
 email when people join the group, or a reminder email sent weekly which
 keeps the peace on this list will not go astray.

I think the key to a good post is be as specific as possible without being
overly wordy, for want of a better expression.  I skim this list every
morning and there are too many vague posts made (by new users, granted)
that I don't have to time to answer.  If someone states their problems in
a concise manner (and it is something I can help with), then I will gladly
take a couple of minutes to point them in the right direction of a web
resource (I hate reinventing the wheel) or I'll batter out a quick
solution if possible.  I would love to help more flailing PHP souls, but
there aren't enough hours in the day to do so.

I agree wholeheartedly that there should be some kind of FAQ and/or
central solutions database where people can be pointed if they are
covering old ground.  I think that it would ease a lot of tension on the
list if people had such a tool at their disposal, rather than greeting an
honest cry for help with a mugfull of vitriol. :)

 Some of the posts (including OT posts, ones with meaningless subject lines,
 ones which ask insane questions, etc etc) in this group would be laughed at
 by members of other programming language groups (Perl for example).

Very true.

 As PHP grows as a language, and as the community of users grows with it,
 this list is going to become higher volume.  The FAQs are going to become
 more frequent, and the poor use / misuse of this list will grow with it.

 I can already see frustration growing in this list.

Frustration leads to anger, anger leads to hate, the Dark Side is only
around the corner! ;)

I think there's frustration from the more experienced members (daft
questions, covering the same ground over and over) but I can imagine the
frustration of the new users when they don't get the help they so
desperately require.  After all, they probably feel that what they are
asking is a legitimate question and yet all they receive in return is a
couple of tons of napalm.

 Sure, new users *could* find the archive by hunting, the *could* get flammed
 for a bad post, poor question, or for not checking the manual first, but
 wouldn't it be a smarter move long term for some sort of guideline/FAQ to be
 incorporated into the list upon subscription, and perhaps on a weekly
 basis??

Sounds like a good idea.

 I'm happy to help in any way I can, but don't consider myself guru enough
 to develop this from scratch.

I'd be willing to chip in my 2p (soon to be 2 euros) worth to get this off
the ground, but I couldn't commit to it on a full-time basis due to
real-life commitments and a million personal projects that are crying out
to be completed.

Cheers,

Nick Winfield.


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




Re: [PHP] odbc_pconnect doesnt reuse connection

2002-04-03 Thread eric.coleman

Why won't you just use odbc_connect ?
- Original Message -
From: Maris Kalnins [EMAIL PROTECTED]
To: 
Sent: Wednesday, April 03, 2002 3:07 AM
Subject: [PHP] odbc_pconnect doesnt reuse connection


 Hi!

 Configuration: WinXP, the latest Apache, PHP4

 The problem is that every time the script runs and the following command
is
 executed
 $cx=odbc_pconnect($G_dbname, $G_dblogin, $G_dbpassw);
 it happens very often that a new connection is created instead of reusing
 the old one!

 Is there any idea what's wrong... ?

 And another question - when user hits reload or submit button at the
moment
 when
 actually this odbc_pconnect is in progress - it generates another
connection
 leaving the old one
 (half opened or whatever) still alive..

 So if you will click on submit button more than 10 times with a little
short
 interval -
 we will get ODBC error - Database server connection limit exceeded

 I tried to set in PHP config file
 odbc.max_persistent = 1

 but it still overgoes more than 1 connection to the same database, user
and
 password..

 What's  wrong?







 --
 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: Including Files

2002-04-03 Thread Maxim Maletsky


try this: 

if(!@include('file.php')) {
header(HTTP/1.0 404 Not Found);
} 

change header() into whatever you want to include at it's place. 

Careful with this though, make sure that the files script is trying to 
include do never get below a certain directory. Otherwise I can dispay 
myself your /etc/passwd and you're freaked :-) 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
maxim phpbeginner.com 

 

Craig Donnelly writes: 

 Is there a way to setup either the apache/php directives to produce a custom
 404 if an include file fails to be included ?? 
 
 Or is this a job for .HTACCESS?? 
 
 Regards, 
 
 ~Craig 
 
  
 
 
 -- 
 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 FAQ (again)

2002-04-03 Thread Justin French

I think this is a good idea, but it looks to be more of a searchable FAQ,
which will highly detailed... I'm really thinking of a medium-length email
introduction to the group (as per my attachment) which hopefulyl cleans up
the group a bit.

Your resource could be fantastic, and could help with what i'm talking
about, but isn't really the answer *I* had in mind :)


Half the problem is that newbies AREN'T searching before asking Q's, or
don't know where to search, or don't know the right question to ask... so
any huge FAQ will not help this problem -- even though it will be a great
asset to the community.


Justin French




on 04/04/02 1:28 AM, J. Scott Johnson ([EMAIL PROTECTED]) wrote:

 Justin,
 
 Here's the data I was planning to capture for the FAQ.  Please let me know
 if there are any fields I'm missing and I'll add them.
 
 http://www.fuzzygroup.com/php/faq/faqadd.php
 
 Thanks
 Scott


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




[PHP] Re: PHP FAQ (again)

2002-04-03 Thread Hugh Bothwell

Justin French [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I saw this mentioned a few times recently, but I'd really like to put out
 the call again.

 This group needs an FAQ *specific to this list* which helps new members /
 posters integrate seamlessly...

Perhaps someone could quickly summarize and refer to
http://www.php.net/manual/en/faq.php
http://www.alt-php-faq.org/
http://www.kbcenter.com/category.php?parent_id=3
http://www.faqts.com/knowledge_base/index.phtml/fid/51/
http://pear.php.net/faq.php
http://www.php-faq.com/
http://www.phpworld.com/faq/faq_000.html
http://www.tek-tips.com/gfaq.cfm/lev2/4/lev3/31/spid/434
http://www.vbweb.co.uk/php/
http://www.cetus-links.org/oo_php.html
http://www.speakeasy.net/main.php?page=phpfaq
+ the list archives
+ posting etiquette

and point to php.net, zend.com, mysql.com, phpbuilder.com, etc...



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




Re: [PHP] odbc_pconnect doesnt reuse connection

2002-04-03 Thread Maris Kalnins

because odbc_connect takes some time to establish connection
while odbc_pconnect establishes it once after that it suppose to
give faster access through already existing connection!

that's what I got from php manual..
the bad thing is .. that in reality it works a little bit different..
so I am wondering .. why?



Eric Coleman [EMAIL PROTECTED] wrote in message
026b01c1db1c$860b2890$0201a8c0@devstation">news:026b01c1db1c$860b2890$0201a8c0@devstation...
 Why won't you just use odbc_connect ?
 - Original Message -
 From: Maris Kalnins [EMAIL PROTECTED]
 To: 
 Sent: Wednesday, April 03, 2002 3:07 AM
 Subject: [PHP] odbc_pconnect doesnt reuse connection


  Hi!
 
  Configuration: WinXP, the latest Apache, PHP4
 
  The problem is that every time the script runs and the following command
 is
  executed
  $cx=odbc_pconnect($G_dbname, $G_dblogin, $G_dbpassw);
  it happens very often that a new connection is created instead of
reusing
  the old one!
 
  Is there any idea what's wrong... ?
 
  And another question - when user hits reload or submit button at the
 moment
  when
  actually this odbc_pconnect is in progress - it generates another
 connection
  leaving the old one
  (half opened or whatever) still alive..
 
  So if you will click on submit button more than 10 times with a little
 short
  interval -
  we will get ODBC error - Database server connection limit exceeded
 
  I tried to set in PHP config file
  odbc.max_persistent = 1
 
  but it still overgoes more than 1 connection to the same database, user
 and
  password..
 
  What's  wrong?
 
 
 
 
 
 
 
  --
  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] What's wrong with the Array? Im baffled!

2002-04-03 Thread Scott Fletcher

Hi!

I'm a little baffled on why the array is not working the way I expect it
to.  It showed there is something about the array I do not know about.
Well, it's never too late to learn something new.  So, here's the code and
see if you can help me out.

-- clip --

  $name = TU4R;

  if ($sumItUp[$name] == ) {
 $sumItUp[$name] = 0;
  } else {
//debug
echo **;
 $number = $sumItUp[$name];
 $number++;
 $sumItUp[$name] = $number;
  }
  echo $sumItUp[$name].br;

-- clip --

In this case, the if statement never went into else statement when
there's a number like 0, 1, 2, etc.  So, what's the heck is happening here?
When the array, sumItUp[] was empty then the number 0 was assigned and
it work like a charm.  So,  when this code is repeated again, the if
statement check the array, sumItUp[] and found a number, 0 and it is not
equal to  as shown in the if statement.  So, therefore the else statement
should be executed.  But in this case, it never did.  I tested it myself to
make sure I wasn't missing something by putting in the php codes, echo
'**'; and the data, ** was never spitted out on the webpage.  So, it tell
me that the else statment was never executed.  So, the problem had to do
with the data in the array itself.  So, can anyone help me out?  Thanks a
million!!

Scott



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




Re: [PHP] odbc_pconnect doesnt reuse connection

2002-04-03 Thread eric.coleman

I have an IDEA

If your familiar with OOP

Write a class that is like a WRAPPER to the ODBC functions.

Then, you can connect once, and keep the connection
ALL this using just odbc_connect

This is what I have done, and if you would like, I can write a quick one.

Eric
- Original Message -
From: Maris Kalnins [EMAIL PROTECTED]
To: 
Sent: Wednesday, April 03, 2002 10:11 AM
Subject: Re: [PHP] odbc_pconnect doesnt reuse connection


 because odbc_connect takes some time to establish connection
 while odbc_pconnect establishes it once after that it suppose to
 give faster access through already existing connection!

 that's what I got from php manual..
 the bad thing is .. that in reality it works a little bit different..
 so I am wondering .. why?



 Eric Coleman [EMAIL PROTECTED] wrote in message
 026b01c1db1c$860b2890$0201a8c0@devstation">news:026b01c1db1c$860b2890$0201a8c0@devstation...
  Why won't you just use odbc_connect ?
  - Original Message -
  From: Maris Kalnins [EMAIL PROTECTED]
  To: 
  Sent: Wednesday, April 03, 2002 3:07 AM
  Subject: [PHP] odbc_pconnect doesnt reuse connection
 
 
   Hi!
  
   Configuration: WinXP, the latest Apache, PHP4
  
   The problem is that every time the script runs and the following
command
  is
   executed
   $cx=odbc_pconnect($G_dbname, $G_dblogin, $G_dbpassw);
   it happens very often that a new connection is created instead of
 reusing
   the old one!
  
   Is there any idea what's wrong... ?
  
   And another question - when user hits reload or submit button at the
  moment
   when
   actually this odbc_pconnect is in progress - it generates another
  connection
   leaving the old one
   (half opened or whatever) still alive..
  
   So if you will click on submit button more than 10 times with a little
  short
   interval -
   we will get ODBC error - Database server connection limit exceeded
  
   I tried to set in PHP config file
   odbc.max_persistent = 1
  
   but it still overgoes more than 1 connection to the same database,
user
  and
   password..
  
   What's  wrong?
  
  
  
  
  
  
  
   --
   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] What's wrong with the Array? Im baffled!

2002-04-03 Thread eric.coleman

Why not try using

if(empty($sumItUp[$name]))
{
// rest of code


- Original Message -
From: Scott Fletcher [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 03, 2002 10:14 AM
Subject: [PHP] What's wrong with the Array? Im baffled!


 Hi!

 I'm a little baffled on why the array is not working the way I expect
it
 to.  It showed there is something about the array I do not know about.
 Well, it's never too late to learn something new.  So, here's the code and
 see if you can help me out.

 -- clip --

   $name = TU4R;

   if ($sumItUp[$name] == ) {
  $sumItUp[$name] = 0;
   } else {
 //debug
 echo **;
  $number = $sumItUp[$name];
  $number++;
  $sumItUp[$name] = $number;
   }
   echo $sumItUp[$name].br;

 -- clip --

 In this case, the if statement never went into else statement when
 there's a number like 0, 1, 2, etc.  So, what's the heck is happening
here?
 When the array, sumItUp[] was empty then the number 0 was assigned and
 it work like a charm.  So,  when this code is repeated again, the if
 statement check the array, sumItUp[] and found a number, 0 and it is
not
 equal to  as shown in the if statement.  So, therefore the else
statement
 should be executed.  But in this case, it never did.  I tested it myself
to
 make sure I wasn't missing something by putting in the php codes, echo
 '**'; and the data, ** was never spitted out on the webpage.  So, it
tell
 me that the else statment was never executed.  So, the problem had to do
 with the data in the array itself.  So, can anyone help me out?  Thanks a
 million!!

 Scott



 --
 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] Can not get session value???

2002-04-03 Thread Johnson, Kirk

Do you have a call to session_start() in the second file? You need this to
access the session variables on the second page.

Kirk

 -Original Message-
 From: N.D. Andini [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 02, 2002 3:20 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Can not get session value???
 
 
 I use php4.0.5, OS : WIN2000, Webserver : Apache
 
 I want to use session to make global variable
 in file php.ini.
 I have set item below become enabled
 - register_globals
 - auto_start
 - use_trans_sid (to compiled with --enable-trans-sid)
 
 in my first file myfirst.php, I register session like below :
 session_register (ses_useid);
 session_register (ses_usename);
 $ses_useid=4;
 $ses_usename=toto;
 
 and on second file mysecond.php, I get value of those session to check
 session value like below:
 print $ses_useid;
 print $ses_usename;
 
 but I have no result from mysecond.php
 
 Is there anybody can help me???
 
 thx
 
 regards,
 
 Dini...

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




RE: [PHP] What's wrong with the Array? Im baffled!

2002-04-03 Thread Rick Emery

show the rest of your code

When you say this code is repeated again, what does that mean?  repeated
in a function, a loop,...?

Print out $sumItUp[TU4R] prior to if().  Is it as you expect?

-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 9:14 AM
To: [EMAIL PROTECTED]
Subject: [PHP] What's wrong with the Array? Im baffled!


Hi!

I'm a little baffled on why the array is not working the way I expect it
to.  It showed there is something about the array I do not know about.
Well, it's never too late to learn something new.  So, here's the code and
see if you can help me out.

-- clip --

  $name = TU4R;

  if ($sumItUp[$name] == ) {
 $sumItUp[$name] = 0;
  } else {
//debug
echo **;
 $number = $sumItUp[$name];
 $number++;
 $sumItUp[$name] = $number;
  }
  echo $sumItUp[$name].br;

-- clip --

In this case, the if statement never went into else statement when
there's a number like 0, 1, 2, etc.  So, what's the heck is happening here?
When the array, sumItUp[] was empty then the number 0 was assigned and
it work like a charm.  So,  when this code is repeated again, the if
statement check the array, sumItUp[] and found a number, 0 and it is not
equal to  as shown in the if statement.  So, therefore the else statement
should be executed.  But in this case, it never did.  I tested it myself to
make sure I wasn't missing something by putting in the php codes, echo
'**'; and the data, ** was never spitted out on the webpage.  So, it tell
me that the else statment was never executed.  So, the problem had to do
with the data in the array itself.  So, can anyone help me out?  Thanks a
million!!

Scott



-- 
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 FAQ (again)

2002-04-03 Thread Miles Thompson

Hugh,
No need - if you wouldn't mind, just post this list each day, along with 
the header PHP FAQs -Check here first!
Miles

At 10:17 AM 4/3/2002 -0500, Hugh Bothwell wrote:
Justin French [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I saw this mentioned a few times recently, but I'd really like to put out
  the call again.
 
  This group needs an FAQ *specific to this list* which helps new members /
  posters integrate seamlessly...

Perhaps someone could quickly summarize and refer to
http://www.php.net/manual/en/faq.php
http://www.alt-php-faq.org/
http://www.kbcenter.com/category.php?parent_id=3
http://www.faqts.com/knowledge_base/index.phtml/fid/51/
http://pear.php.net/faq.php
http://www.php-faq.com/
http://www.phpworld.com/faq/faq_000.html
http://www.tek-tips.com/gfaq.cfm/lev2/4/lev3/31/spid/434
http://www.vbweb.co.uk/php/
http://www.cetus-links.org/oo_php.html
http://www.speakeasy.net/main.php?page=phpfaq
+ the list archives
+ posting etiquette

and point to php.net, zend.com, mysql.com, phpbuilder.com, etc...



--
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 FAQ (again)

2002-04-03 Thread DL Neil

Justin,

 I think this is a good idea, but it looks to be more of a searchable
FAQ,
 which will highly detailed... I'm really thinking of a medium-length
email
 introduction to the group (as per my attachment) which hopefulyl
cleans up
 the group a bit.

 Your resource could be fantastic, and could help with what i'm talking
 about, but isn't really the answer *I* had in mind :)


 Half the problem is that newbies AREN'T searching before asking Q's,
or
 don't know where to search, or don't know the right question to ask...
so
 any huge FAQ will not help this problem -- even though it will be a
great
 asset to the community.


All sounds like a good idea. Your first post was at least half-way
there, so why don't you, in true open systems style, take the lead and
gather a group of other like-minded and motivated people, and just
Nike/do it?

Unfortunately the benefits are predicated on two things:

1 the unreasonable: will the newbie/questioner bother to consult any FAQ
before putting fingers to keyboard? At the one extreme we have people
who don't even notice that there are unsubscribe instructions at the end
of every msg, and beg to be released from membership (and please
encourage them to go - bless 'em!) Another is the person who is so bound
up in his/her work or perhaps naturally self-centered, that (s)he can
justify 'breaking' any 'rules' because I JUST need to know NOW (those
three capitalised words saying it 'all'). I've had three and four-round
correspondence with several ratbags where the last contribution from me
boils down to read what I wrote in paragraph-n of my first reply and
from them Sorry, I've been working continuously for 17hours and can't
see straight (to put it politely - and sometimes they don't feel it
necessary to thank/apologise...)

2 the reasonable: the worst problem a newbie faces is working out the
terminology/jargon. I'm currently helping someone working in MS-Excel
and disappearing deep into the bowels of macros/VBA. His system is
German language, and mine English. Often my problem is working out first
the 'M$ word' for something by chasing through the KnowledgeBase, and
then perhaps working out how to translate it into German-Excel... Anyone
who has (also done something bad in a previous life) worked with M$
products is familiar with this problem/feeling. The same applies here: a
newbie might talk about a 'logon and a password' without knowing that
the online manual's search engine will answer his/her question in a
flash if the word authentication is used...

Yes a bit of thought in the amount of info given (not too little, not
too much - quite a tall order when you're seeking an answer to something
you don't understand!), and the quality of message titles/subjects, does
go a long way towards motivating me (at least) into considering taking
the time and trouble to reply, etc, etc.

Go for it!
=dn


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




[PHP] Environment Variables Functions Incompatible???

2002-04-03 Thread arti

I am running code on different versions of PHP, specifically 4.0.6 and
4.1.2.  For some reason, you have to use $HTTP_SERVER_VARS[HTTP_HOST]) on
4.0.6 and $_SERVER[HTTP_HOST] on 4.1.2.  I'm not sure who thought that
breaking backward compatibility was a good idea, but let's ignore that for
the moment.  In this situation, the obvious thing to do here would be to
make a common function to return the hostname.  But, this does not work as
illustrated below:

- this is the main PHP script
?php
//main.php
include (crap.php);

function thisalsonowork()
{
 print Third one: (.isset($HTTP_SERVER_VARS[HTTP_HOST]).);
}

thisnowork();
print Second one: (.isset($HTTP_SERVER_VARS[HTTP_HOST]).);
thisalsonowork();
?

--- this is the include/require script
?php
//crap.php
function thisnowork()
{
 print First one: (.isset($HTTP_SERVER_VARS[HTTP_HOST]).);
}
?

--- Here is the output

First one: ()Second one: (1)Third one: ()




Besides the fact that the different versions of PHP provide different
environment variables for determining the host, the isset() on the env
variable works differently inside a function.  What is going on here?

Am I just missing something obvious?

Thanks,

-- Brian



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




Re: [PHP] Can not get session value???

2002-04-03 Thread eric.coleman

Yes, you have to call session_start() on every page you want to access/pass
session variables

Eric

- Original Message -
From: Johnson, Kirk [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 03, 2002 10:22 AM
Subject: RE: [PHP] Can not get session value???


 Do you have a call to session_start() in the second file? You need this to
 access the session variables on the second page.

 Kirk

  -Original Message-
  From: N.D. Andini [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, April 02, 2002 3:20 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Can not get session value???
 
 
  I use php4.0.5, OS : WIN2000, Webserver : Apache
 
  I want to use session to make global variable
  in file php.ini.
  I have set item below become enabled
  - register_globals
  - auto_start
  - use_trans_sid (to compiled with --enable-trans-sid)
 
  in my first file myfirst.php, I register session like below :
  session_register (ses_useid);
  session_register (ses_usename);
  $ses_useid=4;
  $ses_usename=toto;
 
  and on second file mysecond.php, I get value of those session to check
  session value like below:
  print $ses_useid;
  print $ses_usename;
 
  but I have no result from mysecond.php
 
  Is there anybody can help me???
 
  thx
 
  regards,
 
  Dini...

 --
 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] Environment Variables Functions Incompatible???

2002-04-03 Thread eric.coleman

They did not break backwords compatiblity, because

$HTTP_*_VARS works on all the new versions of PHP so far, it's just not
Super Global...

Eric

- Original Message -
From: arti [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 03, 2002 10:40 AM
Subject: [PHP] Environment Variables  Functions Incompatible???


 I am running code on different versions of PHP, specifically 4.0.6 and
 4.1.2.  For some reason, you have to use $HTTP_SERVER_VARS[HTTP_HOST])
on
 4.0.6 and $_SERVER[HTTP_HOST] on 4.1.2.  I'm not sure who thought that
 breaking backward compatibility was a good idea, but let's ignore that for
 the moment.  In this situation, the obvious thing to do here would be to
 make a common function to return the hostname.  But, this does not work as
 illustrated below:

 - this is the main PHP script
 ?php
 //main.php
 include (crap.php);

 function thisalsonowork()
 {
  print Third one: (.isset($HTTP_SERVER_VARS[HTTP_HOST]).);
 }

 thisnowork();
 print Second one: (.isset($HTTP_SERVER_VARS[HTTP_HOST]).);
 thisalsonowork();
 ?

 --- this is the include/require script
 ?php
 //crap.php
 function thisnowork()
 {
  print First one: (.isset($HTTP_SERVER_VARS[HTTP_HOST]).);
 }
 ?

 --- Here is the output

 First one: ()Second one: (1)Third one: ()




 Besides the fact that the different versions of PHP provide different
 environment variables for determining the host, the isset() on the env
 variable works differently inside a function.  What is going on here?

 Am I just missing something obvious?

 Thanks,

 -- Brian



 --
 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: some kind of library loader

2002-04-03 Thread Maxim Maletsky


Arpad,
as I read your mail one silly thing came into my mind: 

You can try to load all those classes as texts into a db and then to execute 
the needed ones as eval()ed strings. It could be easy for you to create the 
logic because the PHP code are stings and are never included but SELECTed. 
Not sure if this could be wise to do, just throwing out an idea. 

 

Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
maxim phpbeginner.com 


Arpad Tamas writes: 

 Hi Everyone! 
 
 I have an idea, but I don't know how to realise it, if it can be at 
 all.
 We have a relatively big system, with 52k lines of php code without 
 much html, and many classes (1138) that depend on each other.
 And I think I don't need to say that php parses the code somewhat 
 slow. That's what I'm trying to solve. I know there are code caches, 
 but none of them suits all of our customers or our needs (price, 
 effectiveness).
 Of course not all classes are needed on every page request, so I'm 
 trying to separate them, and require them when they are really 
 needed, but that's not easy with 1100 classes. 
 
 So I thought I'd write a custom error handler, and when an unloaded 
 class is created or it's static method is accessed an error would 
 be triggered and I'd require it in the error handler. The only 
 problem is, that after the error handler finished the main code is 
 executed *after* the statement that triggered the error, so I can't 
 tell php to give one more try for the previously faulty code. 
 
 Is there any chance for this to work with some trick, or do you know 
 of a better sollution for the problem? 
 
 Thanks for your help, 
 
   Arpi 
 
 -- 
 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




FW: [PHP] PHP FAQ (again)

2002-04-03 Thread Christoph Starkmann


Hi Ray!

 I am in total agreement with Justin on this one.  Many of the 
 posters use
 need help,  newbie needs help , etc.  We need to have 
 some form of FAQ
 with detailed instructions on how to post so that I do not 
 have to ask;

There are so many ressources on the web on how to pose questions
in mailing lists.
Do you think some extra documentation would help here?
I am afraid many of these posters wouldn't read this FAQ,
neither...

 I now some mailing lists will not even reply if you do not 
 follow specific
 criteria when you post...

That's up to everyone himself... BTW, there are many docs
on the web, too, on how to quote (avoid full quotes...)

Like someone (Rasmus?) wrote, there is a quite smart PHP
documentation to cover most of the basic questions, and
a lot of help here...

Again, do you think someone who isn't checking ouzt
the online doc would be reading the FAQ?

Regards,

Kiko

-
It's not a bug, it's a feature.
christoph starkmann
-

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




Re: [PHP] What's wrong with the Array? Im baffled!

2002-04-03 Thread Scott Fletcher

Found a way around it.  I'm using if (strlen($sumItUp[$name]) == 0)
{  } else { }.   this one does work.  Yes, I can use the empty()
function but it doesn't fully work that way becuase it return the NULL as
empty.

Scott
Eric Coleman [EMAIL PROTECTED] wrote in message
02cc01c1db23$3fc8ff40$0201a8c0@devstation">news:02cc01c1db23$3fc8ff40$0201a8c0@devstation...
 Why not try using

 if(empty($sumItUp[$name]))
 {
 // rest of code


 - Original Message -
 From: Scott Fletcher [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, April 03, 2002 10:14 AM
 Subject: [PHP] What's wrong with the Array? Im baffled!


  Hi!
 
  I'm a little baffled on why the array is not working the way I
expect
 it
  to.  It showed there is something about the array I do not know about.
  Well, it's never too late to learn something new.  So, here's the code
and
  see if you can help me out.
 
  -- clip --
 
$name = TU4R;
 
if ($sumItUp[$name] == ) {
   $sumItUp[$name] = 0;
} else {
  file://debug
  echo **;
   $number = $sumItUp[$name];
   $number++;
   $sumItUp[$name] = $number;
}
echo $sumItUp[$name].br;
 
  -- clip --
 
  In this case, the if statement never went into else statement when
  there's a number like 0, 1, 2, etc.  So, what's the heck is happening
 here?
  When the array, sumItUp[] was empty then the number 0 was assigned
and
  it work like a charm.  So,  when this code is repeated again, the if
  statement check the array, sumItUp[] and found a number, 0 and it is
 not
  equal to  as shown in the if statement.  So, therefore the else
 statement
  should be executed.  But in this case, it never did.  I tested it myself
 to
  make sure I wasn't missing something by putting in the php codes, echo
  '**'; and the data, ** was never spitted out on the webpage.  So, it
 tell
  me that the else statment was never executed.  So, the problem had to do
  with the data in the array itself.  So, can anyone help me out?  Thanks
a
  million!!
 
  Scott
 
 
 
  --
  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] PHP FAQ (again) ... we have a plan!

2002-04-03 Thread Hugh Bothwell

I'm getting a bit interested in this; here's how I
suggest we proceed.

First, we have to agree on the scope of the project.
I suggest a small number of FAQs directed at specific
subjects (rather than one 5000-line monster); my
suggested breakdown follows below.

Second, I suggest storing these permanently in
an easily-referrable format so it's easy to quote the
official faq.  Would php.net be willing to host them?
Hard to find a more suitable spot...

Third, I suggest the introduction to php.net
should be posted to the php.general newsgroup
weekly, and the other faqs could maybe be
posted one per week in rota just to keep
everyone's memory fresh.

Fourth, we should have a set of guidelines for the
content (a faq faq?), ie

- each faq should start with links to the whole
list of permanently-stored faqs

- each faq should be no more than two layers deep
or 500 lines long; more than that, we should
consider splitting off a top-level subject into its
own faq.

- faqs should be text-only, or HTML equivalent
(modest background, URLs turned into links,
no graphical content) with rows no more than
72 characters long (easy to quote in a newsgroup).

- each bottom-level section should consist of a short
explanation, two to ten lines, followed by one
to three URLs for further reference.

- all URLs should be to stable, recognized sites;
OpenSource-affiliated sites should be listed first

Suggested content / breakdown:
==

+ introduction to php.net
  charter - the purpose of this newsgroup
  posting guidelines and etiquette
be specific
be terse
descriptive subject
include exact error messages
include code no more than N lines, else give URL
be polite
be thankful - no-one HAS to help you
don't cross-post
don't multi-post
don't spam
  how to subscribe / unsubscribe to the newsgroup
  how to subscribe / unsubscribe to mailing lists
  reference to archives
  reference to php.net manual

+ quick overview of the language
  what is PHP, short history
  most recent version
  where to download
refer to installation instructions
  terminology/jargon?
  refer to php.net manual
  refer to tutorials
http://www.zend.com/zend/art/intro.php
http://hotwired.lycos.com/webmonkey/programming/php/
  what else I should learn
HTML, JavaScript, CSS, SQL - links

+ installation, recompilation, configuration

+ name this function
  quick searchable function list with keywords, short
descriptions,  maybe very short examples, and links
to appropriate php.net manual page

+ advanced language questions
  what is a good development environment
  page redirection
  browser refresh / timeout
  I keep getting headers already sent
  how to print a number with leading zeros
  how to interact with JavaScript
  the difference between include() and require()
  playing with arrays
  playing with tables

+ forms, sessions, user authentication, cookies
  how to authenticate users
  playing with forms
  how to pass values from one script to another
  how to initiate a session
  how to terminate a session
  counting current users

+ php+database
  refer to mysql.com
  how to query a database
  how to get a limited number of rows

+ email
  how to validate an email address
http://www.zend.com/zend/spotlight/ev12apr.php
  sending email
refer to RFCs
plain text
HTML
multipart MIME
  processing email ie w/ procmail






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




RE: [PHP] PHP FAQ (again) ... we have a plan!

2002-04-03 Thread Brian Drexler

I like the looks of it, if there's anything I can do just ask

-Original Message-
From: Hugh Bothwell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 12:09 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP FAQ (again) ... we have a plan!


I'm getting a bit interested in this; here's how I
suggest we proceed.

First, we have to agree on the scope of the project.
I suggest a small number of FAQs directed at specific
subjects (rather than one 5000-line monster); my
suggested breakdown follows below.

Second, I suggest storing these permanently in
an easily-referrable format so it's easy to quote the
official faq.  Would php.net be willing to host them?
Hard to find a more suitable spot...

Third, I suggest the introduction to php.net
should be posted to the php.general newsgroup
weekly, and the other faqs could maybe be
posted one per week in rota just to keep
everyone's memory fresh.

Fourth, we should have a set of guidelines for the
content (a faq faq?), ie

- each faq should start with links to the whole
list of permanently-stored faqs

- each faq should be no more than two layers deep
or 500 lines long; more than that, we should
consider splitting off a top-level subject into its
own faq.

- faqs should be text-only, or HTML equivalent
(modest background, URLs turned into links,
no graphical content) with rows no more than
72 characters long (easy to quote in a newsgroup).

- each bottom-level section should consist of a short
explanation, two to ten lines, followed by one
to three URLs for further reference.

- all URLs should be to stable, recognized sites;
OpenSource-affiliated sites should be listed first

Suggested content / breakdown:
==

+ introduction to php.net
  charter - the purpose of this newsgroup
  posting guidelines and etiquette
be specific
be terse
descriptive subject
include exact error messages
include code no more than N lines, else give URL
be polite
be thankful - no-one HAS to help you
don't cross-post
don't multi-post
don't spam
  how to subscribe / unsubscribe to the newsgroup
  how to subscribe / unsubscribe to mailing lists
  reference to archives
  reference to php.net manual

+ quick overview of the language
  what is PHP, short history
  most recent version
  where to download
refer to installation instructions
  terminology/jargon?
  refer to php.net manual
  refer to tutorials
http://www.zend.com/zend/art/intro.php
http://hotwired.lycos.com/webmonkey/programming/php/
  what else I should learn
HTML, JavaScript, CSS, SQL - links

+ installation, recompilation, configuration

+ name this function
  quick searchable function list with keywords, short
descriptions,  maybe very short examples, and links
to appropriate php.net manual page

+ advanced language questions
  what is a good development environment
  page redirection
  browser refresh / timeout
  I keep getting headers already sent
  how to print a number with leading zeros
  how to interact with JavaScript
  the difference between include() and require()
  playing with arrays
  playing with tables

+ forms, sessions, user authentication, cookies
  how to authenticate users
  playing with forms
  how to pass values from one script to another
  how to initiate a session
  how to terminate a session
  counting current users

+ php+database
  refer to mysql.com
  how to query a database
  how to get a limited number of rows

+ email
  how to validate an email address
http://www.zend.com/zend/spotlight/ev12apr.php
  sending email
refer to RFCs
plain text
HTML
multipart MIME
  processing email ie w/ procmail






-- 
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] php - copy problem

2002-04-03 Thread Craig Westerman

I'm trying to copy daily Analog Stats Report to a archive file. (see code
below) Destination file doesn't exist. I get this error:

Warning: Unable to create '030402.html': Permission denied in
/usr/www/users/cfth/WWW_REPORTS/analogarchive.php on line 9
/WWW_REPORTS/analogarchive.php:Error failed to copy the file www.html

It appears to be a permission problem. How do I set permissions to allow me
to do this?

Thanks

Craig 
[EMAIL PROTECTED]


?php
# copy daily analog report to archive file
$filename = www.html;
$newfn = date(dmy);
$fnex = .html;
if (!file_exists($filename)) {
echo Sorry cannot find the file $filename;
} else {
if (!copy($filename, $newfn.$fnex)) {
echo $PHP_SELF:Error failed to copy the file $filename;
} else {
echo The file $filename copied OK to $fn$fnex;
}
}
?


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




[PHP] syntax for date math expressions

2002-04-03 Thread ROBERT MCPEAK

What is the php syntax for adding or subtracting dates?

For example, I'd like to do something like this:

2002-04-03 - 2002-04-02 = 1

or 

2002-04-03 - 2002-04-02 = -00-01

or 

2002-04-03 + -00-01 = 2002-04-03

etc.

Can anybody help this newbie?

Thanks!



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




[PHP] closing a security hole on user accounts possible? - confirming accounts - history function

2002-04-03 Thread andy

Hi there,

is it possible to block hackers from stealing a session with the history
function of the browser?

Example:

A user registeres and recives a confirm e-mail. He confirms and does close
all browser windows. He leaves.
Another user comes to this computer opens the browser and the history and
clicks on the confirm link

Boom!! He has the session and is able to do all the stuff the other one can.

How could I close this security hole? Is there a work around?

Thanx,

Andy



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




[PHP] Re: What's wrong with the Array? Im baffled!

2002-04-03 Thread Maxim Maletsky


it is obvious, Scott: 

   if ($sumItUp[$name] == ) {

is like to say if $sumItUp[$name] is an empty string. Means, that if it 
was not assigned, or if it contains any kind of character in it this will 
result to false. 

Try using this: 

if(isset($sumItUp[$name]) and strlen($sumItUp[$name])) {
} 

this will mean: 

if there's such variable defined and the lenght of what it contains is 
bigger than 0 the statement will result TRUE. 

 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
maxim phpbeginner.com 

 

 

 


Scott Fletcher writes: 

 Hi! 
 
 I'm a little baffled on why the array is not working the way I expect it
 to.  It showed there is something about the array I do not know about.
 Well, it's never too late to learn something new.  So, here's the code and
 see if you can help me out. 
 
 -- clip -- 
 
   $name = TU4R; 
 
   if ($sumItUp[$name] == ) {
  $sumItUp[$name] = 0;
   } else {
 //debug
 echo **;
  $number = $sumItUp[$name];
  $number++;
  $sumItUp[$name] = $number;
   }
   echo $sumItUp[$name].br; 
 
 -- clip -- 
 
 In this case, the if statement never went into else statement when
 there's a number like 0, 1, 2, etc.  So, what's the heck is happening here?
 When the array, sumItUp[] was empty then the number 0 was assigned and
 it work like a charm.  So,  when this code is repeated again, the if
 statement check the array, sumItUp[] and found a number, 0 and it is not
 equal to  as shown in the if statement.  So, therefore the else statement
 should be executed.  But in this case, it never did.  I tested it myself to
 make sure I wasn't missing something by putting in the php codes, echo
 '**'; and the data, ** was never spitted out on the webpage.  So, it tell
 me that the else statment was never executed.  So, the problem had to do
 with the data in the array itself.  So, can anyone help me out?  Thanks a
 million!! 
 
 Scott 
 
  
 
 -- 
 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] Any ideas on combining arrays????

2002-04-03 Thread Scott Fletcher

Hi!

Need some ideas on combining some arrays into one!  I have array for
data and other array for counter.  How do I make an array that would show
different data for each counter number?

-- clip --
   $FFR = array (
  TU4R  = array( data = , count =  ),
  PH01  = array( data = , count =  ),
   );
-- clip --

The response should look something like this when I pick the correct
data and correct count;

   $FFR[TU4R][data][0][count]  = TU4R is 0;
   $FFR[TU4R][data][1][count] = TU4R is 1;
   $FFR[TU4R][data][2][count]  = TU4R is 2;

I tried to do something like this but it doesn't work.  I have been
working for 2 days trying to figure it out.  I appreciate any help you can
provide for me.

Thanks,
  Scott



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




Re: [PHP] closing a security hole on user accounts possible? - confirming accounts - history function

2002-04-03 Thread Andrew Brampton

This comes up on the list again and again.
Force the person to logout, so that the session is closed... check the posts
in the past week for other suggestions.

Andrew
- Original Message -
From: andy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 03, 2002 6:16 PM
Subject: [PHP] closing a security hole on user accounts possible? -
confirming accounts - history function


 Hi there,

 is it possible to block hackers from stealing a session with the history
 function of the browser?

 Example:

 A user registeres and recives a confirm e-mail. He confirms and does close
 all browser windows. He leaves.
 Another user comes to this computer opens the browser and the history and
 clicks on the confirm link

 Boom!! He has the session and is able to do all the stuff the other one
can.

 How could I close this security hole? Is there a work around?

 Thanx,

 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] php - copy problem

2002-04-03 Thread Craig Westerman

I did that first thing. Also tried chmod g+rwx

I can copy manually via Telnet, but something is wrong with my PHP script.

Thanks

Craig 
[EMAIL PROTECTED]


-Original Message-
From: Julian [mailto:[EMAIL PROTECTED]]

Hi!

You must to set the folder  where you want to save the file to CHMOD 777

Enter to your site via FTP and CHMOD your folder to 777 or rwxrwxrwx

Regards! Julian

- Original Message - 

I'm trying to copy daily Analog Stats Report to a archive file. (see code
below) Destination file doesn't exist. I get this error:

Warning: Unable to create '030402.html': Permission denied in
/usr/www/users/cfth/WWW_REPORTS/analogarchive.php on line 9
/WWW_REPORTS/analogarchive.php:Error failed to copy the file www.html

It appears to be a permission problem. How do I set permissions to allow me
to do this?

Thanks

Craig 
[EMAIL PROTECTED]


?php
# copy daily analog report to archive file
$filename = www.html;
$newfn = date(dmy);
$fnex = .html;
if (!file_exists($filename)) {
echo Sorry cannot find the file $filename;
} else {
if (!copy($filename, $newfn.$fnex)) {
echo $PHP_SELF:Error failed to copy the file $filename;
} else {
echo The file $filename copied OK to $fn$fnex;
}
}
?


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




[PHP] Mail Function

2002-04-03 Thread Chiew, Richard



 Can someone please tell me what did i do wrong in the following php
 mail function?
 
 I created the following php file using the mail() function but i keep
 getting the 'failed to connect.unable to send your mail.' message. Can
 anyone please tell me what did i do wrong? thx
 
 ? function show_form($email=,
 $message=,$subject=) {  ?
 
 h2Send Me an E-mail/h2 
 
 form action=email.php method=post
 
 Your E-mail address:br
 input type=text name=email size=30 
 value=?echo $email?br
 
 The Subject:br
 input type=text name=subject size=30 
 value=?echo $subject?br 
 
 Your Message:br
 textarea rows=10 cols=50 name=message
 ?echo $message?
 /textareabr
 input type=submit value=Send E-mail
 /form
 
 ? }  
 
 
 if (!isset($email) or !isset($message)) {
  show_form();
 }
 else {
   if (empty($email) or empty($message)) {
   echo H1There is a Problem:/H1;
   if (empty($email)) {
  echo I need your email address in 
   order to write back.  Please fill 
   it in below.  Thank you.;
   }
   if (empty($message)) {
  echo You did not write anything.  
Please write something.  Thank You.;  
   }
   show_form($email,$message,$subject);
   }
   else {
  if (empty($subject)) { 
  $subject=your email;  
  }
 
 
  $sent = mail( [EMAIL PROTECTED], 
   $subject,$message, From: $email );
 
  if ($sent) {
 echo H1Your Message Has Been Sent./H1;  
 echo Thank you, b$email/b.  pI'll
   will read your email regarding '
   b$subject/b and reply soon.;  
  }
  else {
 echo H1There is a Problem:/H1
   pThe server was unable to send your
mail.;
 }
   }
 }
 ?
 

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




[PHP] register session

2002-04-03 Thread Kris Vose

I am trying to register a session after verification of username and password.
 
It looks like this:
 
session_start();
If ($name = $aa)  ($username = $ab)
{
session_register(valid_user);
echo scriptwindow.location=\'admin_.php'\/script;
}
else
{
echo Your username/password is incorrect;
}
 
On each page that I want secure I include a script that checks for the 
session_register().  It looks like this:
 
session_start();
global $valid_user;
 
if (session_is_registered(valid_user))
{
echo you are registered;
}
else
{
echo you are not registered;
}
 
This code is not working and it sends a warning message like this: Warning: Cannot 
send session cache limiter - headers already sent (output started at 
/var/www/focus-capital/BetterBus/1/admin_.php:7) in 
/var/www/focus-capital/BetterBus/1/admin_.php on line 126
you are registered 1 - Send Mail
 
I have not used sessions before and I am wondering if I am doing some wrong with the 
syntax?
 



RE: [PHP] closing a security hole on user accounts possible? - confirming accounts - history function

2002-04-03 Thread SHEETS,JASON (Non-HP-Boise,ex1)

You could assign a randomly generated confirmation code to the link

for example
http://yoursitel.com/membershipconfirm.php?user=jsheetsconfirmid=1238D7adfd
a

Then when the user hits that link have membershipconfirm.php check the
database, confirm the user and the confirmid, if it matches remove that
entry from the database and finish setting up the user account.  Now if
another user hits that page the confirmid will be invalid and they will not
get access.

I would make the confirmation page a form that asks the user to enter their
username and confirmation id, then auto-populate the fields with the values
from the URL, that way if the user's email client mangles the url they can
still type it in manually.

Jason

-Original Message-
From: andy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 10:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP] closing a security hole on user accounts possible? -
confirming accounts - history function


Hi there,

is it possible to block hackers from stealing a session with the history
function of the browser?

Example:

A user registeres and recives a confirm e-mail. He confirms and does close
all browser windows. He leaves.
Another user comes to this computer opens the browser and the history and
clicks on the confirm link

Boom!! He has the session and is able to do all the stuff the other one can.

How could I close this security hole? Is there a work around?

Thanx,

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




[PHP] Re: Any ideas on combining arrays????

2002-04-03 Thread Maxim Maletsky

See, Scott.. It is all about your logic. 

For instance, you can create a nice multidimentional array like this: 

Array(
'0'=Array(
'data'=Array( // your whole data array
  data
  data
  data
),
'parameters'=Array( // the settings rlative to data array
'count'='256',
'type_of_data'='strings',
'came_from_DB'='PostgreSQL',
'came_from_table'='thisTable'
'etc'='bla...bla..bla..'
)
),
'1'=Array(
'data'=Array( // your whole data array
  data
  data
  data
),
'parameters'=Array( // the settings rlative to data array
'count'='258',
'type_of_data'='integers',
'came_from_DB'='mySQL',
'came_from_table'='thatTable'
'etc'='bla...bla..bla..'
)
), 

... etcetc...etc... 

); 

 

in this way you can loop the whole thing, access the data by refering to the 
'data' subarray and then get the parameters (counts, types whatever you 
want) by accessing 'parameters' subarray containing the relative settings 
for that very array. 

As I said in the very first line - all up to your logic and the organization 
rules within the code. 

Hope it is of any help to you. 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

 

 

 

Scott Fletcher writes: 

 Hi! 
 
 Need some ideas on combining some arrays into one!  I have array for
 data and other array for counter.  How do I make an array that would show
 different data for each counter number? 
 
 -- clip --
$FFR = array (
   TU4R  = array( data = , count =  ),
   PH01  = array( data = , count =  ),
);
 -- clip -- 
 
 The response should look something like this when I pick the correct
 data and correct count; 
 
$FFR[TU4R][data][0][count]  = TU4R is 0;
$FFR[TU4R][data][1][count] = TU4R is 1;
$FFR[TU4R][data][2][count]  = TU4R is 2; 
 
 I tried to do something like this but it doesn't work.  I have been
 working for 2 days trying to figure it out.  I appreciate any help you can
 provide for me. 
 
 Thanks,
   Scott 
 
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 


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




RE: [PHP] register session

2002-04-03 Thread Vlad Kulchitski

Kris,

Idi na phpbeginner.com tam est 'tutorials' dlya tebya.

Vlad

-Original Message-
From: Kris Vose 
Sent: 3 êâ³òíÿ 2002 ð. 12:42
To: [EMAIL PROTECTED]
Subject: [PHP] register session

I am trying to register a session after verification of username and password.
 
It looks like this:
 
session_start();
If ($name = $aa)  ($username = $ab)
{
session_register(valid_user);
echo scriptwindow.location=\'admin_.php'\/script;
}
else
{
echo Your username/password is incorrect;
}
 
On each page that I want secure I include a script that checks for the 
session_register().  It looks like this:
 
session_start();
global $valid_user;
 
if (session_is_registered(valid_user))
{
echo you are registered;
}
else
{
echo you are not registered;
}
 
This code is not working and it sends a warning message like this: Warning: Cannot 
send session cache limiter - headers already sent (output started at 
/var/www/focus-capital/BetterBus/1/admin_.php:7) in 
/var/www/focus-capital/BetterBus/1/admin_.php on line 126
you are registered 1 - Send Mail
 
I have not used sessions before and I am wondering if I am doing some wrong with the 
syntax?
 

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




[PHP] Re: syntax for date math expressions

2002-04-03 Thread Maxim Maletsky


first of all your data seems to come from a DB to me. If it's so then read 
your DB manual for date functions. It would be way better and faster. 

Otherwise, if you're so keen to let this duty job up to PHP then convert 
both dates into UNIX time format 'maketime()' deduct the values and put them 
through the 'date()' function. 

 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

 


ROBERT MCPEAK writes: 

 What is the php syntax for adding or subtracting dates? 
 
 For example, I'd like to do something like this: 
 
 2002-04-03 - 2002-04-02 = 1 
 
 or  
 
 2002-04-03 - 2002-04-02 = -00-01 
 
 or  
 
 2002-04-03 + -00-01 = 2002-04-03 
 
 etc. 
 
 Can anybody help this newbie? 
 
 Thanks! 
 
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

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




RE: [PHP] register session

2002-04-03 Thread SHEETS,JASON (Non-HP-Boise,ex1)

Make sure you have session_start() before any output is sent to the browser,
also look for whitespace at the top of your file, sometimes a blank line or
a space can cause this error.

The reason you get this error is session_start() needs to add information to
the headers but because they have already been sent it can't.  You can
either put session_start before any output or you can enable output
buffering.

If this doesn't work let me know.

Jason

-Original Message-
From: Kris Vose [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 10:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP] register session


I am trying to register a session after verification of username and
password.
 
It looks like this:
 
session_start();
If ($name = $aa)  ($username = $ab)
{
session_register(valid_user);
echo scriptwindow.location=\'admin_.php'\/script;
}
else
{
echo Your username/password is incorrect;
}
 
On each page that I want secure I include a script that checks for the
session_register().  It looks like this:
 
session_start();
global $valid_user;
 
if (session_is_registered(valid_user))
{
echo you are registered;
}
else
{
echo you are not registered;
}
 
This code is not working and it sends a warning message like this: Warning:
Cannot send session cache limiter - headers already sent (output started at
/var/www/focus-capital/BetterBus/1/admin_.php:7) in
/var/www/focus-capital/BetterBus/1/admin_.php on line 126
you are registered 1 - Send Mail
 
I have not used sessions before and I am wondering if I am doing some wrong
with the syntax?
 

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




[PHP] Re: Passing Values

2002-04-03 Thread Maxim Maletsky


Yes, 

that would help... 

 

 

Sebastian A. writes: 

 Hello,
   Today I was working on an object that will create all of the columns and
 tables in my DataBase for my upcoming application. I however, did run into
 trouble. I am having problems because I cannot pass the name of the database
 from the form to the function that needs it. Everything is on the same page
 (sql_create.php), and the functions that gets the data (the form function)
 and the function that needs the Database name are both within an object.
 Does anyone have any ideas? I can post some code samples if it will help. 
 
 Thanks in Advnace 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com
[EMAIL PROTECTED] 

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




RE: [PHP] Mail Function

2002-04-03 Thread Mark Roedel


Have you verified that the mail settings in your php.ini are correct?

---
Mark Roedel   | Blessed is he who has learned to laugh
Systems Programmer|  at himself, for he shall never cease
LeTourneau University |  to be entertained.
Longview, Texas, USA  |  -- John Powell


 -Original Message-
 From: Chiew, Richard [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, April 03, 2002 11:45 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Mail Function
 
 
 
 
  Can someone please tell me what did i do wrong in the following php
  mail function?
  
  I created the following php file using the mail() function 
  but i keep getting the 'failed to connect.unable to send your
  mail.' message. Can anyone please tell me what did i do wrong?
  
  [snip]

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




Re: [PHP] Can't AddType .htm

2002-04-03 Thread php

Thanks for the suggestion but it didn't make any difference.
Currently my http.conf file has

  AddType application/x-httpd-php .htm .php .php4 .php3
  AddType application/x-httpd-php-source .phps

I also have no .htaccess file to overide these settings.
Anyone got any more ideas?

Regards

Dan



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




[PHP] Re: syntax for date math expressions

2002-04-03 Thread ROBERT MCPEAK

Okay, I've got 2 tables.  One has fields user, exp_date, the other has a
bunch of fields including user.  If the exp_date from the first table is
greater than $somedate (probably today's date), then I don't want to
show the records from the 2nd table.  Get it?

So how do I do this?

It doesn't seem apparently obvious to me how to do it in a single, or
multiple sql queries.

Thanks.

 Maxim Maletsky [EMAIL PROTECTED] 04/03/02 12:51PM


first of all your data seems to come from a DB to me. If it's so then
read 
your DB manual for date functions. It would be way better and faster. 

Otherwise, if you're so keen to let this duty job up to PHP then
convert 
both dates into UNIX time format 'maketime()' deduct the values and put
them 
through the 'date()' function. 

 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com 
[EMAIL PROTECTED] 

 


ROBERT MCPEAK writes: 

 What is the php syntax for adding or subtracting dates? 
 
 For example, I'd like to do something like this: 
 
 2002-04-03 - 2002-04-02 = 1 
 
 or  
 
 2002-04-03 - 2002-04-02 = -00-01 
 
 or  
 
 2002-04-03 + -00-01 = 2002-04-03 
 
 etc. 
 
 Can anybody help this newbie? 
 
 Thanks! 
 
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com 
[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] anyone using CVS for PHP dev?

2002-04-03 Thread php

What CVS software do you recommend?

Dan



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




Re: [PHP] intelligent mailing list?

2002-04-03 Thread Miguel Cruz

On Wed, 3 Apr 2002, Denis L. Menezes wrote:
 What I wish to do is develop a mailinmg list which , among the normal
 functions, can give a list of failed email messages. Can anyone please help
 me find such an application code?

The best you can do is to make sure the return address on your outbound 
messages directs to a program that will look through bounces to try to 
figure out the failed address. You can add an extra header to help you. 
For instance, send out your messages with

   X-List-To: [EMAIL PROTECTED]

and then just scan incoming mail at that address for X-List-To: (.*) which 
will give you the failed addresses. Then add them to or subtract them from 
a database.

There's no practical way to find out about failed deliveries while you're 
sending; you have to sit back and wait until the bounces come in (even 
though some of them might come very quickly).

miguel


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




[PHP] Re: Any ideas on combining arrays????

2002-04-03 Thread Scott Fletcher

Well, I don't thinik this will work.  Because I will recieve an unknown
number of data.  The number of PH10 I would get would be either 1 or 2 or
126, etc.  There is no way to determine the number, so I already create an
counter to tell me how many of them.  So, that leave me with an need to
create an array to unlimited number of PH10 without overwritting the current
PH10.  Here's my demo.

TU4R = TU4R is 0
PH10 = PH10 is 0
PH10 = PH10 is 1
PH10 = PH10 is 2

Can anyone write a multidimentional array demostration to handle this
demo?

Thanks a Million!
 Scott

Maxim Maletsky [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 See, Scott.. It is all about your logic.

 For instance, you can create a nice multidimentional array like this:

 Array(
 '0'=Array(
 'data'=Array( // your whole data array
   data
   data
   data
 ),
 'parameters'=Array( // the settings rlative to data array
 'count'='256',
 'type_of_data'='strings',
 'came_from_DB'='PostgreSQL',
 'came_from_table'='thisTable'
 'etc'='bla...bla..bla..'
 )
 ),
 '1'=Array(
 'data'=Array( // your whole data array
   data
   data
   data
 ),
 'parameters'=Array( // the settings rlative to data array
 'count'='258',
 'type_of_data'='integers',
 'came_from_DB'='mySQL',
 'came_from_table'='thatTable'
 'etc'='bla...bla..bla..'
 )
 ),

 ... etcetc...etc...

 );



 in this way you can loop the whole thing, access the data by refering to
the
 'data' subarray and then get the parameters (counts, types whatever you
 want) by accessing 'parameters' subarray containing the relative settings
 for that very array.

 As I said in the very first line - all up to your logic and the
organization
 rules within the code.

 Hope it is of any help to you.


 Maxim Maletsky

 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)

 www.PHPBeginner.com
 [EMAIL PROTECTED]







 Scott Fletcher writes:

  Hi!
 
  Need some ideas on combining some arrays into one!  I have array for
  data and other array for counter.  How do I make an array that would
show
  different data for each counter number?
 
  -- clip --
 $FFR = array (
TU4R  = array( data = , count =  ),
PH01  = array( data = , count =  ),
 );
  -- clip --
 
  The response should look something like this when I pick the correct
  data and correct count;
 
 $FFR[TU4R][data][0][count]  = TU4R is 0;
 $FFR[TU4R][data][1][count] = TU4R is 1;
 $FFR[TU4R][data][2][count]  = TU4R is 2;
 
  I tried to do something like this but it doesn't work.  I have been
  working for 2 days trying to figure it out.  I appreciate any help you
can
  provide for me.
 
  Thanks,
Scott
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 



 Maxim Maletsky

 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)

 www.PHPBeginner.com
 [EMAIL PROTECTED]




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




Re: [PHP] Environment Variables Functions Incompatible???

2002-04-03 Thread Jason Wong

On Wednesday 03 April 2002 23:40, arti wrote:


 Besides the fact that the different versions of PHP provide different
 environment variables for determining the host, the isset() on the env
 variable works differently inside a function.  What is going on here?

$HTTP_SERVER_VARS is only available in the global scope but you're trying to 
use it inside the scope of your function. Here's how to do it.

function doo() {
  global $HTTP_SERVER_VARS;
  print_r($HTTP_SERVER_VARS);
}


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
What the scientists have in their briefcases is terrifying.
-- Nikita Khruschev
*/

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




Re: [PHP] closing a security hole on user accounts possible? - confirming accounts - history function

2002-04-03 Thread Jason Wong

On Thursday 04 April 2002 01:21, Andrew Brampton wrote:
 This comes up on the list again and again.
 Force the person to logout, so that the session is closed... check the
 posts in the past week for other suggestions.

It was the very same Andy who asked a similar question last week :)


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Woman on Street:Sir, you are drunk; very, very drunk.
Winston Churchill:  Madame, you are ugly; very, very ugly.
I shall be sober in the morning.
*/

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




RE: [PHP] php - copy problem

2002-04-03 Thread Miguel Cruz

On Wed, 3 Apr 2002, Craig Westerman wrote:
 I did that first thing. Also tried chmod g+rwx
 I can copy manually via Telnet, but something is wrong with my PHP script.

chmod g+w probably won't help you, since Apache normally runs as user 
'nobody', who tends not to be in groups with anyone else. So the directory 
would need to either be owned by user 'nobody', by nobody's group, or 
chmod o+w.

Also, from your code it's not clear what directory is being written to. 
Are you sure you know?

miguel


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




RE: [PHP] Re: Any ideas on combining arrays????

2002-04-03 Thread Demitrious S. Kelly

Use a multi-dimensional array... try this as a kind of 'proof of
concept'

?php

$array[tu4r][]=0
$array[tu4r][]=10
$array[tu4r][]=100
$array[tu4r][]=1000
$array[ph10][]=0;
$array[ph10][]=1;
$array[ph10][]=2;
$array[ph10][]=126;

echo 'pre';
foreach ( $array[ph10] as $value ) {
echo '  PH10: '.$value.chr(10);
}
echo '/pre';
echo 'pre';
foreach ( $array[tu4r] as $value ) {
echo '  TU4R: '.$value.chr(10);
}
echo '/pre';

?

cheers
-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, April 03, 2002 10:15 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Any ideas on combining arrays

Well, I don't thinik this will work.  Because I will recieve an
unknown
number of data.  The number of PH10 I would get would be either 1 or 2
or
126, etc.  There is no way to determine the number, so I already create
an
counter to tell me how many of them.  So, that leave me with an need to
create an array to unlimited number of PH10 without overwritting the
current
PH10.  Here's my demo.

TU4R = TU4R is 0
PH10 = PH10 is 0
PH10 = PH10 is 1
PH10 = PH10 is 2

Can anyone write a multidimentional array demostration to handle
this
demo?

Thanks a Million!
 Scott

Maxim Maletsky [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 See, Scott.. It is all about your logic.

 For instance, you can create a nice multidimentional array like this:

 Array(
 '0'=Array(
 'data'=Array( // your whole data array
   data
   data
   data
 ),
 'parameters'=Array( // the settings rlative to data array
 'count'='256',
 'type_of_data'='strings',
 'came_from_DB'='PostgreSQL',
 'came_from_table'='thisTable'
 'etc'='bla...bla..bla..'
 )
 ),
 '1'=Array(
 'data'=Array( // your whole data array
   data
   data
   data
 ),
 'parameters'=Array( // the settings rlative to data array
 'count'='258',
 'type_of_data'='integers',
 'came_from_DB'='mySQL',
 'came_from_table'='thatTable'
 'etc'='bla...bla..bla..'
 )
 ),

 ... etcetc...etc...

 );



 in this way you can loop the whole thing, access the data by refering
to
the
 'data' subarray and then get the parameters (counts, types whatever
you
 want) by accessing 'parameters' subarray containing the relative
settings
 for that very array.

 As I said in the very first line - all up to your logic and the
organization
 rules within the code.

 Hope it is of any help to you.


 Maxim Maletsky

 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)

 www.PHPBeginner.com
 [EMAIL PROTECTED]







 Scott Fletcher writes:

  Hi!
 
  Need some ideas on combining some arrays into one!  I have array
for
  data and other array for counter.  How do I make an array that would
show
  different data for each counter number?
 
  -- clip --
 $FFR = array (
TU4R  = array( data = , count =  ),
PH01  = array( data = , count =  ),
 );
  -- clip --
 
  The response should look something like this when I pick the
correct
  data and correct count;
 
 $FFR[TU4R][data][0][count]  = TU4R is 0;
 $FFR[TU4R][data][1][count] = TU4R is 1;
 $FFR[TU4R][data][2][count]  = TU4R is 2;
 
  I tried to do something like this but it doesn't work.  I have
been
  working for 2 days trying to figure it out.  I appreciate any help
you
can
  provide for me.
 
  Thanks,
Scott
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 



 Maxim Maletsky

 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)

 www.PHPBeginner.com
 [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] PHP FAQ (again)

2002-04-03 Thread Miguel Cruz

On Wed, 3 Apr 2002, Andrew Brampton wrote:
 So unless the FAQ was placed infront of them when signing up to this list
 (if they actually sign up), then it might not get the results you expect.

The first time you post to comp.lang.perl.misc, a daemon picks up your 
address, checks it against a database, and sends you a FAQ if you're a new 
poster.

Some newsgroups are auto-moderated and won't post your first message 
unless you specifically acknowledge having read the FAQ.

I think either makes a good solution for getting it in front of people.

miguel


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




Re: [PHP] anyone using CVS for PHP dev?

2002-04-03 Thread Garth Dahlstrom

  php 
-  Re: [PHP] anyone using CVS for PHP dev?
-  Wed, 3 Apr 2002 19:07:33 +0100

What CVS software do you recommend?

Dan

If you're a Windows user:
- TortoiseCVS ( http://www.tortoisecvs.org/ ) is a nice windows client
that integrates with the file manager.

- CVS for NT ( http://www.cvsnt.org/ ) is a windows port of the 
CVS server, with a very easy to use interface (tip: make sure
there are no spaces in your repository directory names).

GED

Northern.CA ===--
http://www.northern.ca 
Canada's Search Engine



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




Re: [PHP] Re: some kind of library loader

2002-04-03 Thread Miguel Cruz

On Thu, 4 Apr 2002, Maxim Maletsky wrote:
 You can try to load all those classes as texts into a db and then to execute 
 the needed ones as eval()ed strings. It could be easy for you to create the 
 logic because the PHP code are stings and are never included but SELECTed. 
 Not sure if this could be wise to do, just throwing out an idea. 

Offhand I'm guessing the payoff wouldn't be great, because you'd lose the 
benefit of PHP's own code caching. Depends on how much of this voluminous 
code actually gets used on any one run, I suppose. But why not do the same 
thing with conditional includes, and then at least let PHP cache it?

miguel


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




[PHP] can't get it to work

2002-04-03 Thread Alex

I'm trying to write code that will return all records found between certain
dates(e.g. 2001-01-30 through 2002-01-30). I created a html form with pull
down menus for both dates but when I try to run it I get a parse error and
can't figure out what's wrong.

Thanks,

Alex

Here is the php code:

$month_1 = addslashes($date_month_1);
$day_1 = addslashes($date_day_1);
$year_1 = addslashes($date_year_1);
$month_2 = addslashes($date_month_2);
$day_2 = addslashes($date_day_2);
$year_2 = addslashes($date_year_2);


$query = SELECT * FROM table where date  = '$month_1/$day_1/$year_1' AND
date = '$month_2/$day_2/$year_2';

$result = mysql_query($query);

$num_results = mysql_num_rows($result);

echo pNumber of records found: .$num_results./p;

for ($i=0; $i $num_results; $i++)
  {
 $row = mysql_fetch_array($result);
 echo pstrong.($i+1).. ID: ;
 echo stripslashes($row[id]);
 echo /strongbrFirst name: ;
 echo stripslashes($row[fname]);
 echo brLast name: ;
 echo stripslashes($row[lname]);
   }

?



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




Re: [PHP] PHP FAQ (again)

2002-04-03 Thread Jason Wong

On Wednesday 03 April 2002 22:06, Hunter, Ray wrote:
 I am in total agreement with Justin on this one.  Many of the posters use
 need help,  newbie needs help , 

I have given up on even reading posts without a meaningful subject. They go 
straight into the trash can.

 etc.  We need to have some form of FAQ
 with detailed instructions on how to post so that I do not have to ask;
 What OS are you using, what version of php, which database, etc  This
 gets tedious and time consuming.  Not to mention the amount of posts.

 I've been watching Rick Emery give out tons of help, but many of his first
 questions are about clarifications on what a users is needing help on. 
 Some extra detail will provide faster and reliable help.

 Just some extra thoughts here...

 I now some mailing lists will not even reply if you do not follow specific
 criteria when you post...

I think that's a jolly good idea. If people are too lazy to help themselves 
by reading the FAQ (if there was one) and the posting guidelines (if there 
was one) then they really don't deserve any help.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
One good thing about music,
Well, it helps you feel no pain.
So hit me with music;
Hit me with music now.
-- Bob Marley, Trenchtown Rock
*/

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




RE: [PHP] can't get it to work

2002-04-03 Thread Collins, Robert

Have you tried BETWEEN

$query = SELECT * FROM table where date  BETWEEN '$month_1/$day_1/$year_1'
AND
 '$month_2/$day_2/$year_2';

Robert W. Collins II 
Webmaster 
New Orleans Regional Transit Authority 
Phone : (504) 248-3826 
Email : [EMAIL PROTECTED] 



-Original Message-
From: Alex [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 12:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] can't get it to work


I'm trying to write code that will return all records found between certain
dates(e.g. 2001-01-30 through 2002-01-30). I created a html form with pull
down menus for both dates but when I try to run it I get a parse error and
can't figure out what's wrong.

Thanks,

Alex

Here is the php code:

$month_1 = addslashes($date_month_1);
$day_1 = addslashes($date_day_1);
$year_1 = addslashes($date_year_1);
$month_2 = addslashes($date_month_2);
$day_2 = addslashes($date_day_2);
$year_2 = addslashes($date_year_2);


$query = SELECT * FROM table where date  = '$month_1/$day_1/$year_1' AND
date = '$month_2/$day_2/$year_2';

$result = mysql_query($query);

$num_results = mysql_num_rows($result);

echo pNumber of records found: .$num_results./p;

for ($i=0; $i $num_results; $i++)
  {
 $row = mysql_fetch_array($result);
 echo pstrong.($i+1).. ID: ;
 echo stripslashes($row[id]);
 echo /strongbrFirst name: ;
 echo stripslashes($row[fname]);
 echo brLast name: ;
 echo stripslashes($row[lname]);
   }

?



-- 
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] can't get it to work

2002-04-03 Thread Miguel Cruz

On Wed, 3 Apr 2002, Alex wrote:
 I'm trying to write code that will return all records found between certain
 dates(e.g. 2001-01-30 through 2002-01-30). I created a html form with pull
 down menus for both dates but when I try to run it I get a parse error and
 can't figure out what's wrong.

It should tell you on which line the parse error occurred. That's 
generally a helpful piece of information. If the parse error is at the end 
of the file, you probably have an unclosed quote or brace.

 $query = SELECT * FROM table where date  = '$month_1/$day_1/$year_1' AND
 date = '$month_2/$day_2/$year_2';

Does MySQL understand dates in that weird order? I would imagine they have 
to be in ascending or descending order of unit size (year-month-day or 
day-month-year). 

miguel


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




Re: [PHP] can't get it to work

2002-04-03 Thread Miguel Cruz

On Wed, 3 Apr 2002, Alex wrote:
 I'm trying to write code that will return all records found between certain
 dates(e.g. 2001-01-30 through 2002-01-30). I created a html form with pull
 down menus for both dates but when I try to run it I get a parse error and
 can't figure out what's wrong.
 
 $query = SELECT * FROM table where date  = '$month_1/$day_1/$year_1' AND
 date = '$month_2/$day_2/$year_2';

By the way, here's your parse error. You need to quote strings.

$query = SELECT ... ;

miguel


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




[PHP] Browser detection

2002-04-03 Thread Joshua E Minnie

Can anybody tell me why, when running on the same browser, I get 2 different
outputs.

This is the output when I echo $HTTP_USER_AGENT:Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.0)

This is the output when I use get_browser():

browser_name_pattern.Mozilla/4\.0.*
parent...Netscape 4.00
browser..Netscape
version..4.00
majorver.4
minorver.00
frames...1
tables...1
cookies..1
backgroundsounds.
vbscript.
javascript...1
javaapplets..1
activexcontrols..
beta.1


I am using IE 6.0 running PHP 4.1.2 binary for Windows.
--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




RE: [PHP] syntax for date math expressions

2002-04-03 Thread Rick Emery

Convert to date/time variable and perform arithmetic.

Otherwise, if these dates are from mysql, let mysql do it

-Original Message-
From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 11:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] syntax for date math expressions


What is the php syntax for adding or subtracting dates?

For example, I'd like to do something like this:

2002-04-03 - 2002-04-02 = 1

or 

2002-04-03 - 2002-04-02 = -00-01

or 

2002-04-03 + -00-01 = 2002-04-03

etc.

Can anybody help this newbie?

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] can't get it to work

2002-04-03 Thread Rick Emery

Of course that's a mysql parse error!!

Mysql dates are -MM-DD.

Do NOT use slashes

$query = SELECT * FROM table where date  =
\$year_1-$month_1-$day_1/$year_1\ AND date =
\$year_2-$month_2-$day_2\;

Read the mysql manual concerning dates, formats, functions

-Original Message-
From: Alex [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 12:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] can't get it to work


I'm trying to write code that will return all records found between certain
dates(e.g. 2001-01-30 through 2002-01-30). I created a html form with pull
down menus for both dates but when I try to run it I get a parse error and
can't figure out what's wrong.

Thanks,

Alex

Here is the php code:

$month_1 = addslashes($date_month_1);
$day_1 = addslashes($date_day_1);
$year_1 = addslashes($date_year_1);
$month_2 = addslashes($date_month_2);
$day_2 = addslashes($date_day_2);
$year_2 = addslashes($date_year_2);


$query = SELECT * FROM table where date  = '$month_1/$day_1/$year_1' AND
date = '$month_2/$day_2/$year_2';

$result = mysql_query($query);

$num_results = mysql_num_rows($result);

echo pNumber of records found: .$num_results./p;

for ($i=0; $i $num_results; $i++)
  {
 $row = mysql_fetch_array($result);
 echo pstrong.($i+1).. ID: ;
 echo stripslashes($row[id]);
 echo /strongbrFirst name: ;
 echo stripslashes($row[fname]);
 echo brLast name: ;
 echo stripslashes($row[lname]);
   }

?



-- 
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] can't get it to work

2002-04-03 Thread Rick Emery

Need one more quote (se below)

Of course that's a mysql parse error!!

Mysql dates are -MM-DD.

Do NOT use slashes

$query = SELECT * FROM table where date  =
\$year_1-$month_1-$day_1/$year_1\ AND date =
\$year_2-$month_2-$day_2\;

Read the mysql manual concerning dates, formats, functions

-Original Message-
From: Alex [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 12:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] can't get it to work


I'm trying to write code that will return all records found between certain
dates(e.g. 2001-01-30 through 2002-01-30). I created a html form with pull
down menus for both dates but when I try to run it I get a parse error and
can't figure out what's wrong.

Thanks,

Alex

Here is the php code:

$month_1 = addslashes($date_month_1);
$day_1 = addslashes($date_day_1);
$year_1 = addslashes($date_year_1);
$month_2 = addslashes($date_month_2);
$day_2 = addslashes($date_day_2);
$year_2 = addslashes($date_year_2);


$query = SELECT * FROM table where date  = '$month_1/$day_1/$year_1' AND
date = '$month_2/$day_2/$year_2';

$result = mysql_query($query);

$num_results = mysql_num_rows($result);

echo pNumber of records found: .$num_results./p;

for ($i=0; $i $num_results; $i++)
  {
 $row = mysql_fetch_array($result);
 echo pstrong.($i+1).. ID: ;
 echo stripslashes($row[id]);
 echo /strongbrFirst name: ;
 echo stripslashes($row[fname]);
 echo brLast name: ;
 echo stripslashes($row[lname]);
   }

?



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

2002-04-03 Thread Georgie Casey

This whole PEAR thing is really confusing. The sites documentation is crap
compared to PHP. what is it and how do i install it on my windows system?
and more, importantly do i have 2 force my host to install it or can i do it
myself. i'm just looking to use the file_find package.

they say pear is automatically installed with php4 but i cant seem to find
it.



--
Regards,
Georgie Casey
[EMAIL PROTECTED]

***
http://www.filmfind.tv
Online Film Production Directory
***



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




RE: [PHP] Re: syntax for date math expressions

2002-04-03 Thread Rick Emery

SELECT * FROM table2 LEFT JOIN USING(user) WHERE table1.exp_date =
$somedate;
or
SELECT * FROM table2 LEFT JOIN USING(user) WHERE table1.exp_date = now();
-Original Message-
From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 12:00 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP] Re: syntax for date math expressions


Okay, I've got 2 tables.  One has fields user, exp_date, the other has a
bunch of fields including user.  If the exp_date from the first table is
greater than $somedate (probably today's date), then I don't want to
show the records from the 2nd table.  Get it?

So how do I do this?

It doesn't seem apparently obvious to me how to do it in a single, or
multiple sql queries.

Thanks.

 Maxim Maletsky [EMAIL PROTECTED] 04/03/02 12:51PM


first of all your data seems to come from a DB to me. If it's so then
read 
your DB manual for date functions. It would be way better and faster. 

Otherwise, if you're so keen to let this duty job up to PHP then
convert 
both dates into UNIX time format 'maketime()' deduct the values and put
them 
through the 'date()' function. 

 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com 
[EMAIL PROTECTED] 

 


ROBERT MCPEAK writes: 

 What is the php syntax for adding or subtracting dates? 
 
 For example, I'd like to do something like this: 
 
 2002-04-03 - 2002-04-02 = 1 
 
 or  
 
 2002-04-03 - 2002-04-02 = -00-01 
 
 or  
 
 2002-04-03 + -00-01 = 2002-04-03 
 
 etc. 
 
 Can anybody help this newbie? 
 
 Thanks! 
 
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
 


Maxim Maletsky 

Founder, Chief Developer
PHPBeginner.com (Where PHP Begins) 

www.PHPBeginner.com 
[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

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




RE: [PHP] Any ideas on combining arrays????

2002-04-03 Thread Rick Emery

ok...so what problem are you having?  what's the error?
your code worked for me, i.e., it compiled and executed

-Original Message-
From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 11:15 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Any ideas on combining arrays


Hi!

Need some ideas on combining some arrays into one!  I have array for
data and other array for counter.  How do I make an array that would show
different data for each counter number?

-- clip --
   $FFR = array (
  TU4R  = array( data = , count =  ),
  PH01  = array( data = , count =  ),
   );
-- clip --

The response should look something like this when I pick the correct
data and correct count;

   $FFR[TU4R][data][0][count]  = TU4R is 0;
   $FFR[TU4R][data][1][count] = TU4R is 1;
   $FFR[TU4R][data][2][count]  = TU4R is 2;

I tried to do something like this but it doesn't work.  I have been
working for 2 days trying to figure it out.  I appreciate any help you can
provide for me.

Thanks,
  Scott



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

2002-04-03 Thread Hiroshi Ayukawa

Hello,

You should modify include_path in php.ini like

include_path = .;c:\php\pear;C:\Apache\htdocs\includes
  ^^^
 the directory where pear files are in.


I often use DB.php from pear.It is very useful!
Good luck.

Hiroshi Ayukawa
http://hoover.ktplan.ne.jp/kaihatsu/php_en/index.php

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




[PHP] New Server, Bad Attitude

2002-04-03 Thread Liam Gibbs

My friends' server is giving me a hard time. What
happened is (long story short) he was forced to use a
new server for the web sites on his old one. One of
them was mine. I'm experiencing some weirdness now:
1. PHP automatically sticks in the backslash in front
of apostrophes and quotation marks. This seems
weird Don't trust it. What's up here?
2. The encryption method seems to be different. This
is weird, because (basic password scenario here), I
can log in to my account (the server encrypts my
password properly and compares it to the one 'on file'
and voila). But, when the password is changed,
encrypted, and saved, it seems to encrypt differently
than when simply entered in a login screen. Now it
seems to have a bunch of $ signs in it, whereas before
it didn't.
3. The mail function doesn't send e-mail, or I should
say hasn't yet (after a few hours). Is this a PHP
setting? Maybe the sendmail functionality is wonky on
the server? Or is it possible PHP isn't looking in the
proper place for the sendmail stuff?

Now, not being totally hardware-savvy, I'm not sure
what could cause these. One thing may be that the OS
is different (was Redhat, is now Debian). Also, my
friend upgraded from PHP3 to 4. Any light on this situation?

__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




Re: [PHP] can't get it to work

2002-04-03 Thread Alex

That did the trick.

Thank you

Miguel Cruz [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Wed, 3 Apr 2002, Alex wrote:
  I'm trying to write code that will return all records found between
certain
  dates(e.g. 2001-01-30 through 2002-01-30). I created a html form with
pull
  down menus for both dates but when I try to run it I get a parse error
and
  can't figure out what's wrong.
 
  $query = SELECT * FROM table where date  = '$month_1/$day_1/$year_1'
AND
  date = '$month_2/$day_2/$year_2';

 By the way, here's your parse error. You need to quote strings.

 $query = SELECT ... ;

 miguel





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




[PHP] New Server, Bad Attitude

2002-04-03 Thread Liam Gibbs

My friends' server is giving me a hard time. What
happened is (long story short) he was forced to use a
new server for the web sites on his old one. One of
them was mine. I'm experiencing some weirdness now:
1. PHP automatically sticks in the backslash in front
of apostrophes and quotation marks. This seems
weird Don't trust it. What's up here?
2. The encryption method seems to be different. This
is weird, because (basic password scenario here), I
can log in to my account (the server encrypts my
password properly and compares it to the one 'on file'
and voila). But, when the password is changed,
encrypted, and saved, it seems to encrypt differently
than when simply entered in a login screen. Now it
seems to have a bunch of $ signs in it, whereas before
it didn't.
3. The mail function doesn't send e-mail, or I should
say hasn't yet (after a few hours). Is this a PHP
setting? Maybe the sendmail functionality is wonky on
the server? Or is it possible PHP isn't looking in the
proper place for the sendmail stuff?

Now, not being totally hardware-savvy, I'm not sure
what could cause these. One thing may be that the OS
is different (was Redhat, is now Debian). Also, my
friend upgraded from PHP3 to 4. Any light on this situation?

__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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




RE: [PHP] PHP FAQ (again)

2002-04-03 Thread Kevin Stone

I wholeheartedly disagree.  I belong to an emailing list that requires
specific headers and it is a pain.  It costs me nothing to ignore a
post.  But it costs me 5 minutes to format my headers correctly.

You really want to reduce frivolous posts on this list?  Do as I said
before.  Send an automated notification to the list once or twice a week
informing users of where they can get answers to common questions and
how to post questions so that they get the best feedback (ie descriptive
subject, to the point, code examples, etc..).

Will this eliminate all frivolous posts?  No.  But it will keep the
channel of information open for those who need legitimate help.

We are not here to shun newbies or act like elitists.

-Kevin

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, April 03, 2002 11:31 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP FAQ (again)

On Wednesday 03 April 2002 22:06, Hunter, Ray wrote:
 I am in total agreement with Justin on this one.  Many of the posters
use
 need help,  newbie needs help , 

I have given up on even reading posts without a meaningful subject. They
go 
straight into the trash can.

 etc.  We need to have some form of FAQ
 with detailed instructions on how to post so that I do not have to
ask;
 What OS are you using, what version of php, which database, etc
This
 gets tedious and time consuming.  Not to mention the amount of posts.

 I've been watching Rick Emery give out tons of help, but many of his
first
 questions are about clarifications on what a users is needing help on.

 Some extra detail will provide faster and reliable help.

 Just some extra thoughts here...

 I now some mailing lists will not even reply if you do not follow
specific
 criteria when you post...

I think that's a jolly good idea. If people are too lazy to help
themselves 
by reading the FAQ (if there was one) and the posting guidelines (if
there 
was one) then they really don't deserve any help.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
One good thing about music,
Well, it helps you feel no pain.
So hit me with music;
Hit me with music now.
-- Bob Marley, Trenchtown Rock
*/

-- 
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: some kind of library loader

2002-04-03 Thread Tamás Árpád

 On Thu, 4 Apr 2002, Maxim Maletsky wrote:
  You can try to load all those classes as texts into a db and then to
execute
  the needed ones as eval()ed strings. It could be easy for you to create
the
  logic because the PHP code are stings and are never included but
SELECTed.
  Not sure if this could be wise to do, just throwing out an idea.

 Offhand I'm guessing the payoff wouldn't be great, because you'd lose the
 benefit of PHP's own code caching. Depends on how much of this voluminous
 code actually gets used on any one run, I suppose. But why not do the same
 thing with conditional includes, and then at least let PHP cache it?

Thanks for your suggestion Maxim and Miguel.

Unfortunately storing code in db wouldn't solve my problem, becuse then I
still had to recognise when the classes are really needed. Now in the 52k
lines of code we just have
$x = new SomeClass();
$y = new OtherClass(); or
$result = AnotherClass::staticMethod(); statements, and we have many of
them.
That's why I'm searching for a sollution that we can use without rewrite all
these calls with the extension of a test if the needed class's definition
was or wasn't loaded before.
So I'd like to use conditional includes, and my first thought was that
somehow I can make it with a custom error handler, but unfortunately I
realized quickly it's not that simple.
Maybe you or someone can help, If I explain my problem in a little more
detail.
We have a portal-creator system (like many of you, I guess), with an own
developed template system. Of course we sell it to customers who have their
own needs. They create the designs, or tell us how the site should look, and
the created templates determine what template classes are needed for
generating the pages. The template classes require other base classes that
are responsible for handling the db storage.
We have about 430 classes (I misscalculated it in my firts mail), and they
have many cross reference to each other. So it's hard to know explicitly
if a class definition is needed, except of course at every new operator, and
static method call, but there are plenty of them.
Parsing of (almost) all of the php code takes about 1,5secs on an athlon 800
cpu, which is far from reasonable. I expect that with conditional includes
at least half of the code wouldn't get parsed on a normal site, and even
less on a smaller site.
I wrote that I tried many code caches (I sent the results in deatils in
December), but none of them - except Zend Cache - made significant speed-up
(PHP-Accelerator also gave good results for speed, but I got many errors).
Unfortunatelly Zend Cache isn't affordable for many of our client,
especially the smaller ones, who don't need many of the features of the
system, so they would benefit much from the conditional includes.

I hope someone who had the same situation can help, or at least I get
reinforcement, that I can't by-pass the hard way (to write an if clause
before every use of a class wether it was loaded or not).
Thanks for your help,
Arpi



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




RE: [PHP] syntax for date math expressions

2002-04-03 Thread Vail, Warren

this is an option that only sort of works (converting to date/time);

$x = strtotime(2002-04-03) - strtotime(2002-04-02);

$x will contain 86400 which is the number of seconds in a normal day.
Since the days that some people use switch from daylight savings time to
standard time (and visa versa) there are a different number of seconds in
those days so simply dividing by some fixed value will not work (this is
what I mean by sort of).

Some databases have a datadiff function, perhaps you can pass a query
something like

SELECT datediff(2002-04-03,2002-04-02) as difference from realtable

Warren Vail
Tools, Metrics  Quality Processes
(415) 667-7814
Pager (877) 774-9891
215 Fremont 02-658


-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 11:02 AM
To: 'ROBERT MCPEAK'; [EMAIL PROTECTED]
Subject: RE: [PHP] syntax for date math expressions


Convert to date/time variable and perform arithmetic.

Otherwise, if these dates are from mysql, let mysql do it

-Original Message-
From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 11:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] syntax for date math expressions


What is the php syntax for adding or subtracting dates?

For example, I'd like to do something like this:

2002-04-03 - 2002-04-02 = 1

or 

2002-04-03 - 2002-04-02 = -00-01

or 

2002-04-03 + -00-01 = 2002-04-03

etc.

Can anybody help this newbie?

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

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




Re: [PHP] Any ideas on combining arrays????

2002-04-03 Thread Hugh Bothwell

I'm not sure I understand what problem
you're trying to solve.

It looks something like the number of times
a given piece of data occurs per user?

Where does the data come from and what
are you trying to accomplish?


 Need some ideas on combining some arrays
 into one!  I have array for data and other array
 for counter.  How do I make an array that would show
 different data for each counter number?

 -- clip --
$FFR = array (
   TU4R  = array( data = , count =  ),
   PH01  = array( data = , count =  ),
);
 -- clip --




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




Re: [PHP] New Server, Bad Attitude

2002-04-03 Thread Tyler Longren

Most of these are probably software/configuration errors.

1. Use the stripslashes() function to remove those slashes.  It does this to
escape the apostrophes and quotes.

2. What were you using to encrypt your passwords before?

3. Does your server have smtp running on port 25?  I think it needs to be
before php can send e-mails.

Tyler Longren
Captain Jack Communications
[EMAIL PROTECTED]
www.captainjack.com
- Original Message -
From: Liam Gibbs [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 03, 2002 1:47 PM
Subject: [PHP] New Server, Bad Attitude


 My friends' server is giving me a hard time. What
 happened is (long story short) he was forced to use a
 new server for the web sites on his old one. One of
 them was mine. I'm experiencing some weirdness now:
 1. PHP automatically sticks in the backslash in front
 of apostrophes and quotation marks. This seems
 weird Don't trust it. What's up here?
 2. The encryption method seems to be different. This
 is weird, because (basic password scenario here), I
 can log in to my account (the server encrypts my
 password properly and compares it to the one 'on file'
 and voila). But, when the password is changed,
 encrypted, and saved, it seems to encrypt differently
 than when simply entered in a login screen. Now it
 seems to have a bunch of $ signs in it, whereas before
 it didn't.
 3. The mail function doesn't send e-mail, or I should
 say hasn't yet (after a few hours). Is this a PHP
 setting? Maybe the sendmail functionality is wonky on
 the server? Or is it possible PHP isn't looking in the
 proper place for the sendmail stuff?

 Now, not being totally hardware-savvy, I'm not sure
 what could cause these. One thing may be that the OS
 is different (was Redhat, is now Debian). Also, my
 friend upgraded from PHP3 to 4. Any light on this situation?

 __
 Do You Yahoo!?
 Yahoo! Tax Center - online filing with TurboTax
 http://taxes.yahoo.com/

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




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




[PHP] MCAL for Windows

2002-04-03 Thread Joshua E Minnie

Does anybody know where I can find MCAL for Windows?

--
Joshua E Minnie
CIO
[EMAIL PROTECTED]

Don't work for recognition, but always do work worthy of recognition.



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




Re: [PHP] Re: Any ideas on combining arrays????

2002-04-03 Thread Scott Fletcher

Bingo!  Here's the script that work!

-- clip --
   $FFR = array (
  TU4R  = array( TU4R =  ),
  CD01  = array( CD01 =  ),
  PH01  = array( PH01 =  ),
  ENDS  = array( ENDS =  )
   );

  // The variable, $name  $number came from the script I made
  // but is not included here.  (No need to make a long news post).
  // $name == for any like TU4R, PH01, etc.
  // $number == Counter for the repeating $name like PH01
  $FFR[$name][$number] = $data_str;

   echo Segment Type -- .$FFR[TU4R][1];
   echo br;
   echo Segment Type -- .$FFR[PH01][1];
   echo br;
   echo Segment Type -- .$FFR[PH01][2];
   echo br;
   echo Segment Type -- .$FFR[PH01][3];
   echo br;
-- clip --

Thank you all for your help!
  Scott

Demitrious S. Kelly [EMAIL PROTECTED] wrote in message
003e01c1db3d$0aa52e50$3601a8c0@DK">news:003e01c1db3d$0aa52e50$3601a8c0@DK...
 Use a multi-dimensional array... try this as a kind of 'proof of
 concept'

 ?php

 $array[tu4r][]=0
 $array[tu4r][]=10
 $array[tu4r][]=100
 $array[tu4r][]=1000
 $array[ph10][]=0;
 $array[ph10][]=1;
 $array[ph10][]=2;
 $array[ph10][]=126;

 echo 'pre';
 foreach ( $array[ph10] as $value ) {
 echo ' PH10: '.$value.chr(10);
 }
 echo '/pre';
 echo 'pre';
 foreach ( $array[tu4r] as $value ) {
 echo ' TU4R: '.$value.chr(10);
 }
 echo '/pre';

 ?

 cheers
 -Original Message-
 From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, April 03, 2002 10:15 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: Any ideas on combining arrays

 Well, I don't thinik this will work.  Because I will recieve an
 unknown
 number of data.  The number of PH10 I would get would be either 1 or 2
 or
 126, etc.  There is no way to determine the number, so I already create
 an
 counter to tell me how many of them.  So, that leave me with an need to
 create an array to unlimited number of PH10 without overwritting the
 current
 PH10.  Here's my demo.

 TU4R = TU4R is 0
 PH10 = PH10 is 0
 PH10 = PH10 is 1
 PH10 = PH10 is 2

 Can anyone write a multidimentional array demostration to handle
 this
 demo?

 Thanks a Million!
  Scott

 Maxim Maletsky [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  See, Scott.. It is all about your logic.
 
  For instance, you can create a nice multidimentional array like this:
 
  Array(
  '0'=Array(
  'data'=Array( // your whole data array
    data
    data
    data
  ),
  'parameters'=Array( // the settings rlative to data array
  'count'='256',
  'type_of_data'='strings',
  'came_from_DB'='PostgreSQL',
  'came_from_table'='thisTable'
  'etc'='bla...bla..bla..'
  )
  ),
  '1'=Array(
  'data'=Array( // your whole data array
    data
    data
    data
  ),
  'parameters'=Array( // the settings rlative to data array
  'count'='258',
  'type_of_data'='integers',
  'came_from_DB'='mySQL',
  'came_from_table'='thatTable'
  'etc'='bla...bla..bla..'
  )
  ),
 
  ... etcetc...etc...
 
  );
 
 
 
  in this way you can loop the whole thing, access the data by refering
 to
 the
  'data' subarray and then get the parameters (counts, types whatever
 you
  want) by accessing 'parameters' subarray containing the relative
 settings
  for that very array.
 
  As I said in the very first line - all up to your logic and the
 organization
  rules within the code.
 
  Hope it is of any help to you.
 
 
  Maxim Maletsky
 
  Founder, Chief Developer
  PHPBeginner.com (Where PHP Begins)
 
  www.PHPBeginner.com
  [EMAIL PROTECTED]
 
 
 
 
 
 
 
  Scott Fletcher writes:
 
   Hi!
  
   Need some ideas on combining some arrays into one!  I have array
 for
   data and other array for counter.  How do I make an array that would
 show
   different data for each counter number?
  
   -- clip --
  $FFR = array (
 TU4R  = array( data = , count =  ),
 PH01  = array( data = , count =  ),
  );
   -- clip --
  
   The response should look something like this when I pick the
 correct
   data and correct count;
  
  $FFR[TU4R][data][0][count]  = TU4R is 0;
  $FFR[TU4R][data][1][count] = TU4R is 1;
  $FFR[TU4R][data][2][count]  = TU4R is 2;
  
   I tried to do something like this but it doesn't work.  I have
 been
   working for 2 days trying to figure it out.  I appreciate any help
 you
 can
   provide for me.
  
   Thanks,
 Scott
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
 
  Maxim Maletsky
 
  Founder, Chief Developer
  PHPBeginner.com (Where PHP Begins)
 
  www.PHPBeginner.com
  [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   >