php-general Digest 15 Feb 2001 21:10:31 -0000 Issue 514

Topics (messages 39858 through 39980):

Re: Undocumented Socket functions?
        39858 by: Rick Hodger
        39859 by: Rog

Re: CSETI Announcement - Urgent Disclosure Project Update
        39860 by: James Moore

Concatenate a variable.
        39861 by: Fabian Fabela
        39863 by: Fabian Fabela

Re: Oracle Web & Php
        39862 by: kaab kaoutar

Cookies
        39864 by: kaab kaoutar
        39867 by: Netbrain di M.L.
        39868 by: Ankur Verma
        39869 by: kaab kaoutar
        39872 by: Netbrain di M.L.

Get a variable from a variable.
        39865 by: Fabian Fabela
        39896 by: Jason Stechschulte

Compiling with Sablotron and XML
        39866 by: Paulo Jan

PHP Charts
        39870 by: Phil Lambert
        39873 by: Ankur Verma

Re: need better solution
        39871 by: Christian Reiniger

problem with pack function
        39874 by: Olivier ZILLER

Array
        39875 by: David Tandberg-Johansen
        39883 by: Ankur Verma
        39924 by: Philip Olson
        39980 by: Dallas Kropka

stupid problem!
        39876 by: kaab kaoutar
        39889 by: Jon Haworth
        39891 by: kaab kaoutar

Re: Array question
        39877 by: Christian Reiniger
        39955 by: Chris

Re: A little code here? :)
        39878 by: Christian Reiniger

Re: php vs perl
        39879 by: Christian Reiniger
        39885 by: Jason Brooke

Re: currency conversion
        39880 by: Robin Vickery
        39897 by: Adrian Murphy

PWS & PHP
        39881 by: kaab kaoutar
        39886 by: Phil Driscoll
        39890 by: Ankur Verma
        39907 by: kaab kaoutar
        39919 by: Phil Driscoll
        39928 by: Phil Driscoll

Re: Specific PHP/JSP questions
        39882 by: Ben Peter
        39903 by: Michael Kimsal

Re: Structuring large PHP programs
        39884 by: Ben Peter

Re: PDF Functions
        39887 by: Mathias Meyer
        39935 by: Mike Tuller
        39937 by: Mike Tuller

Generate XML files
        39888 by: Paulo Jan

Debugger, Debugger and Debugger
        39892 by: Ricardo D'Aguiar
        39910 by: Chris Lee

Re: deleting cart items on session expire
        39893 by: Jørg V. Bryne
        39901 by: Billy Harvey

MVC Framework in PHP?
        39894 by: Alexander, Jason

Re: HTTP authentication
        39895 by: Jason Stechschulte
        39902 by: John Vanderbeck

file upload size limits
        39898 by: Scott
        39917 by: Nick Winfield

Question about ImageCopy and colors
        39899 by: David Raufeisen

Re: XML parsing without the PHP4 XML functions
        39900 by: Shaun Batterton

Compiling PHP for Apache.
        39904 by: Scott Fletcher
        39908 by: Martin A. Marques

Charts
        39905 by: Phil Lambert

Can't access a mail archive
        39906 by: dphillips.rfdinc.com

Re: [PHP-WIN] Bug in mktime-function ?
        39909 by: Boget, Chris

Session Questions...
        39911 by: John Vanderbeck
        39963 by: Martin A. Marques

parse error driving me nuts ...
        39912 by: Andrew
        39915 by: Jon Haworth
        39916 by: Ifrim Sorin
        39918 by: John Vanderbeck
        39920 by: Andrew
        39922 by: John Vanderbeck

File_exists function question.
        39913 by: Gerry
        39956 by: Ben Peter
        39973 by: Gerry

PHP Socket working (sorta)
        39914 by: Rog

Re: ereg_replace
        39921 by: Brian V Bonini
        39923 by: John Vanderbeck
        39930 by: Brian V Bonini
        39934 by: Robin Vickery
        39945 by: Brian V Bonini
        39954 by: Robin Vickery

Magazine Subscription Script
        39925 by: Andy

Job offer in central London (repost)
        39926 by: Simon Gornall

Re: [phplib]  ct_sql bug - PHPLIB & page_close()
        39927 by: Bogdan Morar

Re: PWS & PHP              Thanks
        39929 by: kaab kaoutar

Extra whitespace when decrypting data with mcrypt
        39931 by: Iain Donaldson

unstable execution of  mysql_db_query($db, $myQuery)
        39932 by: Zhu George-CZZ010
        39938 by: Joe Sheble (Wizaerd)
        39965 by: Martin A. Marques

SMTP
        39933 by: Sebastien Le Floc'h

Question about PDF functions and PDFLib 3.03
        39936 by: Vladimir Novakovic

Is there a MOD function in PHP
        39939 by: Randall Perry
        39940 by: Egon Schmid (.vacation)
        39941 by: Alexander Wagner
        39943 by: Mukul Sabharwal
        39946 by: Randall Perry

Reindexing Arrays
        39942 by: Nathan Cassano
        39947 by: Philip Olson

Exception handling
        39944 by: Alain Fontaine

How to inverse the date sorting
        39948 by: Malouin Design Graphique
        39949 by: Joe Sheble (Wizaerd)

javascript in PHP statements
        39950 by: Matt Davis

freeTDS installation
        39951 by: Scott Fletcher

Help with session
        39952 by: Karl J. Stubsjoen

Re: How to inverse the date sorting [IT WORKS! - THANKS!]
        39953 by: Malouin Design Graphique

Re: recommended PHP/MySQL host
        39957 by: Angela

Count columns in array
        39958 by: Fabian Fabela
        39959 by: James Atkinson
        39960 by: Mukul Sabharwal
        39962 by: Philip Olson

Best Remote Php/Mysql host
        39961 by: kaab kaoutar

Where is Regex List of Operators?
        39964 by: Ted Goranson
        39970 by: Christopher Ostmo

MS SQL and Date Fields
        39966 by: James Crowley

case sensitivity checking?
        39967 by: James, Yz
        39972 by: Mark Maggelet
        39974 by: James, Yz
        39975 by: Martin A. Marques

$HTTP_POST_VARS
        39968 by: Augusto Cesar Castoldi

Editor with line counter for WIN95
        39969 by: Info

Re: Search Engines and PHP
        39971 by: Mark Maggelet

php site, parse error
        39976 by: Javier Muniz
        39977 by: Martin A. Marques
        39978 by: Javier Muniz
        39979 by: Philip Olson

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]


----------------------------------------------------------------------



"Daniel Grace" <[EMAIL PROTECTED]> wrote in message
96g30n$jgi$[EMAIL PROTECTED]">news:96g30n$jgi$[EMAIL PROTECTED]...

> "Rog" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Can anyone here decipher for me some of the undocumented Socket
functions
> > in PHP4?
> >
> > For instance, how do I use select() to multiplex multiple connections?
> >
> > With the functions that are documented, there is a nice example of a
> simple
> > echoing TCP server, but it only accepts a single connection which has
> > limited usage. Can anyone come up with an example to expand that to
> > multiple connections.
>
> I too would be interested in knowing this. I was once (and still am)
> interested in developing a MUD (= multi-user text-based game) engine
> entirely in PHP. This would be nice because powerful scripts and stuff
like
> that could be coded within the mud and executed on-the-fly if proper
> considerations were taken towards stability and security.

I'm not honestly sure if it'd be possible. Normally you would have a daemon
running that listens for incoming connections and then spawns another
process for each connection. Then the daemon goes back to listening. As far
as I know, PHP doesn't have any sort of fork() or process spawning type
commands.

--
Rick Hodger






Rick Hodger wrote:
 >I'm not honestly sure if it'd be possible. Normally you would have a daemon
 >running that listens for incoming connections and then spawns another
 >process for each connection. Then the daemon goes back to listening. As far
 >as I know, PHP doesn't have any sort of fork() or process spawning type
 >commands.

It should be entirely possible to manage multiple connections to a socket 
using the alternative to forking, select(). I don't know enough about 
select() and its corresponding functions, but they are there and they 
should allow the ability to step through and deal with each connection 
without ever forking a new process.

Those functions are part of the Socket extension to PHP, but they are 
undocumented. I would be very happy to see an example of their usage in PHP 
(as the C examples are leaving me quite baffled).

--
                     Visit the Gates Motel webgame:
                     http://www.gameslate.com/gatesmotel/





Please read and forward.

-----Original Message-----
From: James [mailto:[EMAIL PROTECTED]]
Sent: 14 February 2001 21:39
To: Young, Stuart; Raf; Nicky Gosney; Nick;
[EMAIL PROTECTED]; John Boddy; Iain; Green, Karen; Darren S;
Andy; [EMAIL PROTECTED]
Subject: FW: CSETI Announcement - Urgent Disclosure Project Update


 
-----Original Message-----
From: Tony Craddock [mailto:[EMAIL PROTECTED]]
Sent: 14 February 2001 05:35
To: [EMAIL PROTECTED]
Subject: CSETI Announcement - Urgent Disclosure Project Update


                Please Post and Distribute As Desired

Since August of 2000, the CSETI Disclosure Project has recorded the
testimony of over 100 military, government and related witnesses to UFO
events and
projects from around the world.  The testimony of these courageous witnesses
creates a permanent archive with the most profound implications as it
constitutes dozens of first-hand, often top-secret witnesses to UFO events,
internal UFO -related government projects and covert government activities
related to UFOs, Extraterrestrial Intelligence and exotic energy and
propulsion system projects. These 100 witnesses constitute the tip of a
larger pool of over 400 prospective witnesses, many of whom would prefer
coming forward first in formal Congressional hearings --which we hope will
follow the upcoming planned disclosure event.

This testimony is on broadcast quality digital videotape and audio tape.
Printed transcriptions of the testimony are currently being created.

We are requesting that any further military, government, government-
contractor or related witnesses to UFO events and projects contact CSETI
Director Dr. Steven Greer immediately for inclusion in the briefing
materials and the upcoming disclosure event. Such witnesses may contact Dr.
Greer via
the CSETI website at www.cseti.org <http://www.cseti.org/>  or at 540 456
8302 (government witnesses
only should use this number, please).

Additionally, any other substantial, supporting evidence, such as government
documents, high quality UFO photographs and videotaped images, hard evidence
etc. should similarly be referred to the project for inclusion in the final
briefing materials and disclosure Press Conference.

The date for the Disclosure Press  Conference and related activities in
Washington DC has been set and will occur in the Spring of this year (2001).

Prior to the Disclosure Press Conference we will be conducting private
briefings for key leaders in society, government and related institutions
(for example, members of the US Congress, White House staff, scientific and
religious leaders etc). If you have good access to such leaders and can
assist with arranging  a briefing please contact Dr. Greer as soon as
possible.

This body of testimony is being edited and the over 100 hours of testimony
will be condensed into a 2 hour briefing video. Additionally, a written
briefing document consisting of witness testimony transcripts, government
documents and important case material and policy papers is being prepared
for use in the briefings and in the Disclosure Press Conference in
Washington.

The Disclosure Press Conference will present many of the government
witnesses in person, and the other evidence and briefing materials will  be
available
to the media at that time.  People with excellent national and international
media contacts  who can assist pro bono with media coordination are invited
to contact Dr. Greer also.

Unfortunately, a documentary containing this witness testimony will not be
available as there are insufficient funds to complete such a project.

We would like to thank all of the supporters and contributors to this
historic effort and especially the witnesses who have come together to let
the world know the truth about this very important matter.

Anyone who would like to help support this effort is invited to make a
tax-deductible contribution to : The Disclosure Project, PO Box 265, Crozet
Va 22932.

Further updates will be issued as the date for the event approaches.

Again, we would like to thank our many supporters for their assistance in
and dedication to disclosing the truth.

The Disclosure Project
CSETI
11 February 2001





Hello.

I receive from a post T1, T2, T3, ... Tn

I want to put then in an array with a for, how can I do that?
How can I use $T$i ???

Thank you

Fabian Fabela
[EMAIL PROTECTED]
www.vacagorda.com





Sorry

I know the answer now.

Thank you

Fabian Fabela

From: "Fabian Fabela" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 15, 2001 3:30 AM
Subject: [PHP] Concatenate a variable.


Hello.

I receive from a post T1, T2, T3, ... Tn

I want to put then in an array with a for, how can I do that?
How can I use $T$i ???

Thank you

Fabian Fabela
[EMAIL PROTECTED]
www.vacagorda.com







Hi!
I mean running php in an oracle server!
thanks


>From: Adi Wibowo <[EMAIL PROTECTED]>
>To: kaab kaoutar <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED], [EMAIL PROTECTED]
>Subject: Re: [PHP] Oracle Web & Php
>Date: Thu, 15 Feb 2001 02:22:03 +0700 (GMT+0700)
>
>
>On Wed, 14 Feb 2001, kaab kaoutar wrote:
> > Hi!
> > thanks but i'm talking of oracle server! i mean instead of using pws or 
>IIS
> > or apache , may i use php with an oracle server
> >
> > thanks
>
>Yes, you could access oracle server using PHP without any web server.
>Just compile it as a CGI (without any kind of web server flag).
>
>But it still has the same instruction manual.
>Try looking at "Oracle Functions" or "Oracle 8 Functions" at PHP manual.
>Hope it help.
>
>
>Adi Wibowo -------------------------------
>* Work matter    : [EMAIL PROTECTED]
>* Private matter : [EMAIL PROTECTED]
>------------------------------------------
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





Hi!
I'm about to use cookies in my application, and i'm intersted in using 
baskets, i mean while the user surfing in my web site, he can select items 
and it will be added to the basket etc (like the classical shopping) !
can u point me to a url with details information about cookies(i've read the 
one of the manual) and php samples about cookies and baskets stuff ...
what about if cookies are disactivated in a user browser ?

Thanks a lot !


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.






Using PHP4 I think u should store your vars on session and pass the
session_id() for all your web pages ...

take a look at the sess-cap on the php man ....

I hope this help
max
-------------------
Please Help Puppies
-------------------
x

On Thu, 15 Feb 2001, kaab kaoutar wrote:

> Hi!
> I'm about to use cookies in my application, and i'm intersted in using 
> baskets, i mean while the user surfing in my web site, he can select items 
> and it will be added to the basket etc (like the classical shopping) !
> can u point me to a url with details information about cookies(i've read the 
> one of the manual) and php samples about cookies and baskets stuff ...
> what about if cookies are disactivated in a user browser ?
> 
> Thanks a lot !
> 
> 
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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]
> 





instead of using cookies to store the informatioon about the stuff selected
by the user while browsing your site, I would suggest that you use sessions
to manage the user basket. Go through the information available at

http://www.devshed.com/Server_Side/PHP/

and

http://www.phpbuilder.com/columns/mattias20000312.php3

for information on implementing sessions and shopping carts in PHP

hope that helps

best regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India

----- Original Message -----
From: "kaab kaoutar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 15, 2001 3:15 PM
Subject: [PHP] Cookies


> Hi!
> I'm about to use cookies in my application, and i'm intersted in using
> baskets, i mean while the user surfing in my web site, he can select items
> and it will be added to the basket etc (like the classical shopping) !
> can u point me to a url with details information about cookies(i've read
the
> one of the manual) and php samples about cookies and baskets stuff ...
> what about if cookies are disactivated in a user browser ?
>
> Thanks a lot !
>
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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]





Ok !
So it has nothing to do with cookies ?!
and i should focus on session part ?
in the manual there is only one chapter called Session handling functions !
Thanks a lot !

