php-general Digest 3 Jan 2002 12:22:53 -0000 Issue 1089

Topics (messages 79274 through 79302):

Re: INI file parsing
        79274 by: Steve Edberg

Code not working in 4.1
        79275 by: Jonathan Hilgeman
        79276 by: Martin Towell

Re: XML Parsing Problem
        79277 by: Matthew Clark

Holy Moly...
        79278 by: Julie Hull
        79279 by: Martin Towell
        79280 by: Matt Moreton
        79291 by: Kevin Keeler
        79292 by: B. van Ouwerkerk
        79298 by: scott
        79299 by: role+php-general.axoria.net

Re: Mysql Curdate problem
        79281 by: Jimmy

Date aritmetic
        79282 by: Carlos Fernando Scheidecker Antunes
        79283 by: Bogdan Stancescu
        79284 by: Bogdan Stancescu
        79285 by: Martin Towell
        79286 by: Martin Towell

Can I config PHP RPM?
        79287 by: gaukia 345

If Statement with more than one conclusion
        79288 by: rdkurth.starband.net
        79289 by: Martin Towell
        79290 by: rdkurth.starband.net
        79293 by: George Nicolae

Re: easy quickie..
        79294 by: TD - Sales International Holland B.V.

Re: Licensing??
        79295 by: TD - Sales International Holland B.V.

Re: Including files & variables ...
        79296 by: Tamas Arpad

Q: PHP3 / Read STDIN when missing Content-Type
        79297 by: role+php-general.axoria.net

Re: array_multisort?
        79300 by: Tim Ward

nested includes
        79301 by: V

SSL & fsockopen()
        79302 by: Jeff Rossi

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]


----------------------------------------------------------------------
--- Begin Message ---
AFAIK, it will reread the .ini file every time only if you're running PHP 
as a CGI, as opposed to an Apache module (or ISAPI or NSAPI module, but I 
don't think either of those are industrial strength yet). SO, yes, the .ini 
file will be reread each time PHP is called by IIS.

-steve

At 01:02 PM 1/2/02 , Joe Webster wrote:
>If so that would be totally shitty (in the respects of effecienty)
>
>
>"Charlesk" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I am running IIS 5.0 Windows 2000 Server.  Changes made to the ini take
>effect immediately.  So it seems that php in Windows and IIS reloads the ini
>every time a page is requested?
> >
> > Charles Killmer
> >
> > ---------- Original Message ----------------------------------
> > From: "Joe Webster" <[EMAIL PROTECTED]>
> > Date: Wed, 2 Jan 2002 15:46:32 -0500
> >
> > no you need to restart apache to change an in setting. So it loads the
> > settings once per server start (at least with apache).
> >
> > "Charlesk" <[EMAIL PROTECTED]> wrote in message
> > news:<[EMAIL PROTECTED]>...
> > > Does PHP parse the ini file every time a file is requested?  I am trying
> > to track down a problem on various pages where the timelimit will expire.
> > These are not complex pages and when I go to them they work fine.
> > > I have used the same browser that the user eses when the timeout occurs.
> > Nothing strange for me.
> > > I have looked at the line that the error log specifies and it is just
> > random lines.  sometimes it is a '}'.  As if the script just ran out of
>time
> > on that line.  BTW '}' is the closing of an if statement so it isnt stuck
>in
> > a loop.  And when I go to the page I make sure to use the same querystring
> > that the user sent.
> > >
> > > Another thought, is the php engine slowed by users with a slow
>connection?
> > >
> > > Charles Killmer
> > > NetgainTechnology.com
> >
> >

+------------------------------------------------------------------------+
| Steve Edberg                                      [EMAIL PROTECTED] |
| Database/Programming/SysAdmin                            (530)754-9127 |
| University of California, Davis             http://pgfsun.ucdavis.edu/ |
+---------------------- Gort, Klaatu barada nikto! ----------------------+

--- End Message ---
--- Begin Message ---
I used to run PHP 4.0.3 and at the beginning of some functions that used a
lot of global variables, I would add the following lines so I could access
all the global variables inside the functions.

 foreach($GLOBALS as $GlobalVarName => $GlobalVarValue)
 {
  global $$GlobalVarName;
 }

I upgraded to 4.1 and this code now causes PHP to die about 50-100 lines
after it is executed. Any ideas?

- Jonathan


--- End Message ---
--- Begin Message ---
use:

extract($GLOBALS);

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

-----Original Message-----
From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 03, 2002 11:32 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Code not working in 4.1


I used to run PHP 4.0.3 and at the beginning of some functions that used a
lot of global variables, I would add the following lines so I could access
all the global variables inside the functions.

 foreach($GLOBALS as $GlobalVarName => $GlobalVarValue)
 {
  global $$GlobalVarName;
 }

I upgraded to 4.1 and this code now causes PHP to die about 50-100 lines
after it is executed. Any ideas?

- Jonathan



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
well thats just the way XML parsers work, according to the parser, what you
have there is not a single string element, you have three child elements
(the parent node being the <title>).. two string nodes broken up by an
entity node.  In other circumstances, this behaviour can be very useful.

Matt.


-----Original Message-----
From: Ben Gollmer [mailto:[EMAIL PROTECTED]]
Sent: 02 January 2002 23:16
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] XML Parsing Problem


