Re: [PHP] Just Testing

2004-06-16 Thread Kevin Clark
Um how so? 

On Wed, 16 Jun 2004 04:18:27 +, Curt Zirzow
<[EMAIL PROTECTED]> wrote:
> 
> * Thus wrote Michael Lauzon ([EMAIL PROTECTED]):
> > I am just testing, so that I can create a filter.
> 
> btw, you're going about it wrong.
> 
> Filters will just contribute spaming to the list.
> 
> Curt
> --

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



Re: [PHP] Re: Unit Testing

2004-06-16 Thread Trevor Nesbit
Hi

I'm interested in locating something straight forward to teach to our
programming students...

Am appreciating the discussion so far...

Trevor Nesbit
MBS BSc BCom CA PGDipBusAdmin
Degree Leader for Bachelor of ICT
Programme Leader for Graduate Diploma in eCommerce
School of Computing - www.cpit.ac.nz/computing
School of Business
Christchurch Polytechnic Institute of Technology
>>> "Torsten Roehr" <[EMAIL PROTECTED]> 06/16/04 07:37 AM >>>
"Rick Fletcher" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Has anyone done any PHP unit testing? I've been looking around for a
unit
> testing library to try out. Below are the ones I've found so far:
>
> SimpleTest: http://www.lastcraft.com/simple_test.php
> PHPUnit (dead?): http://phpunit.sourceforge.net/
> Pear PHPUnit: http://pear.php.net/package/PHPUnit
> Generic PHP Framework (dead?): http://gpfr.sourceforge.net/
>
> SimpleTest looks the most complete and the most active, so that's
where
I'm
> leaning. Anyone have any experience with any of these libraries, or
have
any
> comments on PHP Unit testing in general?

Don't have any experience myself but here's a nice article by Harry
about
SimpleTest:
http://www.sitepoint.com/blog-post-view.php?id=175190

Hope it helps. Regards,
Torsten Roehr

-- 
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] Combo problems.. Multi Array??

2004-06-16 Thread Ford, Mike [LSS]
On 15 June 2004 00:07, Michael Benbow wrote:

> Thanks Mike,
> 
> I have read up a lot on permutation but I'm not completely sure that
> this will solve my problem.  From what I can gather
> permutation takes a
> sample (i.e. ABC) and tells you how many different ways it
> can arrange
> the letters, with order mattering.  What I need to do is take
> a variable
> number of groups (in my example, 3) and then display the combinations
> of ways that my sample (in my example, 2) can be spread across
> the groups.

Ah, yes -- sorry.  Something in your original post must have made me think you just 
wanted the number of ways, not the actual permutations.  (And, in any case, I don't 
think this *is* actually a permutation, so I think I was doubly trigger happy!)

[...]
 
> The example again is as follows..
> 
> A [1][2] BC
> AB [1][2] C
> ABC [1][2]
> A [1]B [2]C
> AB [1]C [2]
> A [1]BC [2]
> A [2]B [1]C
> A [2]CC [1]
> AB [2]C [1]
> 
> Think of the letters as being static amongst all possible
> combinations, and the numbers as the piece of data which is
> varying.  In my actual code both fields are integers but this
> isn't really important here.

I've been fiddling with this for half an hour or so, and I'm pretty convinced the 
solution is going to involve a recursive function.  However, it might help if you 
could say exactly what you want as a result: printed out (in a format similar to the 
above), inserted into a database (how?), or some sort of PHP data structure (such as a 
multi-level array) containing all the possible results?

Don't guarantee to come up with a final (or even an approximate!) solution, but 
knowing what you're trying to work towards would help...!

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



Re: [PHP] Active windows

2004-06-16 Thread franciccio
Very hard (impossible) to control user activities by php-scripting. You are
talking about client-side actions while php is only server-side. You should
check for javascript client-side coding help.

Franciccio


"Curt Zirzow" <[EMAIL PROTECTED]> ha scritto nel messaggio
news:[EMAIL PROTECTED]
> * Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]):
> > I am trying to get my website to refresh when the window becomes active.
> >
> > This is needed so when a user downloads a report and the PDF is
displayed,
> > there is now a new state in the previously active window.  However, the
page
> > needs to refresh to regenerate the new page.  Any ideas on how to do
this?
> > Can one send header information to a separate window, or discern between
> > active and non active windows?
> >
> > I know this is a stretch but I thought I¹d ask
>
> yes it is a stretch.
>
> Determining  what a client is going to do on focus is practically
> impossible. Even with javascript unless you're in a closed
> environment.
>
>
> Curt
> -- 
> First, let me assure you that this is not one of those shady pyramid
schemes
> you've been hearing about.  No, sir.  Our model is the trapezoid!

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



[PHP] Current config of PHP

2004-06-16 Thread Johannes Reichardt
Hello!
This is a newbie question ;) - i want to upgrade php and apache and 
therefore i have to configure them - unfortunatly i forgot the 
configuration of the current installation - how can i get the 
./configure prefixes of my current php/apache version?

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


[PHP] Get Current config of PHP

2004-06-16 Thread Johannes Reichardt
Hello!
This is a newbie question ;) - i want to upgrade php and apache and 
therefore i have to configure them - unfortunatly i forgot the 
configuration of the current installation - how can i get the 
./configure prefixes of my current php/apache version?

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


Re: [PHP] Current config of PHP

2004-06-16 Thread Marek Kilimajer
Johannes Reichardt wrote --- napísal::
Hello!
This is a newbie question ;) - i want to upgrade php and apache and 
therefore i have to configure them - unfortunatly i forgot the 
configuration of the current installation - how can i get the 
./configure prefixes of my current php/apache version?

- Johannes

configure parameters are right at the top
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Losing Sessions

2004-06-16 Thread Marek Kilimajer
Paul Liebrand wrote --- napísal::
Curt,
Thanks for the reply.
I am going to go ahead and change all my session variables to use the
methods you described. Because I am using the session_register method, could
this be the cause of my problem? That it works 90% of the time, but a couple
times throughout the day the sessions just get lost?
Are you loosing all or more sessions at once? Another application 
running on the server may use different session.gc_maxlifetime setting.

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


[PHP] Unexpected behaviuor with __CLASS__

2004-06-16 Thread Torsten Roehr
Hi list,

on RedHat with PHP 4.3.6 the following code produces 'test' - I'm expecting
'test2':

class test {
function printClass() {
echo __CLASS__;
}
}

class test2 extends test {
}

test2::printClass();


I would like to get/echo the name of the class calling the method - in my
case test2. Any ideas?


Thanks and best regards,

Torsten Roehr

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



Re: [PHP] Current config of PHP

2004-06-16 Thread Marek Kilimajer
Johannes Reichardt wrote --- napísal::
Thanks a lot - do you know how to do that with apache 1.3xxx by any chance?
What is "that"?
- Johannes
Johannes Reichardt wrote --- napísal::
Hello!
This is a newbie question ;) - i want to upgrade php and apache and 
therefore i have to configure them - unfortunatly i forgot the 
configuration of the current installation - how can i get the 
./configure prefixes of my current php/apache version?

- Johannes

configure parameters are right at the top

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


[PHP] Re: post data

2004-06-16 Thread Rhemax
 0){

process form
...
header('Location: '.$_SERVER['PHP_SELF']);
die;
}
?>

  ...
  your form here
  ...




"Eoghan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi,
> im posting a form to itself... and im wondering if there is any
> way to clear the post data from the page after if have dealt with it?
> to stop page refreshes posting the data again?
> thanks
> eoghan

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



[PHP] Sending email with php