>From: "Netbrain di M.L." <[EMAIL PROTECTED]>
>To: kaab kaoutar <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED]
>Subject: Re: [PHP] Cookies
>Date: Thu, 15 Feb 2001 03:53:09 -0600 (CST)
>
>
>Using PHP4 I think u should store your vars on session and pass the
>session_id() for all your web pages ...
>
>take a look at the sess-cap on the php man ....
>
>I hope this help
>max
>-------------------
>Please Help Puppies
>-------------------
>x
>
>On Thu, 15 Feb 2001, kaab kaoutar wrote:
>
> > Hi!
> > I'm about to use cookies in my application, and i'm intersted in using
> > baskets, i mean while the user surfing in my web site, he can select 
>items
> > and it will be added to the basket etc (like the classical shopping) !
> > can u point me to a url with details information about cookies(i've read 
>the
> > one of the manual) and php samples about cookies and baskets stuff ...
> > what about if cookies are disactivated in a user browser ?
> >
> > Thanks a lot !
> >
> >
> > 
>_________________________________________________________________________
> > Get Your Private, Free E-mail from MSN Hotmail at 
>http://www.hotmail.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]
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.






On Thu, 15 Feb 2001, kaab kaoutar wrote:

> So it has nothing to do with cookies ?!

No, I did not say this ... I think u need to associate a unique_id for
each client/customer and store the basket's vars on it ...

u know that the session_id is passed on all your pages:

- via cookies
- via get/post method

if cookies failed (cookies that store the session_id) 'cause the client
browser doesn't accept them, you always have the session_id() passed on
the query string or post data ...

Anyway I suggest u to read a very interesting column about this topic that
u can find at phpbuilder.com (".. A simple shopping cart using session
..") ... 

> and i should focus on session part ?
> in the manual there is only one chapter called Session handling functions !

max





Hello,

In $a I have the name of the array that I want to use.

For example.

$a="myarray";

I need to send

myFunction($myarray);

if I try myArray($a); the string "myarray" is sent, and I want to send $myarray that 
is the text in $a.

Thank you.



Fabian Fabela
[EMAIL PROTECTED]
www.vacagorda.com





On Thu, Feb 15, 2001 at 03:57:58AM -0600, Fabian Fabela wrote:
> $a="myarray";
> myFunction($myarray);
> if I try myArray($a); the string "myarray" is sent, and I 
> want to send $myarray that is the text in $a.

You were pretty close.  I think you want to try this:

myFunction($$a);

It is a variable variable.
http://www.php.net/manual/en/language.variables.variable.php

-- 
Jason Stechschulte
[EMAIL PROTECTED]
--
Just don't create a file called -rf.  :-)
             -- Larry Wall in <[EMAIL PROTECTED]>




Hi all:

        I am working now on a project where I want to use PHP's XML and XSLT
capabilities. The problem is that, after searching the list archives, I
have seen endless questions from people who have had problems compiling
PHP4 with Sablotron and XML support, so before I start with it, I would
like to make sure of some things:

        1) Can I compile correctly the latest version of Sablotron with PHP
4.0.4p1? (which is the version of PHP I'm using).
        2) If so, do I need to install the full version of expat? Up to now I
had been compiling PHP with the bundled version of expat (expat-lite)
that came with the Apache sources. In that case, would I havwe to
recompile Apache using the full version of Expat too?
        3) If I can't use Sablotron with PHP 4.0.4p1, which other version
should I use? Will PHP 4.0.3p1 do?



                                        Thanks in advance,


                                                Paulo Jan.
                                                DDnet.




Hi everyone,
    im making a statistics type program and was wondering if anyone knew of
some PHP libraries to produce charts/graphs etc.

Cheers
    Phil

P.S.  Can you please reply to this address as im not on the mailing list
anymore





http://www.phpbuilder.com/columns/allan20000830.php3

http://www.phpbuilder.com/snippet/detail.php?type=snippet&id=183

http://phpclasses.upperdesign.com/browse.html/class/11


This is a great class for printing HTML graphs

http://www.advgraph.regiocom.net/

hope that helps

best regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India


----- Original Message -----
From: "Phil Lambert" <[EMAIL PROTECTED]>
To: "PHP-General Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 15, 2001 3:44 PM
Subject: [PHP] PHP Charts


> Hi everyone,
>     im making a statistics type program and was wondering if anyone knew
of
> some PHP libraries to produce charts/graphs etc.
>
> Cheers
>     Phil
>
> P.S.  Can you please reply to this address as im not on the mailing list
> anymore
>
>
> --
> 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]





On Thursday 15 February 2001 02:49, Christian Dechery wrote:

> > > that's kinda what I have here... but the line of code isn't being
> > > shown... and that is the problem... I for one, think that in an
> > > error message the line of code is crucial.
> >
> >Check the manual for set_error_handler ()
>
> well... that could help, but even than I'd have to call that
> error_handler everytime I execd a query and still would have to pass to
> it the __LINE__ of code...

Read that section again. That error handler is called automatically every 
time an error occurs, and __LINE__ is also passed automatically to it.

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

I saw God --------- and she was black.




Hello,

I need to generate the value '0A 00 00 00' with the pack function.
How to do this?

TIA






How can I delete one record in a array?

Example:

$myarray = array ("a", "b", "c");

I want to delete/take away "b" so the array is:

$myarray = array ("a", "c");

David






use

array_splice ($myarray, 1 ,1);

hope that helps


best regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India
----- Original Message ----- 
From: "David Tandberg-Johansen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 15, 2001 4:35 PM
Subject: [PHP] Array


> How can I delete one record in a array?
> 
> Example:
> 
> $myarray = array ("a", "b", "c");
> 
> I want to delete/take away "b" so the array is:
> 
> $myarray = array ("a", "c");
> 
> David
> 
> 
> 
> -- 
> 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]





Try this :

<?php

    $foo = array('a','b','c');

      unset($foo[1]);

      print_r($foo);    // [0] => a [2] => c

    $bar = array('a','b','c');

      $piece = array_splice ($bar, 1 ,1);

      print_r($piece);  // [0] => b 

      print_r($bar);    // [0] => a [1] => c 

?>

    http://www.php.net/manual/en/function.array-slice.php

    http://www.php.net/manual/en/function.unset.php

Regards,


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

On Thu, 15 Feb 2001, David Tandberg-Johansen wrote:

> How can I delete one record in a array?
> 
> Example:
> 
> $myarray = array ("a", "b", "c");
> 
> I want to delete/take away "b" so the array is:
> 
> $myarray = array ("a", "c");
> 
> David
> 
> 
> 
> -- 
> 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]
> 





if you want to "securely" remove an element of an array ....

$objects =
array('first','second','third','fourth','fifth','sixth','seventteen');

function remove_element($array, $left_id, $right_id) // Remove Element
// left_id is element position(counts from 1)
// right_id array position (counts from 0)

{ 
$left = array_slice ($array, 0, $left_id); 
$right = array_slice ($array, $right_id); 

$array = array_merge ($left, $right); 

unset ($left); 
unset ($right); 

return $array; 
} 

// just give both information of the element you want to remove. 
// if youi want to remove the third element transmit the array 
// position (2) and the "real" position (3) to the function, 
// and the element is gone ... 

$objects = remove_element($objects, 2,3);



found on this page of PHP.Net
http://www.php.net/manual/en/function.array-slice.php




-----Original Message-----
From: David Tandberg-Johansen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 15, 2001 5:05 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Array


How can I delete one record in a array?

Example:

$myarray = array ("a", "b", "c");

I want to delete/take away "b" so the array is:

$myarray = array ("a", "c");

David



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






when i try the phinfo test in a php file it works!
however when i put it in an htm file it does not work :

<html><head><title>PHP Test</title></head>
<body>
<?php
phpinfo();
?>
</body></html>

It gives me a blank page

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





This is because your server is set up to parse .php files as php, and .html
files as html.

If you have access to your httpd.conf or whatever, you can set it to include
.html files in the php parsing. If not, you'll have to stick with calling
your php files .php.

HTH
Jon


-----Original Message-----
From: kaab kaoutar [mailto:[EMAIL PROTECTED]]
Sent: 15 February 2001 11:12
To: [EMAIL PROTECTED]
Subject: [PHP] stupid problem!


when i try the phinfo test in a php file it works!
however when i put it in an htm file it does not work :

<html><head><title>PHP Test</title></head>
<body>
<?php
phpinfo();
?>
</body></html>

It gives me a blank page

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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]





Oh yes u're right it's that once installing i just cares for php file !
but when i try now, i find that thaere are existent phpfile keys that are 
already filled with things related to, for instance in the 
shell->open->commnand default ihave the following :
"C:\PROGRA~1\Plus!\MICROS~1\iexplore.exe" -nohome
may i erase it and put instead it c:\php\php.exe -q %1 ?
Thanks

>From: Jon Haworth <[EMAIL PROTECTED]>
>To: 'kaab kaoutar' <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
>Subject: RE: [PHP] stupid problem!
>Date: Thu, 15 Feb 2001 12:14:35 -0000
>
>This is because your server is set up to parse .php files as php, and .html
>files as html.
>
>If you have access to your httpd.conf or whatever, you can set it to 
>include
>.html files in the php parsing. If not, you'll have to stick with calling
>your php files .php.
>
>HTH
>Jon
>
>
>-----Original Message-----
>From: kaab kaoutar [mailto:[EMAIL PROTECTED]]
>Sent: 15 February 2001 11:12
>To: [EMAIL PROTECTED]
>Subject: [PHP] stupid problem!
>
>
>when i try the phinfo test in a php file it works!
>however when i put it in an htm file it does not work :
>
><html><head><title>PHP Test</title></head>
><body>
><?php
>phpinfo();
>?>
></body></html>
>
>It gives me a blank page
>
>_________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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]

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





On Thursday 15 February 2001 01:40, Chris wrote:

> How do I get the index,number of an array if reffering to an array via
> string? Ex:
> I have 100 arrays, and I want to know what #  myarray["something"] is.

That element doesn't have an index number such arrays are implemented as 
hashes or trees, which don't store data at "fixed positions" (that's a 
very bad explanation, but, well...)
The "index" is the "key" in this case - in your example it's "something".

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

I saw God --------- and she was black.




Ok,
But can't the array still be refered to with a number?
So in myarray["something"] is the 50th element in the array, wouldn't:
 
myarray[49] = myarray["something"]

?



> On Thursday 15 February 2001 01:40, Chris wrote:
> 
> > How do I get the index,number of an array if reffering to an array via
> > string? Ex:
> > I have 100 arrays, and I want to know what #  myarray["something"] is.
> 
> That element doesn't have an index number such arrays are implemented as 
> hashes or trees, which don't store data at "fixed positions" (that's a 
> very bad explanation, but, well...)
> The "index" is the "key" in this case - in your example it's "something".
> 
> -- 
> Christian Reiniger
> LGDC Webmaster (http://sunsite.dk/lgdc/)
> 
> I saw God --------- and she was black.
> 
> -- 
> 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]





On Thursday 15 February 2001 04:31, Dallas Kropka wrote:
> I have a few text input boxes that I am using to allow the client to
> compose emails for a mailing list... does anyone have a little snippet
> that will take the "\n's" and turn them into <BR>'s? I would attempt to
> write one myself.... but Im not the best at ereg or replace code...

nl2br () is the simple solution (as others already mentioned).
Attached is a more sophisticated one I use in my code. It detects 
paragraphs (empty lines), and highlights URLs and email adresses.

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

I saw God --------- and she was black.
<?php

/*
 * $Id: text2html.php,v 1.7 2001/01/07 21:03:23 chris Exp $
 */


function pbText2HTML ($Text, $LinkStyleClass = '', $LinkTarget = '')
{
	$NewText      = "";
        $LastWasBlank = true;

        // (1) quote all HTML entities (assumes iso8859-1)
	$Text = htmlentities ($Text);

	// (2) Divide into paragraphs and
        // (3) Add markup for URLs
	foreach (explode ("\n", $Text) as $CLine)
	{
		$CLine = trim ($CLine);

		if ($CLine == '') {
			if ($LastWasBlank) {
                                // ignore multiple blank lines
				continue;
			}
			else {
				$LastWasBlank = true;
				$NewText .= "</p>\n";
			}
		}
		else {
			if ($LastWasBlank) {
                                $LastWasBlank = false;
				$NewText .= "<p>\n";
			}

			$NewText .= pb_t2h_URLMarkup ($CLine,
						      $LinkStyleClass,
						      $LinkTarget);
			$NewText .= "\n";
		}
	}

        return $NewText;
}



function pb_t2h_URLMarkup ($Text, $StyleClass = '', $Target = '')
{
	if ($StyleClass != '')
		$ClassS = " class='$StyleClass'";
	else
		$ClassS = "";

	if ($Target != '')
		$TargetS = " target='$Target'";
	else
		$TargetS = '';

	$Patterns = array ('/([^"\'])(http:\/\/[\w\.\/~\-]+)/',
                           '/([^"\'])(ftp:\/\/[\w\.\/~\-]+)/',
			   '/([^"\'\w-\.\/])(www\.[\w\.\/~\-]+)/',
			   '/^(www\.[\w\.\/~\-]+)/',
			   '/([\w\.~\-=]+@[\w\.~\-]+)/');

	$Replacements = array ("\\1<a href='\\2'$ClassS$TargetS>\\2</a>",
			       "\\1<a href='\\2'$ClassS$TargetS>\\2</a>",
			       "\\1<a href='http://\\2'$ClassS$TargetS>\\2</a>",
			       "<a href='http://\\1'$ClassS$TargetS>\\1</a>",
                               "<a href='mailto:\\1'$ClassS>\\1</a>");

	return preg_replace ($Patterns, $Replacements, $Text);
}


?>




On Thursday 15 February 2001 08:03, Scott Mebberson wrote:
> When Jason says 'especially when your note using the cgi' he means the
> cgi version of PHP (I think) in preference to installing PHP as an
> apache module.

...just as using mod_perl is better than perl as CGI

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

I saw God --------- and she was black.




> When Jason says 'especially when your note using the cgi' he means the
> cgi version of PHP (I think) in preference to installing PHP as an
> apache module.


Almost, yes - I literally meant the 'common gateway interface', due to the
fact that the webserver spawns the requested script/program outside of it's
own process. I don't know the technical detals involved in doing this, but I'm
guessing that in general, it'd incur more overhead on the system than the same
code would if it was parsed by the already-running httpd process.

jason







>>>>> "c" == christian  <[EMAIL PROTECTED]> writes:

 > does anyone know of a way to currency conversions with php? i want
 > to grab the current currency from some kind of web site and then
 > convert money to different currency value

I'm sure plenty of people have done this properly, but here's a
quick hack to use Xe's currency converter.


<?php

class currency 
{

  function convert($amount, $from, $to) {
    
    $regex = "/[0-9.]+\s*$from\s*=\s*([0-9.]+)\s*$to/";

    $return = file ("http://www.xe.net/ucc/convert.cgi?Amount=1&From=$from&To=$to");

    foreach ($return as $line) {
      if( preg_match($regex, $line, $match) ) break;
    }

    if (!isset($match)) return false;

    return $amount * $match[1];

  }

}

$money = new currency;

print $money->convert( 10, "GBP", "AUD" );

?>


-- 
Robin Vickery.................................................
BlueCarrots, 14th Floor, 20 Eastbourne Terrace, London, W2 6LE




How legal is this?
can u use it on a website?
free?


----- Original Message -----
From: Robin Vickery <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 15, 2001 10:46 AM
Subject: Re: [PHP] currency conversion


> >>>>> "c" == christian  <[EMAIL PROTECTED]> writes:
>
>  > does anyone know of a way to currency conversions with php? i want
>  > to grab the current currency from some kind of web site and then
>  > convert money to different currency value
>
> I'm sure plenty of people have done this properly, but here's a
> quick hack to use Xe's currency converter.
>
>
> <?php
>
> class currency
> {
>
>   function convert($amount, $from, $to) {
>
>     $regex = "/[0-9.]+\s*$from\s*=\s*([0-9.]+)\s*$to/";
>
>     $return = file
("http://www.xe.net/ucc/convert.cgi?Amount=1&From=$from&To=$to");
>
>     foreach ($return as $line) {
>       if( preg_match($regex, $line, $match) ) break;
>     }
>
>     if (!isset($match)) return false;
>
>     return $amount * $match[1];
>
>   }
>
> }
>
> $money = new currency;
>
> print $money->convert( 10, "GBP", "AUD" );
>
> ?>
>
>
> --
> Robin Vickery.................................................
> BlueCarrots, 14th Floor, 20 Eastbourne Terrace, London, W2 6LE
>
> --
> 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]
>