Ok, I can understand the predefined entity replacement. But why does it
break the string up into 3 parts? I think it should just return
"Follow-up To Critique of BeOS &amp; Mac OS X".

Ben


--- End Message ---
--- Begin Message ---
Could someone please direct a total novice to the best PHP beginner news
group. Just to many to choose from ~:)

Thank You,
Julie ~:)

--- End Message ---
--- Begin Message ---
This one's pretty good, IMO
but as for the "best" - hmm... that would be a matter of personal opinion...
:)

-----Original Message-----
From: Julie Hull [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 03, 2002 1:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Holy Moly...


Could someone please direct a total novice to the best PHP beginner news
group. Just to many to choose from ~:)

Thank You,
Julie ~:)


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
If you dont mind downloading ~50 messages a day, then I'd recommend this
group :]

Regards

Matt.

----- Original Message -----
From: "Julie Hull" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 03, 2002 2:16 AM
Subject: [PHP] Holy Moly...


> Could someone please direct a total novice to the best PHP beginner news
> group. Just to many to choose from ~:)
>
> Thank You,
> Julie ~:)
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Well, this *is* a good list, but the subjects tend to be of a more
"intermediate" nature .. You gotta know a little before you know what to
ask.  I would reccomend staying subscribed and just skimming subject
headings for things topics that sound interesting to you.

It's surprisingly easy to get a running start with PHP using some of the
web tutorials out there.

a few:
http://www.phpbeginner.com/
http://www.devshed.com/Server_Side/PHP/
http://www.phpwizard.com/beginning.html
http://www.phpbuilder.com/columns/

those are just from a quick google search, so ypu can easily fins others.

another GREAT source is the PHP manual itself - especially the user
comments.

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

ahoy and enjoy

        --kevin

On Wed, 2 Jan 2002, Julie Hull wrote:

> Could someone please direct a total novice to the best PHP beginner news
> group. Just to many to choose from ~:)
>
> Thank You,
> Julie ~:)
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>

--- End Message ---
--- Begin Message ---
At 17:16 2-1-02 -0900, Julie Hull wrote:
>Could someone please direct a total novice to the best PHP beginner news
>group. Just to many to choose from ~:)

Start by visiting www.php.net and click on links. You'll find many websites 
with tutorials.. Much better to learn something there before you start 
asking questions easily found there.

Bye,


B.

--- End Message ---
--- Begin Message ---
... and dont forget, download some free PHP scripts and
dissect them.  my method for learning a new language is
just to throw myself head-first into it, and start writing
something in that language, using online manuals and
printed works to fill in the gaps along the way.

> On Wed, 2 Jan 2002, Julie Hull wrote:
> 
> > Could someone please direct a total novice to the best PHP beginner news
> > group. Just to many to choose from ~:)
> >
> > Thank You,
> > Julie ~:)


--- End Message ---
--- Begin Message ---
>> On Wed, 2 Jan 2002, Julie Hull wrote:
>> 
>> > Could someone please direct a total novice to the best PHP
>> > beginner news group. Just to many to choose from ~:)
>> >
>> > Thank You,
>> > Julie ~:)


Jump right in, but be sure to read the introductory chapters of the
PHP manual, especially on security, and then dip back into them once
you're getting familiar with PHP.