2004-06-16 Thread Phpu
Hi,
How can i send email in php usig the smtp server? I'm looking for a tutorial or a good 
script.

Thanks



[PHP] Re: Sending email with php

2004-06-16 Thread Torsten Roehr
>"Phpu" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>Hi,
>How can i send email in php usig the smtp server? I'm looking for a
tutorial or a good script.

Take a look at PEAR's Mail package:
http://pear.php.net/package/Mail

Regards, Torsten Roehr

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



Re: [PHP] Sending email with php

2004-06-16 Thread Chris Hayes
At 12:43 16-6-04, you wrote:
Hi,
How can i send email in php usig the smtp server? I'm looking for a 
tutorial or a good script.
for what it's worth, i use the class from phpguru.org
and try a google on [helo smtp php mail], loads of hits
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Sending email with php

2004-06-16 Thread pete M
I use phpMailer
http://phpmailer.sourceforge.net/
makes mailing a doddle
pete
Phpu wrote:
Hi,
How can i send email in php usig the smtp server? I'm looking for a tutorial or a good 
script.
Thanks

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


Re: [PHP] Unexpected behaviuor with __CLASS__

2004-06-16 Thread Robin Vickery
On Wed, 16 Jun 2004 11:49:31 +0200, Torsten Roehr <[EMAIL PROTECTED]> wrote:
> 
> Hi list,
> 
> on RedHat with PHP 4.3.6 the following code produces 'test' - I'm expecting
> 'test2':
> 
> class test {
> function printClass() {
> echo __CLASS__;
> }
> }
> 
> class test2 extends test {
> }
> 
> test2::printClass();
> 
> I would like to get/echo the name of the class calling the method - in my
> case test2. Any ideas?

If you were using objects rather than class methods you could replace
__CLASS__ with  get_class($this) ...but you're not.

you could use debug_backtrace()

function printClass()
{
   $details = array_shift(debug_backtrace());
   print $details['class'];
}

  -robin

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



Re: [PHP] Current config of PHP

2004-06-16 Thread raditha dissanayake
Johannes Reichardt wrote:
Hello!
This is a newbie question ;) - i want to upgrade php and apache and 
therefore i have to configure them - unfortunatly i forgot the 
configuration of the current installation - how can i get the 
./configure prefixes of my current php/apache version?
look in the config.status file
- Johannes

--
Raditha Dissanayake.
-
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] update count

2004-06-16 Thread Bob Lockie
What is the best way to only do an update if it going to update only one 
row?
I want to protect my code so that it won't accidentally update more than 
one row.
I can do a select first but there must be an easier way. :-)

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


RE: [PHP] update count

2004-06-16 Thread Jay Blanchard
[snip]
What is the best way to only do an update if it going to update only one

row?
I want to protect my code so that it won't accidentally update more than

one row.
I can do a select first but there must be an easier way. :-)
[/snip]


Do the update with conditions (this is a SQL question)

UPDATE `tblFOO` SET `bar` = 'a_value' WHERE `barID` = '227098762' 

will only update the record(s) where barID is  227098762

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



Re: [PHP] update count

2004-06-16 Thread John Nichel
Bob Lockie wrote:
What is the best way to only do an update if it going to update only one 
row?
I want to protect my code so that it won't accidentally update more than 
one row.
I can do a select first but there must be an easier way. :-)

UPDATE thisDB.thisTable SET thisTable.thisColumn = 'thisValue' WHERE 
thisTable.uniqueColumn = 'someUniqueValue'

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Unexpected behaviuor with __CLASS__

2004-06-16 Thread Torsten Roehr
"Robin Vickery" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Wed, 16 Jun 2004 11:49:31 +0200, Torsten Roehr <[EMAIL PROTECTED]>
wrote:
> >
> > Hi list,
> >
> > on RedHat with PHP 4.3.6 the following code produces 'test' - I'm
expecting
> > 'test2':
> >
> > class test {
> > function printClass() {
> > echo __CLASS__;
> > }
> > }
> >
> > class test2 extends test {
> > }
> >
> > test2::printClass();
> >
> > I would like to get/echo the name of the class calling the method - in
my
> > case test2. Any ideas?
>
> If you were using objects rather than class methods you could replace
> __CLASS__ with  get_class($this) ...but you're not.
>
> you could use debug_backtrace()
>
> function printClass()
> {
>$details = array_shift(debug_backtrace());
>print $details['class'];
> }

Hi Robin,

thanks! That will be a workaround for my problem. Unfortunately I can't use
get_class() because I need to work with static methods here. I've got a
factory method in my base class for creating objects and I don't want to
pass the name of the class as a parameter.

Thanks and best regards,

Torsten Roehr

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



[PHP] list methods of class COM ?

2004-06-16 Thread Matthieu Loudes
Hi,

Where can i find the methods list of module COM ?

Ex :  $Odject = new COM("WinNT://domain");

Thanks !

Matt

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



Re: [PHP] update count

2004-06-16 Thread Robin Vickery
On Wed, 16 Jun 2004 09:40:52 -0400, Bob Lockie <[EMAIL PROTECTED]> wrote:
> 
> What is the best way to only do an update if it going to update only one
> row?

You don't say what database you're using.

The general way is to use a unique key in the WHERE clause.

   UPDATE tablename SET foo=1 WHERE id=123

MySQL also lets you use a LIMIT clause that will either limit the
number of rows affected by the update, or matched by the WHERE clause
depending on the MySQL version.

  UPDATE tablename SET foo=1 WHERE bar=2 LIMIT 1

  -robin

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



[PHP] Search Sanitization

2004-06-16 Thread Gabe
I'm writing a *very* simple search form for my db and was interested in 
hearing some recommendations on what to check for with the user's input 
for the search.

However, I guess more specifically my question is if anyone had any 
advice as to other things I should check since it's a search form. 
Obviously there's a lot more valid entries that a user can make than a 
normal form where you might know more specifically what they should 
enter and thus your validation can be more stringent.

Any advice?
Thanks!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] update count

2004-06-16 Thread Bob Lockie

What is the best way to only do an update if it going to update only one
row?

You don't say what database you're using.
The general way is to use a unique key in the WHERE clause.
   UPDATE tablename SET foo=1 WHERE id=123
MySQL also lets you use a LIMIT clause that will either limit the
number of rows affected by the update, or matched by the WHERE clause
depending on the MySQL version.
  UPDATE tablename SET foo=1 WHERE bar=2 LIMIT 1
  -robin
The LIMIT clause is perfect but is that standard SQL?
I am using MySQL right now but it will be run on another database 
eventually.

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


Re: [PHP] Regarding variable reference

2004-06-16 Thread Jason Wong
On Tuesday 15 June 2004 14:14, [EMAIL PROTECTED] wrote:
> Hi,
> I have variables called Cookie1 to Cookie35.
>
> I would like to print the values of  Cookie1 to Cookie35 using for loop.
>
> Could anybody correct the below code to print the variables.
>
> ==
> for($i=1;$i<34;$i++)
> {
>   $x="Cookie".$i;
>
>   if(isset($$x))
>   {
>   echo "$x:$$x";
>   }
> }
> ==

You've gotten several answers for this already. But you really should be using 
arrays rather than variable variables.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
You single-handedly fought your way into this hopeless mess.
*/

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



Re: [PHP] can't change upload_tmp_dir--not sure what's up

2004-06-16 Thread Jason Wong
On Tuesday 15 June 2004 05:47, cory wrote:

> alas, when i upload  a file, nothing arrives in the specified folder.  All
> permissions are set to full access.