Hi!
How can i make my web server PWS parse html file into PHP? cause it shows 
nothing when i include php in an html file.However it works when i put it in 
a php file !
Thanks

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





>How can i make my web server PWS parse html file into PHP? cause it shows
>nothing when i include php in an html file.However it works when i put it
in
>a php file !

You need to edit your registry (using regedit or a .reg file based on the
one shown here).

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Scrip
t Map]
".html"="[PUT PATH HERE]\\php.exe"

The registry entry will be the same as the .php one you already have, but
will be called .html

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





This has been extensively covered in a step by step process in the PHP
Manual Installation Chapter

http://www.php.net/manual/en/install.iis.php

follow the steps and you will have php working just fine with PWS

best regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India


----- Original Message -----
From: "kaab kaoutar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, February 15, 2001 5:00 PM
Subject: [PHP] PWS & PHP


>
> Hi!
> How can i make my web server PWS parse html file into PHP? cause it shows
> nothing when i include php in an html file.However it works when i put it
in
> a php file !
> Thanks
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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]






Hi!
please help me !
i have tried to do what is that url concerning html file but i've found that 
there is already a key called htmlfile where the default is filled with 
Microsoft HTML Document 5.0 and the shell->open-<command with
"C\PROGRA~1\Plus!\MICROS~1\iexplorer.exe" -nohome
i get rid of them and put instead them PHP Script and
c:\php\php.exe -q %1
but it does not work and above all now i can't open any html file  from the 
server i get :
Erreur HTTP 403
403.1 Forbidden - Execute Access Forbidden

Cette erreur peut être engendrée si vous tentez d'exécuter une application 
CGI, ISAPI ou un autre programme exécutable à partir d'un répertoire qui 
n'autorise pas l'exécution de programmes.

Veuillez contacter l'administrateur du serveur Web si le problème persiste.

i tried to restore but i still can't open html files !
pleaaaaaaaaaaaaaase help
thanks

>From: "Ankur Verma" <[EMAIL PROTECTED]>
>Reply-To: "Ankur Verma" <[EMAIL PROTECTED]>
>To: "kaab kaoutar" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
>CC: <[EMAIL PROTECTED]>
>Subject: Re: [PHP] PWS & PHP
>Date: Thu, 15 Feb 2001 17:42:53 +0530
>
>This has been extensively covered in a step by step process in the PHP
>Manual Installation Chapter
>
>http://www.php.net/manual/en/install.iis.php
>
>follow the steps and you will have php working just fine with PWS
>
>best regards
>
>Ankur Verma
>HCL Technologies
>A1CD, Sec -16
>Noida, UP
>India
>
>
>----- Original Message -----
>From: "kaab kaoutar" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Cc: <[EMAIL PROTECTED]>
>Sent: Thursday, February 15, 2001 5:00 PM
>Subject: [PHP] PWS & PHP
>
>
> >
> > Hi!
> > How can i make my web server PWS parse html file into PHP? cause it 
>shows
> > nothing when i include php in an html file.However it works when i put 
>it
>in
> > a php file !
> > Thanks
> >
> > 
>_________________________________________________________________________
> > Get Your Private, Free E-mail from MSN Hotmail at 
>http://www.hotmail.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]
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





I think that the registry key you are playing with here just sets what
happens when a file is opened (e.g. by double clicking on it). It should
have no effect on how PWS deals with the file. You should restore that to
it's original setting.

When you have had .php files working, I assume that you were accessing them
as something like http://localhost/myfile.php

With the PWS scriptmap key set for .html, are you saying that accessing a
file  http://localhost/myfile.html just returns you the unparsed raw php
stored in myfile.html

Cheers

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






>First Thanks !
>well yes when i call http://localhost/myfile.html
>it skips the php syntaxes it shows wht is only in the html tags!

Can you check that a view source shows all your php code.

What OS are you running - 9x or NT WS?

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





Gerald,

although I cannot give you extensive answers, I hope I can help you in
some points:

> 
> 1) JSPs can persist variables at the page, request, session and application
> scopes. I believe PHP variables are implicitly page-scoped, and session
> management can be used for session-scoping. Are there equivalents to
> request and application scoping?

The PHP default scope is request scope rather than page scope, as all
processing that is done in connection with one request shares the same
scope. This includes auto_prepend and auto_append files, as well as any
that are included.

There is no concept of application scope variables. You would need to
implement these using the shared memory functions.

> 2) In JSPs, it is possible to do server-side page redirection, i.e.
> "forward" a request from page A to page B, as if the user actually
> requested page B. There is no browser involvement in the redirection; it is
> complete on the server. In this scenario, there are two "page scopes", and
> one "request scope". How is this server-side redirection done in PHP?

You cannot actually do page redirection, but you can simulate something
similar:

If you set up an auto_prepend file, this file is processed before the
requested page 
is. In this file, the originally requested resource is available in
$REQUEST_URI.
With this information, you can decide not to serve the requested file,
but include()
another page and then exit() instead.

I am using this to implement a 'sourceview' function on my homepage.
Have a look
at http://bpeter.org/ and hit 'view source'. Have a look at
'prepend.php' and 'sourceview.php' to get an idea.

> 
> 3) In doing the server-side page redirection, variables can be added to a
> "request" object, which embodies parameters related to a request. Page A
> can add variables to the request object (perhaps values from an SQL
> select), which page B can then retrieve and display. How is this done in PHP?
> 

If you take above approach, the scope will be shared between the prepend
file and any included files.

> 4) JSPs, being a part of J2EE, can use a security system that does
> authentication and authorization. What is the commonly accepted way to do
> security with PHP?

Varies. You can either use http level authentication or something within
application scope. You can access almost any backend you like for that
(MySQL Database, .htpasswd, EJB, whatever).

> 5) On a JSP site, I typically arrange things such that a particular JSP (or
> servlet) accepts requests, processes them and then forwards them to one of
> a number of different pages, depending on the outcome of the processing.
> This is in contrast to the alternative approach where one simply goes to a
> page, which does some processing and then displays the contents of the
> requested page. What is the typical way to achieving this "funnel all
> requests to a single point and have it forward the correct response to the
> user" paradigm?

In the above model, the auto_prepended file would be that point. If you
like, 
you can have a single page which then include()s read()s as necessary.

> 6) JSPs can be packaged up as an application (a WAR file), and that WAR
> file has descriptors that allow mapping of URLs to JSPs and servlets. This
> allows me to just drop in a WAR file to a JSP container, like Tomcat, and
> have it run. Are there equivalents to the "pack it up as an application"
> and URL mapping concepts in PHP?

There is no similar concept in PHP. One way would be to tune an
application so
that it reads all necessary information from a configuration file, but
you would
have to do this manually.

> 
> 7) JSPs can be mapping to multiple URLS, e.g. /alpha/mypage and
> /beta/mypage can both go to the same JSP. Is there an equivalent to this in
> PHP?

This would be best done on webserver configuration level. For apache,
add 'Alias /beta/mypage /alpha/mypage'.

> I have several more, but this is a sample. Answers to these questions are
> quite important to me because at the moment I'm trying to decide whether I
> should choose JSPs (J2EE actually), PHP or Zope for some projects.

I know that most likely my answers are not what you hoped for; others
might have much cleaner and better solutions for achieving your goals in
PHP.
PHP and JSP differ in concept rather far, so that there is no 1:1
mapping of many of the architectural aspects of JSP.

In your decision it might help to know that you can use Java objects
from PHP. This gives you the ability to access EJBs from a PHP frontend.
You can so pack you logic into Java, which offers more capabilities in
backend integration, and stick with PHP/MySQL for the frontend and
personalization.

Cheers,
Ben

> 
> Thanks.
> 
> Gerald.
> 
> --
> 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]






Gerald Gutierrez wrote:

> Hi all.
>
> I understand that a lot of JSP Vs. PHP questions have been asked on this
> list, but they've been philosophical and general in nature. I have some
> specific questions and was hoping that someone might be able to entertain them:
>
> 1) JSPs can persist variables at the page, request, session and application
> scopes. I believe PHP variables are implicitly page-scoped, and session
> management can be used for session-scoping. Are there equivalents to
> request and application scoping?
>

My understanding of this is that the language itself doesn't handle this.  PHP
is a language.  Java is a language.  Neither implicity handle application
variables.  However,
Java running in a java application server handles these for you, similar to how
VBScript running under ASP handles this.  You would need an overriding architecture

in PHP that would handle this for you.  Someone suggested an autoprepend - we
use one main file which handles all this for you (sessions, applications, etc) and
includes
whatever classes are necessary to process a specific request.  As all logic passes
through
one file, that file can handle all session/app variable handling, as well as
security, logging,
error handling, templating and other things.


>
> 2) In JSPs, it is possible to do server-side page redirection, i.e.
> "forward" a request from page A to page B, as if the user actually
> requested page B. There is no browser involvement in the redirection; it is
> complete on the server. In this scenario, there are two "page scopes", and
> one "request scope". How is this server-side redirection done in PHP?
>

Not directly possible, although storing session info, then doing a 'redirect'
to another page via Location: header should accomplish the same thing.  We
have a redirect function which handles this - I can set my session vars, then
redirect()
and it'll close the session, then redirect, pick up the session, and continue
processing.
*probably* equivalent to what you're looking for?


>
> 3) In doing the server-side page redirection, variables can be added to a
> "request" object, which embodies parameters related to a request. Page A
> can add variables to the request object (perhaps values from an SQL
> select), which page B can then retrieve and display. How is this done in PHP?
>

See above.  We've not tried adding things to the request object, but store things
in sessions between pages.

>
> 4) JSPs, being a part of J2EE, can use a security system that does
> authentication and authorization. What is the commonly accepted way to do
> security with PHP?

There are multiple security models out there for implementation in PHP projects -
it comes down to the requirements of the task at hand.  There isn't a
'common' way, yet, anyway, which is both positive and negative.

>
> 5) On a JSP site, I typically arrange things such that a particular JSP (or
> servlet) accepts requests, processes them and then forwards them to one of
> a number of different pages, depending on the outcome of the processing.
> This is in contrast to the alternative approach where one simply goes to a
> page, which does some processing and then displays the contents of the
> requested page. What is the typical way to achieving this "funnel all
> requests to a single point and have it forward the correct response to the
> user" paradigm?
>

Have all your requests go to a single URL, with parameters after them.
blah.com/PHPfile/param1/param2
blah.com/PHPfile/param4/param3

Both requests go to PHPfile, and get processed accordingly.  Not sure why you
need to redirect, and couldn't simply include() the logic you need in the
main file.



>
> 6) JSPs can be packaged up as an application (a WAR file), and that WAR
> file has descriptors that allow mapping of URLs to JSPs and servlets. This
> allows me to just drop in a WAR file to a JSP container, like Tomcat, and
> have it run. Are there equivalents to the "pack it up as an application"
> and URL mapping concepts in PHP?
>

Not to my knowledge, although I don't doubt someone, somewhere is working
on a similar approach.

>
> 7) JSPs can be mapping to multiple URLS, e.g. /alpha/mypage and
> /beta/mypage can both go to the same JSP. Is there an equivalent to this in
> PHP?

Again, it's a server thing, not a language thing.  This is best accomplished
at the web server level, with aliases of some type.


>
> I have several more, but this is a sample. Answers to these questions are
> quite important to me because at the moment I'm trying to decide whether I
> should choose JSPs (J2EE actually), PHP or Zope for some projects.
>

Some of this decision will come down to the comfort level of the developers.
I somewhat don't care how great Zope is - if I needed a project done on a deadline,

I wouldn't use it, because I'm not familiar with it.  If you and/or everyone on
your
team knows Java, there's little reason to use Zope or PHP, I'd think.

Using something like the APC or zend cache, the "compilation time" of PHP scripts
is nothing, especially compared with JSP (at least, my limited experiences with
JSP).
Also, given the JVM, JSP pages may run fairly slowly.  The zdnet "shootout" from a
few weeks ago pointed out that PHP was much faster than JSP, at least for a
standard benchmark app they used.

Lies, damn lies, and benchmarks.  :)



>
> Thanks.
>
> Gerald.
>
> --
> 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]





Joe,

