[PHP] Shopping Cart Schema - Sessions

2001-01-10 Thread Jason Beebe

Hey, 

I'm looking for little information from those who have coded their own shopping cart 
apps. what would you say the best way to setup a cart would be? more specificly, the 
method for adding items to the cart.

say the user is broswing around. when they entered the website a new session was 
created. when they go to add an item, what is the best way store variables (such as 
what they bought and quantity) in the session. i have read that it is possible to put 
all of your session variables in a single associative array. however, i have not had 
any luck doing this myself. Under such a method of an array, how would i store each 
item (product id and quantity, possibly price as well) in the cart into the session. 
obviously i don't expect anyone to write an entire app. i am comfortable starting the 
session, and doing th db extraction and presentation. i just need to know how to store 
a variable in a session (passed through post) and how to extract it when need be 
(considering it is an array). Thanks a lot!



[PHP] Templating help

2001-01-10 Thread Cameron

ok, im working on a simple and fast templating system for the website im
recreating at the moment. im trying to make it so as the template file
can be opened into a variable before it is passed to the parsing section
so as i dont have to open the file 100 times etc. im not using
fasttemplates because it is to complicated for my liking and nothing out
there seems to be much good. can someone look over this code and tell me
why its screwing up?

template.php


row.tpl
{NAME}
{DATE}
{STYLE}
{REVIEW}
{LINK}


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] User Authentication Integration with NT

2001-01-10 Thread Phil Driscoll

>Is there a way with PHP to use the Windows NT or Windows 2000
authentication
>information.  So it can compare the username and password entered with
>either the cached information or the user information from the NT server...
>This is for an intranet setup...  Has anyone tried this kind of thing?

If you configure IIS to 'check that file exists' for the php file extension
you are using, then IIS will sort out authentication for you based on file
system permissions.
If you need to do something not based on file system permissions, I guess
you would need to write an external php module to communicate directly with
NTs authentication, but you might have to get the module to run as (or
impersonate) a user with more privileges that might be desirable for
anonymous web access - this may not be too much of a problem on an intranet
though.

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Ping

2001-01-10 Thread Tshering Norbu

Dear list,
I have this proposal: I work in ISP where we have a web site. On our web site, we 
would like to ping, say 3 other distant web sites at every interval of 10 minutes. We 
would like to have the result like say " The internet is down" message displayed on 
our homepage if the PING doesn't get reply. If there is a reply, then nothing should 
be displayed. So I would like to know the PHP functions/code to do that (i.e the PING 
function). I am sure that can be done in PHP. Could someone please instruct me how to 
go about it. 
Thanks.

NOBBY



Re: [PHP] Ping

2001-01-10 Thread DaViper


Code to show ping results on a webpage included in the 2 -files ping.php 
and output.php

Greets,


DaViper

Maybe this can help you
At 15:03 10/01/2001 +0600, you wrote:
>Dear list,
>I have this proposal: I work in ISP where we have a web site. On our web 
>site, we would like to ping, say 3 other distant web sites at every 
>interval of 10 minutes. We would like to have the result like say " The 
>internet is down" message displayed on our homepage if the PING doesn't 
>get reply. If there is a reply, then nothing should be displayed. So I 
>would like to know the PHP functions/code to do that (i.e the PING 
>function). I am sure that can be done in PHP. Could someone please 
>instruct me how to go about it.
>Thanks.
>
>NOBBY


";
}

Return $tmp;
}

$starttime = exec("date");
$resultaat = pingHost($input,5);
$endtime = exec("date");

$port="";
printit($starttime, $endtime, $resultaat, $input, $port);

?>


PHP Webtools");
printf ("");
printf ("PHP 
Webtools\n");
printf ("");

}

function printfooter() {

printf ("© copyright 2000 mailto:[EMAIL PROTECTED]\">Ruben Vanhoutte");
printf ("Powered by:\n");

/*

printf (" http://www.slackware.com\" target=\"_blank\">");
printf ("http://www2.php.net\" target=\"_blank\">");
printf ("http://www.apache.org\" target=\"_blank\">");

*/

printf (" ");
printf ("");
printf ("  ");
printf ("");
printf (" http://www.slackware.com\" target=\"_blank\">");
printf ("  http://www.apache.org\" target=\"_blank\"> ");
printf ("  ");
printf ("  http://www.apache.org\" 
target=\"_blank\">");
printf ("  http://www.apache.org\" 
target=\"_blank\">");
printf ("");
printf ("  ");

}

function printit($starttime, $stoptime, $result, $host, $port) {

$spaces = " ";

printheader();
printf ("Date Started: %s \n",$starttime);
printf ("Date Ended: %s \n",$stoptime);
if ($port != "") {
printf ("Host: %s Port: %s\n",$host,$port);
}
else
printf ("Host: %s\n",$host);
printf ("Data returned:\n");
printf ("%s",$result);
printfooter();

}

?>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP] BCDIV problems

2001-01-10 Thread Christian Fagerheim

Hello!

I have some problems with my PHP script that utilizes the BCDIV function,
and I was hoping some of you could be so kind as to help me solve it.

To the problem: I use BCDIV to divide a string to a integer constant and it
works great, unless the string is no more than 14 digits...
I have tried to do an echo between each operation to see what happens, and
then I discovered that BCDIV returned, much to my dismay, a double. Based
upon further use of the value BCDIV returns I have made some calculations,
but when BCDIV returned a double with "+E**" at the end the calculations
fails.
I have recreated the piece of my code that I am talking about, and I hope it
will be more enlightening than my explenations.

/
function user_func($input_string) {
$new_string = "";
$temp_string = "";

while($input_string) {
$div_string = 0;
$div_string = (string) (bcdiv($input_string, 100) * 100);
$temp_string = bcsub($input_string, $div_string);
$int_input = bcdiv($input_string, 100);
$new_string .= call_user_func("string_manip", $temp_string);
}

return $new_string;
}
//

This should return a 2 digit value removed from the end of $input_string,
but when the problem arises it returns a "0". Everything else works
perfectly though, even if the problem occurs.

I hope that there are somebody out there that know what the problem is
caused by, or can help me in any other way. I would like to thank you all in
advance!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] declaring variables in class definitions

2001-01-10 Thread Max A. Derkachev

Hello sam1600,

Wednesday, January 10, 2001, 6:42:58 AM, you wrote:

sic> What in the world is reason for declaring the following in the class?:
sic> var $somevar;
sic> I see no reason, and no differences if I don't declare: var $somevar;

Classes are intended to be structured data storage. You should define
a structure of the class before using the class.
You can set the value of the $somevar anytime later, when using an
object of class a.
$d->somevar = true;
and the next call to $d->b() will print nothing.
But you won't be able to assign a value to $somevar, if it is not
declared in the class.

sic> Maybe a better question is what will break if I do not declare
sic> my vars in my class definition?

the method b() of the class a will break if you don't declare $somevar
in the class definition. In the string "if (!isset($this->somevar))"
it would throw an error saying that you have no variable named 'somevar' in
you class.


-- 
Best regards,
Max A. Derkachev mailto:[EMAIL PROTECTED]
Symbol-Plus Publishing Ltd.
phone: +7 (812) 324-53-53
http://www.Books.Ru -- All Books of Russia
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Ping

2001-01-10 Thread Tshering Norbu

Hello DaViper,
Where do I get those 2 files from? The PHP I am running is 4.0.0


- Original Message -
From: DaViper <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 3:07 PM
Subject: Re: [PHP] Ping


>
> Code to show ping results on a webpage included in the 2 -files ping.php
> and output.php
>
> Greets,
>
>
> DaViper
>
> Maybe this can help you
> At 15:03 10/01/2001 +0600, you wrote:
> >Dear list,
> >I have this proposal: I work in ISP where we have a web site. On our web
> >site, we would like to ping, say 3 other distant web sites at every
> >interval of 10 minutes. We would like to have the result like say " The
> >internet is down" message displayed on our homepage if the PING doesn't
> >get reply. If there is a reply, then nothing should be displayed. So I
> >would like to know the PHP functions/code to do that (i.e the PING
> >function). I am sure that can be done in PHP. Could someone please
> >instruct me how to go about it.
> >Thanks.
> >
> >NOBBY
>






> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Speaking of OOP

2001-01-10 Thread Neil Kimber

Two of the greatest benefits of OO design is polymorphism.

Polymorphism allows you to build complex systems in a simple manner. A
simple example that is easy to visualise would be considering a system that
draws different objects to a screen. Each object could be a vector image
(i.e. a list of points to connect lines) or a jpg binary image. You could
create a different class to handle each class of drawing object. You could
then give each class the same draw() method, although the implementation
would be different in class. Now, here's were polymorphism kicks in, you can
write some code that keeps a list of graphics objects to draw and loop
through that list simply calling

myDrawingObject[numIndex]->draw();

At no stage does your controlling code need to understand the difference
between the different base classes. Your controlling code will happily draw
any graphic object. Indeed, you could now add new base drawing classes and
your controlling code would handle these equally well with no need for code
changes.

This is a wondefully powerful concept.

p.s. inheritance is pretty cool too.



-Original Message-
From: Ignacio Vazquez-Abrams [mailto:[EMAIL PROTECTED]]
Sent: 09 January 2001 22:35
To: John Guynn
Cc: Php (E-mail)
Subject: Re: [PHP] Speaking of OOP


On Tue, 9 Jan 2001, John Guynn wrote:

> I am a hardware guy hacking my way through building dynamic web pages
using
> PHP and MySQL and I just can't get the concept of OOP.  I don't understand
> what a class can offer that I can't do with a function.  I've tried to
read
> a couple of books about OOP and a chapter about classes and such in a PHP
> book and I just can't grasp the concept.
>
> Can someone explain to me how a class makes my life easier compared to
using
> functions.
>
> Thanks in advance,
>
> John Guynn
>
> This email brought to you by RFCs 821 and 1225.
>

You are absolutely right. There is not one single thing that can be done
with
classes that couldn't be done with functions. Not in PHP anyway. The main
use
of OOP is the abstraction of data along with the code used to manipulate it.
Observe:



Now using OOP:

redius=$r;
  }

  function area()
  {
return $this->radius*$this->radius*3.1415;
  }
};

class Square
{
  var $width;
  var $height;

  function Square($w=0, $h=0)
  {
$this->width=$w;
$this->height=$h;
  }

  function area()
  {
return $this->width*$this->height;
  }
};

$circle=New Circle(5);
$square=New Square(4, 3);

$circlearea=$circle->area();
$squarearea=$square->area();
?>

In short, OOP makes it just slightly more difficult to screw things up.
PHP's
OOP model is missing two things (field scope [private, protected, public]
and
class destructors) that prevent it from being as powerful as it could
be, but
it beats flipping switches :)

--
Ignacio Vazquez-Abrams  <[EMAIL PROTECTED]>







--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Compiling php-3.0.18 with Openldap-2.0.7 support!

2001-01-10 Thread ndemeno

I'm trying to build php-3.0.18 as a shared module of Apache
with support for openldap-2.0.7.  It compiles, makes and
installs without problems, but once I try to start apache
it gives the following error:

Cannot load /usr/local/apache/libexec/libphp3.so into server:
/usr/local/apache/libexec/libphp3.so: undefined symbol:
ldap_get_lderrno

if I recompile php without ldap support, Apache starts just fine.

Taking a look at the ldap.c that comes with php-3.0.18, I notice
the following section:

# if LDAP_API_VERSION > 2000
/* New versions of OpenLDAP do it this way */
php3_error(E_WARNING,"LDAP:  Unable to bind to server: %
s",ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));
# else
php3_error(E_WARNING,"LDAP:  Unable to bind to server: %
s",ldap_err2string(ldap->ld_errno));
# endif
#else
php3_error(E_WARNING,"LDAP:  Unable to bind to server: %
s",ldap_err2string(ldap_get_lderrno(ldap,NULL,NULL)));
#endif

which I presume is causing libphp3.so to build with ldap_get_lderrno
which isn't defined in openldap-2.0.7.

Short of recompiling php3 with support for an older version of openldap
are there other workarounds?  I can't upgrade to php4 just yet.

Marius

-
This mail sent through IMP: webmail.sdfparty.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] include & include_once, how do they work?

2001-01-10 Thread William Bailey

I have just been playing around with include and include_once with one of
my classes, basicly there are a lot of functions inside this class so we
have put the contance of the function into its own file (so that different
people can work  on it) and are useing the include function to call it.

example:
...
function getCategorys ($id=0) {
return include($this->functionDirectory
."getCategorys.inc.php");   
}
function listItemsByCategory ($id,$start=0,$dynamic=FALSE) {
return include($this->functionDirectory
."listItemsByCategory.inc.php");
}
...

At one point I was useing include_once thinking that it would load the file
once and then keep it in memmory untill the script exited, but this dosen't
seem to be the case. What happens it that you call the function once and it
works fine but if you call it again it returns nothing so I have therefore
had to use include, which will load the file every time and it works.

Anyway to my question: Is there a way to keep code in different files and
have php load the file once and then keep the code in memmory once it has
been called?

Thanks,
William.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Session cookie expiration

2001-01-10 Thread Michal Thomka



 I am working on an aplication which uses sessions, and I would like to
set the expiration time of the cookie , which is sent by session. 
  Can someone help me with this small problem? 

  Thank you in advance
   Mike

-- 
 

   Michal Thomka 
Programmer/Developer   
___  
surfEU.com GmbH
Nordbahnstrasse 36/1/3
A-1020 Wien

Tel:  +43 1 9989777-208
Fax:  +43 1 9989777-200
mailto: [EMAIL PROTECTED]
http://www.surfeu.at/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Ping

2001-01-10 Thread DaViper

Those 2 files are programs I made myself using some tips from the 
mailinglist. My Idea was to create webtools with PHP. A port of some kind 
from the Perl webtools.



At 15:25 10/01/2001 +0600, you wrote:
>Hello DaViper,
>Where do I get those 2 files from? The PHP I am running is 4.0.0
>
>
>- Original Message -
>From: DaViper <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Wednesday, January 10, 2001 3:07 PM
>Subject: Re: [PHP] Ping
>
>
> >
> > Code to show ping results on a webpage included in the 2 -files ping.php
> > and output.php
> >
> > Greets,
> >
> >
> > DaViper
> >
> > Maybe this can help you
> > At 15:03 10/01/2001 +0600, you wrote:
> > >Dear list,
> > >I have this proposal: I work in ISP where we have a web site. On our web
> > >site, we would like to ping, say 3 other distant web sites at every
> > >interval of 10 minutes. We would like to have the result like say " The
> > >internet is down" message displayed on our homepage if the PING doesn't
> > >get reply. If there is a reply, then nothing should be displayed. So I
> > >would like to know the PHP functions/code to do that (i.e the PING
> > >function). I am sure that can be done in PHP. Could someone please
> > >instruct me how to go about it.
> > >Thanks.
> > >
> > >NOBBY
> >
>
>
>
>
>
>
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Templating help

2001-01-10 Thread Rasmus Lerdorf

> $template_file = "".$template_root."".$template_file."";

What are those empty strings supposed to do?  This is the same thing:

  $template_file = $template_root.$template_file;

> return implode("",(@file($template_file)));

Ack!  That's horrible.  Do this instead:

  $fp = fopen($template_file) or die("Unable to open $template_file");
  $file = fread($fp, filesize($template_file));
  fclose($fp);
  return $file;

> /* **
>* $template_type decides weather

Cool, make it snow.

> if ( $template_type == '0' )
> $template_contents =
> implode("",(@file($template_root.$template_file)));

See above

>
> if ( is_array ( $template_data ) && is_array ( $template_replace
> ) )
> {
>
> for ( $i=0; $i < count ( $template_replace ); $i++ )
> {
>
> $template_contents =
> str_replace("{".$template_replace[$i]."}", $template_data[$i],
> $template_contents);
>
> }

Whoa..

  foreach($template_replace as $key=>$val) {
  $template_contents =
str_replace('{'.$val.'}',$template_data[$key], $template_contents);
  }


-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Problème

2001-01-10 Thread Abdelghani Mekhoukh

Monsieur,
Premièrement et avant tout je vous souhaite une bonne année.
Je suis un débutant en PHP, et je veux l'installer comme un
module dans le serveur web Apache mais j'ai rencontré des
problèmes. Je tiens à vous signaler que je travaille sur la
plate forme WINDOWS NT 4.0 SERVER.
Pouvez vous s'il vous plaît me donner la méthode en détails
?
Je vous remercie préalablement.

__
Boîte aux lettres - Caramail - http://www.caramail.com




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


RE: [PHP] Problème

2001-01-10 Thread Dominick Vansevenant

Peut être essaye de écrir la message en anglais, ça va mieux.

D.

-Original Message-
From: Abdelghani Mekhoukh [mailto:[EMAIL PROTECTED]]
Sent: woensdag 10 januari 2001 12:45
To: [EMAIL PROTECTED]
Subject: [PHP] Problème


Monsieur,
Premièrement et avant tout je vous souhaite une bonne année.
Je suis un débutant en PHP, et je veux l'installer comme un
module dans le serveur web Apache mais j'ai rencontré des
problèmes. Je tiens à vous signaler que je travaille sur la
plate forme WINDOWS NT 4.0 SERVER.
Pouvez vous s'il vous plaît me donner la méthode en détails
?
Je vous remercie préalablement.

__
Boîte aux lettres - Caramail - http://www.caramail.com





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP vs. qmail

2001-01-10 Thread Teodor Cimpoesu

Hi Nicklas!
On Tue, 09 Jan 2001, Nicklas af Ekenstam wrote:

> I have a server running qmail and php on which I'm trying to do some php 
> processing of incoming e-mail.
> I have a virtual domain set up like this:
> 
> '.qmail-virtualdomain.com-default'
> which contains the following:
> '|/usr/local/php-4.0.1pl2/php /home/nille/script.php -q'
> 
nice :)

> What I would like to know is if there is a nice way of parsing out the body 
> of the incoming message and place that into a variable and also the same 
> thing with the subject so that I can process these using som regular 
> expressions and respond to certain keywords using custom templates.
> 
well, IIRC, the mail is available at the stdin, right? So in your script.php
you may do a fopen ("php://stdin") and read it. You can either save it to a
temporary file (assuming it's a big one) or process it in memory.

Now, I dunno if qmail also sends via environ the mail size, but I guess there
should be a way to figure it out.

Given the mail into a temp. file, you can use all imap_* functions on it, of
particular interest being imap_rfc822*() functions for example.

I once wrote a small and clumsy code for a freemail application (long ago) and
now I was considering something like that for preparsing of the mails at the
incoming time, not reading time as most do, so I'll dig too and if I find
something more interesting I'll let you know :)

cheers,

-- teodor

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Show output of program in realtime on website

2001-01-10 Thread Christian Reiniger

On Wednesday 10 January 2001 00:08, Stefan Scherf wrote:

> the program "main" produces x times an output with an delay of 1 second
> between each output.
>
> I want to show this output in "realtime" on a website (this should
> become a progress-bar).

> Does anybody know how to realise this?

Write a custom browser for this and tell all your visitors to use it. 
Seriously - you can't control how the browsers buffer the received data, 
when they render it etc.

That said - make sure that PHP output buffering is off

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Those who will not reason, are bigots,
those who cannot, are fools,
and those who dare not, are slaves.

- George Gordon Noel Byron (1788-1824), [Lord Byron]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Ping

2001-01-10 Thread Brad Hubbard

Unfortunately I added some code today to show the local time/date and
haven't tested them since ;)

If the machine being pinged is up it shows a green "Light" if it loses a
ping it'll show red and if it loses 5 in a row it's name goes red and there
should (this is the bit I haven't tested) be a time stamp next to it to show
when contact was lost.

This currently only works on a *nix system (I don't need to run it on M$)
and requires the GD library although
it would be a simple matter to change them to run without GD you also need
sessions with use_cookies enabled (php.ini).

Anyone is welcome to use these BTW, just drop me a line if you do (so I can
feel I'm "making a difference" ;)

Cheers,
Brad

- Original Message -
From: "Tshering Norbu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 20:03
Subject: [PHP] Ping


Dear list,
I have this proposal: I work in ISP where we have a web site. On our web
site, we would like to ping, say 3 other distant web sites at every interval
of 10 minutes. We would like to have the result like say " The internet is
down" message displayed on our homepage if the PING doesn't get reply. If
there is a reply, then nothing should be displayed. So I would like to know
the PHP functions/code to do that (i.e the PING function). I am sure that
can be done in PHP. Could someone please instruct me how to go about it.
Thanks.

NOBBY




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


php-general Digest 10 Jan 2001 11:42:10 -0000 Issue 446

2001-01-10 Thread php-general-digest-help


php-general Digest 10 Jan 2001 11:42:10 - Issue 446

Topics (messages 33587 through 33647):

AFTERBURNER - PHP CACHE
33587 by: Marcin Orlowski

Baby's First Regex! (Repost - Please Help)
33588 by: Murray Shields
33589 by: Ignacio Vazquez-Abrams
33590 by: Brian Clark
33591 by: Toby Butzon
33600 by: Murray Shields

replacing null characters
33592 by: Chris

php script
33593 by: Devin Atencio

HELP! PLEASE! Interfacing EMail to PHP
33594 by: Dieter Kneffel

include problem using windows
33595 by: Onaje Johnston

Re: looking for a PHP editor
33596 by: Arcady Genkin
33598 by: Arcady Genkin
33599 by: Jeffrey A. Stuart
33602 by: Josh G
33606 by: Jeffrey A. Stuart

FP_QUERY:  Make problem php 4.0.4
33597 by: Mark Olbert

snapshots
33601 by: Dan Phoenix
33603 by: Rasmus Lerdorf

Looking for a script
33604 by: PeterOblivion.aol.com
33605 by: Brian Clark

Passing a query result
33607 by: Todd Cary
33608 by: Toby Butzon
33610 by: Todd Cary
33611 by: Todd Cary
33613 by: Toby Butzon
33615 by: Todd Cary

Re: installing PHP4 on Apache on Win2000
33609 by: Tshering Norbu

Re: more shopping cart crap
33612 by: Tshering Norbu
33614 by: Tshering Norbu

MySQL Newbie ? -Help!
33616 by: Matt Stone
33618 by: Jason Brooke
33620 by: Matt Stone

Re: week of example code
33617 by: Tiger Quimpo

PHP newbie question
33619 by: Neil Zanella

mysql and php possibly causing problem
33621 by: James Mclean

oops forgot to add
33622 by: James Mclean

declaring variables in class definitions
33623 by: sam1600.iname.com
33635 by: Max A. Derkachev

Im having Trouble with File uploading,
33624 by: MacBane

Browser cache and form with $PHP_SELF
33625 by: Egan
33626 by: Hrishi
33627 by: Egan

Connect problem
33628 by: Maximiliano Bubenick

Shopping Cart Schema - Sessions
33629 by: Jason Beebe

Templating help
33630 by: Cameron
33642 by: Rasmus Lerdorf

Re: User Authentication Integration with NT
33631 by: Phil Driscoll

Ping
33632 by: Tshering Norbu
33633 by: DaViper
33636 by: Tshering Norbu
33641 by: DaViper
33647 by: Brad Hubbard

BCDIV problems
33634 by: Christian Fagerheim

Re: Speaking of OOP
33637 by: Neil Kimber

Compiling php-3.0.18 with Openldap-2.0.7 support!
33638 by: ndemeno.sdfparty.org

include & include_once, how do they work?
33639 by: William Bailey

Session cookie expiration
33640 by: Michal Thomka

Problème
33643 by: Abdelghani Mekhoukh
33644 by: Dominick Vansevenant

Re: PHP vs. qmail
33645 by: Teodor Cimpoesu

Re: Show output of program in realtime on website
33646 by: Christian Reiniger

Administrivia:

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

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

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


--




Anyone have played with Afterburner PHP cache (
http://bwcache.bware.it/ )? I'm curious the resutls ;)

Regards,
--
 You mean you have Windows98 and still have available memory?!?

 Marcin  http://wfmh.org.pl/~carlos/
   mailto:[EMAIL PROTECTED]






Hi all.

I have written my first regex's, which are simply used for validation of
input into a web form. Basically, they check to see if an invalid characters
are being entered, and is working perfectly. A different regex is used to
different types of input.

They are as follows

$Status = (ereg("^[A-Za-z0-9` !@#$%&()=:;\"\'.?/-]*$", $String));
$Status = (ereg("^[0-9 +-]*$", $String)); 0-9 [SPACE] + -
$Status = (ereg("^[A-Za-z`' -]*$", $String)); A-Z a-z ` - ' [SPACE]
$Status = (ereg("^[A-Z_]*$", $String)); A-Z _
$Status = (ereg("^[A-Z ]*$", $String)); A-Z [SPACE]
$Status = (ereg("^[0-9 ]*$", $String)); 0-9 [SPACE]
$Status = (ereg("^[A-Za-z0-9` @#$%&()=:;\"\'.?/-]*$", $String));

At the moment, the error message sent to the browser is along the lines of
"You have entered invalid characters. Please check and try again." However,
I would rather be able to tell them WHICH characters they entered represent
a problem.

How can I get a the list of characters tht causes one of these regex's to
fail?

==
Murray Shields  Email: [EMAIL PROTECTED]
MU Systems Pty Ltd  Phone: +61 7 3351 6677
Global Catalogs Pty Ltd Phone: +61 7 3351 4777





On Wed, 10 Jan 2001, Murray Shields wrote:

> Hi all.
>
> I have written my first regex's, which are simply

Re: [PHP] Shopping Cart Schema - Sessions

2001-01-10 Thread Teodor Cimpoesu

Hi Jason!
On Wed, 10 Jan 2001, Jason Beebe wrote:

> Hey, 
> 
> I'm looking for little information from those who have coded their own shopping cart 
>apps. what would you say the best way to setup a cart would be? more specificly, the 
>method for adding items to the cart.
> 
eww, lost wrapping ...

> say the user is broswing around. when they entered the website a new session was 
>created. when they go to add an item, what is the best way store variables (such as 
>what they bought and quantity) in the session. i have read that it is possible to put 
>all of your session variables in a single associative array. however, i have not had 
>any luck doing this myself. Under such a method of an array, how would i store each 
>item (product id and quantity, possibly price as well) in the cart into the session. 
>obviously i don't expect anyone to write an entire app. i am comfortable starting the 
>session, and doing th db extraction and presentation. i just need to know how to 
>store a variable in a session (passed through post) and how to extract it when need 
>be (considering it is an array). Thanks a lot!

I codded a shopping cart which allowed `thin sessions' and `fat sessions'.

Thin would mean I store only the IDs, then retrieve the rest of the
information about the product from the DB (more DB queries, but smaller
session data), while `fat' would mean I store all the data I need to display
when the user invetories his/her cart, namely name, price &|short desc.,
quantity.

Some code snippets would be:

if (!$SES->isRegistered ('cart.object')) {
 $CART = new Cart();
 $CART->setLanguage (CART_LANGUAGE);
 $SES->setAttribute ('cart.object', $CART);
}

$CART = &$SES->getAttribute ('cart.object');

then go ahead and use the cart object:
...
$CART->addItem ($sku, 1, new Product($arr_attr));
$CART->dropItem ($sku);

And the Product class has among others, these two methods:

 __setStorageType ($t) 
{  
if ($t == CART_FAT_SESS) {
$this->_slots = array_keys (get_object_vars ($this));
unset ($this->_slots['_desc']);
}
}

function __sleep ()
{
return  (isset ($this->_slots) ? $this->_slots : array ('_quant')); 
}

This is in the manner of Session class from PHPLIB which records what is to
be saved in the session (in this case, what attributes.)

And the Cart class has:

function __wakeup ()
{
 if ($this->STORAGE == CART_THIN_SESS) {
$pr_attrs = Cart::getItemsAttr (array_keys($this->_items));

foreach ($pr_attrs as $sku => $attrs) {
$attrs['quant'] = $this->_items[$sku]->getQuantity();
$this->_items[$sku] = new Product ($attrs);
}
 }
}

Note that __sleep() and __wakeup() are PHP serialisation hooks, which can customize
the marshalling/unmarshalling process (e.g. restore DB connections, etc.)

cheers,

-- teodor

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Show output of program in realtime on website

2001-01-10 Thread Brad Hubbard

I've seen this done with some CGI (not PHP) programs like online traceroutes
and things.

Is there something you can do with a CGI lib that facilitates this?

Cheers,
Brad

- Original Message -
From: "Christian Reiniger" <[EMAIL PROTECTED]>
To: "Stefan Scherf" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 22:21
Subject: Re: [PHP] Show output of program in realtime on website


On Wednesday 10 January 2001 00:08, Stefan Scherf wrote:

> the program "main" produces x times an output with an delay of 1 second
> between each output.
>
> I want to show this output in "realtime" on a website (this should
> become a progress-bar).

> Does anybody know how to realise this?

Write a custom browser for this and tell all your visitors to use it.
Seriously - you can't control how the browsers buffer the received data,
when they render it etc.

That said - make sure that PHP output buffering is off

--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Those who will not reason, are bigots,
those who cannot, are fools,
and those who dare not, are slaves.

- George Gordon Noel Byron (1788-1824), [Lord Byron]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Show output of program in realtime on website

2001-01-10 Thread Stefan Scherf

""Brad Hubbard"" <[EMAIL PROTECTED]> schrieb:
> Is there something you can do with a CGI lib that facilitates this?

this one works:

$fp = popen ("ping www.test.de -c 20", "r"); // output with delay
// $fp = popen ("main", "r");// one output, no delay
while( $zeile=fgets($fp,100) ) {
   echo $zeile."";
   flush();  // flush output-buffer
}

maybe the problem is in the c-programm "main":

int main() {
   int i;
   for(i=0;i<10;i++) {
  printf("Output: %i\n",i);
  sleep(1);
   }
   return;
}

any suggestions?

Stefan



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Show output of program in realtime on website

2001-01-10 Thread Brad Hubbard

Have you tried passthru() instead of popen() ?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Shopping Cart Schema - Sessions

2001-01-10 Thread Paul K Egell-Johnsen

Jason Beebe wrote:
> 
> Hey,
> 
> I'm looking for little information from those who have coded their own shopping cart 
>apps. what would you say the best way to setup a cart would be? more specificly, the 
>method for adding items to the cart.
> 
> say the user is broswing around. when they entered the website a new session was 
>created. when they go to add an item, what is the best way store variables (such as 
>what they bought and quantity) in the session. i have read that it is possible to put 
>all of your session variables in a single associative array. however, i have not had 
>any luck doing this myself. Under such a method of an array, how would i store each 
>item (product id and quantity, possibly price as well) in the cart into the session. 
>obviously i don't expect anyone to write an entire app. i am comfortable starting the 
>session, and doing th db extraction and presentation. i just need to know how to 
>store a variable in a session (passed through post) and how to extract it when need 
>be (considering it is an array). Thanks a lot!

A session cookie can be of max 4096 bytes, so there is a limit to what
you can set. Also it is (I'm not sure if this is part of the cookie
standard) a general standard that only the supplier sites name and the
user's ID should be stored, nothing else.

Instead you can use the session id as the id of tables used for storing
info:

session_id
key
value

Then you could store key value pairs in say a database. The above
example is, btw, a misuse of relational databases, and should not be
taken as the way of doing things.

You should use a databaase in the background and store info in tables, a
structure might be something like:

customer_history
---
session_id
cart_id

cart
-
id
total
date

cart_item
---
cart_id
item_id
quantity
price_pr_unit

item
---
id
name

In this structure you can give each customer a number of carts (ie,
previous orders), you can let each cart have several items, you will
know the quantity of each item, and the item price for this (allowing
for prices which are variable with price/discounts).

You should also consider that you don't want people to register until
checkout (just to mention this), if they aren't registered customers
from before.

If you want to read more about this, take a look at
http://developer.ez.no where you can learn about eZ trade which has
implemented such a shopping cart system. You'll find code, examples,
design documents, administration documents and discussions covering this
software. The software is free under the GNU GPL.

-- 
Paul K Egell-Johnsen
Developer/PR Manager
eZ systems as
http://ez.no/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Changing passwords

2001-01-10 Thread A.D. Vijverberg

Hello,

i have got a question I can't find the answer to. I want to enable my users
to change their password for a intranet and their mail account (different
machine than the Intranet). i want my users to do this throug a web
interface on the intranet. Can anyone tell me how I can make an app to do
this in PHP. If a password chang request is made, the old password has to be
validated to prevent others to change the password while the computer is
logged on to the intranet but the person of that system is away for some
reason.

And how can I change the password on the standalone mailserver (using the
same concept as above) which is an other machine as the machine my Intranet
runs on.

The machine for the Intranet is a suse 7.0 machine and the mailserver is a
normal pc running Sun Solaris 2.6 intel.

Thanx in advance.

Kind regards,

A.D. Vijverberg


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/standard exec.c

2001-01-10 Thread Thies C. Arntzen

thies   Wed Jan 10 05:08:14 2001 EDT

  Modified files:  
/php4/ext/standard  exec.c 
  Log:
  exec'd processes now get cleaned up even if the browser connections was 
  aborted. 
  fixes: #8143
  
  
Index: php4/ext/standard/exec.c
diff -u php4/ext/standard/exec.c:1.44 php4/ext/standard/exec.c:1.45
--- php4/ext/standard/exec.c:1.44   Mon Jan  8 08:39:39 2001
+++ php4/ext/standard/exec.cWed Jan 10 05:08:14 2001
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf   |
+--+
  */
-/* $Id: exec.c,v 1.44 2001/01/08 16:39:39 stas Exp $ */
+/* $Id: exec.c,v 1.45 2001/01/10 13:08:14 thies Exp $ */
 
 #include 
 #include "php.h"
@@ -23,6 +23,7 @@
 #include "php_string.h"
 #include "safe_mode.h"
 #include "ext/standard/head.h"
+#include "ext/standard/file.h"
 #include "exec.h"
 #include "php_globals.h"
 #include "SAPI.h"
@@ -45,6 +46,7 @@
int buflen = 0;
int t, l, ret, output=1;
int overflow_limit, lcmd, ldir;
+   int rsrc_id;
char *b, *c, *d=NULL;
PLS_FETCH();
 
@@ -116,6 +118,13 @@
array_init(array);
}
}
+
+   /* we register the resource so that case of an aborted connection the 
+* fd gets pclosed
+*/
+
+   rsrc_id = ZEND_REGISTER_RESOURCE(NULL, fp, php_file_le_fopen());
+
if (type != 3) {
l=0;
while ( !feof(fp) || l != 0 ) {
@@ -183,8 +192,10 @@
if (output) (void)PUTC(buf[i]);
}
}
+
+   /* the zend_list_delete will pclose our popen'ed process */
+   zend_list_delete(rsrc_id); 