Get the example in the manual to work then modify it to your needs.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Q:  What do you have when you have a lawyer buried up to his neck in sand?
A:  Not enough sand.
*/

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



Re: [PHP] index.php not loading up

2004-06-16 Thread John Nichel
Nguyen, Long P (Mission Systems) wrote:
this is an entry in the php.ini file:
error_reporting  =  E_ALL & ~E_NOTICE
where on the machine are the error logged to?
Below that will be a line like this...
display_errors = On
If you setting is Off, change it to 'On', and restart your webserver. 
Also, if this is a development enviorment, you can remove the '& 
~E_NOTICE', and you will see all the errors and notices (you can do this 
even if it's a production enviroment, but some will flame me if I 
suggest that ;)

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Scheduling a PHP script

2004-06-16 Thread Jason Wong
On Monday 14 June 2004 22:21, Phil Ewington - 43 Plc wrote:

> > Is your commandline php executable compiled --with-mysql ?
>
> My PHP installation (4.3.6) was configured with: with-mysql=shared

Does

  /path/to/php -i | less

confirm this?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
People will do tomorrow what they did today because that is what they
did yesterday.
*/

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



RE: [PHP] index.php not loading up

2004-06-16 Thread Nguyen, Long P (Mission Systems)
ok - I checked and it's set to:

display_errors = On

so going back to your original question - yes error set to display on, but I don't 
think I am seeing errors - where are the error logs?

Thank you


-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 16, 2004 11:22 AM
To: PHP Mailing Lists
Subject: Re: [PHP] index.php not loading up


Nguyen, Long P (Mission Systems) wrote:
> this is an entry in the php.ini file:
> 
> error_reporting  =  E_ALL & ~E_NOTICE
> 
> where on the machine are the error logged to?

Below that will be a line like this...

display_errors = On

If you setting is Off, change it to 'On', and restart your webserver. 
Also, if this is a development enviorment, you can remove the '& 
~E_NOTICE', and you will see all the errors and notices (you can do this 
even if it's a production enviroment, but some will flame me if I 
suggest that ;)

-- 
John C. Nichel
KegWorks.com
716.856.9675
[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] index.php not loading up

2004-06-16 Thread Greg Donald
On Wed, 16 Jun 2004 08:33:46 -0700, Nguyen, Long P (Mission Systems)
<[EMAIL PROTECTED]> wrote:
> so going back to your original question - yes error set to display on, but I don't 
> think I am seeing errors - where are the error logs?

Depends on what web server software you're using.  Mine are in
/var/log/apache for example.

-- 
Greg Donald
http://destiney.com/

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



Re: [PHP] Search Sanitization

2004-06-16 Thread Greg Donald
On Wed, 16 Jun 2004 10:34:21 -0400, Gabe <[EMAIL PROTECTED]> wrote:
> 
> I'm writing a *very* simple search form for my db and was interested in
> hearing some recommendations on what to check for with the user's input
> for the search.
> 
> However, I guess more specifically my question is if anyone had any
> advice as to other things I should check since it's a search form.
> Obviously there's a lot more valid entries that a user can make than a
> normal form where you might know more specifically what they should
> enter and thus your validation can be more stringent.

Well, for starters you should definately check and prevent SQL
injection.  I use this in all my scripts:

set_magic_quotes_runtime(0);
if(get_magic_quotes_gpc() == 0){
   $_GET = isset($_GET) ? array_map("slashes", $_GET) : array();
   $_POST  = isset($_POST) ? array_map("slashes", $_POST) : array();
   $_COOKIE = isset($_COOKIE) ? array_map("slashes", $_COOKIE) : array();
}

function slashes($var){
if(is_array($var))
return array_map("slashes", $var);
else
return addslashes($var);
}

-- 
Greg Donald
http://destiney.com/

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



Re: [PHP] Just Testing

2004-06-16 Thread Greg Donald
On Wed, 16 Jun 2004 00:13:50 -0700, Kevin Clark <[EMAIL PROTECTED]> wrote:
> 
> Um how so?

He probably means it's improper netiquette to send a test message to
such a large list as php-general.  One could just wait for a message,
as they usually come only moments apart.  Sending a test message can
get you practically beheaded on some lists, lkml for example.

-- 
Greg Donald
http://destiney.com/

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




Re: [PHP] Just Testing

2004-06-16 Thread John Nichel
Greg Donald wrote:
On Wed, 16 Jun 2004 00:13:50 -0700, Kevin Clark <[EMAIL PROTECTED]> wrote:
Um how so?

He probably means it's improper netiquette to send a test message to
such a large list as php-general.  One could just wait for a message,
as they usually come only moments apart.  Sending a test message can
get you practically beheaded on some lists, lkml for example.
Or qmail.

Conveniently dodges the netiquette issues with going off-topic. ;)

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP & MySQL DATE comparison

2004-06-16 Thread Ryan Schefke
Hello,

 

I'm pulling a date in the "datetime" format via a MySQL query.  Using PHP I
would like to check if that date is prior to today's date.  Can someone
please help with this quick question.

 

Thanks,

Ryan



Re: [PHP] update count

2004-06-16 Thread Daniel Clark
If your table has a primary key, or auto increment field works well and is
quick.

> What is the best way to only do an update if it going to update only one
> row?
> I want to protect my code so that it won't accidentally update more than
> one row.
> I can do a select first but there must be an easier way. :-)

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



[PHP] Re: PHP & MySQL DATE comparison

2004-06-16 Thread Torsten Roehr
"Ryan Schefke" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
>
>
> I'm pulling a date in the "datetime" format via a MySQL query.  Using PHP
I
> would like to check if that date is prior to today's date.  Can someone
> please help with this quick question.

You could convert it to a timestamp via strtotime() and check it against
time():

$date = strtotime($dateFromDb);

if ($date < time()) {
echo 'Date is in the past.';
}

Regards, Torsten Roehr

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



RE: [PHP] PHP & MySQL DATE comparison

2004-06-16 Thread Ryan Schefke

Hi All,

Answering my own question here, maybe this will help others out:

I found a nifty function below that will return seconds from Unix epoch to a
mysql value in the datetime format.  I'll just compare this to the php
function time().  Let me know if anyone has a better solution.