I believe that the concept of the Zend Cache shows the contrary. It
basically pre-parses scripts and stores them in memory. Zend.com give
figures up to 603% performance increase
(http://www.zend.com/cguidemo/benchmark_frame.html). Part of this
certainly is due to less disk access, the other part is the time that is
saved in parsing the scripts. So, for a heavily-used application, the
overhead in parsing code that is not needed is all but minimal.

Ben

Joe Stump wrote:
> 
> Declaring the functions is minimal. Either your ISP has the memory allocations
> set unbearably low or you aren't coding things very well ...
> 
> --Joe
> 
> On Thu, Feb 15, 2001 at 04:16:22AM +0100, Ben Peter wrote:
> > Hi Joe,
> >
> > the reason I changed to 'include on demand' was a rather large
> > application which would not work, as the memory limit that my isp had
> > set wouldn't suffice.
> >
> > I have files that are included all the way, yes: DB connection, some
> > common helpers, etc. But I would not include files that the current
> > state of an application (or part of the site) does not need to keep
> > things small.
> > This is especially true for some classes which before included both user
> > access and 'admin' function (for, say, user authentication and
> > administration). I split all of these up into two classes, so that the
> > part that is accessed when a regular user hits the site is minimal, and
> > the administrative functions won't be loaded in that case.
> >
> > Ben




> -----Original Message-----
> From: Chris Carbaugh [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 15, 2001 1:39 AM
> To: Mike Tuller; Michael Stearne
> Cc: php mailing list
> Subject: Re: Re: [PHP] PDF Functions
> 
> Redhat's *.0 releases are known to be problematic.  They are usually
> pretty much bleading edge, meaning they're buggy.
> 
Thats might not really a problem. A few days ago I successfully compiled PHP
4.0.4 with PDFlib 3.0.3 on RedHat 7. When I tried it on Mandrake 7.2 I
failed, but on RH7 it compiled without any problems. Maybe a description of
the installed libraries would help here.

An ldconfig is important after installing PDFlib and configuring PDFlib with
--enable-shared-pdflib too.

Best Regards.
Mathias Meyer




I will as soon as the final release comes out. I don't want to rely on the
beta now. Even though it is very stable. It will be nice to have standard
hardware for a change.

Mike

> From: Michael Stearne <[EMAIL PROTECTED]>
> Date: Thu, 15 Feb 2001 00:53:22 -0500
> To: [EMAIL PROTECTED]
> Cc: Mike Tuller <[EMAIL PROTECTED]>, php mailing list
> <[EMAIL PROTECTED]>
> Subject: Re: [PHP] PDF Functions
> 
> I'm waiting on OS X also.  (I'm running it now.) But I need to get a RH
> setup working for a client.  BTW PHP4, mySQL and Apache work fine of the
> OS X PB so you might try installing PDF on that (I haven't yet though).
> 
> Michael
> 
> 
> Chris Carbaugh wrote:
> 
>> OS X?  What's that? :)  Damn Mac.... PPC somethin or other.... I just
>> don't get it..............
>> 
>> In the mean time, I'd say 6.2 is a good bet.
>> 
>> Good Luck,
>> 
>> Chris
>> 
>> On Wed, 14 Feb 2001, Mike Tuller wrote:
>>> Date: Wed, 14 Feb 2001 19:03:05 -0600
>>> To: <[EMAIL PROTECTED]>, Michael Stearne <[EMAIL PROTECTED]>
>>> From: Mike Tuller <[EMAIL PROTECTED]>
>>> Subject: Re: [PHP] PDF Functions
>>> 
>>> I decided on my way home tonight to ditch 7.0 and go back to 6.2. I
>>> think
>>> that it is the only way to get anything done. When 7.1 or later comes
>>> out
>>> then I can go back. Thanks for your help.
>>> 
>>> When OS X finally ships I will be happy.
>>> 
>>> Mike
>>> 
>>>> From: Chris Carbaugh <[EMAIL PROTECTED]>
>>>> Reply-To: [EMAIL PROTECTED]
>>>> Date: Wed, 14 Feb 2001 19:39:04 EST
>>>> To: Mike Tuller <[EMAIL PROTECTED]>, Michael Stearne
>>>> <[EMAIL PROTECTED]>
>>>> Cc: php mailing list <[EMAIL PROTECTED]>
>>>> Subject: Re: Re: [PHP] PDF Functions
>>>> 
>>>> 
>>>> Well, first let me say that I'm kind of surprised I'm the only one
>>>> trying to help you guys out.  It seems not many folk are into
>>> PHP/PDF?
>>>> 
>>>> Any how,
>>>> 
>>>> Redhat's *.0 releases are known to be problematic.  They are
>>> usually
>>>> pretty much bleading edge, meaning they're buggy.
>>>> 
>>>> The last time I compiled PHP with PDF support, was a few weeks ago.
>>>  It
>>>> was on RedHat 6.2, PHP 4.0.2, and PDFLIB, as a CGI or a stand alone
>>>> executable.  The config was pretty much ./configure
>>>> --with-pgsql=/usr/local/pgsql --with-pdf=/usr/local/bin  (I really
>>>> think that was it, note I did NOT point right to the libpdf.so).  I
>>>> also added /usr/local/lib to /etc/ld.so.conf and did a ldconfig.
>>>> 
>>>> That's really all I did.  RH 6.2, source tarballs of Apache 1.3.12,
>>> PHP
>>>> 4.0.2, pdflib 3.03, postgresql 7.0.2.
>>>> 
>>>> If everything configs/builds correctly, I would blame RH 7.0
>>>> 
>>>> While I would like to install RH 7.0 and figure out what's up, I
>>> just
>>>> don't have the time.  I would suggest, A) you try to install
>>> PHP/PDF as
>>>> a CGI under your current install.  This allows the simplest
>>> install.
>>>> If that doesn't work, try RH 6.2 or some other distro?
>>>> 
>>>> Good Luck,
>>>> 
>>>> Chris
>>>> 
>>>> On Wed, 14 Feb 2001, Mike Tuller wrote:
>>>>> Date: Wed, 14 Feb 2001 17:45:28 -0600
>>>>> To: Michael Stearne <[EMAIL PROTECTED]>
>>>>> From: Mike Tuller <[EMAIL PROTECTED]>
>>>>> Subject: Re: [PHP] PDF Functions
>>>>> 
>>>>> Exactly!!! I have gone back and redone everything 3 or 4 times,
>>> and
>>>>> am on
>>>>> day 3 of this. I watch while I configure, and it says that it is
>>>>> working,
>>>>> but when I go to check. I still get an error.
>>>>> 
>>>>> 
>>>>>> From: Michael Stearne <[EMAIL PROTECTED]>
>>>>>> Date: Wed, 14 Feb 2001 18:01:20 -0500
>>>>>> To: [EMAIL PROTECTED]
>>>>>> Cc: Mike Tuller <[EMAIL PROTECTED]>, php mailing list
>>>>>> <[EMAIL PROTECTED]>
>>>>>> Subject: Re: [PHP] PDF Functions
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> Chris Carbaugh wrote:
>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> I have had problems in the past with RedHat's RPMs.  They seem
>>> to
>>>>> put
>>>>>>> things in weird places.  And just removing them and starting
>>> fresh
>>>>> with
>>>>>>> source always seems to work.  Besides, once you have built from
>>>>> source
>>>>>>> a few times, it's really a piece of cake, and much less
>>>>> frustrating
>>>>>>> than screwing with RPMs.
>>>>>>> 
>>>>>> 
>>>>>> I am in the same situation except I have compiled from all the
>>>>> sources (not
>>>>>> RPMS) and I still get hung up when I try to include PDF.  My
>>> system
>>>>> is a
>>>>>> new install of RH 7 with the updates that up2date suggests (gcc,
>>>>> etc.).  I
>>>>>> have compiled and installed PHP with PDF no problem on RH 6.2.  I
>>>>> think the
>>>>>> issue is something specific to RH7. I hope RH 7.1 fixes it.  I
>>>>> think at
>>>>>> this point I am going back to 6.2
>>>>>> 
>>>>>> Michael
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>> 
>>>>>>> Chris
>>>>>>> 
>>>>>>> On Wed, 14 Feb 2001, Mike Tuller wrote:
>>>>>>>> Date: Wed, 14 Feb 2001 15:49:44 -0600
>>>>>>>> To: <[EMAIL PROTECTED]>, php mailing list
>>>>>>>> <[EMAIL PROTECTED]>
>>>>>>>> From: Mike Tuller <[EMAIL PROTECTED]>
>>>>>>>> Subject: Re: [PHP] PDF Functions
>>>>>>>> 
>>>>>>>> The reason why I needed the RPM is because no matter what I
>>>>> tried, I
>>>>>>>> couldn't get PHP to compile for the Apache rpm on Redhat 7. If
>>> at
>>>>> all
>>>>>>>> possible, I like to use the rpms so that they can be easily
>>>>> updated.
>>>>>>>> 
>>>>>>>> I have done everything everyone has suggested, and I still get
>>> an
>>>>>>>> error. I
>>>>>>>> have even compiled PHP and still I can't use PDFlib. What next?
>>>>>>>> 
>>>>>>>> Here is the updated config script that I used.
>>>>>>>> 
>>>>>>>>  ./configure   --prefix=/usr   --with-config-file-path=/etc
>>>>>>>> --disable-debug   --enable-pic   --enable-shared
>>>>>>>> --enable-inline-optimization   --with-apxs=/usr/sbin/apxs
>>>>>>>> --with-exec-dir=/usr/bin   --with-regex=system   --with-gettext
>>>>>>>> --with-gd
>>>>>>>> --with-jpeg-dir=/usr   --with-png   --with-zlib   --with-gdbm
>>>>>>>> --enable-debugger   --enable-magic-quotes   --enable-safe-mode
>>>>>>>> --enable-sockets   --enable-sysvsem   --enable-sysvshm
>>>>>>>> --enable-track-vars
>>>>>>>> --enable-yp   --enable-ftp   --enable-wddx   --with-mysql
>>>>>>>> --with-xml
>>>>>>>> --with-pdflib=/usr/local/lib   --with-tiff
>>>>>>>> 
>>>>>>>> 
>>>>>>>>> From: Chris Carbaugh <[EMAIL PROTECTED]>
>>>>>>>>> Reply-To: [EMAIL PROTECTED]
>>>>>>>>> Date: Wed, 14 Feb 2001 15:08:02 EST
>>>>>>>>> To: Mike Tuller <[EMAIL PROTECTED]>, php mailing list
>>>>>>>>> <[EMAIL PROTECTED]>
>>>>>>>>> Subject: Re: [PHP] PDF Functions
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> How about in /etc/ld.so.conf you make sure /usr/lib is in
>>> there.
>>>>>>>>> 
>>>>>>>>> Then run /sbin/ldconfig.
>>>>>>>>> 
>>>>>>>>> Also, why bother with the source RPM?  I would rather just get
>>>>> the
>>>>>>>>> source tarball direct from PHP.net and run with it.
>>>>>>>>> 
>>>>>>>>> Chris
>>>>>>>>> 
>>>>>>>>> On Wed, 14 Feb 2001, Mike Tuller wrote:
>>>>>>>>>> Date: Wed, 14 Feb 2001 12:07:50 -0600
>>>>>>>>>> To: php mailing list <[EMAIL PROTECTED]>
>>>>>>>>>> From: Mike Tuller <[EMAIL PROTECTED]>
>>>>>>>>>> Subject: [PHP] PDF Functions
>>>>>>>>>> 
>>>>>>>>>> I finally got everything to install on RedHat 7, but I can't
>>> do
>>>>>>>>>> anything
>>>>>>>>>> with pdflib like I had expected.
>>>>>>>>>> 
>>>>>>>>>> I get back Fatal error: Call to undefined function: pdf_new()
>>>>> in
>>>>>>>>>> /var/www/html/pdfclock.php on line 7. Line 7 is $pdf =
>>>>> PDF_new();
>>>>>>>>>> 
>>>>>>>>>> This is rather frustrating that every time I try to install
>>> PHP
>>>>> on
>>>>>>>> a
>>>>>>>>>> machine
>>>>>>>>>> it takes me a week to get it going.
>>>>>>>>>> 
>>>>>>>>>> Here is what I have for the config from the srpm after
>>>>>>>> modification
>>>>>>>>>> as
>>>>>>>>>> instructed earlier.
>>>>>>>>>> 
>>>>>>>>>> ../configure \
>>>>>>>>>>     --prefix=%{_prefix} \
>>>>>>>>>>     --with-config-file-path=%{_sysconfdir} \
>>>>>>>>>>     --disable-debug \
>>>>>>>>>>     --enable-pic \
>>>>>>>>>>     --enable-shared \
>>>>>>>>>>     --enable-inline-optimization \
>>>>>>>>>>     $* \
>>>>>>>>>>     --with-exec-dir=%{_bindir} \
>>>>>>>>>>     --with-regex=system \
>>>>>>>>>>     --with-gettext \
>>>>>>>>>>     --with-gd \
>>>>>>>>>>     --with-jpeg-dir=%{_prefix} \
>>>>>>>>>>     --with-png \
>>>>>>>>>>     --with-zlib \
>>>>>>>>>>     --with-gdbm \
>>>>>>>>>>     --enable-debugger \
>>>>>>>>>>     --enable-magic-quotes \
>>>>>>>>>>     --enable-safe-mode \
>>>>>>>>>>     --enable-sockets \
>>>>>>>>>>     --enable-sysvsem \
>>>>>>>>>>     --enable-sysvshm \
>>>>>>>>>>     --enable-track-vars \
>>>>>>>>>>     --enable-yp \
>>>>>>>>>>     --enable-ftp \
>>>>>>>>>>     --enable-wddx \
>>>>>>>>>>     --with-mysql  \
>>>>>>>>>>     --with-xml \
>>>>>>>>>>     --with-pdflib=/usr/lib/lipdf.so.0 \
>>>>>>>>>>     --with-tiff
>>>>>>>>>> 
>>>>>>>>>> Can someone look at this and tell me what else I need to put
>>> in
>>>>> to
>>>>>>>>>> get this
>>>>>>>>>> to work?
>>>>>>>>>> 
>>>>>>>>>> Mike
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> --
>>>>>>>>>> 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 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]
>>>>> 
>>>> --
>>>> "Without the threat of death, there's no reason to live at all"  -
>>>> Marilyn Manson
>>> 
>>> 
>>> --
>>> 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]
>>> 
>> --
>> Earnest HemmingWay wrote: "The world is a fine place, and worth
>> fighting for" I agree with the second part.
> 
> 
> -- 
> 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]





I did that yesterday, but didn't help. I've reinstalled RedHat 6.2 now, so
it is moot for me.



> From: Mathias Meyer <[EMAIL PROTECTED]>
> Date: Thu, 15 Feb 2001 12:52:53 +0100
> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> Subject: RE: Re: [PHP] PDF Functions
> 
>> -----Original Message-----
>> From: Chris Carbaugh [mailto:[EMAIL PROTECTED]]
>> Sent: Thursday, February 15, 2001 1:39 AM
>> To: Mike Tuller; Michael Stearne
>> Cc: php mailing list
>> Subject: Re: Re: [PHP] PDF Functions
>> 
>> Redhat's *.0 releases are known to be problematic.  They are usually
>> pretty much bleading edge, meaning they're buggy.
>> 
> Thats might not really a problem. A few days ago I successfully compiled PHP
> 4.0.4 with PDFlib 3.0.3 on RedHat 7. When I tried it on Mandrake 7.2 I
> failed, but on RH7 it compiled without any problems. Maybe a description of
> the installed libraries would help here.
> 
> An ldconfig is important after installing PDFlib and configuring PDFlib with
> --enable-shared-pdflib too.
> 
> Best Regards.
> Mathias Meyer
> 
> -- 
> 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]





Hi all:

        A question tangentially related to the former one. I have seen lots of
tutorials about how to parse XML files using PHP and generate something
else (usually HTML) from it, but I haven't seen anything so far about
generating XML with some specific data.
        Basically, what I want is:

        1) To have a XML file describing the structure of the data, like:

                <SECTION>
                        <BLAH VALUE="">
                        <FOOBAR VALUE="">
                </SECTION>

        2) Receive the values of "BLAH" and "FOOBAR" from, say, a Web form.
        3) Output an XML file with the values of "BLAH" and "FOOBAR", like:

                <SECTION>
                        <BLAH VALUE="203">
                        <FOOBAR VALUE="666">
                </SECTION>

        4) Store said XML file with the data in a text field in a database.

        I suppose that I could use the existing XML parsr functions to parse
the XML template in 1), and define event handlers that output the
relevant XML tag with the specific data, like:


function startElement($parser, $name, $attribs) {
        $data=$data . "<BLAH VALUE=\"" . $blah . "\">";
        }

        (I know that the above is probably wrong; it's just an example).

        ...But I'd like to know if there's another way to do the above,
something more... elegant.


                                                Paulo Jan.
                                                DDnet.




Hi,

Problem:
I'm trying put to work the debugger in php4.0.4pl1(Red Hat Distribution), I
change my php.ini file to enable the debugger but when try to use in a simple
script I get the following error:

Fatal error: Call to undefined function: debugger_on() in
/var/www/html/php/dbg.php on line 2

Questions:
1º Do I need some sort of extension (something like  xxx.so) to activate the
debugger?

2º In php documentation (Chapter: Using the Debugger) says:
     Set up a TCP listener on that port somewhere (for example socket -l -s 1400
on UNIX).

     I don't have that "socket" command in Linux/Unix, what is this?
     What this means?

3º I need to debug my script what is the best way to do that?
     (I tried the "Zend IDE Test Drive" but after 30 days is not for free and
can't put to work the "The DBG PHP Debugger").

4º What is the difference between Zend debugger, Dmitri Dmitrienko PHP debugger
(seen link below) and the 'internal' PHP debugger?

Thanks, (Sorry for the bad english)



Additional Information:

PHP version: PHP Version 4.0.4pl1- Red Hat distribution
O.S. - Red Hat 7.0

Compiled options (PHP) extract from phpinfo():
'./configure' '--prefix=/usr' '--with-config-file-path=/etc' '--disable-debug'
'--enable-pic' '--enable-shared' '--enable-inline-optimization'
'--with-apxs=/usr/sbin/apxs' '--with-exec-dir=/usr/bin' '--with-regex=system'
'--with-gettext' '--with-gd' '--with-jpeg-dir=/usr' '--with-png' '--with-zlib'
'--with-db2' '--with-db3' '--with-gdbm' '--enable-debugger'
'--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets'
'--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-yp'
'--enable-ftp' '--enable-wddx' '--without-mysql' '--without-oracle'
'--without-oci8' '--with-xml'

Simple Script to test the debugger:
<?php
    debugger_on(localhost);

    $var = 1;

    if ($var == 1 ) {
        echo "VAR is 1";
    } else {
        echo "VAR is not 1";
    }
?>

PHP.INI file (Revelant parts):
#Extension actived
extension=imap.so
extension=ldap.so
extension=pgsql.so
 
[Debugger]
debugger.host   =       localhost
debugger.port   =       7869
debugger.enabled        =       true

Dmitri Dmitrienko PHP Debugger:
http://dd.cron.ru/dbg/
+++++++++++++++++++++++++++++++
Ricardo D'Aguiar
MemoSis - Sistemas Informáticos
Portugal
+++++++++++++++++++++++++++++++




You must be viewing old documentation.

http://php.net/manual/en/debugger.php

clearly states that debugger, ie debugger_on() support is in php3 only, not
in php4.

Your not out of luck though, you could still use the Zend Debugger, the Zend
boys seem to be quite eager to improve its current quallity.

http://zend.com/store/products/ide-test-drive.php


--


Chris Lee
Mediawaveonline.com

em. [EMAIL PROTECTED]

ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120



"Ricardo D'Aguiar" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> Problem:
> I'm trying put to work the debugger in php4.0.4pl1(Red Hat Distribution),
I
> change my php.ini file to enable the debugger but when try to use in a
simple
> script I get the following error:
>
> Fatal error: Call to undefined function: debugger_on() in
> /var/www/html/php/dbg.php on line 2
>
> Questions:
> 1º Do I need some sort of extension (something like  xxx.so) to activate
the
> debugger?
>
> 2º In php documentation (Chapter: Using the Debugger) says:
>      Set up a TCP listener on that port somewhere (for example
socket -l -s 1400
> on UNIX).
>
>      I don't have that "socket" command in Linux/Unix, what is this?
>      What this means?
>
> 3º I need to debug my script what is the best way to do that?
>      (I tried the "Zend IDE Test Drive" but after 30 days is not for free
and
> can't put to work the "The DBG PHP Debugger").
>
> 4º What is the difference between Zend debugger, Dmitri Dmitrienko PHP
debugger
> (seen link below) and the 'internal' PHP debugger?
>
> Thanks, (Sorry for the bad english)
>
>
>
> Additional Information:
>
> PHP version: PHP Version 4.0.4pl1- Red Hat distribution
> O.S. - Red Hat 7.0
>
> Compiled options (PHP) extract from phpinfo():
> './configure' '--prefix=/usr' '--with-config-file-path=/etc'
'--disable-debug'
> '--enable-pic' '--enable-shared' '--enable-inline-optimization'
> '--with-apxs=/usr/sbin/apxs' '--with-exec-dir=/usr/bin'
'--with-regex=system'
> '--with-gettext' '--with-gd' '--with-jpeg-dir=/usr' '--with-png'
'--with-zlib'
> '--with-db2' '--with-db3' '--with-gdbm' '--enable-debugger'
> '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets'
> '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-yp'
> '--enable-ftp' '--enable-wddx' '--without-mysql' '--without-oracle'
> '--without-oci8' '--with-xml'
>
> Simple Script to test the debugger:
> <?php
>     debugger_on(localhost);
>
>     $var = 1;
>
>     if ($var == 1 ) {
>         echo "VAR is 1";
>     } else {
>         echo "VAR is not 1";
>     }
> ?>
>
> PHP.INI file (Revelant parts):
> #Extension actived
> extension=imap.so
> extension=ldap.so
> extension=pgsql.so
>
> [Debugger]
> debugger.host   =       localhost
> debugger.port   =       7869
> debugger.enabled        =       true
>
> Dmitri Dmitrienko PHP Debugger:
> http://dd.cron.ru/dbg/
> +++++++++++++++++++++++++++++++
> Ricardo D'Aguiar
> MemoSis - Sistemas Informáticos
> Portugal
> +++++++++++++++++++++++++++++++
>
> --
> 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]
>






Well, why not store the item's in the session-var? When the session dies because of 
timeout or user-intervention, the items dissapear too.

Or store a timestamp along with the items, and refresh the timestamps as needed. Then 
put in a cron-job to delete out-of-date items left in the DB at 
regular intervals.

-J

17.02.01 02:29:04, Joseph H Blythe <[EMAIL PROTECTED]> wrote:

>hey all,
>
>I was wondering how one would suggest removing items from a cart system once the 
>session lifetime has expired. I have it set to the default 0, which 
expires the session on browser close, what I want to be able to do is "delete * from 
Cart where session='$PHPSESSID'" when the user closes thier 
browser window is this even possible? maybe using register_shutdown_function or 
something?
>
>Any ideas would be great!
>
>Thanks
>
>Joseph
>
>-- 
>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]
>
>







> Just as an aside, there's no reason I can think of that you can't run both
> the Apache module and standalone binary on the same system side by side -
> I've been doing this for about 2 years without trouble.
>
> jason

However, there's no necessity to have the cgi version if you already have
the modular version.  All that is needed is to call the appropriate script
using a tool such as 'wget'.  This can be done manually or from cron as
appropriate.

Billy






Hello all,


I've been searching for a framework for MVC in PHP and I've been
unsuccessful thus far.

Does anyone know of one out there?


TIA,
-Jason




On Wed, Feb 14, 2001 at 11:07:46PM -0800, Thomas Edison Jr. wrote:
> The code I'm entering is:
> 
> <?php
> if(!isset($PHP_AUTH_USER)) {
> Header("WWW-Authenticate: Basic realm=\"My Realm\"");
> Header("HTTP/1.0 401 Unauthorized");
> echo "Text to send if user hits Cancel button\n";
> exit;
> } else {
> echo "Hello $PHP_AUTH_USER.<P>";
> echo "You entered $PHP_AUTH_PW as your password.<P>";
> }
> ?>

I'm not sure what is wrong.  I copied and pasted this onto my system and
it works just fine.  

-- 
Jason Stechschulte
[EMAIL PROTECTED]
--
Soitainly.  I was assuming that came with the OO-ness of it.
             -- Larry Wall in <[EMAIL PROTECTED]>




I'm sure this wont' help, but just in case you may have missed the obvious
(it happens sometimes<g>)..Make sure you PHP script has the extension .PHP
.. The server won't recognize it as a PHP file otherwise, and it won't know
what to do with it.  Also this extension has to be registred properly on the
server, but that is beyond me.

- John Vanderbeck
- Admin, GameDesign

----- Original Message -----
From: "Thomas Edison Jr." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 15, 2001 2:07 AM
Subject: [PHP] HTTP authentication


> I was browsing thru the http authentication method
> given thru the header() function in the manual. I
> tried it out but it's not giving me the pop-up window
> asking me the username and password and is only
> writing the text given in the code on the page.
> I'm using win98 and otherwise use sun solaris. Does
> this function work on these two OS?
> I have to write a code that checks each time a user
> enters a page, his previously entered user/pwd so as
> to prevent anyone from entering the page if he knows
> and writes the page's URL in the address bar. I've
> used the same authentication method in ASP before for
> the same. Can I use it in my OS using PHP?
> The code I'm entering is:
>
> <?php
> if(!isset($PHP_AUTH_USER)) {
> Header("WWW-Authenticate: Basic realm=\"My Realm\"");
> Header("HTTP/1.0 401 Unauthorized");
> echo "Text to send if user hits Cancel button\n";
> exit;
> } else {
> echo "Hello $PHP_AUTH_USER.<P>";
> echo "You entered $PHP_AUTH_PW as your password.<P>";
> }
> ?>
>
> Regards,
> T.Edison jr.
>
> =====
> Rahul S. Johari (Director)
> ******************************************
> Abraxas Technologies Inc.
> Homepage : http://www.abraxastech.com
> Email : [EMAIL PROTECTED]
> Tel : 91-4546512/4522124
> *******************************************
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35
> a year!  http://personal.mail.yahoo.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]
>
>





I am uploading files and want to limit the size of the file. I can do this
as long as the file that I am uploading doesn't exceed the Server limit. We
don't own the server so I can't change any configuration on the server.

Is there a way to Catch the warning and display my own message in the
browser.

The Warning that I am getting is

Warning: Max file size of 2097152 bytes exceeded - file [upfile] not saved
in [no active file] on line 0

Thanks,

Scott







On Thu, 15 Feb 2001, Scott wrote:

> I am uploading files and want to limit the size of the file. I can do this
> as long as the file that I am uploading doesn't exceed the Server limit. We
> don't own the server so I can't change any configuration on the server.
> 
> Is there a way to Catch the warning and display my own message in the
> browser.
> 
> The Warning that I am getting is
> 
> Warning: Max file size of 2097152 bytes exceeded - file [upfile] not saved
> in [no active file] on line 0

You could control filesize within the HTML form.

<input type="hidden" name="MAX_FILE_SIZE" value="(insert size)" />

This means that PHP will automatically reject files over the specified
size. As far as I know, I'm not sure you will be able to catch the
exceeded file error before it is passed back to the client, so customising
the error might be out of the question. Also, I doubt you would be able to
perform any kind of action that would determine the entire size of the
uploading file prior to the upload being completed - if there was a way to
catch this, then you would be able to redirect to an error page at the
beginning of the upload, thus meaning that there would be no time wasted
on the user's behalf. :)

Cheers,

Nicky W..
-[ [EMAIL PROTECTED] ]-






Hi,

I have 4 images, and I copy three of them onto one main background, these
images all have fairly different colors and as you can imagine the resulting
image looks splotchy and missing colors.

What do i need to do to make sure the resulting image looks proper?

-- 
David Raufeisen <[EMAIL PROTECTED]>
Cell: (604) 818-3596




Wddx may also be an option.  That would allow you to serialize the xml
into php variables so that you could use them in your example.  But if
your provider won't compile xml in, I doubt you'll be able to get wddx.

Shaun

On Wed, 14 Feb 2001, Stefen Lars wrote:

> Hello all
> 
> I have recently been assigned the task of parsing an xml file and format the 
> contents of the file in HTML. The xml file lies on another server. Our web 
> space provider does not provide the XML functions (nor is he willing to 
> install them) :-gr.
> 
> I am sure that I am not the only who has come across this problem.
> 
> Would someone have already created a few functions to parse xml that they 
> are willing to share?
> 
> I have the following structure to deal with:
> 
> <faq>
>   <item>
>     <product>ProductName</product>
>     <question>Why does it not work</question>
>     <answer>Because it is not turned on<answer>
>   <item>
> </faq>
> 
> There are whole load of <item>s in the file.
> 
> I then want to display the contents a bit like this:
> 
> echo $product;
> echo $question;
> 
> etc (of course with some HTML formatting, like a bulleted list).
> 
> Any help would be really VERY appreciated!
> 
> Thanks
> 
> S
> 
> 
> 
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> 
> 
> 

-- 





Hi!

        Right now, I'm trying to figure out which step in order is
appropriate.  I'm going to put it down now, if I got it wrong then help me
out with the correct order.  Whether it is from scratch or from existing
softwares.


        1) OpenSSL
        2) libmcrypt  (Add-on to PHP)
        3) PHP 4.0
        4) mod_ssl
        5) apache

    Thanks,
 Scott






El Jue 15 Feb 2001 11:47, escribiste:
> Hi!
>
>         Right now, I'm trying to figure out which step in order is
> appropriate.  I'm going to put it down now, if I got it wrong then help me
> out with the correct order.  Whether it is from scratch or from existing
> softwares.
>
>
>         1) OpenSSL
>         2) libmcrypt  (Add-on to PHP)
>         3) PHP 4.0
>         4) mod_ssl
>         5) apache

OS is an importante issue. More info please.

Saludos... ;-)

-- 
System Administration: It's a dirty job, 
but someone told I had to do it.
-----------------------------------------------------------------
Martín Marqués                  email:  [EMAIL PROTECTED]
Santa Fe - Argentina            http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------




Hi everyone,
    im doing a statistics type system with PHP4 and I was wondering if
anyone had any experience of creating charts/graphs with PHP.

Cheers
    Phil






Can someone please help? I'm seeing lots of interesting message headings 
go by in the digest, but I can't get to the current archive. I get the 
error message: "Forbidden. You don't have permission to access 
/mail/php-general/2001012/ on this server." But I can get to all the other 
archives.

And speaking of the digest, is it normal behavior for this one to get the 
summary of message headings, but only a single message text, the first?

Please help. I feel like I'm locked out.
  --David

------------------------------
David M. Phillips [EMAIL PROTECTED]
eBoing, Inc.
Austin, Texas




> Therefore any date on or before 1 Jan 1970 ain't going to 
> work using mktime or any PHP function which returns a 
> UNIX timestamp.

I'm sorry, but this is wrong.  The following works with no
problems whatsoever.

<script language="php">

  $month = 3;
  $day   = 9;
  $year  = 1935;
  
  echo "Using $month/$day/$year<br>\n";
  
  $oldDate = mktime( 0, 0, 0, $month, $day, $year );
  
  echo "Unix timestamp for this date is $oldDate<br><br>\n";
  
  echo "Reconverting... " . date( "F d, Y", $oldDate );

</script>


Chris




I was reading through the documentation on sessions at
http://www.php.net/manual/en/html/ref.session.html

I have a few questions..

1) How do I explicitly close a session, so that any subsequent attempts to
use pages would require a new session started? Will session_destroy() do
this?

2) I don't want to rely on cookies being set for the client's browser.  What
are the security ramifications for passing the SID through the URL?

Most important to me is to understand the overall concept.  Can I start and
stop sessions whever I want? Can I start and use one session, then destroy
it, then start a whole new session on the client?

I'm just starting to hate the looks of all these encoded urls being thrown
around as i'm developing the site.  It is getting more and more complex, and
some of the stuff i'm passing in the urls is ugly, and some of it is not
good to be showing.

- John Vanderbeck
- Admin, GameDesign





El Jue 15 Feb 2001 12:32, escribiste:
> I was reading through the documentation on sessions at
> http://www.php.net/manual/en/html/ref.session.html
>
> I have a few questions..
>
> 1) How do I explicitly close a session, so that any subsequent attempts to
> use pages would require a new session started? Will session_destroy() do
> this?

Yes.

> 2) I don't want to rely on cookies being set for the client's browser. 
> What are the security ramifications for passing the SID through the URL?

As secure as your server is.
But if you compiled php --with-trans-id, then you will have no problems at 
all.

> Most important to me is to understand the overall concept.  Can I start and
> stop sessions whever I want? Can I start and use one session, then destroy
> it, then start a whole new session on the client?

Yes, but remember that the data es stored on the server side, not the client 
side.

> I'm just starting to hate the looks of all these encoded urls being thrown
> around as i'm developing the site.  It is getting more and more complex,
> and some of the stuff i'm passing in the urls is ugly, and some of it is
> not good to be showing.

Try hidding variables in inputs (if you use forms) or store the values in a 
session.

Saludos... :-)

-- 
System Administration: It's a dirty job, 
but someone told I had to do it.
-----------------------------------------------------------------
Martín Marqués                  email:  [EMAIL PROTECTED]
Santa Fe - Argentina            http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------




hi, can anyone help me spot the parse error?
It's throwing up on the first "if" line, and for the life of me I cannot
find it! :)

tia,
andrew

<?php

include("db_connect_params.inc");
$sql="select path from PHOTO where pid =1";
$link_id = mysql_connect($host, $usr, $pass);
$result = mysql_db_query($database, $sql, $link_id) or die("no result");

if ((mysql_num_rows($result)) = 1)

{
 $row=mysql_fetch_array($result);
 extract($row);
 echo "<img src =\"$path\"></img><br>";

} else {
         if (!isset($ii)) $ii = 1;
         $i = 1;
         while($row=mysql_fetch_array($result))
             {
                extract($row);
                $displayed[$i]=$path;
                echo "<a href=\"$PHP_SELF?ii=$i\">$i</a>&nbsp&nbsp";
                $i++;
             }
         echo "<img src =\"$displayed[$ii]\"></img><br>";
          }
?>





Instead of 

if ((mysql_num_rows($result)) = 1)