It also depends on what you know about web servers, server-side
scripting, what other languages you know, and so on...

--- End Message ---
--- Begin Message ---
Hi Andras,

> $aresult=mysql_query("select * from orders WHERE (a3 >= CURDATE()-$datec)"
> ,$db);

what's the value of $datec? integer 7 or 14?
if so then try to change it to this: "interval 7 days"

--
Jimmy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Love deeply and passionately. You might get hurt but it's the only way to live life 
completely.

--- End Message ---
--- Begin Message ---
Hello all,

I would like to know if anyone could help me with the following issue:

I have 6 variables, two holds a day, others the month and the last ones the year. They 
are entered through drop-down-menus where the user selects day, month and year for 
each date.

I would like to know the difference in days between these two dates. Since the dates 
are separated and each value day, month and year are stored on separated variables I 
wonder who to proceed here. I need to know how many days of separate each dates. 

Thank you in advance,

Carlos Fernando
Salt Lake City, UT.
Linux User #207984

--- End Message ---
--- Begin Message ---
Not mentioning that you could've taken a look at 
http://www.php.net/manual/en/ref.datetime.php yourself, here goes:
$days_diff=(mktime(0,0,0,$month2,$day2,$year2)-mktime(0,0,0,$month2,$day2,$year2))/86400;

Bogdan

Carlos Fernando Scheidecker Antunes wrote:

> Hello all,
>
> I would like to know if anyone could help me with the following issue:
>
> I have 6 variables, two holds a day, others the month and the last ones the year. 
>They are entered through drop-down-menus where the user selects day, month and year 
>for each date.
>
> I would like to know the difference in days between these two dates. Since the dates 
>are separated and each value day, month and year are stored on separated variables I 
>wonder who to proceed here. I need to know how many days of separate each dates.
>
> Thank you in advance,
>
> Carlos Fernando
> Salt Lake City, UT.
> Linux User #207984

--- End Message ---
--- Begin Message ---
Well, actually
$days_diff=(mktime(0,0,0,$month2,$day2,$year2)-mktime(0,0,0,$month1,$day1,$year1))/86400;
but you probably got that... :-)

Bogdan

--- End Message ---
--- Begin Message ---
convert both in dates into a time stamp using mktime()
subtract the two figures you get back
then divide by 86400 (60sec/min * 60min/hr * 24hr/day)


-----Original Message-----
From: Carlos Fernando Scheidecker Antunes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 03, 2002 12:57 PM
To: PHP-GENERAL
Subject: [PHP] Date aritmetic
Importance: High


Hello all,

I would like to know if anyone could help me with the following issue:

I have 6 variables, two holds a day, others the month and the last ones the
year. They are entered through drop-down-menus where the user selects day,
month and year for each date.

I would like to know the difference in days between these two dates. Since
the dates are separated and each value day, month and year are stored on
separated variables I wonder who to proceed here. I need to know how many
days of separate each dates. 

Thank you in advance,

Carlos Fernando
Salt Lake City, UT.
Linux User #207984

--- End Message ---
--- Begin Message ---
This isn't to pick on Carlos, but I've notice there's heaps of ppl who don't
read the manual, or do a search on the manual - I've found that many of my
questions have been answered by doing a search on the docs

-----Original Message-----
From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 03, 2002 2:20 PM
To: Carlos Fernando Scheidecker Antunes
Cc: PHP-GENERAL
Subject: Re: [PHP] Date aritmetic


Not mentioning that you could've taken a look at
http://www.php.net/manual/en/ref.datetime.php yourself, here goes:
$days_diff=(mktime(0,0,0,$month2,$day2,$year2)-mktime(0,0,0,$month2,$day2,$y
ear2))/86400;

Bogdan

Carlos Fernando Scheidecker Antunes wrote:

> Hello all,
>
> I would like to know if anyone could help me with the following issue:
>
> I have 6 variables, two holds a day, others the month and the last ones
the year. They are entered through drop-down-menus where the user selects
day, month and year for each date.
>
> I would like to know the difference in days between these two dates. Since
the dates are separated and each value day, month and year are stored on
separated variables I wonder who to proceed here. I need to know how many
days of separate each dates.
>
> Thank you in advance,
>
> Carlos Fernando
> Salt Lake City, UT.
> Linux User #207984


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I'm a PHP newbie and have a few questions.