-   ret = pclose(fp);
 #if HAVE_SYS_WAIT_H
if (WIFEXITED(ret)) {
ret = WEXITSTATUS(ret);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] looking for a PHP editor

2001-01-10 Thread Chris Hayes


> I went to their homepage, and couldn't find a link to download
> the actual program, just some example stuff, and it says "coming
> soon"... Is it out there somewhere and I'm just retarded, or are
> you mob on a beta list or something???

www.codecharge.com/download

Their homepage is sort of hidden because it's still in beta.
Like in the version i downloaded the generated code gave a lot of PHP errors.
I understand they are working on it every day, sometimes it works, sometimes 
not.

Also my trial period was only 1 day due to some error.


Chris




--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --


 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Adding comma's to numeric string

2001-01-10 Thread Timothy G. Wells

Greetings,

Any efficient ideas how to make any number readable by adding comma's?

i.e. 300  ==>  3,000,000

Thanks,

-- Tim Wells


--
 Timothy G. Wells, CEOGood News Internet Services
 [EMAIL PROTECTED]   http://www.goodnews.net 
 voice 513-662-4443 x 11 fax 513-662-8461

  Everything You Need To Succeed On the Internet


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Adding comma's to numeric string

2001-01-10 Thread Cynic

number_format()

At 14:16 10.1. 2001, Timothy G. Wells wrote the following:
-- 
>Greetings,
>
>Any efficient ideas how to make any number readable by adding comma's?
>
>i.e. 300  ==>  3,000,000
>
>Thanks,
>
>-- Tim Wells
>
>
>--
> Timothy G. Wells, CEOGood News Internet Services
> [EMAIL PROTECTED]   http://www.goodnews.net 
> voice 513-662-4443 x 11 fax 513-662-8461
>
>  Everything You Need To Succeed On the Internet
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
--end of quote-- 




Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] iptc fields

2001-01-10 Thread Markus H. Maussner

hi..

is there a solution how i can get all iptc fields out of an immage ?

i tried the 'iptcparse' command wich works quiet well.. just that anny
commas are taken out..
like from the original field 
'red,dog,cat' i just get
'cat' or like
'this, i want to show' returns
'i want to show'

for anny hints i am thankfull

markus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] gdImageCreateFromGif compile

2001-01-10 Thread \"Cyb\"

I think that above GD1.3 Gif is no longer supported, you have to switch
to PNG.

Cheers,

Al


Dan Harrington wrote:
> 
> Hello all,
> 
> I've installed: libpng-1.08, tiff-v3.5.5, zlib-1.1.3, freetype-2.0,
> pdflib-3.03, and gd-1.8.3
> reconfigured ldconfig, and I configured with:
> 
> ./configure --with-apache=../apache_1.3.12 --enable-gd-imgstrttf --with-gd=.
> ./gd-1.8.3 \
> --with-jpeg-dir --with-zlib-dir --with-png-dir --with-tiff-dir --with-pgsql
> --with-zlib
> 
> and now I get:
> 
> gcc  -I. -I/usr/local/src/php-4.0.4/ext/gd -I/usr/local/src/php-4.0.4/main -
> I/us
> r/local/src/php-4.0.4 -I/usr/local/src/apache_1.3.12/src/include -I/usr/loca
> l/sr
> c/apache_1.3.12/src/os/unix -I/usr/local/src/php-4.0.4/Zend -I/usr/local/src
> /gd-
> 1.8.3 -I/usr/local/src/php-4.0.4/ext/mysql/libmysql -I/usr/local/src/php-4.0
> .4/e
> xt/xml/expat/xmltok -I/usr/local/src/php-4.0.4/ext/xml/expat/xmlparse -I/usr
> /loc
> al/src/php-4.0.4/TSRM  -DXML_BYTE_ORDER=12 -g -O2  -c gd.c && touch gd.lo
> 
> gd.c: In function `php_if_imagecreatefromgif':
> gd.c:703: `gdImageCreateFromGif' undeclared (first use in this function)
> gd.c:703: (Each undeclared identifier is reported only once
> gd.c:703: for each function it appears in.)
> gd.c: In function `php_if_imagegif':
> gd.c:862: `gdImageGif' undeclared (first use in this function)
> 
> I thought that all my includes were correct.  What's going on?
> Thank you
> Dan Harrington
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] looking for a PHP editor

2001-01-10 Thread defender of the protocol

the specialized editors for php are bs, you don't need an IDE to script 
your web page or anything else for that matter

http://www.ultraedit.com

go get a copy of UltraEdit, download the wordfile for php syntax so it 
highlights properly, and you're set

http://www.ultraedit.com/downloads/additional.html

i'm sure someone on this list has said this before

- jeremy

At 07:49 PM 1/9/2001, you wrote:

> > I went to their homepage, and couldn't find a link to download
> > the actual program, just some example stuff, and it says "coming
> > soon"... Is it out there somewhere and I'm just retarded, or are
> > you mob on a beta list or something???
>
>www.codecharge.com/download
>
>Their homepage is sort of hidden because it's still in beta.
>Like in the version i downloaded the generated code gave a lot of PHP errors.
>I understand they are working on it every day, sometimes it works, sometimes
>not.
>
>Also my trial period was only 1 day due to some error.
>
>
>Chris
>
>
>
>
>--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Fields to large for php3

2001-01-10 Thread Paul Lewis

I have an application that stores large text fields in MS SQL SVR and when
they are entered on-line everything works fine.  The problem begins when I
try to retrieve them from the database and populate a field on the php3
on-line form.  The query will only return the first 4096 byte of the
information in the data base field.

I have been told there is a work around, but don't know where to find it.
Splitting the field up in to smaller chunks is not an option.

Can anyone help me with this problem.

Thanks
PaulL


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] looking for a PHP editor

2001-01-10 Thread Markus H. Maussner

hi..

..i am curious if theres anny linux (x, KDE, Gnome) php editor with syntax
highliting and this things...

markus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] looking for a PHP editor

2001-01-10 Thread Daniel Solin

One word: VIM !!!

If you want an editor for X - use gvim.

On Wed, Jan 10, 2001 at 02:50:53PM +0100, Markus H. Maussner wrote:
> hi..
> 
> ..i am curious if theres anny linux (x, KDE, Gnome) php editor with syntax
> highliting and this things...
> 
> markus
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
Daniel Solin
System Engineer
Carambole Karlstad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] looking for a PHP editor

2001-01-10 Thread Pavel Jartsev

"Markus H. Maussner" wrote:
> 
> hi..
> 
> ..i am curious if theres anny linux (x, KDE, Gnome) php editor with syntax
> highliting and this things...
> 

bluefish is quite nice.
http://bluefish.openoffice.nl/

-- 
Pavel a.k.a. Papi

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/ircg ircg.c

2001-01-10 Thread Sascha Schumann

sas Wed Jan 10 05:50:26 2001 EDT

  Modified files:  
/php4/ext/ircg  ircg.c 
  Log:
  Remove unused channel element from the php_irconn structure.
  
  Remove unnecessary check when freeing custom format messages.
  
  Improve handling, if send(2) fails.
  
  
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.10 php4/ext/ircg/ircg.c:1.11
--- php4/ext/ircg/ircg.c:1.10   Tue Jan  9 00:00:23 2001
+++ php4/ext/ircg/ircg.cWed Jan 10 05:50:25 2001
@@ -65,7 +65,6 @@
 typedef struct {
irconn_t conn;
const char *username;
-   const char *channel;
zend_llist buffer;
int fd;
int irconn_id;
@@ -89,7 +88,7 @@
 
 php_irconn_t *lookup_irconn(int id)
 {
-   php_irconn_t **ret = NULL;
+   php_irconn_t **ret;
 
if (zend_hash_index_find(&h_irconn, id, (void **) &ret) == FAILURE)
return NULL;
@@ -109,17 +108,19 @@
 
smart_str_free_ex(msg, 1);
 }
+
 static void quit_handler(irconn_t *c, void *dummy)
 {
php_irconn_t *conn = dummy;
int i;
 
-   if (conn->fd != -1) 
+   if (conn->fd > -1) 
zend_hash_index_del(&h_fd2irconn, conn->fd);
+   conn->fd = -2;
zend_hash_index_del(&h_irconn, conn->irconn_id);

for (i = 0; i < NO_FMTS; i++) {
-   if (conn->fmt_msgs[i] && conn->fmt_msgs[i] != fmt_msgs_default[i]) 
free(conn->fmt_msgs[i]);
+   if (conn->fmt_msgs[i]) free(conn->fmt_msgs[i]);
}
free((char *) conn->username);
 
@@ -282,11 +283,21 @@
 {
zend_llist_clean(&conn->buffer);
 }
+   
+static void http_closed_connection(int fd);
 
 static void msg_send(php_irconn_t *conn, smart_str *msg)
 {
if (conn->fd != -1) {
-   send(conn->fd, msg->c, msg->len, 0);
+   int n;
+
+   n = send(conn->fd, msg->c, msg->len, 0);
+
+   if ((n == -1 && errno == EPIPE) || n == 0) { 
+   http_closed_connection(conn->fd);
+   }
+   } else if (conn->fd == -2) {
+   /* do nothing */
} else {
smart_str msg2 = {0};
 
@@ -519,7 +530,6 @@
 */
conn = malloc(sizeof(*conn));
conn->username = strdup(username);
-   conn->channel = NULL,
conn->fd = -1;
if (p4) {
HashTable *h;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] looking for a PHP editor

2001-01-10 Thread William Bailey

Try Nedit.

http://www.nedit.org

On 2001.01.10 13:50:53 + Markus H. Maussner wrote:
> hi..
> 
> ..i am curious if theres anny linux (x, KDE, Gnome) php editor with
> syntax
> highliting and this things...
> 
> markus
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 

Thanks,
William.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] looking for a PHP editor

2001-01-10 Thread Alexander Wagner

Markus H. Maussner wrote:
> ...i am curious if theres anny linux (x, KDE, Gnome) php editor with syntax
> highliting and this things...

emacs and xemacs shouldn't be forgotten here.

Wagner

-- 
One maniac alone can do what 20 together cannot

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] looking for a PHP editor

2001-01-10 Thread Miles Thompson

Editors are like hammers - once you get used to one, well that's what you 
use because you know how it behaves. For a Windows environment I'll endorse 
jeremy's recommendation of Ultraedit -- my hammer of choice. It offers some 
neat features: tons of macros and word files for various languages, 
multiple windows into same document, an easily used column mode that just 
great for picking a list of fields from one file and inserting into another.

Need hex? Click on the "H" button on the toolbar.

Need wordwrapping? There's a wrap button, and wraps can be soft or hard.

Need to change formatting between DOS and Unix/MAC? Click of a button.

For Linx, etc.? I don't have a hammer yet. I feel obligated to use VIM, but 
I cut my teeth on WordStar for CP/M so Joe is comfortable, but I'm leaning 
towards Jed. I find VIM very arcane, but if it's your hammer of choice, go 
for it.

And if you have the horsepower, in the Linux GUI there's Bluefish -- looks 
quite nice.

Finally, don't forget AMAYA, but you won't find and PHP add-ons.

Now, can we pick one and get back to work?

Cheers - Miles

PS I really liked yesterday's comment that " Real Programmers cat 
/dev/audio > myprog and hiss machine code into the mic". Kewl!! //mt

At 08:35 AM 01/10/2001 -0500, defender of the protocol wrote:
>the specialized editors for php are bs, you don't need an IDE to script 
>your web page or anything else for that matter
>
>http://www.ultraedit.com
>
>go get a copy of UltraEdit, download the wordfile for php syntax so it 
>highlights properly, and you're set
>
>http://www.ultraedit.com/downloads/additional.html
>
>i'm sure someone on this list has said this before
>
>- jeremy
>
>At 07:49 PM 1/9/2001, you wrote:
>
>> > I went to their homepage, and couldn't find a link to download
>> > the actual program, just some example stuff, and it says "coming
>> > soon"... Is it out there somewhere and I'm just retarded, or are
>> > you mob on a beta list or something???
>>
>>www.codecharge.com/download
>>
>>Their homepage is sort of hidden because it's still in beta.
>>Like in the version i downloaded the generated code gave a lot of PHP errors.
>>I understand they are working on it every day, sometimes it works, sometimes
>>not.
>>
>>Also my trial period was only 1 day due to some error.
>>
>>
>>Chris
>>
>>
>>
>>
>>--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --
>>
>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: [EMAIL PROTECTED]
>>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] looking for a PHP editor

2001-01-10 Thread Toby Miller

The editors that I usually use are Textpad and Jedit. I usually use Textpad
as it's my favorite editor. Jedit is very similar to Textpad which is why
it's my second favorite editor. The bonus of using Jedit is that it's
written entirely in Java so it also runs in Linux (quite well too). You can
download them both here:

http://www.textpad.com/
http://jedit.sourceforge.net/

They both provide color syntax highlighting for PHP (as well as just about
everything else) and both have loads of extra features (much like those of
UltraEdit). So if this is the sort of editor you're looking for these are
both worth a look see.

As far as Linux goes, Jedit is the only editor I've been able to find that
compares against something like Textpad or UltraEdit.

-Toby

- Original Message -
From: "Miles Thompson" <[EMAIL PROTECTED]>
To: "defender of the protocol" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 9:50 AM
Subject: Re: [PHP] looking for a PHP editor


> Editors are like hammers - once you get used to one, well that's what you
> use because you know how it behaves. For a Windows environment I'll
endorse
> jeremy's recommendation of Ultraedit -- my hammer of choice. It offers
some
> neat features: tons of macros and word files for various languages,
> multiple windows into same document, an easily used column mode that just
> great for picking a list of fields from one file and inserting into
another.
>
> Need hex? Click on the "H" button on the toolbar.
>
> Need wordwrapping? There's a wrap button, and wraps can be soft or hard.
>
> Need to change formatting between DOS and Unix/MAC? Click of a button.
>
> For Linx, etc.? I don't have a hammer yet. I feel obligated to use VIM,
but
> I cut my teeth on WordStar for CP/M so Joe is comfortable, but I'm leaning
> towards Jed. I find VIM very arcane, but if it's your hammer of choice, go
> for it.
>
> And if you have the horsepower, in the Linux GUI there's Bluefish -- looks
> quite nice.
>
> Finally, don't forget AMAYA, but you won't find and PHP add-ons.
>
> Now, can we pick one and get back to work?
>
> Cheers - Miles
>
> PS I really liked yesterday's comment that " Real Programmers cat
> /dev/audio > myprog and hiss machine code into the mic". Kewl!! //mt
>
> At 08:35 AM 01/10/2001 -0500, defender of the protocol wrote:
> >the specialized editors for php are bs, you don't need an IDE to script
> >your web page or anything else for that matter
> >
> >http://www.ultraedit.com
> >
> >go get a copy of UltraEdit, download the wordfile for php syntax so it
> >highlights properly, and you're set
> >
> >http://www.ultraedit.com/downloads/additional.html
> >
> >i'm sure someone on this list has said this before
> >
> >- jeremy
> >
> >At 07:49 PM 1/9/2001, you wrote:
> >
> >> > I went to their homepage, and couldn't find a link to download
> >> > the actual program, just some example stuff, and it says "coming
> >> > soon"... Is it out there somewhere and I'm just retarded, or are
> >> > you mob on a beta list or something???
> >>
> >>www.codecharge.com/download
> >>
> >>Their homepage is sort of hidden because it's still in beta.
> >>Like in the version i downloaded the generated code gave a lot of PHP
errors.
> >>I understand they are working on it every day, sometimes it works,
sometimes
> >>not.
> >>
> >>Also my trial period was only 1 day due to some error.
> >>
> >>
> >>Chris
> >>
> >>
> >>
> >>
> >>--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --
> >>
> >>
> >>
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Shorter way for "each"

2001-01-10 Thread Moritz Petersen

Hi,

is there a shorter way to do:

while (list($key, $value) = each($my_array))
{
echo $value...
}

I just need the value!

Thanks,
Mo.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /sapi/thttpd thttpd.c

2001-01-10 Thread Sascha Schumann

sas Wed Jan 10 05:51:58 2001 EDT

  Modified files:  
/php4/sapi/thttpd   thttpd.c 
  Log:
  Especially on FreeBSD it seems to be common that send(2) does not
  do a decent job.  We handle that better now.
  
  
Index: php4/sapi/thttpd/thttpd.c
diff -u php4/sapi/thttpd/thttpd.c:1.32 php4/sapi/thttpd/thttpd.c:1.33
--- php4/sapi/thttpd/thttpd.c:1.32  Tue Jan  9 01:01:33 2001
+++ php4/sapi/thttpd/thttpd.c   Wed Jan 10 05:51:58 2001
@@ -42,17 +42,26 @@
 static int sapi_thttpd_ub_write(const char *str, uint str_length)
 {
int n;
+   uint sent = 0;  
TLS_FETCH();

-   n = send(TG(hc)->conn_fd, str, str_length, 0);
+   while (str_length > 0) {
+   n = send(TG(hc)->conn_fd, str, str_length, 0);
 
-   if (n == -1 && errno == EPIPE) {
-   php_handle_aborted_connection();
-   }
+   if (n == -1 && errno == EPIPE)
+   php_handle_aborted_connection();
+   if (n == -1 && errno == EAGAIN)
+   continue;
+   if (n <= 0) 
+   return n;
 
-   TG(hc)->bytes += n;
+   TG(hc)->bytes += n;
+   str += n;
+   sent += n;
+   str_length -= n;
+   }
 
-   return n;
+   return sent;
 }
 
 static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers SLS_DC)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] looking for a PHP editor