try

if ((mysql_num_rows($result)) == 1)


HTH
Jon

-----Original Message-----
From: Andrew [mailto:[EMAIL PROTECTED]]
Sent: 15 February 2001 15:34
To: [EMAIL PROTECTED]
Subject: [PHP] parse error driving me nuts ...


hi, can anyone help me spot the parse error?
It's throwing up on the first "if" line, and for the life of me I cannot
find it! :)

tia,
andrew

<?php

include("db_connect_params.inc");
$sql="select path from PHOTO where pid =1";
$link_id = mysql_connect($host, $usr, $pass);
$result = mysql_db_query($database, $sql, $link_id) or die("no result");

if ((mysql_num_rows($result)) = 1)

{
 $row=mysql_fetch_array($result);
 extract($row);
 echo "<img src =\"$path\"></img><br>";

} else {
         if (!isset($ii)) $ii = 1;
         $i = 1;
         while($row=mysql_fetch_array($result))
             {
                extract($row);
                $displayed[$i]=$path;
                echo "<a href=\"$PHP_SELF?ii=$i\">$i</a>&nbsp&nbsp";
                $i++;
             }
         echo "<img src =\"$displayed[$ii]\"></img><br>";
          }
?>


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




Try to use  ==  instead of  =

Sorin Ifrim

----- Original Message ----- 
From: Andrew <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 15, 2001 5:33 PM
Subject: [PHP] parse error driving me nuts ...


> hi, can anyone help me spot the parse error?
> It's throwing up on the first "if" line, and for the life of me I cannot
> find it! :)
> 
> tia,
> andrew
> 
> <?php
> 
> include("db_connect_params.inc");
> $sql="select path from PHOTO where pid =1";
> $link_id = mysql_connect($host, $usr, $pass);
> $result = mysql_db_query($database, $sql, $link_id) or die("no result");
> 
> if ((mysql_num_rows($result)) = 1)
> 
> {
>  $row=mysql_fetch_array($result);
>  extract($row);
>  echo "<img src =\"$path\"></img><br>";
> 
> } else {
>          if (!isset($ii)) $ii = 1;
>          $i = 1;
>          while($row=mysql_fetch_array($result))
>              {
>                 extract($row);
>                 $displayed[$i]=$path;
>                 echo "<a href=\"$PHP_SELF?ii=$i\">$i</a>&nbsp&nbsp";
>                 $i++;
>              }
>          echo "<img src =\"$displayed[$ii]\"></img><br>";
>   }
> ?>
> 
> 
> -- 
> 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]
> 





> hi, can anyone help me spot the parse error?
> It's throwing up on the first "if" line, and for the life of me I cannot
> find it! :)
>
> tia,
> andrew
>
> <?php
>
> include("db_connect_params.inc");
> $sql="select path from PHOTO where pid =1";
> $link_id = mysql_connect($host, $usr, $pass);
> $result = mysql_db_query($database, $sql, $link_id) or die("no result");
>
> if ((mysql_num_rows($result)) = 1)

Well I don't know if it will give a parse error or not, but you  have made
the oh way too common C error in your IF statement.
> if ((mysql_num_rows($result)) = 1)
should be:
if ((mysql_num_rows($result)) == 1)

- John Vanderbeck
- Admin, GameDesign







Jon, John, Ifrim, the == worked ... thank you!!
gotta read up on it now :)

Cameron, dropping the extra () did not work :(

thanks for the suggestions folks!
andrew


> -----Original Message-----
> From: Jon Haworth [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 15, 2001 10:38 AM
> To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
> Subject: RE: [PHP] parse error driving me nuts ...
> 
> 
> Instead of 
> 
> if ((mysql_num_rows($result)) = 1)
> 
> try
> 
> if ((mysql_num_rows($result)) == 1)
> 
> 
> HTH
> Jon
> 
> -----Original Message-----
> From: Andrew [mailto:[EMAIL PROTECTED]]
> Sent: 15 February 2001 15:34
> To: [EMAIL PROTECTED]
> Subject: [PHP] parse error driving me nuts ...
> 
> 
> hi, can anyone help me spot the parse error?
> It's throwing up on the first "if" line, and for the life of me I cannot
> find it! :)
> 
> tia,
> andrew
> 
> <?php
> 
> include("db_connect_params.inc");
> $sql="select path from PHOTO where pid =1";
> $link_id = mysql_connect($host, $usr, $pass);
> $result = mysql_db_query($database, $sql, $link_id) or die("no result");
> 
> if ((mysql_num_rows($result)) = 1)
> 
> {
>  $row=mysql_fetch_array($result);
>  extract($row);
>  echo "<img src =\"$path\"></img><br>";
> 
> } else {
>          if (!isset($ii)) $ii = 1;
>          $i = 1;
>          while($row=mysql_fetch_array($result))
>              {
>                 extract($row);
>                 $displayed[$i]=$path;
>                 echo "<a href=\"$PHP_SELF?ii=$i\">$i</a>&nbsp&nbsp";
>                 $i++;
>              }
>          echo "<img src =\"$displayed[$ii]\"></img><br>";
>         }
> ?>
> 
> 
> -- 
> 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]
> 
> 




> Jon, John, Ifrim, the == worked ... thank you!!
> gotta read up on it now :)
>
> Cameron, dropping the extra () did not work :(
>
> thanks for the suggestions folks!
> andrew
>

Remember that '=' means assign what is on the right to what is on the left,
whereby '==' means is what is on the left equal to what is on the right.

C, and C based languages allow you to out an assignemtn statement even when
you intend a relational expression.  It is a very common pitfall.  I know I
have fallen into it in my C work many times :(

- John Vanderbeck
- Admin, GameDesign






Hello everyone:

I'm trying to build a table with the last row being a check function for
an image, where it checks if the item image exists in the image
directory and either echos "no image" or places a small icon of
something (I guess you could say Ebay style). 

The problem is that the fuction checks for an image matching the first
row item id and then it copies the same result to  the remaning item
rows weather they have images or not. I read that I could use the
clearstatcache() to clear the cache and start again but there must be
something wrong with the way I persive the use of this.

this is the code:

$fn = "directory/images/$id.gif";
if (!file_exists($fn)) {
        echo "no image";
} else {
        echo"<img src=\"$siteurl/images/camara.gif\">"; 

clearstatcache();
}

Could anyone that sees what's wrong with this drop me a line?

Thanks in advance:
-- 
Gerry Figueroa
-------------- - -  -   -    -    *
War does not determine who is right, war determine who is left.
|XXXXXXX|-----^|XXXXXX|




Gerry,

could you give us a bit more code, esp. the while or for loop that
surrounds the code you have quoted?

Cheers,
Ben


Gerry wrote:
> 
> Hello everyone:
> 
> I'm trying to build a table with the last row being a check function for
> an image, where it checks if the item image exists in the image
> directory and either echos "no image" or places a small icon of
> something (I guess you could say Ebay style).
> 
> The problem is that the fuction checks for an image matching the first
> row item id and then it copies the same result to  the remaning item
> rows weather they have images or not. I read that I could use the
> clearstatcache() to clear the cache and start again but there must be
> something wrong with the way I persive the use of this.
> 
> this is the code:
> 
> $fn = "directory/images/$id.gif";
> if (!file_exists($fn)) {
>         echo "no image";
> } else {
>         echo"<img src=\"$siteurl/images/camara.gif\">";
> 
> clearstatcache();
> }
> 
> Could anyone that sees what's wrong with this drop me a line?
> 
> Thanks in advance:
> --
> Gerry Figueroa
> -------------- - -  -   -    -    *
> War does not determine who is right, war determine who is left.
> |XXXXXXX|-----^|XXXXXX|
> 
> --
> 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]




Hello again:

Ben Peter wrote:
> 
> Gerry,
> 
> could you give us a bit more code, esp. the while or for loop that
> surrounds the code you have quoted?
> 
> Cheers,
> Ben


Sorry for the confusion, and yes I did mispelled camera in english. Here
is more of my sloppy code. I might have an extra }...not sure though
since I have anther couple of "ifs" above it. the code works fine, but
not the "(!$file_exists)" part since it seams it is not checking and it
gives the same result all over the table--"no image". I did change
things as suggested I think, but stll get the same thing. 


 echo"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"
width=\"100%\" bgcolor=\"ffffff\"\n>";
echo"<tr>/n"; 

while ($row = mysql_fetch_array($sql_result)) {

echo"</td><td width=\"20%\" align=\"center\" valign=\"top\"><font size=\"2\">/n";
echo $row["name"];
echo "</font>\n";
echo"</td><td width=\"20%\" align=\"center\" valign=\"top\"><font size=\"2\">/n";
echo $row["Color"];
echo "</font>\n";
echo"</td><td width=\"20%\" align=\"center\" valign=\"top\"><font size=\"2\">";
echo $row["Size"];
echo "</font>\n";
echo"</td><td width=\"20%\" align=\"center\" valign=\"top\"> </form> ";
echo"<td width=\"20%\" align=\"center\" valign=\"top\"><font size=\"2\">";
$fn = "/images/$ID.jpg";
if (!file_exists($fn)) {
echo "not working yet";
} else {
echo'<img src=\"http://site.com/images/camera.gif\">'; 
clearstatcache();
}
 echo"<tr><td colspan=\"5\" valign=\"top\"><hr size=\"1\"></td></tr>";
}
echo"</table>";
}

-- 
Gerry Figueroa
-------------- - -  -   -    -    *
War does not determine who is right, war determine who is left.

|XXXXXXX|------^|XXXXXXXXXXXXXXXXXX|




After hours of pulling my hair out and staring a C code I don't understand, 
I almost have a generic PHP multiplexing TCP server running. Basically 
right now multiple clients can connect and be recognized by the server and 
the server is aware of incoming input from the clients.

This is mostly using undocumented functions from the Socket extension and I 
could really use some help from anyone that knows sockets better than I.

 From where I am, I still need to figure out when a client disconnects, 
plus how to disconnect a client (at the server's whim) directly. I also 
need the multiplex to be aware of writes as well as reads, although I think 
I should be able to sort that part out, it's the disconnects that I haven't 
a clue on yet.

Here's my sloppy code (sorely lacking in error checking, but oh well):

// PHP normally times out, we don't want to do that here.
set_time_limit (0);
// Server's address and port we want to listen to.
$address = '209.53.13.112';
$port = 8080;
// Start the socket.
$sock = socket (AF_INET, SOCK_STREAM, 0);
$foo = bind ($sock, $address, $port);
$foo = listen ($sock, 10);
// Allocate File Descriptor, not sure if this is needed, I'm just guessing.
$fdgroup = fd_alloc();
$maxfd = $sock + 1;
do {
        // FD needs to be rebuilt each time because select() may alter it.
        if ($maxfd > $sock + 1) {
                // If any clients have connected, rebuild the FD from the list.
                $foo = fd_zero($fdgroup);
                $foo = fd_set($sock,$fdgroup);
                for ($i=0;$i <= count($fdlist);$i++) {
                        $foo = fd_set($fdlist[$i],$fdgroup);
                }
        } else {
                // or else the socket itself is the only FD.
                $foo = fd_zero($fdgroup);
                $foo = fd_set($sock,$fdgroup);
        }
        // Now the very important and magical select(), set to timeout after a 
million microseconds (1 second).
        $selectnow = select($maxfd, $fdgroup, NULL, NULL, 0, 1000000);
        if ($selectnow == 0) {
                // We've timed out, put any appropriate activities here.
        } elseif ($selectnow > 0) {
                for ($fd=$sock;$fd <=$maxfd;$fd++) {
                        if (fd_isset($fd,$fdgroup)) {
                                if ($fd == $sock) {
                                        // The socket is knocking, someone is at the 
door.
                                        $newfd = accept_connect($sock);
                                        if ($newfd > 0) {
                                                $fdlist[] = $newfd;
                                                if ($maxfd < $newfd + 1) $maxfd = 
$newfd + 1;
                                        }
                                } else {
                                        // One of our clients has something to say.
                                }
                        }
                }
        }
} while (true);
// Do we need to deallocate File Descriptors? I'm not sure.
$foo = fd_dealloc($fdgroup);
close ($sock);



--
                     Visit the Gates Motel webgame:
                     http://www.gameslate.com/gatesmotel/





why does this

<?php
$string = "this is my string.";

print $string . "<br>\n";

$string = preg_replace(
                        array( '/is/', '/string/'    ),  
                        array( 'is not', 'bit of text' ),    
                        $string
                      );

print $string . "<br>\n";
?>

return this:

this is my string.
this not is not my bit of text.

I was expecting:

this is my string.
this is not my bit of text.

I'm obviously not understanding how this works.....

-brian
*************

> -----Original Message-----
> From: Robin Vickery [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 14, 2001 5:05 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] ereg_replace
> 
> 
> >>>>> ""VB" == "Brian V Bonini" <[EMAIL PROTECTED]> writes:
> 
>  > I know you can replace A or B or C with D but can you replace A
>  > with B and C with D exclusively with one call to ereg_replace or
>  > does this need to be done seperately?
> 
> With ereg_replace it must be done seperately, but if you use
> preg_replace you can pass it a list of replacements. like this:
> 
> <?php
> $string = "this is my string.";
> 
> print $string . "<br>\n";
> 
> $string = preg_replace( 
>                         array( '/my/', '/string/'    ), 
>                         array( 'your', 'bit of text' ), 
>                         $string 
>                       );
> 
> print $string . "<br>\n";
> ?>
> 
> The output would be:
> 
>    this is my string.
>    this is your bit of text.
> 
> 
> -- 
> Robin Vickery.................................................
> BlueCarrots, 14th Floor, 20 Eastbourne Terrace, London, W2 6LE
> 
> -- 
> 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]
> 
> 




> why does this
>
> <?php
> $string = "this is my string.";
>
> print $string . "<br>\n";
>
> $string = preg_replace(
>                         array( '/is/', '/string/'    ),
>                         array( 'is not', 'bit of text' ),
>                         $string
>                       );
>
> print $string . "<br>\n";
> ?>
>

This happens because you are replacing  "is" with "is not" so parse your
string by hand:

"this is my string"..ok the first occurence of "is", is in the word "this",
so do the replace..the replaced part in CAPS:
"thIS NOT" .. then the second "is":
thIS NOT IS NOT" etc..I think you can see why now..

- John Vanderbeck
- Admin, GameDesign






Ah right, strings not words, I feel like a dummy now... ;-)

> -----Original Message-----
> From: John Vanderbeck [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 15, 2001 10:57 AM
> To: [EMAIL PROTECTED]; Robin Vickery; [EMAIL PROTECTED]
> Subject: Re: [PHP] ereg_replace
> 
> 
> > why does this
> >
> > <?php
> > $string = "this is my string.";
> >
> > print $string . "<br>\n";
> >
> > $string = preg_replace(
> >                         array( '/is/', '/string/'    ),
> >                         array( 'is not', 'bit of text' ),
> >                         $string
> >                       );
> >
> > print $string . "<br>\n";
> > ?>
> >
> 
> This happens because you are replacing  "is" with "is not" so parse your
> string by hand:
> 
> "this is my string"..ok the first occurence of "is", is in the 
> word "this",
> so do the replace..the replaced part in CAPS:
> "thIS NOT" .. then the second "is":
> thIS NOT IS NOT" etc..I think you can see why now..
> 
> - John Vanderbeck
> - Admin, GameDesign
> 
> 
> 
> -- 
> 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]
> 
> 