-Original Message-
From: Ryan Schefke [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 16, 2004 12:43 PM
To: Php-General-Help
Subject: [PHP] PHP & MySQL DATE comparison

Hello,

 

I'm pulling a date in the "datetime" format via a MySQL query.  Using PHP I
would like to check if that date is prior to today's date.  Can someone
please help with this quick question.

 

Thanks,

Ryan

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



RE: [PHP] index.php not loading up

2004-06-16 Thread Nguyen, Long P (Mission Systems)
apache - and I would think that mine would also be /var/log/apache but that path does 
not exist - was this created automatically when apache was installed?


-Original Message-
From: Greg Donald [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 16, 2004 12:00 PM
To: Nguyen, Long P (Mission Systems)
Cc: PHP Mailing Lists
Subject: Re: [PHP] index.php not loading up


On Wed, 16 Jun 2004 08:33:46 -0700, Nguyen, Long P (Mission Systems)
<[EMAIL PROTECTED]> wrote:
> so going back to your original question - yes error set to display on, but I don't 
> think I am seeing errors - where are the error logs?

Depends on what web server software you're using.  Mine are in
/var/log/apache for example.

-- 
Greg Donald
http://destiney.com/

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



RE: [PHP] index.php not loading up

2004-06-16 Thread R'twick Niceorgaw
Quoting "Nguyen, Long P (Mission Systems)" <[EMAIL PROTECTED]>:

> apache - and I would think that mine would also be /var/log/apache but that
> path does not exist - was this created automatically when apache was
> installed?

probably its /var/log/httpd ?

-R'twick
-- 
This is a signature


This message was sent using IMP, the Internet Messaging Program.

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



[PHP] Re: update count

2004-06-16 Thread Gerben
LIMIT 1


"Bob Lockie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> What is the best way to only do an update if it going to update only one
> row?
> I want to protect my code so that it won't accidentally update more than
> one row.
> I can do a select first but there must be an easier way. :-)

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



[PHP] src="test.php"

2004-06-16 Thread Gerben
I wondering how browsers handle the following html-codes:


and


are there any browser that will choke in it because the files don't have the
appropriate (.css and .js) extension?

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



RE: [PHP] index.php not loading up

2004-06-16 Thread Nguyen, Long P (Mission Systems)
Found it, thanks.  The errors are:

[Wed Jun 16 13:49:12 2004] [error] [client 158.114.144.121] File does not exist: 
/var/www/html/<, referer: http://158.114.148.90/index.php3
[Wed Jun 16 13:49:14 2004] [error] [client 158.114.144.121] File does not exist: 
/var/www/html/<, referer: http://158.114.148.90/index.php3
[Wed Jun 16 13:49:16 2004] [error] [client 158.114.144.121] File does not exist: 
/var/www/html/<, referer: http://158.114.148.90/index.php
[Wed Jun 16 13:49:18 2004] [error] [client 158.114.144.121] File does not exist: 
/var/www/html/<, referer: http://158.114.148.90/index.php

The index.php file is there, is it looking for some other file?

[EMAIL PROTECTED] html]# pwd
/var/www/html
[EMAIL PROTECTED] html]# ls -l index.php
-rwxr-xr-x1 root root 4870 Jun  4 15:28 index.php



-Original Message-
From: R'twick Niceorgaw [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 16, 2004 12:26 PM
To: PHP Mailing Lists
Subject: RE: [PHP] index.php not loading up


Quoting "Nguyen, Long P (Mission Systems)" <[EMAIL PROTECTED]>:

> apache - and I would think that mine would also be /var/log/apache but that
> path does not exist - was this created automatically when apache was
> installed?

probably its /var/log/httpd ?

-R'twick
-- 
This is a signature


This message was sent using IMP, the Internet Messaging Program.

-- 
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: Sending email with php

2004-06-16 Thread Manuel Lemos
Hello,
On 06/16/2004 07:43 AM, Phpu wrote:
Hi,
How can i send email in php usig the smtp server? I'm looking for a tutorial or a good 
script.
You may want to try this class that lets you send messages via a custom 
SMTP server if you really have to:

http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] src="test.php"

2004-06-16 Thread Chris W. Parker
Gerben 
on Wednesday, June 16, 2004 10:38 AM said:

> I wondering how browsers handle the following html-codes:
> 
> 
> and
> 
> 
> are there any browser that will choke in it because the files don't
> have the appropriate (.css and .js) extension?

although i don't have an answer specifically, you might try having your
webserver process .js and .css files just like it would .php files. that
way you can use the correct extensions in your html and *still* have the
web server do what you want it to do.



chris.

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



RE: [PHP] index.php not loading up

2004-06-16 Thread Michal Migurski
> [Wed Jun 16 13:49:12 2004] [error] [client 158.114.144.121] File does not exist: 
> /var/www/html/<, referer: http://158.114.148.90/index.php3
> [Wed Jun 16 13:49:14 2004] [error] [client 158.114.144.121] File does not exist: 
> /var/www/html/<, referer: http://158.114.148.90/index.php3
> [Wed Jun 16 13:49:16 2004] [error] [client 158.114.144.121] File does not exist: 
> /var/www/html/<, referer: http://158.114.148.90/index.php
> [Wed Jun 16 13:49:18 2004] [error] [client 158.114.144.121] File does not exist: 
> /var/www/html/<, referer: http://158.114.148.90/index.php
>
> The index.php file is there, is it looking for some other file?

Yes, it appears to be looking for "/var/www/html/<".

Going back to your original post, this line is where your problem is:


I'm not even sure that's remotely valid PHP or HTML.
What's it supposed to do?

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



RE: [PHP] index.php not loading up

2004-06-16 Thread R'twick Niceorgaw
Quoting "Nguyen, Long P (Mission Systems)" <[EMAIL PROTECTED]>:

> Found it, thanks.  The errors are:
> 
> [Wed Jun 16 13:49:12 2004] [error] [client 158.114.144.121] File does not
> exist: /var/www/html/<, referer: http://158.114.148.90/index.php3

/var/www/html/<
check your httpd.conf file and see if there's an extra < at end of DocumentRoot
directive.

R'twick
-- 
This is a signature


This message was sent using IMP, the Internet Messaging Program.

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



Re: [PHP] src="test.php"

2004-06-16 Thread Michal Migurski
> I wondering how browsers handle the following html-codes:
>
> 
> and
> 
>
> are there any browser that will choke in it because the files don't have the
> appropriate (.css and .js) extension?

What matters is the appropriate Content-type header. See header().

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

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



[PHP] Read Last Lines of a Text File

2004-06-16 Thread Scott Miller
I have a text file (log file) that I want to be able to read the last 30 or
40 lines of.  I've created the code below, but since this file is so large
(currently 8 MB) it won't work.  The code works on smaller files, but not
this one.  Can someone look at this below and tell me where I went wrong?



Thanks,
Scott Miller



-- 
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.251 / Virus Database: 263.3.2 - Release Date: 6/15/2004

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



Re: [PHP] Read Last Lines of a Text File

2004-06-16 Thread Matt Matijevich
[snip]
I've created the code below, but since this file is so large
(currently 8 MB) it won't work.
[/snip]

I would guess you are running into your php memory_limit.

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



RE: [PHP] index.php not loading up

2004-06-16 Thread Nguyen, Long P (Mission Systems)
Doesn't look like it..

DocumentRoot "/var/www/html"


-Original Message-
From: R'twick Niceorgaw [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 16, 2004 1:10 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] index.php not loading up


Quoting "Nguyen, Long P (Mission Systems)" <[EMAIL PROTECTED]>:

> Found it, thanks.  The errors are:
> 
> [Wed Jun 16 13:49:12 2004] [error] [client 158.114.144.121] File does not
> exist: /var/www/html/<, referer: http://158.114.148.90/index.php3

/var/www/html/<
check your httpd.conf file and see if there's an extra < at end of DocumentRoot
directive.

R'twick
-- 
This is a signature


This message was sent using IMP, the Internet Messaging Program.

-- 
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] src="test.php"

2004-06-16 Thread Keith Greene
I don't think there is a standard for the extensions of these files. In 
fact, this page: http://www.w3c.org/TR/CSS1#basic-concepts
uses a url of "http://style.com/cool"; as an example of an external style sheet.

Also, I use a .php file as a javascript include on my site. The script is 
included on other websites as a js include as well so others can see what's 
new on my site.
I haven't had any problems or complaints so far.

At 10:58 AM 6/16/2004, Chris W. Parker wrote:
Gerben 
on Wednesday, June 16, 2004 10:38 AM said:
> I wondering how browsers handle the following html-codes:
>
> 
> and
> 
>
> are there any browser that will choke in it because the files don't
> have the appropriate (.css and .js) extension?
although i don't have an answer specifically, you might try having your
webserver process .js and .css files just like it would .php files. that
way you can use the correct extensions in your html and *still* have the
web server do what you want it to do.

chris.
--
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] Value in URL issue