2001-01-10 Thread Alexander Wagner

Toby Miller wrote:
> As far as Linux goes, Jedit is the only editor I've been able to find that
> compares against something like Textpad or UltraEdit.

It should be stated here that vi (vim, gvim) and emacs (xemacs) belong to a 
different class of editor.
If you know how to handle them (which may include learning a few words of 
lisp in the case of emacs), you have an extremely powerful editor that can do 
anything you want. This may not be an easy task, but it is no coincidence 
that especially programmers use these editors.

This is why they cannot really be compared with Textpad or Ultraedit.

Wagner

-- 
One maniac alone can do what 20 together cannot

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/sablot config.m4 /ext/xml config.m4

2001-01-10 Thread Rui Hirokawa

hirokawaWed Jan 10 06:41:02 2001 EDT

  Modified files:  
/php4/ext/sablotconfig.m4 
/php4/ext/xml   config.m4 
  Log:
  disable directory search for libexpat and disable some macros for libxml-1.95.
  
Index: php4/ext/sablot/config.m4
diff -u php4/ext/sablot/config.m4:1.10 php4/ext/sablot/config.m4:1.11
--- php4/ext/sablot/config.m4:1.10  Tue Jan  9 14:15:56 2001
+++ php4/ext/sablot/config.m4   Wed Jan 10 06:41:01 2001
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.10 2001/01/09 22:15:56 hirokawa Exp $
+dnl $Id: config.m4,v 1.11 2001/01/10 14:41:01 hirokawa Exp $
 dnl config.m4 for extension Sablot
 
 PHP_ARG_WITH(expat-dir, for Sablotron XSL support,
@@ -37,6 +37,7 @@
   testval=no
   for i in $PHP_EXPAT_DIR $SABLOT_DIR; do
 if test -f $i/lib/libexpat.a -o -f $i/lib/libexpat.so; then
+  AC_DEFINE(HAVE_LIBEXPAT2,1,[ ])
   AC_ADD_LIBRARY_WITH_PATH(expat, $i/lib)
   AC_CHECK_LIB(sablot, SablotSetEncoding, AC_DEFINE(HAVE_SABLOT_SET_ENCODING,1,[ 
]))
   testval=yes
Index: php4/ext/xml/config.m4
diff -u php4/ext/xml/config.m4:1.23 php4/ext/xml/config.m4:1.24
--- php4/ext/xml/config.m4:1.23 Thu Jan  4 22:36:51 2001
+++ php4/ext/xml/config.m4  Wed Jan 10 06:41:01 2001
@@ -1,5 +1,5 @@
 # $Source: /local/repository/php4/ext/xml/config.m4,v $
-# $Id: config.m4,v 1.23 2001/01/05 06:36:51 hirokawa Exp $
+# $Id: config.m4,v 1.24 2001/01/10 14:41:01 hirokawa Exp $
 
 dnl Fallback for --with-xml[=DIR]
 AC_ARG_WITH(xml,[],enable_xml=$withval)
@@ -17,17 +17,9 @@
 
 if test "$PHP_XML" != "no"; then
 
-  AC_MSG_CHECKING(for expat in default path)
-  for i in /usr/local /usr; do
-if test -r $i/include/expat.h; then
-  EXPAT_DIR=$i
-  AC_MSG_RESULT(found in $i)
-fi
-  done
-
   AC_DEFINE(HAVE_LIBEXPAT, 1, [ ])
 
-  if test -z "$EXPAT_DIR"; then
+  if test "$PHP_XML" = "yes"; then
 CPPFLAGS="$CPPFLAGS -DXML_BYTE_ORDER=$order"
 EXPAT_INTERNAL_LIBADD="expat/libexpat.la"  
 PHP_SUBST(EXPAT_INTERNAL_LIBADD)
@@ -44,10 +36,10 @@
 
   else
 
-if test -f $EXPAT/lib/libexpat.a -o -f $EXPAT_DIR/lib/libexpat.so ; then
+EXPAT_DIR="$withval"
+if test -f $EXPAT_DIR/lib/libexpat.a -o -f $EXPAT_DIR/lib/libexpat.so ; then
 AC_DEFINE(HAVE_LIBEXPAT2, 1, [ ])
 AC_ADD_INCLUDE($EXPAT_DIR/include)
-   AC_ADD_LIBRARY(expat)
 else
 AC_MSG_RESULT(not found)
 AC_MSG_ERROR(Please reinstall the expat distribution)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Shorter way for "each"

2001-01-10 Thread Cynic

while( list( , $value ) = each( $my_array) )
or
foreach( $my_array as $value ) 


At 16:16 10.1. 2001, Moritz Petersen wrote the following:
-- 
>Hi,
>
>is there a shorter way to do:
>
>while (list($key, $value) = each($my_array))
>{
>echo $value...
>}
>
>I just need the value!
>
>Thanks,
>Mo.
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
--end of quote-- 




Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] looking for a PHP editor

2001-01-10 Thread Matthew Mundy

Has anyone mentioned Bluefish?  I was using code crusader till I tried it
yesterday.  It blows away both jcc, emacs, xemacs, and gvim.
---Matt
On Wed, 10 Jan 2001, Toby Miller wrote:

> The editors that I usually use are Textpad and Jedit. I usually use Textpad
> as it's my favorite editor. Jedit is very similar to Textpad which is why
> it's my second favorite editor. The bonus of using Jedit is that it's
> written entirely in Java so it also runs in Linux (quite well too). You can
> download them both here:
> 
> http://www.textpad.com/
> http://jedit.sourceforge.net/
> 
> They both provide color syntax highlighting for PHP (as well as just about
> everything else) and both have loads of extra features (much like those of
> UltraEdit). So if this is the sort of editor you're looking for these are
> both worth a look see.
> 
> As far as Linux goes, Jedit is the only editor I've been able to find that
> compares against something like Textpad or UltraEdit.
> 
> -Toby
> 
> - Original Message -
> From: "Miles Thompson" <[EMAIL PROTECTED]>
> To: "defender of the protocol" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Wednesday, January 10, 2001 9:50 AM
> Subject: Re: [PHP] looking for a PHP editor
> 
> 
> > Editors are like hammers - once you get used to one, well that's what you
> > use because you know how it behaves. For a Windows environment I'll
> endorse
> > jeremy's recommendation of Ultraedit -- my hammer of choice. It offers
> some
> > neat features: tons of macros and word files for various languages,
> > multiple windows into same document, an easily used column mode that just
> > great for picking a list of fields from one file and inserting into
> another.
> >
> > Need hex? Click on the "H" button on the toolbar.
> >
> > Need wordwrapping? There's a wrap button, and wraps can be soft or hard.
> >
> > Need to change formatting between DOS and Unix/MAC? Click of a button.
> >
> > For Linx, etc.? I don't have a hammer yet. I feel obligated to use VIM,
> but
> > I cut my teeth on WordStar for CP/M so Joe is comfortable, but I'm leaning
> > towards Jed. I find VIM very arcane, but if it's your hammer of choice, go
> > for it.
> >
> > And if you have the horsepower, in the Linux GUI there's Bluefish -- looks
> > quite nice.
> >
> > Finally, don't forget AMAYA, but you won't find and PHP add-ons.
> >
> > Now, can we pick one and get back to work?
> >
> > Cheers - Miles
> >
> > PS I really liked yesterday's comment that " Real Programmers cat
> > /dev/audio > myprog and hiss machine code into the mic". Kewl!! //mt
> >
> > At 08:35 AM 01/10/2001 -0500, defender of the protocol wrote:
> > >the specialized editors for php are bs, you don't need an IDE to script
> > >your web page or anything else for that matter
> > >
> > >http://www.ultraedit.com
> > >
> > >go get a copy of UltraEdit, download the wordfile for php syntax so it
> > >highlights properly, and you're set
> > >
> > >http://www.ultraedit.com/downloads/additional.html
> > >
> > >i'm sure someone on this list has said this before
> > >
> > >- jeremy
> > >
> > >At 07:49 PM 1/9/2001, you wrote:
> > >
> > >> > I went to their homepage, and couldn't find a link to download
> > >> > the actual program, just some example stuff, and it says "coming
> > >> > soon"... Is it out there somewhere and I'm just retarded, or are
> > >> > you mob on a beta list or something???
> > >>
> > >>www.codecharge.com/download
> > >>
> > >>Their homepage is sort of hidden because it's still in beta.
> > >>Like in the version i downloaded the generated code gave a lot of PHP
> errors.
> > >>I understand they are working on it every day, sometimes it works,
> sometimes
> > >>not.
> > >>
> > >>Also my trial period was only 1 day due to some error.
> > >>
> > >>
> > >>Chris
> > >>
> > >>
> > >>
> > >>
> > >>--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --
> > >>
> > >>
> > >>
> > >>
> > >>--
> > >>PHP General Mailing List (http://www.php.net/)
> > >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >>For additional commands, e-mail: [EMAIL PROTECTED]
> > >>To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >For additional commands, e-mail: [EMAIL PROTECTED]
> > >To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-

Re: [PHP] Shorter way for "each"

2001-01-10 Thread Alexander Wagner

Moritz Petersen wrote:
> is there a shorter way to do:
>
> while (list($key, $value) = each($my_array))
> {
>   echo $value...
> }
>
> I just need the value!

PHP3:
while (list(, $value) = each($my_array))
{
 echo $value...
}

PHP4:
foreach ($my_array as $value)
{
echo $value...
}

manual/control-structures.foreach.php

Wagner

-- 
One maniac alone can do what 20 together cannot

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] to be persistent connected or not to be persistent connected

2001-01-10 Thread Kayra Otaner

Hi,

I am searching for detailed information about persistent connection. I've
looked at all the web sites just for "persistent" word but always I found
the same information. All the time people are saying "persistent connection
is good if you are dealing with lots of small queries".

Here is my case: This week I've upgraded necessary server software to the
latest versions of Php and Apache (Php 4.04 and Apache 1.3.14) As I did
before upgrade I've compiled Php as an Apache Static Module ( mod_so is not
necessary ) And check MySQL for persistent connection. My site is focused on
free web services like graphic counter, polls, url redirection, webring and
news syndication to personal web sites. (www.kelalaka.net, it is Turkish
only). Only for graphic counter services, it counts 180.000+ hits per day.
It means 350.000+ queries per day. Day average is 250 query , 60 connection
per minute, but in popular hours it is very high and MySQL server gives "Too
many connections" errors. MySQL server is default and set to 100 connection
at most.

Yesterday I ordered more ram in order to increase connection number of MySQL
from 100 to 200+ connection. But today I realized that my server wasn't work
with persistent connection.
All the Php code contains mysql_pconnect for MySQL connections. Apache and
Php works in module type not in cgi mode. I've looked at phpinfo() in order
to see anything that can indicate status of persistent connection.  It says
"mysql.allow_persistent is On". But again in phpinfo it says "Active
Persistent Links 1" . It is sometime changes to "0". In MySQL I am looking
for active processess by using "mysql" and "show processlist" commands it
shows me 100 active links but most of them are in sleep state. In php.ini
there is a line in order to set maximum number of persistent connection and
I set it to just 25.
If somebody uses mysql_pconnect's instead of mysql_connect in Php cgi mode,
he doesn't see any error messages. All mysql_pconnects work like
mysql_connect.