>>>>> "VB" == "Brian V Bonini" <[EMAIL PROTECTED]> writes:

 > Ah right, strings not words, I feel like a dummy now... ;-)

 >> -----Original Message----- From: John Vanderbeck
 >> [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 15, 2001
 >> 10:57 AM To: [EMAIL PROTECTED]; Robin Vickery;
 >> [EMAIL PROTECTED] Subject: Re: [PHP] ereg_replace
 >> 

 >> > $string = preg_replace(
 >> >                         array( '/is/', '/string/'    ),
 >> >                         array( 'is not', 'bit of text' ),
 >> >                         $string
 >> >                       );

You could specify word boundaries on each side of your string
to get the behaviour you were expecting.

 $string = preg_replace(
                         array( '/\bis\b/', '/\bstring\b/'    ),
                         array( 'is not', 'bit of text' ),
                         $string
                       );

-- 
Robin Vickery.................................................
BlueCarrots, 14th Floor, 20 Eastbourne Terrace, London, W2 6LE




Ok, but I thought the start and end chars
were ^ $
i.e., ^is$ 
or is this not what you mean by bounderies?

????
-confused... ;-)

> -----Original Message-----
> From: Robin Vickery [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 15, 2001 11:06 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] ereg_replace
> 
> 
> >>>>> "VB" == "Brian V Bonini" <[EMAIL PROTECTED]> writes:
> 
>  > Ah right, strings not words, I feel like a dummy now... ;-)
> 
>  >> -----Original Message----- From: John Vanderbeck
>  >> [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 15, 2001
>  >> 10:57 AM To: [EMAIL PROTECTED]; Robin Vickery;
>  >> [EMAIL PROTECTED] Subject: Re: [PHP] ereg_replace
>  >> 
> 
>  >> > $string = preg_replace(
>  >> >                         array( '/is/', '/string/'    ),
>  >> >                         array( 'is not', 'bit of text' ),
>  >> >                         $string
>  >> >                       );
> 
> You could specify word boundaries on each side of your string
> to get the behaviour you were expecting.
> 
>  $string = preg_replace(
>                          array( '/\bis\b/', '/\bstring\b/'    ),
>                          array( 'is not', 'bit of text' ),
>                          $string
>                        );
> 
> -- 
> Robin Vickery.................................................
> BlueCarrots, 14th Floor, 20 Eastbourne Terrace, London, W2 6LE
> 
> -- 
> 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]
> 
> 




>>>>> "VB" == "Brian V Bonini" <[EMAIL PROTECTED]> writes:

 > Ok, but I thought the start and end chars were ^ $ i.e., ^is$ or is
 > this not what you mean by bounderies?


No, not really. \b matches the start or end of a word. You can see it
clearly if you do this:

   print preg_replace( '/\b/', '-', 'this is a string' ) . "<br>\n"; 


It will output:

   -this- -is- -a- -string-

As it replaces all the word boundaries with a hyphen.

So the regular expression /\bis\b/ will match only the word 'is'
and not 'this' or 'isotope' or 'biscuit'.

        -robin

-- 
Robin Vickery.................................................
BlueCarrots, 14th Floor, 20 Eastbourne Terrace, London, W2 6LE




Does anyone know of any sites that have any scripts for managing magazine 
subscriptions!

Cheeky I know but may save a lot of time!

Thanks

Andy Kent
Managing Director
Angel Solutions Ltd
t: 0151 737 1048
f: 0870 126 9837
e: [EMAIL PROTECTED]
w: http://www.angelsolutions.co.uk






Hi all,

Unique ID Software are looking for a new permanent PHP
and MySQL programmer. The company is based in central 
London and works in the video/film industry.

The main product is called Cakes (don't ask!) which
transparently manages video footage in a professional
environment. I think we can probably make a claim
for the largest PHP application ever - we're up to
some 100,000 lines or so at the moment, not including
the support C++ programs! 

We have a lively and robust office environment, and
meet our clients on a daily basis, so you must be able
to interact well with people. 

The major qualifications we need are PHP (3 or 4. Must
be comfortable with classes :-) and MySQL. Anything
else of benefit is a bonus :-)

The initial position is to work on two of the client
sites hosted by us - we make you do some smaller, more
self-contained projects before letting you loose on
the main product :-) If you can prove to us that you
are competent, we'll "upgrade" you to the main team.

UID is a small company at the moment - 7 people in fact.
We are currently being courted by two of the main 
industry players to fund us to a much larger company.
This is a good opportunity to get in before the big
expansion happens. OTOH at the moment everyone is
expected to "muck in" and help. You pays your money...

Along with the general "good environment to work in", we
offer a group company personal pension scheme (it's
yours, you can take it with you, but we can contribute
as if it were ours :-), death-in-service benefit (!) and
critical-illness insurance (pays out 80% of your salary
till your pension kicks in if you can't work. 5% "pay"
increase per year). The industry we work in
is a lot of fun, and there are 2 guaranteed trade
shows to go to every year (one in Las Vegas, one in
Amsterdam). This assumes you can talk to people in a
non-scary manner :-)

Feel free to browse the website (www.unique-id.com) and
reply to [EMAIL PROTECTED] if you're interested. CV's
are requested, along with expected salary. 

ATB,
        Simon.




I have the same problem but i don't study the record which is the
subject of the update query.
I tested just the object "db" from ac_store, which has the props Host,
Database, user. The values of the db are correct in a debug mode (print
the values :o) ) but in the command query($q) is the error.

My user has a insert, update and delete privileges, on a just select
privilege user i hadn't the error.

Example of dabases and users:

class MyDB extend DB_SQL {
        Host = "aaa.com";
        Database = "MyDataBase";
        User = "writeuser";
        Password = "xxx";
}

class MySession extend Session {
        Host = "aaa.com";
        Database = "lib";
        User = "writeuser";
        Password = "xxx";
}

I had the objects:

page_open (array("sess"=>"MySession"));
X = new MyDB;
....
X->free();
....
page_close();

My error is, after the correct properties Host, Database, User, printed
in debug mode (from ac_store function) MyDataBase.active_session "isn't
a table";
I ask myself why ct_sql.db before the command "query" has the correct
properties and in the "query" function will be used the
MyDataBase.properties.

If you find a solution, please email me.

Bogdan Morar

SO: Redhat 6.2
Database: MySql 3.2.
Php: 3.0.16
Web Server: Apache
PhpLib: 7.2c

Prasad RL wrote:
> 
> I know this problem has been discussed before. But then unfortunatly, i still find 
>the bug has not been fixed.
> 
> The problem seems to be in ac_store() function in ct_sql.inc.
> 
> My observations were that
> 
>  1. Surprisingly though the page_open() function doesnt create any entry in 
>active_sessions table.
> 
>  2.When page_close() function is called, it
>    gives the following error;
> 
> Database error: Invalid SQL: update active_sessions set val='...', 
>changed='20010215030837' where sid='8378099455e8f8f96958bc3fc3559cbd' and 
>name='Example_Session'
> 
> MSSQL Error: 1 (General Error (The MSSQL interface cannot return detailed error 
>messages).) Session halted.
> 
> (pls note: this error doesnt appear when call to the page_close function is removed)
> 
> The program halts with the above error immediately when the query "update 
>active_sessions set val=.." is executed.
> 
> What could be the cause of this error ?
> 
> Why is the function trying to update when there's no entry in active_sessions table.
> and why is the entry not created at first point ?
> 
> Any help would be highly appreciated.
> 
> Thanks in advance,
> 
> Sivaprasad R.L.
> 
> p.s. I'm using phplib 7.2c (also tried with 7.2b)




Thanks a lot guys for ur help!


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





Folks:

I have some code that encrypts data using a relatively long (164 characters)
alphanumeric key. 

The code for encrypt is:

$encrypted = mcrypt_cbc( MCRYPT_TripleDES, $secret_key, trim($data),
MCRYPT_ENCRYPT);

and the decrypt code is:

$decrypted = mcrypt_cbc( MCRYPT_TripleDES, $secret_key, $data,
MCRYPT_DECRYPT);

The encrypted valus is stored in a mysql database with 'addslashes' on store
and 'stripslashes' on retrieval.

When I decrypt the data, I'm getting extra whitespace characters at the end
of it. I don't get this when I test it stand-alone, but on my production
server it seems to be happening regularly. I've stopped it with trim(), but
is this a known weirdness ? I'm running PHP4.0.3pl1 and mcrypt 2.2.x on
FreeBSD 4.1.1.

Any thoughts appreciated as this is causing me some concern with respect to
the encryption/decryption process not being that robust.

tia

..Iain

--
Join Nortel Networks at CeBIT 2001 on Stand F13, Hall 17, March 22-28, 2001
in Hannover, Germany. And find out how Nortel Networks is building the
high-performance Internet.

Visit www.nortelnetworks.com/cebit for all the information you need.






I am using MySQL 3.22.32 and PHP 4.01PL2, but it seems that
mysql_db_query($db, $myQuery) is not quite stable, actually, in my code, it is like

mysql_db_query($db, $myQuery) or die "Something wrong during query");

1 out of 15 (the same query), it will "die".

Does anyone have any suggestion?

Thanks,
George




try using mysql_query( $qQuery, $dbConnection );

At 10:32 AM 2/15/01 -0600, Zhu George-CZZ010 wrote:

>I am using MySQL 3.22.32 and PHP 4.01PL2, but it seems that
>mysql_db_query($db, $myQuery) is not quite stable, actually, in my code, 
>it is like
>
>mysql_db_query($db, $myQuery) or die "Something wrong during query");
>
>1 out of 15 (the same query), it will "die".
>
>Does anyone have any suggestion?
>
>Thanks,
>George
>
>--
>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]





El Jue 15 Feb 2001 13:32, escribiste:
> I am using MySQL 3.22.32 and PHP 4.01PL2, but it seems that
> mysql_db_query($db, $myQuery) is not quite stable, actually, in my code, it
> is like
>
> mysql_db_query($db, $myQuery) or die "Something wrong during query");
>
> 1 out of 15 (the same query), it will "die".

Looks like you have a problem with the MySQL configuration.

> Does anyone have any suggestion?

Change to PostgreSQL maybe?

Saludos... :-)

-- 
System Administration: It's a dirty job, 
but someone told I had to do it.
-----------------------------------------------------------------
Martín Marqués                  email:  [EMAIL PROTECTED]
Santa Fe - Argentina            http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------




Hi, on PHP.ini, it's said 

[mail function]
SMTP = localhost ;for win32 only
sendmail_from = [EMAIL PROTECTED] ;for win32 only
;sendmail_path  = ;for unix only, may supply arguments as well (default is 'sendmail 
-t -i')

Well, my question is : does anyone knows abasic solution to use another smtp server 
than localhost (we use sudo, on debian, sendmail is on the sbin dir and we don't want 
to move it from here, that's the problem : mail() is used by nobody and not have 
rights tu use sendmail, if it's on sbin...) 

I know I may implement another php mail() fonction that connect to the SMTP server I 
want and says helo....
But I was wondering it anyone had a better solution

Thanks
Seb





I'm running PHP4.0.4pl1-Win32, Zend Engine v1.0.4, Zend Optimizer v1.0.0, I
tryed to run sample script for creating PDF document. It's PHP manual
script, but I get message like this:

Fatal error: Call to undefined function: pdf_new() in c:/web/pdf/pdf.php on
line 2

phpinfo.php said:

        PDF Support                           enabled
        PDFLib Version                           3.03
        CJK Font Support                          yes
        In-memory PDF Creation Support            yes


Can you help me with this problem?

Thanks in advance,
Vladmir

P.S. Here is a PDF that I wanted to create.

<?php
$pdf = PDF_new();
PDF_open_file($pdf, "test.pdf");
PDF_set_info($pdf, "Author", "Uwe Steinmann");
PDF_set_info($pdf, "Title", "Test for PHP wrapper of PDFlib 2.0");
PDF_set_info($pdf, "Creator", "See Author");
PDF_set_info($pdf, "Subject", "Testing");
PDF_begin_page($pdf, 595, 842);
PDF_add_outline($pdf, "Page 1");
PDF_set_font($pdf, "Times-Roman", 30, "host");
PDF_set_value($pdf, "textrendering", 1);
PDF_show_xy($pdf, "Times Roman outlined", 50, 750);
PDF_moveto($pdf, 50, 740);
PDF_lineto($pdf, 330, 740);
PDF_stroke($pdf);
PDF_end_page($pdf);
PDF_close($pdf);
PDF_delete($pdf);
echo "<A HREF=getpdf.php>finished</A>";
?>








Couldn't find one in the manual under arithmetic functions.


-- 
Randy Perry
sysTame

Mac Consulting/Sales





Randall Perry wrote:
> 
> Couldn't find one in the manual under arithmetic functions.

%

-Egon

-- 
SIX Offene Systeme GmbH       ·        Stuttgart  -  Berlin 
Sielminger Straße 63   ·    D-70771 Leinfelden-Echterdingen
Fon +49 711 9909164 · Fax +49 711 9909199 http://www.six.de
Besuchen Sie uns auf der CeBIT 2001,  Halle 6,  Stand F62/4




Randall Perry wrote:
> Couldn't find one in the manual under arithmetic functions.

You would've found it under operators, I think.
It's %

regards
Wagner

-- 
Three may keep a secret, if two of them are dead.





$remainder = 10 % 5;

--- Randall Perry <[EMAIL PROTECTED]> wrote: > Couldn't
find one in the manual under arithmetic
> functions.
> 
> 
> -- 
> Randy Perry
> sysTame
> 
> Mac Consulting/Sales
> 
> 
> -- 
> 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]
> 


=====
To find out more about me : http://www.geocities.com/mimodit
My bookmarks are available @ http://mukul.free.fr

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/




on 2/15/01 12:01 PM, Mukul Sabharwal at [EMAIL PROTECTED] wrote:

> 
> $remainder = 10 % 5;
> 
> --- Randall Perry <[EMAIL PROTECTED]> wrote: > Couldn't
> find one in the manual under arithmetic

Thanks


-- 
Randy Perry
sysTame

Mac Consulting/Sales





I have an array of search results which I am searching through and
unset()ing unwanted search results. My question is once I have unset a
result there is then a break in the numeric index and how do I stop this
from happening or reindex the results. Like this..

$results = array(0 => array(more elements...), 1 => array(bla bla...) , 2
=>array(....));

/* unset results index 1 */
unset($results[1]);

/*

Now the $results index is like this..

array(0 => array(more elements...), 2 =>array(....));

*/





Try this :

<?php

    $foo = array('a','b','c');

      unset($foo[1]);

      print_r($foo);    // [0] => a [2] => c

    $bar = array('a','b','c');

      $piece = array_splice ($bar, 1 ,1);

      print_r($piece);  // [0] => b 

      print_r($bar);    // [0] => a [1] => c 

?>

    http://www.php.net/manual/en/function.array-slice.php

    http://www.php.net/manual/en/function.unset.php

Regards,

Philip

On Thu, 15 Feb 2001, Nathan Cassano wrote:

> I have an array of search results which I am searching through and
> unset()ing unwanted search results. My question is once I have unset a
> result there is then a break in the numeric index and how do I stop this
> from happening or reindex the results. Like this..
> 
> $results = array(0 => array(more elements...), 1 => array(bla bla...) , 2
> =>array(....));
> 
> /* unset results index 1 */
> unset($results[1]);
> 
> /*
> 
> Now the $results index is like this..
> 
> array(0 => array(more elements...), 2 =>array(....));
> 
> */
> 
> 
> -- 
> 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]
> 





Hello,

Is it impolite to ask about when approximately PHP will support Exception
handling ? :)

Thanks !






Hello,

Anybody here would know, how I could inverse the date sorting or ordering?

This script below gives me for example:
2001-01-01
2001-01-15
2001-01-31
and so on...

when I wish it would gives me:
2001-01-31
2001-01-15
2001-01-01
and so on...

---------------------------------------------
<?php
$db = mysql_connect("servername.com", "root", "password");
mysql_select_db("stats", $db);
$sql = "select * from table_name WHERE TO_DAYS(NOW()) - TO_DAYS(date)
<= 21 order by 'date'";
$result = mysql_query( $sql );
while ( $row = mysql_fetch_array( $result ) )
     {
     echo "<tr><td><span class=\"size1\"><b>$row[date]</b><br><img
src=\"$row[indice_url]\"><br>$row[indice]<hr noshade
size=\"1\"></span></td></tr>\n";
     }