1) The server I'm working on has PHP 4.0.5 installed using an RPM. So 
there's no source code. How do I include extensions (say --enable java ) 
without getting the PHP source code and without "make"?

2) I think the server's Apache web server is also installed using an RPM. 
But the PHP is installed as a dynamic module. As far as I know, to install 
as a dynamic module, you'll have to use the ./configure command of Apache 
and re "make" and then "make install" Apache. But the Apache source code is 
not there. How is this possible?

Thank you.

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx

--- End Message ---
--- Begin Message ---
How can I do an if statement with more than one conclusions
Something like this I know this is not correct just an example of what
I what to do
If($ext=="com"or"net"or"org"or"info"){
Then do this
}
If($ext=="com.uk"or"me.uk"or"org.uk){
Then do this
}
  

-- 
Best regards,
 rdkurth                          mailto:[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
something like:

If(in_array($ext, array("com", "net", "org", "info")){
//Then do this
}
If(in_array($ext, "com.uk", "me.uk", "org.uk")){
//Then do this
}

maybe??

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 03, 2002 4:22 PM
To: php-general
Subject: [PHP] If Statement with more than one conclusion


How can I do an if statement with more than one conclusions
Something like this I know this is not correct just an example of what
I what to do
If($ext=="com"or"net"or"org"or"info"){
Then do this
}
If($ext=="com.uk"or"me.uk"or"org.uk){
Then do this
}
  

-- 
Best regards,
 rdkurth                          mailto:[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hello Martin,
Thanks that work perfect

Wednesday, January 02, 2002, 9:31:36 PM, you wrote:

MT> something like:

MT> If(in_array($ext, array("com", "net", "org", "info")){
MT> //Then do this
MT> }
MT> If(in_array($ext, "com.uk", "me.uk", "org.uk")){
MT> //Then do this
MT> }

MT> maybe??

MT> -----Original Message-----
MT> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
MT> Sent: Thursday, January 03, 2002 4:22 PM
MT> To: php-general
MT> Subject: [PHP] If Statement with more than one conclusion


MT> How can I do an if statement with more than one conclusions
MT> Something like this I know this is not correct just an example of what
MT> I what to do
MT> If($ext=="com"or"net"or"org"or"info"){
MT> Then do this
MT> }
MT> If($ext=="com.uk"or"me.uk"or"org.uk){
MT> Then do this
MT> }
  




-- 
Best regards,
 rdkurth                            mailto:[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
if (($text=="com")||($text=="net")||($text=="org")||($text=="info"))
{

}

--


Best regards,
George Nicolae
IT Manager
___________________
X-Playin - Professional Web Design
www.x-playin.f2s.com



<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> How can I do an if statement with more than one conclusions
> Something like this I know this is not correct just an example of what
> I what to do
> If($ext=="com"or"net"or"org"or"info"){
> Then do this
> }
> If($ext=="com.uk"or"me.uk"or"org.uk){
> Then do this
> }
>
>
> --
> Best regards,
>  rdkurth                          mailto:[EMAIL PROTECTED]
>


--- End Message ---
--- Begin Message ---
On Wednesday 02 January 2002 20:20, Seb Frost stuffed this into my mailbox:

For the ease I guess.... I use alt-<leftarrow> to go back :-)

> I've never understood why people do this?  My browser has a back button.  I
> know how to use it.  It's only a centimetre of mouse travel away from the
> page I'm looking at, why do I need a duplicate?
>
> - seb
>
>
> -----Original Message-----
> From: Kelly Meeks [mailto:[EMAIL PROTECTED]]
>
>
> Happy New Year,
>
> Does php set a variable that tells you the url of the page that a user has
> just come from?  So if I wanted to create my own 'Back' button in a pop up
> window, for instance?
>
> Thanks in advance,
>
> Kelly
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/2001
--- End Message ---
--- Begin Message ---
On Wednesday 02 January 2002 20:14, Michael A. Peters stuffed this into my 
mailbox:

Hmm but ClibPDF is an additional library package which is not part of the PHP 
engine right? 

regards

> I would like to note that you may need to purchase licensing for certain
> uses.
> For instance, I use ClibPDF on OS X.
>
> If I ever use it for commercial purposes (which I am planning to do, btw)
> I will need to purchase a license from FastIO for use of the ClibPDF
> library.
>
> On Wed, 2 Jan 2002 23:00:23 +0100
>
> "TD - Sales International Holland B.V." <[EMAIL PROTECTED]> mentioned:
> > On Saturday 29 December 2001 05:47, Rasmus Lerdorf stuffed this into my
> > mailbox:
> >
> > No it's free hehe :-) but I think they still appreciate any donations
> >
> :-).
> :
> > For since they are developping software they also have to do research n
>
> stuff
>
> > so sometimes they have to buy books and some testing hardware which
>
> mainly is
>
> > financed by donations I believe (this is general open-source far as I
>
> know,
>
> > not PHP project specific)
> >
> > I'm sure you should be able to find info about it on the homepage.
> >
> > Regards
--- End Message ---
--- Begin Message ---
On Wednesday 02 January 2002 20:43, you wrote:
> What you need to do is simply set the variables before you include
> the script.
>
> When you include a script with include() or require(), they fall
> into the same namespace as the include() or require() function that
> called them.
I read that in the manual too, but I have never understoud how it 
really works. I use require_once in function and the files I include 
have many class and function definitions in it (I include them when I 
really need them to make things faster). So when I try to imagine how 
it works, I feel that it shouldn't.
Becuse if I put the files in place of the require_onces I would get a 
code like this:
function foo() {

        class foo2 {
                function foo2() {
                        ...
                }
                ...
        }
        class foo3 { ... }
        ...
}
And it looks strange, but it works well, I use it frequently. Does 
anybody know why is this code works actually?
Thanks,
        Arpi

p.s. of course it's only a theoretical question. I don't have to 
understand really, but it's good to know what I rely on.
--- End Message ---
--- Begin Message ---
I'm stuck with PHP3 at present and need to process POSTed data that
has a missing Content-Type, so the HTTP_POST_VARS don't work.

Is the raw STDIN data accessible in this situation, please?
Pretty please?

Cheers,
J.

--- End Message ---
--- Begin Message ---
        If title can be guaranteed to be unique then just amend your code to
...

        $product = array($id, $title, $price);
        $shop[$title] = $product;

        if not then you'll have to make the key unique, something like ...

        $product = array($id, $title, $price);
        $shop[$title . "..." . $counter++] = $product;

        you can then use the normal array sorting functions on $shop

        Tim
        www.chessish.com <http://www.chessish.com> 


        ----------
        From:  Sebastiaan Timmers - Bean IT [SMTP:[EMAIL PROTECTED]]
        Sent:  02 January 2002 13:48
        To:  [EMAIL PROTECTED]
        Subject:  array_multisort?

        Hi List,

        I'm having a problem sorting the following array:

        $product = array($id, $title, $price);
        $shop[] = $product;


        I want the array 'shop' to be sorted by the 'title' in array
'product'. I
        tried  the function 'array_multisort()', but that did not do the
trick.

        Does anyone know how to fix this?

        Best regards,

        Sebastiaan Timmers

        
--- End Message ---
--- Begin Message ---
I have this tree:

myroot
  |
  |--folderone
  |      |
  |      |--foldertwo
  |      |      |
  |      |      |--archivethree.php
  |      |
  |      |--archivetwo.php
  |
  |--archiveone.php

I need to include archiveone.php:

In archivetwo.php I make one include:
  include("../archiveone.php");

In archivethree.php I make another include:
  include("../archivetwo.php");

It gives me an error:
Failed opening '../archiveone.php' for inclusion (include_path='') in 
c:\mycompletepath\mypath\folderone\foldertwo.php on line 2

I have read about this but i can't find a valid solution.

Any ideas?

_______________________________________________________
Antonio Vicente Maturana

_______________________________________________________
Powered by Sambar Webmail - http://www.sambar.com)




--- End Message ---
--- Begin Message ---
Is there a way to make an SSL connection between to servers 
with fsockopen()? I'm using PHP 3.0.13 and don't have cURL 
support.

-- 
Data Driven Design
1506 Tuscaloosa Ave
Holly Hill, Florida 32117
Phone : (386) 226-8979

http://www.datadrivendesign.com
Websites That WORK For You
--- End Message ---

Reply via email to