My questions :
1 - How can users exactly determine whether they are using Php as a module
or cgi mode? (from phpinfo or ..?)
2 - Is it sufficient Php and Apache compiled in static or dynamic module
version in order to use mysql_pconnects in Php code? Anything to do with
MySQL?
3 - In a Apache + Php module compiled system is it normal to reach more than
predefined connection number in php.ini? (100 active connection but 25
defined in php.ini. In phpinfo shows same settings in the php.ini file (it
shows 25 max persistent connection))
4 - Is there any web page containing a real how-to and tutorial about
persistent connection? (If not I will certainly prepare one in a few weeks
:-))

Any kind of help will be appreciated...


Kayra Otaner
www.kelalaka.net





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Shorter way for "each"

2001-01-10 Thread Moritz Petersen

That's it. Thank you!

> -Original Message-
> From: Alexander Wagner [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 10, 2001 4:17 PM
> To: Php-General@Lists. Php. Net
> Subject: Re: [PHP] Shorter way for "each"
> 
> 
> Moritz Petersen wrote:
> > is there a shorter way to do:
> >
> > while (list($key, $value) = each($my_array))
> > {
> > echo $value...
> > }
> >
> > I just need the value!
> 
> PHP3:
> while (list(, $value) = each($my_array))
> {
>  echo $value...
> }
> 
> PHP4:
> foreach ($my_array as $value)
> {
>   echo $value...
> }
> 
> manual/control-structures.foreach.php
> 
> Wagner
> 
> -- 
> One maniac alone can do what 20 together cannot
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] urlencode problem

2001-01-10 Thread Zhihong Pan

I have tow files named as "a+b.doc" and "x y.doc". Before I pass them to another page, 
I do urlencode first. But after I do urldecode in the next page, I got "a b.doc" 
instead of "a+b.doc", but the second file is correct. Could anybody help me to solve 
the problem ?

Thanks,

Zhihong Pan
Chek, Inc



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] urlencode problem

2001-01-10 Thread Cynic

rawurlencode() / rawurldecode()
^^^  ^^^

At 16:35 10.1. 2001, Zhihong Pan wrote the following:
-- 
>I have tow files named as "a+b.doc" and "x y.doc". Before I pass them to another 
>page, I do urlencode first. But after I do urldecode in the next page, I got "a 
>b.doc" instead of "a+b.doc", but the second file is correct. Could anybody help me to 
>solve the problem ?
>
>Thanks,
>
>Zhihong Pan
>Chek, Inc
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
--end of quote-- 




Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Calling a Windows Com object or an Extended Fetch?

2001-01-10 Thread Paulson, Joseph V. \"Jay\"

Well the next problem I have found is that php has to be running on a
windows machine for the com objects to actually work and well we are running
it on a Unix box.  So we can't use the com objects.  Thanks for all the help
thought! 
Jay

-Original Message-
From: bard [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 09, 2001 5:37 PM
To: Miles Thompson
Cc: Paulson, Joseph V. "Jay"; [EMAIL PROTECTED]
Subject: Re: [PHP] Calling a Windows Com object or an Extended Fetch?


Or you could just look at the phpbuilder.com column on using COM objects in
php, or you could RTFM at the php.net site. just type in php.net/com and see
what happens. 

We use php and com here a lot, and while the implementation lacks a few
features of the asp/vb implementation it's handy when migrating from NT/ASP
to NT/PHP.


On Tue, 9 Jan 2001, Miles Thompson wrote:

> I don't know, but I was glancing through an article on PHP in the current 
> issue of Dr. Dobb's Journal last week. At the very end I *think* there was

> an example of calling a COM object. It was a VbScript <-> PHP comparision.

> Have a look, might help.
> 
> Miles
> 
> (Yes, I've been known to make notes while in the newsstand.)
> 
> At 10:01 AM 01/09/2001 -0600, Paulson, Joseph V. \"Jay\" wrote:
> >Hello everyone--
> >I was wondering if PHP can call Windows COM objects in memory?  If PHP
can
> >do this does anyone know how to do it or can you point me in the
direction
> >were I can pissibly figure it out.  Also, does anyone know if PHP can
call
> >an Extended Fetch?
> >Thanks,
> >Jay Paulson
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] to be persistent connected or not to be persistent connected

2001-01-10 Thread Jon Haworth

In your Apache httpd.conf, do you have the line

KeepAlive On

- this is the Apache directive to turn on persistent connections. You will
also want to play with the MaxKeepAliveRequests directive, if you set it to
0 then it will allow an unlimited number of connections. 

There may be more to it than this, but it's worth checking.

HTH
Jon



-Original Message-
From: Kayra Otaner [mailto:[EMAIL PROTECTED]]
Sent: 10 January 2001 15:32
To: [EMAIL PROTECTED]
Subject: [PHP] to be persistent connected or not to be persistent
connected


Hi,

I am searching for detailed information about persistent connection. I've
looked at all the web sites just for "persistent" word but always I found
the same information. All the time people are saying "persistent connection
is good if you are dealing with lots of small queries".

Here is my case: This week I've upgraded necessary server software to the
latest versions of Php and Apache (Php 4.04 and Apache 1.3.14) As I did
before upgrade I've compiled Php as an Apache Static Module ( mod_so is not
necessary ) And check MySQL for persistent connection. My site is focused on
free web services like graphic counter, polls, url redirection, webring and
news syndication to personal web sites. (www.kelalaka.net, it is Turkish
only). Only for graphic counter services, it counts 180.000+ hits per day.
It means 350.000+ queries per day. Day average is 250 query , 60 connection
per minute, but in popular hours it is very high and MySQL server gives "Too
many connections" errors. MySQL server is default and set to 100 connection
at most.

Yesterday I ordered more ram in order to increase connection number of MySQL
from 100 to 200+ connection. But today I realized that my server wasn't work
with persistent connection.
All the Php code contains mysql_pconnect for MySQL connections. Apache and
Php works in module type not in cgi mode. I've looked at phpinfo() in order
to see anything that can indicate status of persistent connection.  It says
"mysql.allow_persistent is On". But again in phpinfo it says "Active
Persistent Links 1" . It is sometime changes to "0". In MySQL I am looking
for active processess by using "mysql" and "show processlist" commands it
shows me 100 active links but most of them are in sleep state. In php.ini
there is a line in order to set maximum number of persistent connection and
I set it to just 25.
If somebody uses mysql_pconnect's instead of mysql_connect in Php cgi mode,
he doesn't see any error messages. All mysql_pconnects work like
mysql_connect.

My questions :
1 - How can users exactly determine whether they are using Php as a module
or cgi mode? (from phpinfo or ..?)
2 - Is it sufficient Php and Apache compiled in static or dynamic module
version in order to use mysql_pconnects in Php code? Anything to do with
MySQL?
3 - In a Apache + Php module compiled system is it normal to reach more than
predefined connection number in php.ini? (100 active connection but 25
defined in php.ini. In phpinfo shows same settings in the php.ini file (it
shows 25 max persistent connection))
4 - Is there any web page containing a real how-to and tutorial about
persistent connection? (If not I will certainly prepare one in a few weeks
:-))

Any kind of help will be appreciated...


Kayra Otaner
www.kelalaka.net





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Calling a Windows Com object or an Extended Fetch?

2001-01-10 Thread Miles Thompson


Looks like we still have the famous MSFT definition of cross-platform:
Windows, Windows 9x, Windows NT (and now Windows 2000).

So, is this the clinching argument for CORBA, rather than COM?
And I doubt the vaunted COM+ solves the problem.

Miles

At 09:42 AM 01/10/2001 -0600, Paulson, Joseph V. \"Jay\" wrote:
>Well the next problem I have found is that php has to be running on a
>windows machine for the com objects to actually work and well we are running
>it on a Unix box.  So we can't use the com objects.  Thanks for all the help
>thought!
>Jay
>
>-Original Message-
>From: bard [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, January 09, 2001 5:37 PM
>To: Miles Thompson
>Cc: Paulson, Joseph V. "Jay"; [EMAIL PROTECTED]
>Subject: Re: [PHP] Calling a Windows Com object or an Extended Fetch?
>
>
>Or you could just look at the phpbuilder.com column on using COM objects in
>php, or you could RTFM at the php.net site. just type in php.net/com and see
>what happens.
>
>We use php and com here a lot, and while the implementation lacks a few
>features of the asp/vb implementation it's handy when migrating from NT/ASP
>to NT/PHP.
>
>
>On Tue, 9 Jan 2001, Miles Thompson wrote:
>
> > I don't know, but I was glancing through an article on PHP in the current
> > issue of Dr. Dobb's Journal last week. At the very end I *think* there was
>
> > an example of calling a COM object. It was a VbScript <-> PHP comparision.
>
> > Have a look, might help.
> >
> > Miles
> >
> > (Yes, I've been known to make notes while in the newsstand.)
> >
> > At 10:01 AM 01/09/2001 -0600, Paulson, Joseph V. \"Jay\" wrote:
> > >Hello everyone--
> > >I was wondering if PHP can call Windows COM objects in memory?  If PHP
>can
> > >do this does anyone know how to do it or can you point me in the
>direction
> > >were I can pissibly figure it out.  Also, does anyone know if PHP can
>call
> > >an Extended Fetch?
> > >Thanks,
> > >Jay Paulson
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >For additional commands, e-mail: [EMAIL PROTECTED]
> > >To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> >




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] to be persistent connected or not to be persistent connected

2001-01-10 Thread Marcelo Gulin

Hi!

  php manual...

http://www.php.net/manual/features.persistent-connections.php

regards
Marcelo Gulin

Kayra Otaner escribió:
> 
> Hi,
> 
> I am searching for detailed information about persistent connection. I've
> looked at all the web sites just for "persistent" word but always I found
> the same information. All the time people are saying "persistent connection
> is good if you are dealing with lots of small queries".
> 
> Here is my case: This week I've upgraded necessary server software to the
> latest versions of Php and Apache (Php 4.04 and Apache 1.3.14) As I did
> before upgrade I've compiled Php as an Apache Static Module ( mod_so is not
> necessary ) And check MySQL for persistent connection. My site is focused on
> free web services like graphic counter, polls, url redirection, webring and
> news syndication to personal web sites. (www.kelalaka.net, it is Turkish
> only). Only for graphic counter services, it counts 180.000+ hits per day.
> It means 350.000+ queries per day. Day average is 250 query , 60 connection
> per minute, but in popular hours it is very high and MySQL server gives "Too
> many connections" errors. MySQL server is default and set to 100 connection
> at most.
> 
> Yesterday I ordered more ram in order to increase connection number of MySQL
> from 100 to 200+ connection. But today I realized that my server wasn't work
> with persistent connection.
> All the Php code contains mysql_pconnect for MySQL connections. Apache and
> Php works in module type not in cgi mode. I've looked at phpinfo() in order
> to see anything that can indicate status of persistent connection.  It says
> "mysql.allow_persistent is On". But again in phpinfo it says "Active
> Persistent Links 1" . It is sometime changes to "0". In MySQL I am looking
> for active processess by using "mysql" and "show processlist" commands it
> shows me 100 active links but most of them are in sleep state. In php.ini
> there is a line in order to set maximum number of persistent connection and
> I set it to just 25.
> If somebody uses mysql_pconnect's instead of mysql_connect in Php cgi mode,
> he doesn't see any error messages. All mysql_pconnects work like
> mysql_connect.
> 
> My questions :
> 1 - How can users exactly determine whether they are using Php as a module
> or cgi mode? (from phpinfo or ..?)
> 2 - Is it sufficient Php and Apache compiled in static or dynamic module
> version in order to use mysql_pconnects in Php code? Anything to do with
> MySQL?
> 3 - In a Apache + Php module compiled system is it normal to reach more than
> predefined connection number in php.ini? (100 active connection but 25
> defined in php.ini. In phpinfo shows same settings in the php.ini file (it
> shows 25 max persistent connection))
> 4 - Is there any web page containing a real how-to and tutorial about
> persistent connection? (If not I will certainly prepare one in a few weeks
> :-))
> 
> Any kind of help will be appreciated...
> 
> Kayra Otaner
> www.kelalaka.net
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /main php_compat.h

2001-01-10 Thread Rui Hirokawa

hirokawaWed Jan 10 06:42:23 2001 EDT

  Modified files:  
/php4/main  php_compat.h 
  Log:
  
  
Index: php4/main/php_compat.h
diff -u php4/main/php_compat.h:1.6 php4/main/php_compat.h:1.7
--- php4/main/php_compat.h:1.6  Sat Mar  4 11:58:59 2000
+++ php4/main/php_compat.h  Wed Jan 10 06:42:23 2001
@@ -24,6 +24,8 @@
 #define hashTableDestroy   php_hashTableDestroy
 #define hashTableIterInit  php_hashTableIterInit
 #define hashTableIterNext  php_hashTableIterNext
+
+#ifndef HAVE_LIBEXPAT2
 #define XML_DefaultCurrent php_XML_DefaultCurrent
 #define XML_ErrorString php_XML_ErrorString
 #define XML_ExternalEntityParserCreate php_XML_ExternalEntityParserCreate
@@ -67,5 +69,6 @@
 #define XmlUtf16Encode php_XmlUtf16Encode
 #define XmlUtf8Encode php_XmlUtf8Encode
 #define XmlPrologStateInit php_XmlPrologStateInit
+#endif
 
 #endif



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-CVS] cvs: php4 /ext/ircg ircg.c

2001-01-10 Thread Sascha Schumann

sas Wed Jan 10 07:52:01 2001 EDT

  Modified files:  
/php4/ext/ircg  ircg.c 
  Log:
  Check the return value irc_connect().  There are some cases where
  that function would fail and we were leaking memory.
  
  
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.11 php4/ext/ircg/ircg.c:1.12
--- php4/ext/ircg/ircg.c:1.11   Wed Jan 10 05:50:25 2001
+++ php4/ext/ircg/ircg.cWed Jan 10 07:52:01 2001
@@ -531,6 +531,13 @@
conn = malloc(sizeof(*conn));
conn->username = strdup(username);
conn->fd = -1;
+
+   if (irc_connect(username, NULL, msg_handler, quit_handler, error_handler,
+   conn, server, port, &conn->conn)) {
+   free(conn->username);
+   free(conn);
+   RETVAL_FALSE;
+   }
if (p4) {
HashTable *h;
int i;
@@ -551,8 +558,6 @@
conn->irconn_id = irconn_id;
zend_hash_index_update(&h_irconn, irconn_id, &conn, sizeof(conn), NULL);
zend_llist_init(&conn->buffer, sizeof(smart_str), buffer_dtor, 1);
-   irc_connect(username, NULL, msg_handler, quit_handler, error_handler,
-   conn, server, port, &conn->conn);
 
RETVAL_LONG(irconn_id);
 }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include path confusion

2001-01-10 Thread Randy

Does this mean that of all of the people on this list, NOBODY
understands how php searches for include files? Surely somebody
knows!

How I think it SHOULD work is like DOS - First it looks at where
you say it is. If not there, it looks in the current directory.
If not there, it looks in the directories in the path. I'm sure
PHP doesn't work this way, but I can't figure out how it does
work.

Please, if anybody understands this, let me know.

Thanks!

Best regards,
 Randy   


Tuesday, January 09, 2001, 9:33:34 AM, you wrote:

R> I've done that too, but it's a real pain.

R> Does anyone know how php searches for include files?

R> Does everyone use the entire path?

R> Best regards,
R>  Randy   


R> Monday, January 08, 2001, 1:02:52 PM, you wrote:

W>> I use the full path to help fix this problem. This way no matter where you
W>> drop it in, it will work...

W>> 

W>> -Original Message-
W>> From: Randy [mailto:[EMAIL PROTECTED]]
W>> Sent: Monday, January 08, 2001 2:02 PM
W>> To: [EMAIL PROTECTED]
W>> Subject: [PHP] include path confusion


W>> I'm confused on what should be a simple issue - where does php
W>> look for an include file in the following example? My test
W>> results seem very confusing and the docs never mention it.

W>> In the program:
W>>   include "../test/sample.php";

W>> In php.ini:
W>>   include_path="../include"