?>
---------------------------------------------


Thanks again for your help.
Merci beaucoup,

Yves
--


------------------------
Malouin Design Graphique
http://www.malouin.qc.ca

Québec (Québec)  CANADA





add a DESC to your order by clause... fairly simple SQL syntax, could be 
picked up from a myriad of SQL references and manuals

$sql = "select * from table_name WHERE TO_DAYS(NOW()) - TO_DAYS(date) <= 21 
order by date DESC";


At 12:14 PM 2/15/01 -0500, Malouin Design Graphique wrote:
>Hello,
>
>Anybody here would know, how I could inverse the date sorting or ordering?
>
>This script below gives me for example:
>2001-01-01
>2001-01-15
>2001-01-31
>and so on...
>
>when I wish it would gives me:
>2001-01-31
>2001-01-15
>2001-01-01
>and so on...
>
>---------------------------------------------
><?php
>$db = mysql_connect("servername.com", "root", "password");
>mysql_select_db("stats", $db);
>$sql = "select * from table_name WHERE TO_DAYS(NOW()) - TO_DAYS(date) <= 
>21 order by 'date'";
>$result = mysql_query( $sql );
>while ( $row = mysql_fetch_array( $result ) )
>     {
>     echo "<tr><td><span class=\"size1\"><b>$row[date]</b><br><img 
> src=\"$row[indice_url]\"><br>$row[indice]<hr noshade 
> size=\"1\"></span></td></tr>\n";
>     }
>?>
>---------------------------------------------
>
>
>Thanks again for your help.
>Merci beaucoup,
>
>Yves
>--
>
>
>------------------------
>Malouin Design Graphique
>http://www.malouin.qc.ca
>
>Québec (Québec)  CANADA
>
>
>--
>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]
>
>





I am new to php and I am wondering if it is possible to use a javascript
variable in a php statement for example:

// create sql statement

                $sql = "select * from main where businesstype = "consultancy" and
top.upper.villagename = != "0";";

Is it possible to make this work if "top.upper.villagename" is my javascript
variable this would save having to write many php pages as i could just use
the a generic one with the javascript variable changing.

Thanks

Matt Davis.





Hi!

    I read the instruction and am not sure on whether to proceed or not.
The instruction mentioned that you install/compile the FreeTDS first then
compile PHP 2nd.  So, does this mean I have to compile Apache as well?

Thanks,
 Scott






I have 2 functions on my page, RegisterUser, IsValidUser.
RegisterUser looks in the querystring to see if you've passed a certain key
& value.   If you have it populates a session variable called "ValidUser"
with a 1.
All that IsValidUser does, is check to see if the session variable
"ValidUser" is a 1 or not.

It doesn't work.
RegisterUser (which sets session variables) is taking place before headers
are written to the browser.  I'm not gettin errors, but the problem is that
ValidUser isn't able to read the session variable for some reason.

Any Ideas?

Here is the code for these 2 functions:

function IsValidUser()
{
global $HTTP_SESSION_VARS;

$reslt = 0;

  if (isset($HTTP_SESSION_VARS["ValidUser"]))
   {
    if ($HTTP_SESSION_VARS["ValidUser"] == "1")
     $reslt = 1;
  }
  print("ValidUser? " . $HTTP_SESSION_VARS["ValidUser"] . "<br>");

return($reslt);
}


function RegisterUser()
{
global $HTTP_SESSION_VARS;
global $HTTP_GET_VARS;
$reslt = 0;

if (isset($HTTP_SESSION_VARS["ValidUser"]))
{
 if ($HTTP_SESSION_VARS["ValidUser"] == 1)
 {
   $reslt = 1;
 }
}

if ($reslt=0);
{

 $Val_User = $HTTP_GET_VARS["fis"];

 if ($Val_User == "1")
 {
  $reslt = 1;
     if (!isset($HTTP_SESSION_VARS["ValidUser"]))
     {
    session_start();
     session_register("ValidUser");
     $HTTP_SESSION_VARS["ValidUser"] = 1;
    }
    else
    {
     $HTTP_SESSION_VARS["ValidUser"] = 1;
    }
 }
 else
 {
 $reslt = 0;
 }
}
return($reslt);
}






Just as simple as that?!
Thank you guys: Fang; Andrew and Joe.
Much appreciated.

Hope to be able to give a hand myself someday to newbies like me ;-)

Won't have to ask this question again. Promessed!

Mes salutations,

Yves


At 12:26 -0500 15/02/2001, Fang Li wrote:
>add DESC after order by 'date', it will be
>
>$sql = "select * from table_name WHERE TO_DAYS(NOW()) - TO_DAYS(date)
><= 21 order by 'date' DESC";
>
>Fang
>
>-----Original Message-----
>From: Malouin Design Graphique [mailto:[EMAIL PROTECTED]]
>Sent: February 15, 2001 12:15 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] How to inverse the date sorting
>
>
>Hello,
>
>Anybody here would know, how I could inverse the date sorting or ordering?
>
>This script below gives me for example:
>2001-01-01
>2001-01-15
>2001-01-31
>and so on...
>
>when I wish it would gives me:
>2001-01-31
>2001-01-15
>2001-01-01
>and so on...
>
>---------------------------------------------
><?php
>$db = mysql_connect("servername.com", "root", "password");
>mysql_select_db("stats", $db);
>$sql = "select * from table_name WHERE TO_DAYS(NOW()) - TO_DAYS(date)
><= 21 order by 'date'";
>$result = mysql_query( $sql );
>while ( $row = mysql_fetch_array( $result ) )
>      {
>      echo "<tr><td><span class=\"size1\"><b>$row[date]</b><br><img
>src=\"$row[indice_url]\"><br>$row[indice]<hr noshade
>size=\"1\"></span></td></tr>\n";
>      }
>?>
>---------------------------------------------
>
>
>Thanks again for your help.
>Merci beaucoup,
>
>Yves

--


------------------------
Malouin Design Graphique
http://www.malouin.qc.ca

Québec (Québec)  CANADA





Our company, IBC,  hosts websites.  We currently have PHP4 and MySQL 3.23 on all our
servers.  I would suggest contacting Charone at [EMAIL PROTECTED] or call us at
(937)277-2000.  The prices on our website aren't very accurate.  Often our prices are 
much
cheaper than what you will find there.  Actually, you could more than likely get your 
own
server through us for less than $100 dollars a month.  If you would rather email me 
back,
I can forward the information on to her and find out a price range for what you want.  
If
you have any questions, let me know.
-Angela

-- 
Angela Curtis
Innovative Business Consultants
http://www.ibc2001.com




Hello,

I have the array  $array[x][y];

if I want to know the x I use count($array);

Now, How can I count the y??

Thank you.

Fabian Fabela
[EMAIL PROTECTED]
www.vacagorda.com





> Hello,
> 
> I have the array  $array[x][y];
> 
> if I want to know the x I use count($array);
> 
> Now, How can I count the y??

for($x = 0; $x <= count($array); $x++) {
 echo "Number of elements at $x: " . count($array[$x]) . "<br>";
}

Thats assumeing that y is an array...

- James





Hi,

Well it depends, on which elements /2nd/ dimension you
wanna see!

here's some code:

$myarr[0][0] = "sdkjsjks";
$myarr[1][0] = "dsjkdkjsd";
$myarr[1][1] = "hsjdsh";
$myarr[1][2] = "dsjkdsjkdkjsdkjs";

echo sizeof($myarr); // would print 2, element 0 and
1.
echo sizeof($myarr[0]); would print 1, 0 of 0.
echo sizeof($myarr[1]); would print 3, 3 of 1.

Hope that helps. It goes on into as many dimensions!

=====
To find out more about me : http://www.geocities.com/mimodit
My bookmarks are available @ http://mukul.free.fr

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/




Try this :

<?php

    $a[0][0] = 'a';
    $a[0][1] = 'b';
    $a[0][2] = 'c';
    $a[1][0] = 'aa';

    print '<br> $a    : ' . sizeof($a);    // 2
    print '<br> $a[0] : ' . sizeof($a[0]); // 3
    print '<br> $a[1] : ' . sizeof($a[1]); // 1

?>

Regards,

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

On Thu, 15 Feb 2001, Fabian Fabela wrote:

> Hello,
> 
> I have the array  $array[x][y];
> 
> if I want to know the x I use count($array);
> 
> Now, How can I count the y??
> 
> Thank you.
> 
> Fabian Fabela
> [EMAIL PROTECTED]
> www.vacagorda.com
> 
> 





Hi!
Can u point me to an excellent php/mysql provider ?
with whom i can communicate by distance !
Thanks


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





Hello--

I'm faced with writing some rather difficult regex's, and would like 
to be pointed to a comprehensive list of POSIX regex operators.

I have been unable to find these in the on-line docs, nor the three 
PHP books I bought.

I purchased "Mastering Regular Expressions," which is very helpful 
2-week intro. But amazingly, it has no chart. There must be a 
downloadable reference for this.

Best, Ted

_____________
Ted Goranson
Fusecap and Sirius-Beta, Virginia Beach USA
757/426-6704
[EMAIL PROTECTED]
Symmetry Conference: http://www.isis-s.unsw.edu.au




Ted Goranson pressed the little lettered thingies in this order...

> Hello--
> 
> I'm faced with writing some rather difficult regex's, and would like 
> to be pointed to a comprehensive list of POSIX regex operators.
> 
> I have been unable to find these in the on-line docs, nor the three 
> PHP books I bought.
> 
> I purchased "Mastering Regular Expressions," which is very helpful 
> 2-week intro. But amazingly, it has no chart. There must be a 
> downloadable reference for this.
> 
> Best, Ted
> 
> _____________
> Ted Goranson
> Fusecap and Sirius-Beta, Virginia Beach USA
> 757/426-6704
> [EMAIL PROTECTED]
> Symmetry Conference: http://www.isis-s.unsw.edu.au
> 

try:
http://www.contactor.se/~dast/mail2sms/regex.shtml
http://www.ciser.cornell.edu/info/regex.html

If at all possible, I would recommend using the perl compatible REs 
since they're more powerful, are documented much more thoroughly and 
support for them is much easier to obtain.

If it's not possible to use PCREs, the above links (particularly the first) 
whould contain details for just about anything you may need to do with 
POSIX REs.

Good luck...

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com

For a good time,
http://www.AppIdeas.com/




Hi,
        I have a problem (!). I am using an MS SQL db, which returns a date field.
How can I format this using the date() function? ie how can I convert the
date to a Unix timestamp? I know you can use the mktime() function, but in
which case, how can I get the day/month/year etc from the ms sql date
field?!

Many thanks,

- James

Editor, VB Web
==================
Web   - http://www.vbweb.co.uk
Email - [EMAIL PROTECTED]
ICQ#  - 60612011
==================





Hi Guys,

Just a quick question.  If I have a user database, with joe_bloggs as a
user, what would I need to do to make sure that his login details matched
the case sensitivity in a MySQL database?  Say if he logged in as
JOE_BLOGGS, could I return an error?  I'm guessing this is going to turn
into some complicated regex that mashes my brain.

Oh, another thing.  Anyone know of any tools like PHP MyAdmin for
PostGresSQL ?

Thanks,
James.






On Thu, 15 Feb 2001 19:41:04 -0000, James, Yz ([EMAIL PROTECTED])
wrote:
>Hi Guys,
>
>Just a quick question.  If I have a user database, with joe_bloggs
>as a
>user, what would I need to do to make sure that his login details
>matched
>the case sensitivity in a MySQL database?  Say if he logged in as
>JOE_BLOGGS, could I return an error?

make the login field BINARY.





> make the login field BINARY.

Thanks! ;)

James.






El Jue 15 Feb 2001 16:41, James, Yz escribió:
>
> Oh, another thing.  Anyone know of any tools like PHP MyAdmin for
> PostGresSQL ?

phpPgAdmin?

http://www.greatbridge.org/project/phppgadmin/projdisplay.php

Saludos... ;-)

-- 
System Administration: It's a dirty job, 
but someone told I had to do it.
-----------------------------------------------------------------
Martín Marqués                  email:  [EMAIL PROTECTED]
Santa Fe - Argentina            http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------




   reset($HTTP_POST_VARS);
   while (list($key, $val) = each($HTTP_POST_VARS)) {
//print "$key - $val<br>";
      if (substr($key,0,3) == "alt" or substr($key,0,3) == "exc")


Somebody can explain or indicate any site about this ($HTTP_POST_VARS)?

It is used to do menu in php. If the name of the button (<input
type="image" name="back"...>

then in php I use:

if ($back_x > 0) {
  .
  .
  .
}

Augusto Cesar Castoldi





Notepad, Wordpad and MS Word are my available choices.  

Word interpret my PHP so how to inhibit that?

so I can get a line count and get closer to my many newbie errors
..OR..
I need a recommendation of an inexpensive editor.

I am reading digest so please CC or direct mailto:[EMAIL PROTECTED]

Thanks, 

Lonnie





On Tue, 23 Jan 2001 13:33:00 +0100, Sander Pilon ([EMAIL PROTECTED])
wrote:
>>
>> >If you want to be totally searchengine-safe, do not use variables
>>on the
>> >url, do not rely on cookies and do not rely on POST variables
>> for the pages
>> >you want to have the searchengine spider.
>>
>> How the heck do you build a dynamic site without URL variables,
>> cookies, or POST variables?
>>
>> Kristofer
>
>One way would be to use the url path.
>
>Http://script.php/these/are/variables/passed/to/php
>
>You fool the searchengine, it thinks 'script.php' is a directory and
>its
>getting a file called 'php', but actually you're calling
>'script.php' with
>'/these/are/variables/passed/to/php' as parameters.

These days most search engines index everything, no matter how many
?'s or &'s they see. It used to matter that you do things this way,
but now it really doesn't.

BTW, the key to showing up high in google is to get people to link to
your site with the right link text. let's say for instance a hundred
people link to you like this:
<a href="http://www.mysite.com">php scripts</a>

google notices this and builds an index based on it. Then when
someone types in 'php scripts' into google, you're almost guaranteed
to rank first.





Looks like the PHP site is down, parse error on site.inc... just an FYI :)




El Jue 15 Feb 2001 17:41, escribiste:
> Looks like the PHP site is down, parse error on site.inc... just an FYI :)

Ohhh, I'd love to get me hands on some of the code these great guys do. :-)

Saludos... :-)

-- 
System Administration: It's a dirty job, 
but someone told I had to do it.
-----------------------------------------------------------------
Martín Marqués                  email:  [EMAIL PROTECTED]
Santa Fe - Argentina            http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------




Definately a bit frightening that a virtually static site has an include
that is over 300 lines long :)  Maybe just well documented?

-jm

-----Original Message-----
From: Martin A. Marques [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 15, 2001 12:40 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] php site, parse error


El Jue 15 Feb 2001 17:41, escribiste:
> Looks like the PHP site is down, parse error on site.inc... just an FYI :)

Ohhh, I'd love to get me hands on some of the code these great guys do. :-)

Saludos... :-)

-- 
System Administration: It's a dirty job, 
but someone told I had to do it.
-----------------------------------------------------------------
Martín Marqués                  email:  [EMAIL PROTECTED]
Santa Fe - Argentina            http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------

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





> > Looks like the PHP site is down, parse error on site.inc... just an FYI :)
> 
> Ohhh, I'd love to get me hands on some of the code these great guys do. :-)

You can, for example (re: above) see :

    http://php.net/source.php?page_url=/include/site.inc

It's *all* public and available, see :

    http://php.net/COPYRIGHT.txt

Note the "source" button on every php.net page.


Regards,

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




Reply via email to