2004-06-16 Thread Mike R

I have an issue where I have a value in a link like this:

http://www.something.com/templates/nav.php?page=about

But when the link is clicked on, the value of page is empty.  Is this a
globals issue of some sort?

Thanks,

-Mike

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



[PHP] Re: Value in URL issue

2004-06-16 Thread Torsten Roehr
"Mike R" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> I have an issue where I have a value in a link like this:
>
> http://www.something.com/templates/nav.php?page=about
>
> But when the link is clicked on, the value of page is empty.  Is this a
> globals issue of some sort?

Try accessing it via $_GET['page']. You can always do a print_r($_REQUEST)
to see which variables are available.

Regards, Torsten Roehr

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



RE: [PHP] Re: Value in URL issue

2004-06-16 Thread Mike R

Both $_GET['page'] and print_r($_REQUEST) come up empty!  No results at all.

:\

-Mike


> -Original Message-
> From: Torsten Roehr [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 16, 2004 3:44 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Value in URL issue
>
>
> "Mike R" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >
> > I have an issue where I have a value in a link like this:
> >
> > http://www.something.com/templates/nav.php?page=about
> >
> > But when the link is clicked on, the value of page is empty.  Is this a
> > globals issue of some sort?
>
> Try accessing it via $_GET['page']. You can always do a print_r($_REQUEST)
> to see which variables are available.
>
> Regards, Torsten Roehr
>
> --
> 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: Value in URL issue

2004-06-16 Thread chmok
[EMAIL PROTECTED] (Mike R) wrote in 
news:[EMAIL PROTECTED]:

> 
> I have an issue where I have a value in a link like this:
> 
> http://www.something.com/templates/nav.php?page=about
> 
> But when the link is clicked on, the value of page is empty.  Is this a
> globals issue of some sort?
> 
> Thanks,
> 
> -Mike

How are you testing for the variable on nav.php? It will be in $_GET
['page'] with more recent versions of PHP. If you want to use the variable 
directly, like $page, you need to extract it first - extract($_GET).

-Matt

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



Re: [PHP] Value in URL issue

2004-06-16 Thread Gabino Travassos
$_SERVER['QUERY_STRING'] should get anything after the "?" in your url.

- Original Message - 
From: "Mike R" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 16, 2004 1:45 PM
Subject: [PHP] Value in URL issue


> 
> I have an issue where I have a value in a link like this:
> 
> http://www.something.com/templates/nav.php?page=about
> 
> But when the link is clicked on, the value of page is empty.  Is this a
> globals issue of some sort?
> 
> Thanks,
> 
> -Mike

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



Re: [PHP] Search Sanitization

2004-06-16 Thread Gabe
Greg Donald wrote:
On Wed, 16 Jun 2004 10:34:21 -0400, Gabe <[EMAIL PROTECTED]> wrote:
I'm writing a *very* simple search form for my db and was interested in
hearing some recommendations on what to check for with the user's input
for the search.
However, I guess more specifically my question is if anyone had any
advice as to other things I should check since it's a search form.
Obviously there's a lot more valid entries that a user can make than a
normal form where you might know more specifically what they should
enter and thus your validation can be more stringent.

Well, for starters you should definately check and prevent SQL
injection.  I use this in all my scripts:
set_magic_quotes_runtime(0);
if(get_magic_quotes_gpc() == 0){
   $_GET = isset($_GET) ? array_map("slashes", $_GET) : array();
   $_POST  = isset($_POST) ? array_map("slashes", $_POST) : array();
   $_COOKIE = isset($_COOKIE) ? array_map("slashes", $_COOKIE) : array();
}
function slashes($var){
if(is_array($var))
return array_map("slashes", $var);
else
return addslashes($var);
}
Hi Greg, I was looking at your function and I was wondering if you could 
 explain how the slashes function works exactly.  It looks like it is 
recursive, but I don't understand why you would need to do that.

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


Re: [PHP] Read Last Lines of a Text File

2004-06-16 Thread Matt Grimm
[EMAIL PROTECTED] (Scott Miller) wrote in
news:[EMAIL PROTECTED]: 

> I have a text file (log file) that I want to be able to read the last
> 30 or 40 lines of.  I've created the code below, but since this file
> is so large (currently 8 MB) it won't work.  The code works on smaller
> files, but not this one.  Can someone look at this below and tell me
> where I went wrong? 
> 
>  
> $filename ="/var/log/radius.log";
> 
> $myFile = fopen($filename, "r"); //open the file for reading, file
> pointer will be at the beginning of the file
> 
> if(! $myFile){// Make sure the file was opened
> successfully 
> 
> print ("File could not be opened.");
> 
> exit;
> }
> 
> $fcontents = file($filename);
> 
>   $limit = 30;
> 
> for ($i = 0; $i < $limit; $i++){ // while $i is less than 30
> 
> $line = $fcontents[$i];  // assign value of array element to a
> variable 
> 
>   if($line != ""){  // if the line from the file is not blank
>   print it 
> echo "$line \n";
>   }
> 
>  }
> 
> fclose($myFile);
> 
> ?>
> 
> Thanks,
> Scott Miller
> 
> 
> 

Your problem is likely with the following line, which reads the *entire* 
file into an array:

$fcontents = file($filename);

You're also opening and closing a file handle, but never using it. Use 
fread after fopen instead of the "file" function.  You'll have to decide on 
a byte limit instead of a line limit, though.

http://php.net/manual/en/function.fread.php

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



RE: [PHP] Re: Value in URL issue

2004-06-16 Thread Mike R

I only get 'NULL' when I do that.  Sort of interesting.

-Mike



> -Original Message-
> From: Matt Grimm [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 16, 2004 4:10 PM
> To: Mike R
> Subject: Re: [PHP] Re: Value in URL issue
>
>
> Try this at the top of nav.php (before any other code):
>
> var_dump($_GET['page']);
>
> It can generally can give you more interesting information.
>
> --
>
> Matt Grimm
> Web Developer
> The Health TV Channel, Inc.
> (a non - profit organization)
> 3820 Lake Otis Parkway
> Anchorage, AK 99508
> 907.770.6200 ext. 686
> 907.336.6205 (fax)
> E-mail: [EMAIL PROTECTED] 
> Web: www.healthtvchannel.org 
>
>
>
> Mike R wrote:
>
> >
> >
> >>-Original Message-
> >>From: chmok [mailto:[EMAIL PROTECTED]
> >>Sent: Wednesday, June 16, 2004 3:50 PM
> >>To: [EMAIL PROTECTED]
> >>Subject: [PHP] Re: Value in URL issue
> >>
> >>
> >>[EMAIL PROTECTED] (Mike R) wrote in
> >>news:[EMAIL PROTECTED]:
> >>
> >>
> >>
> >>>I have an issue where I have a value in a link like this:
> >>>
> >>>http://www.something.com/templates/nav.php?page=about
> >>>
> >>>But when the link is clicked on, the value of page is empty.  Is this a
> >>>globals issue of some sort?
> >>>
> >>>Thanks,
> >>>
> >>>-Mike
> >>>
> >>>
> >>How are you testing for the variable on nav.php? It will be in $_GET
> >>['page'] with more recent versions of PHP. If you want to use the
> >>variable
> >>directly, like $page, you need to extract it first - extract($_GET).
> >>
> >>
> >
> >I did print  $_GET['page'];
> >
> >:)
> >
> >-Mike
> >
> >
> >
> >
> >
> >
>
>

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



RE: [PHP] Value in URL issue

2004-06-16 Thread Mike R


Nothing gets printed out with this.  :\

-Mike



> -Original Message-
> From: Gabino Travassos [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 16, 2004 4:04 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Value in URL issue
> 
> 
> $_SERVER['QUERY_STRING'] should get anything after the "?" in your url.
> 
> - Original Message - 
> From: "Mike R" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, June 16, 2004 1:45 PM
> Subject: [PHP] Value in URL issue
> 
> 
> > 
> > I have an issue where I have a value in a link like this:
> > 
> > http://www.something.com/templates/nav.php?page=about
> > 
> > But when the link is clicked on, the value of page is empty.  Is this a
> > globals issue of some sort?
> > 
> > Thanks,
> > 
> > -Mike
> 
> -- 
> 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] Regarding variable reference

2004-06-16 Thread Justin Patrin
Ulrik S. Kofod wrote:
Justin Patrin sagde:
Ulrik S. Kofod wrote:
Why are you using eval? Eval is slow and is a hack... Just do:
$y = $$x;

   if(isset($y))
   {
   echo "$x:$y";
   }
}

True ! I just tested it with both eval and $$, and $$ seems to be about 3 to 4 
times
faster than eval BUT if you are processing less than 1 variables then there is
no noticeable difference.
Sorry I suggested eval!
but I think it is easier to read the program when using eval as it is more eye
catching than just an extra $ that is easily missed.
Well, eval can also easily be a security vulnerability... Using $$x 
means that you *will* be using $x as the var name. Consider this:

$x = 'varName; `rm -rf /`';
eval("\$y = \$$x;");
This will produce the PHP code:
$y = $varName; `rm -rf /`';
Which will be evaled and delete files from your system.
$y = $$x; will take the value of the variable with the name of what's in 
$x. You can even do:

$x = '"I am an invalid var name!"';
$$x = 'abc';
$y = $$x;
Even though what's in x isn't a valid normal variable name, this will 
work. Strange, huh?

AFAIK the eval code looks very similar to my code as it also has $$. 
IMHO, it's harder to read eval code.

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


Re: [PHP] list methods of class COM ?

2004-06-16 Thread Marek Kilimajer
Matthieu Loudes wrote --- napísal::
Hi,
Where can i find the methods list of module COM ?
Ex :  $Odject = new COM("WinNT://domain");
Thanks !
Matt
http://msdn.microsoft.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Value in URL issue

2004-06-16 Thread Gabino Travassos
Maybe you should post all the relevant code.

- Original Message - 
From: "Mike R" <[EMAIL PROTECTED]>
To: "Gabino Travassos" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, June 16, 2004 2:36 PM
Subject: RE: [PHP] Value in URL issue


>
>
> Nothing gets printed out with this.  :\
>
> -Mike
>
>
>
> > -Original Message-
> > From: Gabino Travassos [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, June 16, 2004 4:04 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Value in URL issue
> >
> >
> > $_SERVER['QUERY_STRING'] should get anything after the "?" in your url.
> >
> > - Original Message - 
> > From: "Mike R" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, June 16, 2004 1:45 PM
> > Subject: [PHP] Value in URL issue
> >
> >
> > >
> > > I have an issue where I have a value in a link like this:
> > >
> > > http://www.something.com/templates/nav.php?page=about
> > >
> > > But when the link is clicked on, the value of page is empty.  Is this
a
> > > globals issue of some sort?
> > >
> > > Thanks,
> > >
> > > -Mike
> >
> > -- 
> > 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] Re: Unit Testing

2004-06-16 Thread Red Wingate
Used all but 'Generic PHP Framework' and everything was quite fine and
worked out just as i expected. But i was still missing some features
which made me build my own small library to fit into my Framework.
 -- red
Rick Fletcher wrote:
Has anyone done any PHP unit testing? I've been looking around for a unit
testing library to try out. Below are the ones I've found so far:
SimpleTest: http://www.lastcraft.com/simple_test.php
PHPUnit (dead?): http://phpunit.sourceforge.net/
Pear PHPUnit: http://pear.php.net/package/PHPUnit
Generic PHP Framework (dead?): http://gpfr.sourceforge.net/
SimpleTest looks the most complete and the most active, so that's where I'm
leaning. Anyone have any experience with any of these libraries, or have any
comments on PHP Unit testing in general?
Thanks.
Rick
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Unit Testing

2004-06-16 Thread Red Wingate
Allmost forgot about this one:
http://www.phppatterns.com/index.php/article/articleview/33/1/2/
very well written ( phpPatterns() ) covers some other nice topics
as well, allways worth a read.
 -- red
Red Wingate wrote:
Used all but 'Generic PHP Framework' and everything was quite fine and
worked out just as i expected. But i was still missing some features
which made me build my own small library to fit into my Framework.
 -- red
Rick Fletcher wrote:
Has anyone done any PHP unit testing? I've been looking around for a unit
testing library to try out. Below are the ones I've found so far:
SimpleTest: http://www.lastcraft.com/simple_test.php
PHPUnit (dead?): http://phpunit.sourceforge.net/
Pear PHPUnit: http://pear.php.net/package/PHPUnit
Generic PHP Framework (dead?): http://gpfr.sourceforge.net/
SimpleTest looks the most complete and the most active, so that's 
where I'm
leaning. Anyone have any experience with any of these libraries, or 
have any
comments on PHP Unit testing in general?

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


Re: [PHP] Search Sanitization

2004-06-16 Thread Greg Donald
On Wed, 16 Jun 2004 16:10:10 -0400, Gabe <[EMAIL PROTECTED]> wrote:
> 
> Hi Greg, I was looking at your function and I was wondering if you could
>  explain how the slashes function works exactly.  It looks like it is
> recursive, but I don't understand why you would need to do that.

It handles regular form variables as well as arrays.

So if your form had an array of checkboxes coming in via $_POST for
example, it will handle it.

-- 
Greg Donald
http://destiney.com/

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



Re: [PHP] Read Last Lines of a Text File

2004-06-16 Thread Ashwin Purohit
Or maybe execution time limit.
[snip]
I've created the code below, but since this file is so large
(currently 8 MB) it won't work.
[/snip]
I would guess you are running into your php memory_limit.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
Is your PC infected? Get a FREE online computer virus scan from McAfee® 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


[Fwd: RE: [PHP] list methods of class COM ?]

2004-06-16 Thread Marek Kilimajer
Forwarded to the list...
- Pôvodná správa -
Predmet: RE: [PHP] list methods of class COM ?
Dátum: Wed, 16 Jun 2004 17:06:25 -0400
Od: Gryffyn, Trevor <[EMAIL PROTECTED]>
Pre: Marek Kilimajer <[EMAIL PROTECTED]>
I'm not familiar with using COM("WinNT://domain") but I've done quite a 
bit with COM objects involving Excel, MapPoint, Word and Access.   If 
you're working with a specific application like this, search for 
"mappoint data model" or "mappoint object model".

Here's the one for MapPoint:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mappoint2004/BIZOMAboutOM.asp
You can probably find what you're looking for in that general area. 
Some object models are written better than others.

Good luck!
-TG
-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 16, 2004 4:59 PM
To: Matthieu Loudes
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] list methods of class COM ?