W>> Does php:
W>>   A. Look in the dir "../test" for sample.php first and if not found,
W>>   look in "../include" for sample.php?
W>>   B. Ignore the dir "../test/" and look in "../include" for
W>>   sample.php?
W>>   C. Look in dir "../test" for sample.php and if not found, look
W>>   in "../include" for "../test/sample.php"? (and can't find it as
W>>   invalid)
W>>   D. Look only in dir "../include" for "../test/sample.php"? (and
W>>   can't find it as invalid)

W>> Does it work exactly the same for REQUIRE?

W>> TIA
W>> --
W>> Best regards,
W>>  Randy



W>> --
W>> PHP General Mailing List (http://www.php.net/)
W>> To unsubscribe, e-mail: [EMAIL PROTECTED]
W>> For additional commands, e-mail: [EMAIL PROTECTED]
W>> To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Shopping Cart Schema - Sessions

2001-01-10 Thread JB

ok, this all looks good, but then I again I am having a problem figuring out
that code you wrote below. the code i'm attempting to write isn't going to
be complex. there's maybe 10 or 15 items going to be sold. it would be very
rare if the customer ever had 1 or 2 things in their basket, let alone more
than that. i think i'm looking for a simpler solution. from what i had read,
though i couldn't get to work, this would be an acceptable method of
starting a sessions and trapping the variables without a million
session_register calls.

session_start();
session_register("sessvar");
$sessvar["user"]["name"] = $login_name;
$sessvar["cart"]["item1"] = $prod_id;
$sessvar["cart"]["qty1"] = $qty;

Then.. I should be able to access them like:

print "$sessvar['user']['name']";
etc...

does this make sense to you? or anyone else?
all i need is a sure fire way to easily hold a few variables throughout the
site. i'm not concerned about holding the keys in a db, as with the small
activity on this site, and the fact the writing to a local file will not
rpoduce any noticable difference over a db query on my machine w/ its
traffic, the db is not needed for this.

so.. all i need is a good simple method to register the following varables:
uid (user id)
p1 (product id for item 1)
q1 (qty for item 1)

and a method to increase the next variable to p2, q2, p3,q3 etc to represent
other items in the cart.

i think i should be able to figure out how to manipulate/extract the data
and work with it from there (in an array) once i am able to get them
registered. really i would just need a method for walking through the
array(s) to pull out the data. but if anyone has any suggestions on that too
i'd love to hear em.

thanks for the help everyone.


> > Hey,
> >
> > I'm looking for little information from those who have coded their own
shopping cart apps. what would you say the best way to setup a cart would
be? more specificly, the method for adding items to the cart.
> >
> eww, lost wrapping ...
>
> > say the user is broswing around. when they entered the website a new
session was created. when they go to add an item, what is the best way store
variables (such as what they bought and quantity) in the session. i have
read that it is possible to put all of your session variables in a single
associative array. however, i have not had any luck doing this myself. Under
such a method of an array, how would i store each item (product id and
quantity, possibly price as well) in the cart into the session. obviously i
don't expect anyone to write an entire app. i am comfortable starting the
session, and doing th db extraction and presentation. i just need to know
how to store a variable in a session (passed through post) and how to
extract it when need be (considering it is an array). Thanks a lot!
>
> I codded a shopping cart which allowed `thin sessions' and `fat sessions'.
>
> Thin would mean I store only the IDs, then retrieve the rest of the
> information about the product from the DB (more DB queries, but smaller
> session data), while `fat' would mean I store all the data I need to
display
> when the user invetories his/her cart, namely name, price &|short desc.,
> quantity.
>
> Some code snippets would be:
>
> if (!$SES->isRegistered ('cart.object')) {
>  $CART = new Cart();
> $CART->setLanguage (CART_LANGUAGE);
> $SES->setAttribute ('cart.object', $CART);
> }
>
> $CART = &$SES->getAttribute ('cart.object');
>
> then go ahead and use the cart object:
> ...
> $CART->addItem ($sku, 1, new Product($arr_attr));
> $CART->dropItem ($sku);
>
> And the Product class has among others, these two methods:
>
>  __setStorageType ($t)
>

>   if ($t == CART_FAT_SESS) {
> $this->_slots = array_keys (get_object_vars ($this));
> unset ($this->_slots['_desc']);
> }
> }
>
> function __sleep ()
> {
> return  (isset ($this->_slots) ? $this->_slots : array ('_quant'));
> }
>
> This is in the manner of Session class from PHPLIB which records what is
to
> be saved in the session (in this case, what attributes.)
>
> And the Cart class has:
>
> function __wakeup ()
> {
>  if ($this->STORAGE == CART_THIN_SESS) {
> $pr_attrs = Cart::getItemsAttr (array_keys($this->_items));
>
> foreach ($pr_attrs as $sku => $attrs) {
> $attrs['quant'] = $this->_items[$sku]->getQuantity();
> $this->_items[$sku] = new Product ($attrs);
> }
>  }
> }
>
> Note that __sleep() and __wakeup() are PHP serialisation hooks, which can
customize
> the marshalling/unmarshalling process (e.g. restore DB connections, etc.)
>
> cheers,
>
> -- teodor
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL P

[PHP] Functions

2001-01-10 Thread Augusto Cesar Castoldi

How do I use a function?

I did:

function ShowMessage {
  echo "Show message...\n";
}

How can I call the function now?

thanks,

Augusto Cesar Castoldi


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Shopping Carts

2001-01-10 Thread Brandon Orther

Hello,

I am making a shopping cart.  I am wondering on how I should separate each
user.  I though the I.P. would be good but there can be a couple people on
one I.P. so if someone is sharing an I.P. it will mess things up.. Anyone
got a better way to do it?

Thank you,


Brandon Orther
WebIntellects Design/Development Manager
[EMAIL PROTECTED]
800-994-6364
www.webintellects.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Functions

2001-01-10 Thread Emil Rasmussen

Hi

not the () after the function name

> 
> function ShowMessage() {
>   echo "Show message...\n";
> }
> 
> How can I call the function now?
> 


echo ShowMessage();


:: Emil

---
Emil Rasmussen
http://www.noget.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Calling a Windows Com object or an Extended Fetch?

2001-01-10 Thread Niel Zeeman

Try this article
http://www.phpbuilder.com/columns/alain20001003.php3

it helped me allot, If you go deeper into the Com object you will find that
you can actually call an object from a
remote server -- have not tried it myself yet : )
Niel Zeeman

- Original Message -
From: Paulson, Joseph V. "Jay" <[EMAIL PROTECTED]>
To: 'bard' <[EMAIL PROTECTED]>; Miles Thompson
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 5:42 PM
Subject: RE: [PHP] Calling a Windows Com object or an Extended Fetch?


> Well the next problem I have found is that php has to be running on a
> windows machine for the com objects to actually work and well we are
running
> it on a Unix box.  So we can't use the com objects.  Thanks for all the
help
> thought!
> Jay
>
> -Original Message-
> From: bard [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 09, 2001 5:37 PM
> To: Miles Thompson
> Cc: Paulson, Joseph V. "Jay"; [EMAIL PROTECTED]
> Subject: Re: [PHP] Calling a Windows Com object or an Extended Fetch?
>
>
> Or you could just look at the phpbuilder.com column on using COM objects
in
> php, or you could RTFM at the php.net site. just type in php.net/com and
see
> what happens.
>
> We use php and com here a lot, and while the implementation lacks a few
> features of the asp/vb implementation it's handy when migrating from
NT/ASP
> to NT/PHP.
>
>
> On Tue, 9 Jan 2001, Miles Thompson wrote:
>
> > I don't know, but I was glancing through an article on PHP in the
current
> > issue of Dr. Dobb's Journal last week. At the very end I *think* there
was
>
> > an example of calling a COM object. It was a VbScript <-> PHP
comparision.
>
> > Have a look, might help.
> >
> > Miles
> >
> > (Yes, I've been known to make notes while in the newsstand.)
> >
> > At 10:01 AM 01/09/2001 -0600, Paulson, Joseph V. \"Jay\" wrote:
> > >Hello everyone--
> > >I was wondering if PHP can call Windows COM objects in memory?  If PHP
> can
> > >do this does anyone know how to do it or can you point me in the
> direction
> > >were I can pissibly figure it out.  Also, does anyone know if PHP can
> call
> > >an Extended Fetch?
> > >Thanks,
> > >Jay Paulson
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >For additional commands, e-mail: [EMAIL PROTECTED]
> > >To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> >
> >
> >
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Shopping Carts

2001-01-10 Thread John Guynn

I use MyCart for the sites I've built around Shopping Carts.  In MyCart
there is some combination of ip address and date or time (I haven't looked
at the source recently) concatenated together.

You might want to take a look at MyCart for ideas...or as a solution to
avoid having to build a cart from scratch.

John Guynn

This email brought to you by RFCs 821 and 1225.


-Original Message-
From: Brandon Orther [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 10, 2000 10:18 AM
To: PHP User Group
Subject: [PHP] Shopping Carts


Hello,

I am making a shopping cart.  I am wondering on how I should separate each
user.  I though the I.P. would be good but there can be a couple people on
one I.P. so if someone is sharing an I.P. it will mess things up.. Anyone
got a better way to do it?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Functions

2001-01-10 Thread Emil Rasmussen


That should bee notice and not "not"! Ups :-)

> 
> Hi
> 
> not the () after the function name
> 
> > 
> > function ShowMessage() {
> >   echo "Show message...\n";
> > }
> > 
> > How can I call the function now?
> > 
> 
> 
> echo ShowMessage();
> 
> 
> :: Emil
> 
> ---
> Emil Rasmussen
> http://www.noget.net
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP newbie question

2001-01-10 Thread Toby Butzon

- Original Message -
From: "Neil Zanella" <[EMAIL PROTECTED]>
To: "PHP General Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, January 09, 2001 11:55 PM
Subject: [PHP] PHP newbie question


:
: Hello,
:
: I have a question regarding the following 3 one line .php files:
:
: 

isset($a) returns false, the ! reverses it to true, and it prints "Hello,
World!"

:
: 

$a evaluates to false, the ! reverses it, and it prints "Hello, World!"

: 

You get a syntax error. PHP's ! operator does _not_ evaluate to any value;
it has to have a value to operate on. Hence, if you just say if (! ), you
get a syntax error... there's nothing for the ! to operate on.

:
: The first script prints the famous words correctly but what baffles
: me is the second script which should be the same as the third script
: since $a is not set and hence should evaluate to nothing, but PHP 3.0.15
: is evaluating ! $a to true instead of giving me a syntax error as in
: script 3. Can someone explain why this is? Does this make the isset()
: built in function redundant in general?

No, this doesn't make isset() redundant. isset($var) will return true if
$var=0, whereas just testing $var would evaluate to false (since it is 0).

TB

:
: Thanks,
:
: Neil
:
:
: --
: PHP General Mailing List (http://www.php.net/)
: To unsubscribe, e-mail: [EMAIL PROTECTED]
: For additional commands, e-mail: [EMAIL PROTECTED]
: To contact the list administrators, e-mail: [EMAIL PROTECTED]
:
:


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Functions

2001-01-10 Thread Chris Lee

\n";
 }

 function returnfunction()
 {
  return "showfunction\n";
 }

 showfunction();

 echo returnfunction();
?>

Chris Lee
Mediawaveonline.com
"Augusto Cesar Castoldi" <[EMAIL PROTECTED]> wrote in message
Pine.GSO.4.10.10101101404540.1072-10@juno">news:Pine.GSO.4.10.10101101404540.1072-10@juno...
> How do I use a function?
>
> I did:
>
> function ShowMessage {
>   echo "Show message...\n";
> }
>
> How can I call the function now?
>
> thanks,
>
> Augusto Cesar Castoldi
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] IIS4 problem

2001-01-10 Thread VALLET, Luc

hi,

I 've got problems executing .exe through Php script.


On my machine ( NT4, Omnihttpd), i can do whatever I want, but when I
transfer my scripts to
my server NT4 with IIS4, something goes wrong, (with a "dir" nothing
happens, with a "help" it slows down my server to a point I need to reboot
it)

To summarize I need to execute an exe for a connection with a bank and as it
did not work I tried with some DOS commands.

(I gave the proper rights to the directory containing my exe and my scripts)


Below is my script
\n");
 print("Output : \n");
 print $allOutput;
 for ($index = 0; $index < count($AllOutput); $index++)
 {
 print("$AllOutput[$index] \n");
 }
 print ("\n");
 print("return value : $ReturnValue\n");
 
 ?>


Thanks in advance if someone had a similar problem

Luc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Shorter way for "each"

2001-01-10 Thread Chris Lee

everyone allready posted about foreach(), but they didnt post the
alternative syntax

foreach ($array as $position => $value)
{
echo $postition : $value\n";
}

http://www.php.net/manual/control-structures.foreach.php

Chris Lee
Mediawaveonline.com




""Moritz Petersen"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> is there a shorter way to do:
>
> while (list($key, $value) = each($my_array))
> {
> echo $value...
> }
>
> I just need the value!
>
> Thanks,
> Mo.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Shorter way for "each"

2001-01-10 Thread Wico de Leeuw

hiya

echo implode (' ', $array);

greetz,

Wico

At 08:24 10-1-01 -0800, Chris Lee wrote:
>everyone allready posted about foreach(), but they didnt post the
>alternative syntax
>
>foreach ($array as $position => $value)
>{
> echo $postition : $value\n";
>}
>
>http://www.php.net/manual/control-structures.foreach.php
>
>Chris Lee
>Mediawaveonline.com
>
>
>
>
>""Moritz Petersen"" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi,
> >
> > is there a shorter way to do:
> >
> > while (list($key, $value) = each($my_array))
> > {
> > echo $value...
> > }
> >
> > I just need the value!
> >
> > Thanks,
> > Mo.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Shopping Cart Schema - Sessions

2001-01-10 Thread JB

I also forgot to mention. I am leaning towards using GET to send the session
ids. Many people have told me that customer penatration decreases, some
times significantly, when requiring cookies to use the cart. How would this
have an effect on my script? i will have to call the sessid in all of my
links, correct?


> ok, this all looks good, but then I again I am having a problem figuring
out
> that code you wrote below. the code i'm attempting to write isn't going to
> be complex. there's maybe 10 or 15 items going to be sold. it would be
very
> rare if the customer ever had 1 or 2 things in their basket, let alone
more
> than that. i think i'm looking for a simpler solution. from what i had
read,
> though i couldn't get to work, this would be an acceptable method of
> starting a sessions and trapping the variables without a million
> session_register calls.
>
> session_start();
> session_register("sessvar");
> $sessvar["user"]["name"] = $login_name;
> $sessvar["cart"]["item1"] = $prod_id;
> $sessvar["cart"]["qty1"] = $qty;
>
> Then.. I should be able to access them like:
>
> print "$sessvar['user']['name']";
> etc...
>
> does this make sense to you? or anyone else?
> all i need is a sure fire way to easily hold a few variables throughout
the
> site. i'm not concerned about holding the keys in a db, as with the small
> activity on this site, and the fact the writing to a local file will not
> rpoduce any noticable difference over a db query on my machine w/ its
> traffic, the db is not needed for this.
>
> so.. all i need is a good simple method to register the following
varables:
> uid (user id)
> p1 (product id for item 1)
> q1 (qty for item 1)
>
> and a method to increase the next variable to p2, q2, p3,q3 etc to
represent
> other items in the cart.
>
> i think i should be able to figure out how to manipulate/extract the data
> and work with it from there (in an array) once i am able to get them
> registered. really i would just need a method for walking through the
> array(s) to pull out the data. but if anyone has any suggestions on that
too
> i'd love to hear em.
>
> thanks for the help everyone.
>
>
> > > Hey,
> > >
> > > I'm looking for little information from those who have coded their own
> shopping cart apps. what would you say the best way to setup a cart would
> be? more specificly, the method for adding items to the cart.
> > >
> > eww, lost wrapping ...
> >
> > > say the user is broswing around. when they entered the website a new
> session was created. when they go to add an item, what is the best way
store
> variables (such as what they bought and quantity) in the session. i have
> read that it is possible to put all of your session variables in a single
> associative array. however, i have not had any luck doing this myself.
Under
> such a method of an array, how would i store each item (product id and
> quantity, possibly price as well) in the cart into the session. obviously
i
> don't expect anyone to write an entire app. i am comfortable starting the
> session, and doing th db extraction and presentation. i just need to know
> how to store a variable in a session (passed through post) and how to
> extract it when need be (considering it is an array). Thanks a lot!
> >
> > I codded a shopping cart which allowed `thin sessions' and `fat
sessions'.
> >
> > Thin would mean I store only the IDs, then retrieve the rest of the
> > information about the product from the DB (more DB queries, but smaller
> > session data), while `fat' would mean I store all the data I need to
> display
> > when the user invetories his/her cart, namely name, price &|short desc.,
> > quantity.
> >
> > Some code snippets would be:
> >
> > if (!$SES->isRegistered ('cart.object')) {
> >  $CART = new Cart();
> > $CART->setLanguage (CART_LANGUAGE);
> > $SES->setAttribute ('cart.object', $CART);
> > }
> >
> > $CART = &$SES->getAttribute ('cart.object');
> >
> > then go ahead and use the cart object:
> > ...
> > $CART->addItem ($sku, 1, new Product($arr_attr));
> > $CART->dropItem ($sku);
> >
> > And the Product class has among others, these two methods:
> >
> >  __setStorageType ($t)
> >
>
> >   if ($t == CART_FAT_SESS) {
> > $this->_slots = array_keys (get_object_vars ($this));
> > unset ($this->_slots['_desc']);
> > }
> > }
> >
> > function __sleep ()
> > {
> > return  (isset ($this->_slots) ? $this->_slots : array ('_quant'));
> > }
> >
> > This is in the manner of Session class from PHPLIB which records what is
> to
> > be saved in the session (in this case, what attributes.)
> >
> > And the Cart class has:
> >
> > function __wakeup ()
> > {
> >  if ($this->STORAGE == CART_THIN_SESS) {
> > $pr_attrs = Cart::getItemsAttr (array_keys($this->_items));
> >
> > foreach ($pr_attrs as $sku => $attrs) {
> > $attrs['quant'] = $this->_items[$sku]->getQuantity();
> > $this->_items[$sku] = new Product ($attrs);
> > }
> >  }
> > }
> >
> > Note that __sleep() and __wakeup() are PHP serialisati

Re: [PHP] Fields to large for php3

2001-01-10 Thread Chris Lee

I am using MySQL (dont think im a MySQL preacher, im not) and Ive used
LONGBLOBS to store 100K+ binary images and sucessfully retreaved them, no
problem. I almost wonder if the problem is in the fieldtype in MSSQL? is it
set to LONGBLOB ? MSSQL might not even have such a field (postgres's largest
field I *think* is 4k). the only solution I can think of in such a case is
to store a unique filename in the field to reference the data from a file.
You could split the data up into 4k chucks using



I dont know if this is the best idea, but it may work, you would then of
course have to retreave X number of fields and peice the data together
again...

Chris Lee
Mediawaveonline.com



""Paul Lewis"" <[EMAIL PROTECTED]> wrote in message
007d01c07b0a$abfda4b0$[EMAIL PROTECTED]">news:007d01c07b0a$abfda4b0$[EMAIL PROTECTED]...
> I have an application that stores large text fields in MS SQL SVR and when
> they are entered on-line everything works fine.  The problem begins when I
> try to retrieve them from the database and populate a field on the php3
> on-line form.  The query will only return the first 4096 byte of the
> information in the data base field.
>
> I have been told there is a work around, but don't know where to find it.
> Splitting the field up in to smaller chunks is not an option.
>
> Can anyone help me with this problem.
>
> Thanks
> PaulL
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Shopping Cart Schema - Sessions

2001-01-10 Thread Teodor Cimpoesu

Hi JB!
On Wed, 10 Jan 2001, JB wrote:

> ok, this all looks good, but then I again I am having a problem figuring out
> that code you wrote below. the code i'm attempting to write isn't going to
> be complex. there's maybe 10 or 15 items going to be sold. it would be very
> rare if the customer ever had 1 or 2 things in their basket, let alone more
> than that. i think i'm looking for a simpler solution. from what i had read,
> though i couldn't get to work, this would be an acceptable method of
> starting a sessions and trapping the variables without a million
> session_register calls.
> 
> session_start();
> session_register("sessvar");
> $sessvar["user"]["name"] = $login_name;
> $sessvar["cart"]["item1"] = $prod_id;
> $sessvar["cart"]["qty1"] = $qty;
> 
> Then.. I should be able to access them like:
> 
> print "$sessvar['user']['name']";
> etc...
> 
yap, just like that!
have you tried it yet?
Just remember to test if the array variable isn't already set so not to
overwrite the old values by accident (use session_is_registered(), I think)

> all i need is a sure fire way to easily hold a few variables throughout the
> site. i'm not concerned about holding the keys in a db, as with the small
> activity on this site, and the fact the writing to a local file will not
> rpoduce any noticable difference over a db query on my machine w/ its
> traffic, the db is not needed for this.
> 
My advice is to have a clear idea of what you really want, and write it down
first. Clearely formulate your problem to solve, and don't jump at coding as
most guru coders do :) Start simple.

> so.. all i need is a good simple method to register the following variables:
> uid (user id)
> p1 (product id for item 1)
> q1 (qty for item 1)
> 
[products.php][cart.php]
{uid, product_id, quantity} ---> {$cart, $user}

in cart.php you do:

session_start();

// don't mix different data (products w/ user data)
// have them in separate entities

if (!session_is_registered('cart')) {
$cart = array();
session_register('cart');
}

if (!session_is_registered('user')) {
$user = array();
session_register('user');
}

// you may have different operations on the cart. 
// let's say we add something, so we receive {uid,product_id, quantity}
// from products.php
...
$cart[$product_id] = $quantity;

I am not sure why do you need user id, as every session is `customized' for a
user, who has a corresponding session_id in your application.

> and a method to increase the next variable to p2, q2, p3,q3 etc to represent
> other items in the cart.

for this example, I thought the `key' in the array to be the  product_id (a user
can have one or more products identified by their id).

> i think i should be able to figure out how to manipulate/extract the data
> and work with it from there (in an array) once i am able to get them
> registered. really i would just need a method for walking through the
> array(s) to pull out the data. but if anyone has any suggestions on that too
> i'd love to hear em.
 
You must view it this way when writing your php code for the problem: 
you have a session associated with a user (1 to 1 relationship) in which you
store pertinent data related to users actions. We call it session because it
persists over several requests.

A user can request one or more products (a 1 to n relationship), and the
information will be stored in the session. Simple, isn't it? :)

cheers,

-- teodor

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] declaring variables in class definitions

2001-01-10 Thread sam1600

Hi Max!

--- you wrote: 
> Hello sam1600,
> 
> Wednesday, January 10, 2001, 6:42:58 AM, you wrote:
> 
> sic> What in the world is reason for declaring the following in the class?:
> sic> var $somevar;
> sic> I see no reason, and no differences if I don't declare: var $somevar;
> 
> Classes are intended to be structured data storage. You should define
> a structure of the class before using the class.
> You can set the value of the $somevar anytime later, when using an
> object of class a.
> $d->somevar = true;
> and the next call to $d->b() will print nothing.
> But you won't be able to assign a value to $somevar, if it is not
> declared in the class.

This does not appear to be true.  With error reporting set to max, and the 
variables not defined in the class ( $somevar,$somevar2 and $somevar3 ),
the following will echo out:
Not set
empty
value of somevar2
value of somevar3

class a {
   function b(){
 if (!isset($this->somevar))
  echo "Not set";
 if (empty($this->somevar))
 echo "empty";
  }
   }
$d = new a;
$d->b();
$d->somevar2 = "value of somevar2";
$d->somevar3 = "value of somevar3";
echo $d->somevar2;
echo $d->somevar3;


> 
> sic> Maybe a better question is what will break if I do not declare
> sic> my vars in my class definition?
> 
> the method b() of the class a will break if you don't declare $somevar
> in the class definition. In the string "if (!isset($this->somevar))"
> it would throw an error saying that you have no variable named 'somevar' in
> you class.

 This does not appear to be true either, see above.

Thanks,
Sam

I'm using php4.0



Get your free email from AltaVista at http://altavista.iname.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Show output of program in realtime on website

2001-01-10 Thread Christian Reiniger

On Wednesday 10 January 2001 13:11, Stefan Scherf wrote:

> maybe the problem is in the c-programm "main":
>
> int main() {
>int i;
>for(i=0;i<10;i++) {
>   printf("Output: %i\n",i);

The "\n" triggers a buffer flush if I'm not completely mistaken, so there 
shouldn't be a problem

>   sleep(1);
>}
>return;

Your compiler should throw an error here - main is declared as "int" but 
doesn't return a value

> }

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Those who will not reason, are bigots,
those who cannot, are fools,
and those who dare not, are slaves.

- George Gordon Noel Byron (1788-1824), [Lord Byron]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] looking for a PHP editor

2001-01-10 Thread Egan

On Wed, 10 Jan 2001 10:50:40 -0400, Miles Thompson
<[EMAIL PROTECTED]> wrote:

> For a Windows environment I'll endorse jeremy's recommendation
> of Ultraedit -- my hammer of choice.

Am I the only one using HoTMetal Pro 6.0 on Windows?

Its PHP support has a very annoying bug when it encounters embedded
HTML output contained within PHP standard tags, but using PHP long
tags fixes that problem.  Long tags help in other ways too, because
they make HoTMetaL format your PHP script text as-is, letting you
control indenting of the PHP text the way you want.

And as long as you're not trying to embed HTML output inside your PHP
tags, you can use PHP short tags in contexts where they make the most
sense, like printing the contents of a single variable:

  VALUE=""

Notice the omission of the "print" command.  That's a neat little
trick I learned from Matt Zandstra's book.  Very helpful for quick
output of a single variable.

One thing I can no longer live without, is HoTMetaL's integrated FTP
support.  It's so good, the FTP site becomes part of your desktop.

I can open a remote FTP file for some quick changes, without even
storing it locally on my hard drive.  And then just as quickly, save
it back to the FTP site with the touch of one toolbar button.

OTOH, after an editing session where I make extensive changes to the
local copy of my project, its FTP file synchronization is everything I
could ask for.

And did I mention its excellent support for different HTML views like
tags-on, WYSIWYG, and raw source?

Did I mention its excellent table design and manipulation facilities?

Did I mention its project management?

Did I mention ...

Yes I could go on and on.  You get a screwdriver and some wrenches
with your hammer.  It's available at Amazon, discounted to about $70.


Egan




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] looking for a PHP editor

2001-01-10 Thread Christian Reiniger

On Wednesday 10 January 2001 15:50, Miles Thompson wrote:

> you use because you know how it behaves. For a Windows environment I'll
> endorse jeremy's recommendation of Ultraedit -- my hammer of choice. It

seconded.

> For Linx, etc.? I don't have a hammer yet. I feel obligated to use VIM,

My personal favourite is fte. Its only problem is that it doesn't have 
real PHP highlighting, but I got used to switching between HTML and C 
mode...

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Those who will not reason, are bigots,
those who cannot, are fools,
and those who dare not, are slaves.

- George Gordon Noel Byron (1788-1824), [Lord Byron]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] looking for a PHP editor

2001-01-10 Thread Wacks, David

Personally, my team and I use HomeSite 4.5.x from Allaire.  It is PHP aware
and there are extensions you can add to allow PHP expression building. I
have used it for a coupe of years and fills my text building personality as
well as the graphical GUI ones with DW and browsing.

If you use DreamWeaver (DW), it usually comes as a freebie.

--Dave 

-Original Message-
From: Egan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 10, 2001 9:54 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] looking for a PHP editor


On Wed, 10 Jan 2001 10:50:40 -0400, Miles Thompson
<[EMAIL PROTECTED]> wrote:

> For a Windows environment I'll endorse jeremy's recommendation
> of Ultraedit -- my hammer of choice.

Am I the only one using HoTMetal Pro 6.0 on Windows?

Its PHP support has a very annoying bug when it encounters embedded
HTML output contained within PHP standard tags, but using PHP long
tags fixes that problem.  Long tags help in other ways too, because
they make HoTMetaL format your PHP script text as-is, letting you
control indenting of the PHP text the way you want.

And as long as you're not trying to embed HTML output inside your PHP
tags, you can use PHP short tags in contexts where they make the most
sense, like printing the contents of a single variable:

  VALUE=""

Notice the omission of the "print" command.  That's a neat little
trick I learned from Matt Zandstra's book.  Very helpful for quick
output of a single variable.

One thing I can no longer live without, is HoTMetaL's integrated FTP
support.  It's so good, the FTP site becomes part of your desktop.

I can open a remote FTP file for some quick changes, without even
storing it locally on my hard drive.  And then just as quickly, save
it back to the FTP site with the touch of one toolbar button.

OTOH, after an editing session where I make extensive changes to the
local copy of my project, its FTP file synchronization is everything I
could ask for.

And did I mention its excellent support for different HTML views like
tags-on, WYSIWYG, and raw source?

Did I mention its excellent table design and manipulation facilities?

Did I mention its project management?

Did I mention ...

Yes I could go on and on.  You get a screwdriver and some wrenches
with your hammer.  It's available at Amazon, discounted to about $70.


Egan




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Changing passwords

2001-01-10 Thread Chris Lee

That's quite a big request :) here are a few tips you might allready know.
changin the passwd for a user to view a site isnt that hard, just store the
username and password in a db, this is the file I use, nb. fetch_db_value()
replace with your own sql functions

\n";
  exit();
 }

 session_start();

 if (!isset($SessionID))
 {
  $SessionID = mtime();
  session_register("SessionID");
 }

 if ( isset($PHP_AUTH_USER) AND isset($PHP_AUTH_PW) AND $peop_r =
fetch_db_value('people_manager', "WHERE username = '$PHP_AUTH_USER' AND
password = '$PHP_AUTH_PW' ") )
  $SessionID = $peop_r['peopleID'];
 else
 {
  Header("WWW-Authenticate: Basic realm='$SERVER_NAME' ");
  Header("HTTP/1.0 401 Unauthorized");
  bad_passwd();
 }
?>

just include this file on the top of every page you want passwd protected,
change the passwd in the db and this script will confirm the passwd allways.
Now for changing the passwd for a mailserver ona  remote box, well there
aint no easy way todo this. so I wont even try. I have idea's about setting
some small http server on that box, passwd protect it, and build a small php
page on THAT server to handel the passwd changes, using exec() ? maybe
modifying /etc/passwd using the builting crypt() functions, I dont have any
experience when it somes to that.

Im unsure when you say the old passwd still has to be valid because of
someone being away from the computer? when the passwd is changed the old
passwd would be invalid, thats the point of changing a passwd :) are
multiple users going to login with one username / passwd ? thats not such a
good idea, with individual username passwds individuals can have their
access restricted, alot easier to maintain. also with multiple users single
passwd systems, who decided to change the passwd? your opening up the door
to piss people off, some jerk decideds hes going to change the passwd and
not tell anyone. real nice. haha

Chris Lee
Mediawaveonline.com




""A.D. Vijverberg"" <[EMAIL PROTECTED]> wrote in message
002301c07b4d$da653d20$cd64a8c0@milaan">news:002301c07b4d$da653d20$cd64a8c0@milaan...
> Hello,
>
> i have got a question I can't find the answer to. I want to enable my
users
> to change their password for a intranet and their mail account (different
> machine than the Intranet). i want my users to do this throug a web
> interface on the intranet. Can anyone tell me how I can make an app to do
> this in PHP. If a password chang request is made, the old password has to
be
> validated to prevent others to change the password while the computer is
> logged on to the intranet but the person of that system is away for some
> reason.
>
> And how can I change the password on the standalone mailserver (using the
> same concept as above) which is an other machine as the machine my
Intranet
> runs on.
>
> The machine for the Intranet is a suse 7.0 machine and the mailserver is a
> normal pc running Sun Solaris 2.6 intel.
>
> Thanx in advance.
>
> Kind regards,
>
> A.D. Vijverberg
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] looking for a PHP editor

2001-01-10 Thread Cal Evans

What extensions and where can you get them?

Cal
http://www.calevans.com

p.s. love homesite use it for everything from HTML to Java to php.


-Original Message-
From: Wacks, David [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 10, 2001 10:59 AM
To: 'Egan'; [EMAIL PROTECTED]
Subject: RE: [PHP] looking for a PHP editor


Personally, my team and I use HomeSite 4.5.x from Allaire.  It is PHP aware
and there are extensions you can add to allow PHP expression building. I
have used it for a coupe of years and fills my text building personality as
well as the graphical GUI ones with DW and browsing.

If you use DreamWeaver (DW), it usually comes as a freebie.

--Dave 

-Original Message-
From: Egan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 10, 2001 9:54 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] looking for a PHP editor


On Wed, 10 Jan 2001 10:50:40 -0400, Miles Thompson
<[EMAIL PROTECTED]> wrote:

> For a Windows environment I'll endorse jeremy's recommendation
> of Ultraedit -- my hammer of choice.

Am I the only one using HoTMetal Pro 6.0 on Windows?

Its PHP support has a very annoying bug when it encounters embedded
HTML output contained within PHP standard tags, but using PHP long
tags fixes that problem.  Long tags help in other ways too, because
they make HoTMetaL format your PHP script text as-is, letting you
control indenting of the PHP text the way you want.

And as long as you're not trying to embed HTML output inside your PHP
tags, you can use PHP short tags in contexts where they make the most
sense, like printing the contents of a single variable:

  VALUE=""

Notice the omission of the "print" command.  That's a neat little
trick I learned from Matt Zandstra's book.  Very helpful for quick
output of a single variable.

One thing I can no longer live without, is HoTMetaL's integrated FTP
support.  It's so good, the FTP site becomes part of your desktop.

I can open a remote FTP file for some quick changes, without even
storing it locally on my hard drive.  And then just as quickly, save
it back to the FTP site with the touch of one toolbar button.

OTOH, after an editing session where I make extensive changes to the
local copy of my project, its FTP file synchronization is everything I
could ask for.

And did I mention its excellent support for different HTML views like
tags-on, WYSIWYG, and raw source?

Did I mention its excellent table design and manipulation facilities?

Did I mention its project management?

Did I mention ...

Yes I could go on and on.  You get a screwdriver and some wrenches
with your hammer.  It's available at Amazon, discounted to about $70.


Egan




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] looking for a PHP editor

2001-01-10 Thread Egan

On Wed, 10 Jan 2001 09:58:34 -0700, "Wacks, David"
<[EMAIL PROTECTED]> wrote:

>Personally, my team and I use HomeSite 4.5.x from Allaire.

You did not mention the price (compared to HoTMetaL at $70).


Egan



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] knowing file's mime-type

2001-01-10 Thread Nikolai Vladychevski

Hello,
I am doing my own file manager over the web and for that application I
need to identify what mime-type has each file that user has on his own
space. I know I can code some parser of /etc/mime.types and use its data
to identify mime types by file extension, but first I would like to ask
if these functions are already included in some libraries or anywhere
else?

Tanks in advance

Nikolai

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Shopping Carts

2001-01-10 Thread Chris Lee

I use sessions combinded with utc

 function mtime()
 {
   $mtime = microtime();
   $mtime = ereg_replace('\.', '', $mtime);
   $mtime = explode(' ', $mtime);
   $mtime = $mtime[1] . $mtime[0];
  return($mtime);
 }

will ALLWAYS return a unique number, store this number in a session, each
user gets assigned a sessionID now each user has their own number, 100%
unique to themselves. this is how I seperate my users. Ive built quite a few
cart systems with this aproch. I store the cart right in the sessions, but I
have also set systems up where the cart is right in the db. I did the later
because a client wanted to have a way to see the % of users that put things
in their cart and never purchased, and % of products purchased to %
abandonded in their cart.

Your right on the IP system, here in the office I share the same IP with 12
people throught a NAT.

I dont know if you need to use an IP at all, if this is just for a cart...
then big deal, some script kiddy could try 36^32 possible combinations of a
PHPSESSID to try and hijack their cart ! haha. maybe for a something a
little more secure.

Chris Lee
Mediawaveonline.com



"Brandon Orther" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> I am making a shopping cart.  I am wondering on how I should separate each
> user.  I though the I.P. would be good but there can be a couple people on
> one I.P. so if someone is sharing an I.P. it will mess things up.. Anyone
> got a better way to do it?
>
> Thank you,
>
> 
> Brandon Orther
> WebIntellects Design/Development Manager
> [EMAIL PROTECTED]
> 800-994-6364
> www.webintellects.com
> 
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] knowing file's mime-type

2001-01-10 Thread Chris Lee

use exec() and unix's command 'file'

exec("file $filename");

and admire the output :)

http://www.php.net/manual/function.exec.php

Chris Lee
Mediawaveonline.com




"Nikolai Vladychevski" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
> I am doing my own file manager over the web and for that application I
> need to identify what mime-type has each file that user has on his own
> space. I know I can code some parser of /etc/mime.types and use its data
> to identify mime types by file extension, but first I would like to ask
> if these functions are already included in some libraries or anywhere
> else?
>
> Tanks in advance
>
> Nikolai
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Shorter way for "each"

2001-01-10 Thread Moritz Petersen

Hey Wico,


> echo implode (' ', $array);

this is quite a cool idea! For example

echo "" . implode("", $my_array) . "";

would save some time, printing out an select-group...

Thanks a lot, also to all other people, who helped me.

Mo.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] is there a builtin php function for this ?

2001-01-10 Thread Monte Ohrt

echo array_sum($price) * tax;

array_sum() was added to PHP 4.0.4.

Chris Lee wrote:
> 
>   function add_all($array)
>  {
>   foreach($array as $pos => $val)
>@$sum += $val;
>   return @$sum;
>  }
> 
>  $price[123] = 5;
>  $price[123] = 2;
>  $price[123] = 7;
>  $price[123] = 9;
> 
>  $tax = 0.14;
> 
>  echo add_all($price) * $tax;
> ?>
> 
> is there a built in function to replace add_all, I would like to have a
> add_all, multiply_all, divide_all, etc etc. a php function would just be
> nicer...
> 
> Chris Lee
> Mediawaveonline.com
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Monte Ohrt <[EMAIL PROTECTED]>
http://www.ispi.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] HELP HELP! PLEASE! Interfacing EMail to PHP

2001-01-10 Thread Dieter Kneffel

> Please help! Perhaps you have an idea what to do:
> 
> I want to get information directly from sendmail,
> like the body of the message and, very important,
> the receipients address.
> 
> So if someone sends an email to [EMAIL PROTECTED]
> I want to see who it was sent to.
> 
> Currently I am using a script that is triggered
> by an alias in /etc/aliases. Problem here is, I
> only get the header but no more information. This
> script isn't intended for one single user but for
> a whole domain, purpose is for messaging. So I
> really don't want to create a login for every possible
> name as I don't know the names before. You have
> to think of this like a short messaging service
> where you send a message to [EMAIL PROTECTED]
> with 0123456789 beeing the phone number of the
> subscriber.
> The above mentioned script gets the emails' contents
> from stdin but fails if e.g. the mail is sent as
> a blind copy (BCC) or if multiple receipients are
> listed in the header!
> 
> Do you have an idea for me? I was thinking about
> the mailertable, to do something similar as you
> do when you set up an UUCP account for a whole
> domain, but I don't know where I can interface.
> 
> So, any ideas are highly appreciated!
> 
> Thanks,
> 
> dk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Code diagnostics & profiling

2001-01-10 Thread Guille -bisho-

Anymody knows any way of making diagnostics of PHP code to make
optimizations???

In mod_perl exists a bunch of utilitys & modules to make this things like
Devel::DProf

I usually put PHP in the maximun Warning level and write them to a log file,
or using the debugger and see the output in other machine.

Also in PHP4 its imposible to use the debugger, so the things are harder...

-- 
 \|||/Guillermo Pérez Pérez
 < o   o >  - [EMAIL PROTECTED]
  \  L  /   - [EMAIL PROTECTED]
 -oOOo---oOOo-
 Onírica: Análisis, diseño e implantación de soluciones informáticas
  http://www.onirica.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re[2]: [PHP] declaring variables in class definitions

2001-01-10 Thread Max A. Derkachev

Hello sam1600,

Wednesday, January 10, 2001, 7:44:44 PM, you wrote:

>> $d->somevar = true;
>> and the next call to $d->b() will print nothing.
>> But you won't be able to assign a value to $somevar, if it is not
>> declared in the class.

sic> This does not appear to be true.  With error reporting set to max, and the 
sic> variables not defined in the class ( $somevar,$somevar2 and $somevar3 ),
sic> the following will echo out:
sic> Not set
sic> empty
sic> value of somevar2
sic> value of somevar3

sic> class a {
sic>function b(){
sic>  if (!isset($this->somevar))
sic>   echo "Not set";
sic>  if (empty($this->somevar))
sic>  echo "empty";
sic>   }
sic>}
sic> $d = new a;
$d->b();
$d->somevar2 = "value of somevar2";
$d->somevar3 = "value of somevar3";
echo $d->somevar2;
echo $d->somevar3;

try to assign something to $d->somevar if it is not declared in the
definition.


>> the method b() of the class a will break if you don't declare $somevar
>> in the class definition. In the string "if (!isset($this->somevar))"
>> it would throw an error saying that you have no variable named 'somevar' in
>> you class.

sic>  This does not appear to be true either, see above.

bad practice anyway

-- 
Best regards,
Max A. Derkachev mailto:[EMAIL PROTECTED]
Symbol-Plus Publishing Ltd.
phone: +7 (812) 324-53-53
http://www.Books.Ru -- All Books of Russia
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] looking for a PHP editor

2001-01-10 Thread Philip Olson


> >Personally, my team and I use HomeSite 4.5.x from Allaire.
> 
> You did not mention the price (compared to HoTMetaL at $70).

my two cents on price.  who cares!  if an editor makes one happy then pay
as much as it takes to get it.  consider how many hours are spent with the
editor.  18 hours a day?  in the end, what's $20?  $200?  homesite is
about $90.

oh btw, i use homesite and vim , and vim is free! :)

philip


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] looking for a PHP editor

2001-01-10 Thread Boget, Chris

> > >Personally, my team and I use HomeSite 4.5.x from Allaire.
> > You did not mention the price (compared to HoTMetaL at $70).
> my two cents on price.  who cares!  if an editor makes one 
> happy then pay as much as it takes to get it.  consider how many 
> hours are spent with the editor.  18 hours a day?  in the end, what's 
> $20?  $200?  homesite is about $90.
> oh btw, i use homesite and vim , and vim is free! :)

Plus, Homesite has project management and can interface 
with source control applications (we use VSS) whereas I 
believe HoTMetaL does not.  I don't particularly like Homesite
(there are many things I despise about it, as a matter of fact),
but it's the only one that I know of (on a windows OS) that has
these features.  If there were another, I think I'd probably switch
in a heartbeat.

Chris



[PHP] cgi--remove X-Powered-By and Content-type

2001-01-10 Thread Tom Harris

I'm sure this is an easy question (I'm just too dumb to figure it out).

When I run a php script from the shell it always outputs
X-Powered-By: PHP/4.0.3pl1
Content-type: text/html

Normally I just ignore this, but I've been using cron to run a php script
and I'm getting my mailbox cluttered with messages that just contain the
above 2 lines.  Is there a way to make the cgi version of php not send those
two lines.  I tried changing default_mimetype ="" in the php.ini file but
that didn't work.

Thanks



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] cgi--remove X-Powered-By and Content-type

2001-01-10 Thread Philip Olson

Add a -q

#!/usr/local/bin/php -q 

To suppress them.


Philip Olson
http://www.cornado.com/

On Wed, 10 Jan 2001, Tom Harris wrote:

> I'm sure this is an easy question (I'm just too dumb to figure it out).
> 
> When I run a php script from the shell it always outputs
> X-Powered-By: PHP/4.0.3pl1
> Content-type: text/html
> 
> Normally I just ignore this, but I've been using cron to run a php script
> and I'm getting my mailbox cluttered with messages that just contain the
> above 2 lines.  Is there a way to make the cgi version of php not send those
> two lines.  I tried changing default_mimetype ="" in the php.ini file but
> that didn't work.
> 
> Thanks
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] cgi--remove X-Powered-By and Content-type

2001-01-10 Thread Cynic

I think you could also turn expose_php off in php.ini (if you 
use it)

At 19:11 10.1. 2001, Philip Olson wrote the following:
-- 
>Add a -q
>
>#!/usr/local/bin/php -q 
>
>To suppress them.
>
>
>Philip Olson
>http://www.cornado.com/
>
>On Wed, 10 Jan 2001, Tom Harris wrote:
>
>> I'm sure this is an easy question (I'm just too dumb to figure it out).
>> 
>> When I run a php script from the shell it always outputs
>> X-Powered-By: PHP/4.0.3pl1
>> Content-type: text/html
>> 
>> Normally I just ignore this, but I've been using cron to run a php script
>> and I'm getting my mailbox cluttered with messages that just contain the
>> above 2 lines.  Is there a way to make the cgi version of php not send those
>> two lines.  I tried changing default_mimetype ="" in the php.ini file but
>> that didn't work.
>> 
>> Thanks
>> 
>> 
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>> 
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
--end of quote-- 




Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Calling a funtion inside a function

2001-01-10 Thread Alan Todd
 smime.p7m


Re: [PHP] looking for a PHP editor

2001-01-10 Thread Egan

On Wed, 10 Jan 2001 17:54:07 + (GMT), Philip Olson
<[EMAIL PROTECTED]> wrote:

>> >Personally, my team and I use HomeSite 4.5.x from Allaire.
>> 
>> You did not mention the price (compared to HoTMetaL at $70).
>
>my two cents on price.  who cares!

>philip

No need to get ballistic.  I just wanted to know if its price is in a
range where I might consider it at some future time.

I chose HoTMetaL after briefly considering a few products.  I didn't
have time to undertake an in-depth analysis of every HTML product on
the market.  More than anything else, I needed to get up and running
quickly, having had very little HTML experience myself.

So far, HoTMetaL has provided everything I need.  But as my experience
grows, perhaps my needs will too.

Relax.  This work is not hard!

:-)


Egan



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Functions

2001-01-10 Thread Marcelo Gulin

Hi!

  ShowMessage();

regards
Marcelo Gulin

Augusto Cesar Castoldi escribió:
> 
> How do I use a function?
> 
> I did:
> 
> function ShowMessage {
>   echo "Show message...\n";
> }
> 
> How can I call the function now?
> 
> thanks,
> 
> Augusto Cesar Castoldi
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] looking for a PHP editor

2001-01-10 Thread Cynic

agreed, 4.5.2 still contains pretty old bugs.
UltraEdit is bugfree (at least I haven't encountered any), has 
project management capabilities (but cannot make use of a 
version control system, AFAIK).

At 18:59 10.1. 2001, Boget, Chris wrote the following:
-- 
>> > >Personally, my team and I use HomeSite 4.5.x from Allaire.
>> > You did not mention the price (compared to HoTMetaL at $70).
>> my two cents on price.  who cares!  if an editor makes one 
>> happy then pay as much as it takes to get it.  consider how many 
>> hours are spent with the editor.  18 hours a day?  in the end, what's 
>> $20?  $200?  homesite is about $90.
>> oh btw, i use homesite and vim , and vim is free! :)
>
>Plus, Homesite has project management and can interface 
>with source control applications (we use VSS) whereas I 
>believe HoTMetaL does not.  I don't particularly like Homesite
>(there are many things I despise about it, as a matter of fact),
>but it's the only one that I know of (on a windows OS) that has
>these features.  If there were another, I think I'd probably switch
>in a heartbeat.
>
>Chris
--end of quote-- 




Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   3   4   >