Matthieu Loudes wrote --- napísal::
> Hi,
> 
> Where can i find the methods list of module COM ?
> 
> Ex :  $Odject = new COM("WinNT://domain");
> 
> Thanks !
> 
> Matt
> 

http://msdn.microsoft.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] Include Issues

2004-06-16 Thread Stephen Craton
I have a script that calls a function called conbox. This function creates
the HTML to a content box and you also pass a file to be included into the
content area of the box.
 
The function echos out some of the HTML, then does a simple include(), and
then echos out the rest of the HTML.
 
I'm trying to do this with another file containing PHP code and HTML
together, it's a file that fetches and displays information from a database.
The file is fine by itself, but once I include it into the actual content
box, it does a die(). I have it set to do that if there's a MySQL error, but
it doesn't output any error at all, and the file works by itself. Here is
the code that fetches from the database:



And here's where it displays:


  

  


This is fine, completely fine, by itself (if I include the database
credentials of course, but if I leave that include in there, it still won't
work). I've already included that file into the file it's being included
into anyway so it should work, but it simply isn't. Here's the conbox
function with less of the echo:

function conbox($title, $contentfile, $content, $width, $height) {
echo 'Stuff...';
if($content == '') {
if([EMAIL PROTECTED]($contentfile)) {
echo 'content unavailable';
}
}
if($content != '') {
echo ''.$content.'';
}
echo'stuff';
}

Like I said, all the database credentials and everything is included into
the final file, but it simply won't work. Any ideas here?

Thanks,
Stephen Craton
http://www.melchior.us  

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



[PHP] Resolving a warning

2004-06-16 Thread Ryan Schefke
Hi All,

 

I've built my own shopping cart and use a library supplied by USAePay.  The
library is accessed via an include statement in my code.  Because of theirs
a desire to keep this library outside of my public web file directory
USAePay recommended using:

 

include "/usr/local/lib/php/usaepay.php";

 

I put the file "usaepay.php" in that directory (using a dedicated linux box
with root access) and run my script with the above include.  I get the
following: 

 

Warning: main(): open_basedir restriction in effect.
File(/usr/local/lib/php/usaepay.php) is not within the allowed path(s):
(/home/httpd/vhosts/tgwedding.com/httpdocs:/tmp) in
/home/httpd/vhosts/tgwedding.com/httpdocs/tgwedding/payment7.php on line 11

 

How can I resolve this?

 

Thanks,

Ryan



[PHP] Re: Include Issues

2004-06-16 Thread Justin Patrin
Stephen Craton wrote:
I have a script that calls a function called conbox. This function creates
the HTML to a content box and you also pass a file to be included into the
content area of the box.
 
The function echos out some of the HTML, then does a simple include(), and
then echos out the rest of the HTML.
 
I'm trying to do this with another file containing PHP code and HTML
together, it's a file that fetches and displays information from a database.
The file is fine by itself, but once I include it into the actual content
box, it does a die(). I have it set to do that if there's a MySQL error, but
it doesn't output any error at all, and the file works by itself. Here is
the code that fetches from the database:


And here's where it displays:

  

  

This is fine, completely fine, by itself (if I include the database
credentials of course, but if I leave that include in there, it still won't
work). I've already included that file into the file it's being included
into anyway so it should work, but it simply isn't. Here's the conbox
function with less of the echo:
function conbox($title, $contentfile, $content, $width, $height) {
echo 'Stuff...';
if($content == '') {
if([EMAIL PROTECTED]($contentfile)) {
echo 'content unavailable';
}
}
if($content != '') {
echo ''.$content.'';
}
echo'stuff';
}
Like I said, all the database credentials and everything is included into
the final file, but it simply won't work. Any ideas here?
Thanks,
Stephen Craton
http://www.melchior.us  
You're probably running into a namespace issue here. The global 
variables that you're trying to use for mysql_select_db aren't in the 
namespace of the function that's including the file.

I would suggest using a better (OOP) system to get around this. Barring 
that, the best way IMHO is to use $GLOBALS['database_default'], etc. for 
the vars in the include that are created globally.

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


[PHP] Re: Resolving a warning

2004-06-16 Thread Justin Patrin
Warning: main(): open_basedir restriction in effect.
File(/usr/local/lib/php/usaepay.php) is not within the allowed path(s):
(/home/httpd/vhosts/tgwedding.com/httpdocs:/tmp) in
/home/httpd/vhosts/tgwedding.com/httpdocs/tgwedding/payment7.php on line 11
 

How can I resolve this?
Search the PHP docs or google. You'll find something.
--
paperCrane 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Re: Include Issues

2004-06-16 Thread Stephen Craton
Thank you for the suggestion, worked like a charm. I was using GLOBALS
earlier in the script because of the same issue, just wasn't thinking about
it for these variables. :-)
 
Thanks,
Stephen Craton
http://www.melchior.us

-Original Message-
From: Justin Patrin [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 16, 2004 5:53 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Include Issues

Stephen Craton wrote:

> I have a script that calls a function called conbox. This function 
> creates the HTML to a content box and you also pass a file to be 
> included into the content area of the box.
>  
> The function echos out some of the HTML, then does a simple include(), 
> and then echos out the rest of the HTML.
>  
> I'm trying to do this with another file containing PHP code and HTML 
> together, it's a file that fetches and displays information from a
database.
> The file is fine by itself, but once I include it into the actual 
> content box, it does a die(). I have it set to do that if there's a 
> MySQL error, but it doesn't output any error at all, and the file 
> works by itself. Here is the code that fetches from the database:
> 
>  mysql_select_db($database_default, $default); $query_headlines = 
> "SELECT id, headline, short, datetime FROM snews ORDER BY datetime 
> DESC"; $headlines = mysql_query($query_headlines, $default) or 
> die(mysql_error()); $row_headlines = mysql_fetch_assoc($headlines); 
> $totalRows_headlines = mysql_num_rows($headlines); ?>
> 
> And here's where it displays:
> 
>  bordercolor="#616161" align="center" style="border-collapse:collapse">
>   
>  href="snews.php?id="
> class="headline">
>   
> 
> 
> This is fine, completely fine, by itself (if I include the database 
> credentials of course, but if I leave that include in there, it still 
> won't work). I've already included that file into the file it's being 
> included into anyway so it should work, but it simply isn't. Here's 
> the conbox function with less of the echo:
> 
> function conbox($title, $contentfile, $content, $width, $height) {
>   echo 'Stuff...';
>   if($content == '') {
>   if([EMAIL PROTECTED]($contentfile)) {
>   echo 'content unavailable';
>   }
>   }
>   if($content != '') {
>   echo ''.$content.'';
>   }
>   echo'stuff';
> }
> 
> Like I said, all the database credentials and everything is included 
> into the final file, but it simply won't work. Any ideas here?
> 
> Thanks,
> Stephen Craton
> http://www.melchior.us 

You're probably running into a namespace issue here. The global variables
that you're trying to use for mysql_select_db aren't in the namespace of the
function that's including the file.

I would suggest using a better (OOP) system to get around this. Barring
that, the best way IMHO is to use $GLOBALS['database_default'], etc. for the
vars in the include that are created globally.

--
paperCrane 

--
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] Read Last Lines of a Text File

2004-06-16 Thread Curt Zirzow
* Thus wrote Scott Miller ([EMAIL PROTECTED]):
> I have a text file (log file) that I want to be able to read the last 30 or
> 40 lines of.  I've created the code below, but since this file is so large
> (currently 8 MB) it won't work.  The code works on smaller files, but not
> this one.  Can someone look at this below and tell me where I went wrong?
>
> ...
> 
> $fcontents = file($filename);

This will make your script consume lots of memory, and is very
inefficient.

You'd be better of using the unix tail command:

$fp = popen("/usr/bin/tail -$limit $file", 'r');
if (! $fp ) {
  echo 'unable to pipe command';
}
while (!feof($fp) ) {
  $line = fgets($fp);
  print $line;
}

Of course if you're simply going to output the results a simple:

  system("/usr/bin/tail -$limit $file");

Would do the job nicely.


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Value in URL issue

2004-06-16 Thread Curt Zirzow
hmm.. the third different topic in this thread..

* Thus wrote Mike R ([EMAIL PROTECTED]):
> 
> I have an issue where I have a value in a link like this:
> 
> http://www.something.com/templates/nav.php?page=about
> 
> But when the link is clicked on, the value of page is empty.  Is this a
> globals issue of some sort?

most likely yes. More information needs to be known about you're
system check the local values from the output of phpinfo()

  php version:
  register_globals:
  variables_order:
  error_reporing:
  display_errors:


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Value in URL issue

2004-06-16 Thread Curt Zirzow
* Thus wrote Gabino Travassos ([EMAIL PROTECTED]):
> Maybe you should post all the relevant code.

Please dont.

If a simple script like so:
  http://server/simplescript.php?avar=avalue

Is printing null, then something else is wrong.

Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Resolving a warning

2004-06-16 Thread Curt Zirzow
* Thus wrote Ryan Schefke ([EMAIL PROTECTED]):
> 
> I've built my own shopping cart and use a library supplied by USAePay.  The
> library is accessed via an include statement in my code.  Because of theirs
> a desire to keep this library outside of my public web file directory
> USAePay recommended using:
> 
> include "/usr/local/lib/php/usaepay.php";

Actually you're better off not hard coding that path. A simple
  include "usaepay.php";

> 
> I put the file "usaepay.php" in that directory (using a dedicated linux box
> with root access) and run my script with the above include.  I get the
> following: 
> 
> Warning: main(): open_basedir restriction in effect.
> File(/usr/local/lib/php/usaepay.php) is not within the allowed path(s):
> (/home/httpd/vhosts/tgwedding.com/httpdocs:/tmp) in
> /home/httpd/vhosts/tgwedding.com/httpdocs/tgwedding/payment7.php on line 11

Two things:
1. which is probably already set, is to make sure your include_path 
   has /usr/local/lib/php  in listed in it as the first item.
2. add to open_basedir: /usr/local/lib/php

You'll be all set.


Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Regarding variable reference

2004-06-16 Thread Curt Zirzow
* Thus wrote Ulrik S. Kofod ([EMAIL PROTECTED]):
> but I think it is easier to read the program when using eval as it is more eye
> catching than just an extra $ that is easily missed.


If eval() is the answer, you're almost certainly asking the
wrong question. -- Rasmus Lerdorf, BDFL of PHP



Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Resolving a warning

2004-06-16 Thread Marek Kilimajer
Ryan Schefke wrote --- napísal::
Hi All,
 

I've built my own shopping cart and use a library supplied by USAePay.  The
library is accessed via an include statement in my code.  Because of theirs
a desire to keep this library outside of my public web file directory
USAePay recommended using:
 

include "/usr/local/lib/php/usaepay.php";
 

I put the file "usaepay.php" in that directory (using a dedicated linux box
with root access) and run my script with the above include.  I get the
following: 

 

Warning: main(): open_basedir restriction in effect.
File(/usr/local/lib/php/usaepay.php) is not within the allowed path(s):
(/home/httpd/vhosts/tgwedding.com/httpdocs:/tmp) in
/home/httpd/vhosts/tgwedding.com/httpdocs/tgwedding/payment7.php on line 11
 

How can I resolve this?
The library must be either under 
/home/httpd/vhosts/tgwedding.com/httpdocs or /tmp. /tmp is out of 
question, so the only directory left is your docroot. But as you are 
saing you are root on the server, you can change open_basedir setting to 
/home/httpd/vhosts/tgwedding.com:/tmp and put the library to 
/home/httpd/vhosts/tgwedding.com/usepay/ directory.

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


[PHP] imagecolortransparent & IE

2004-06-16 Thread Brian Krausz
Hi, I have been working to create a program that takes a user-uploaded 
background image, a little alpha blending, some data, and a pinch of 
fairy dust, and outputs a nice image.  I have had trouble with the image 
displaying properly in Internet Explorer.  An example:

http://ffxi.nerdlife.net/ffxi.php?id=1
If you open it in any non-IE browser, it looks fine, but if you open it 
in IE, the gray background is not made transparent.

My question is, how can I fix this, and if I can't, is there any 
alternative for making a transparent background.  Here's my code snipplet:

$color = ImageColorAt($im, 1, 1);
imagecolortransparent($im, $color);
Also, I output the file as a png file, but I don't care what it is 
output as (although my server for some reason doesn't recognize 
ImageGif...):

header("Content-Type: image/png");
Imagepng($im);
Any advice?
Thanks,
Brian
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] imagecolortransparent & IE

2004-06-16 Thread Richard Harb
That's sort of a known issue with our oh so standards compliant
favourite browser...

Search google for
   ie png transparency

and though shall be enlighted.
Richard

-Original Message-
> Hi, I have been working to create a program that takes a user-uploaded
> background image, a little alpha blending, some data, and a pinch of
> fairy dust, and outputs a nice image.  I have had trouble with the image
> displaying properly in Internet Explorer.  An example:

> http://ffxi.nerdlife.net/ffxi.php?id=1

> If you open it in any non-IE browser, it looks fine, but if you open it
> in IE, the gray background is not made transparent.

> My question is, how can I fix this, and if I can't, is there any 
> alternative for making a transparent background.  Here's my code snipplet:

>   $color = ImageColorAt($im, 1, 1);
>   imagecolortransparent($im, $color);

> Also, I output the file as a png file, but I don't care what it is 
> output as (although my server for some reason doesn't recognize 
> ImageGif...):

>   header("Content-Type: image/png");
>   Imagepng($im);

> Any advice?

> Thanks,
> Brian

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



[PHP] PDF Templates with PHP

2004-06-16 Thread Merlin
HI there,
I am wondering if it is possible to generate a pdf page with pdflib based on a 
existing pdf document. For example using an invoice template and filling in the 
values with php.

Thank you for any hint,
Merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] session looses variable

2004-06-16 Thread Anthony Weston
Hi,

This is what is probably a newbie session problem.

I've been having some trouble with sessions on php 4.0.6, I'm developing 
a website in which I don't have direct control over the server.  Due to 
some other problems I created a test counter script to try to narrow 
down where the problem resides but no I'm sort of stuck.

Here is the small counter script.

session_start();
print_r($HTTP_SESSION_VARS);
if (!session_is_registered('count2345')) {
$GLOBALS['count2345'] = 0;
echo "create count";
session_register('count2345');
} else {
$count2345++;
}
echo "";
echo session_id();
session_write_close();

When I refresh it will periodically loose the count2345 session variable 
and recreate the variable.  At times it will also jump in value.

Here are also the php configuration session settings.

session.auto_start  Off Off
session.cache_expire 180 180
session.cache_limiter   nocache nocache
session.cookie_domain   no valueno value
session.cookie_lifetime 00
session.cookie_path  //
session.cookie_secure   Off Off
session.entropy_fileno valueno value
session.entropy_length  00
session.gc_maxlifetime  1440 1440
session.gc_probability  11
session.name PHPSESSID   PHPSESSID
session.referer_check   no valueno value
session.save_handler files   files
session.save_path/tmp/tmp
session.serialize_handler php   php
session.use_cookies  On   On

Here is also the compile configuration which includes --enable-trans-sid
 './configure' '--disable-pear' '--enable-ftp' 
'--with-sybase-ct=/usr/local/freetds' '--enable-trans-sid' 
'--enable-force-cgi-redirect'

Thank you

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