php-general Digest 7 Oct 2002 08:03:44 -0000 Issue 1629

Topics (messages 119013 through 119048):

Re: Can it be Done?
        119013 by: Sascha Cunz
        119014 by: Adriano
        119015 by: Sascha Cunz
        119042 by: . Edwin

need help for a where clause
        119016 by: Alex Shi
        119024 by: David Freeman
        119025 by: Sascha Cunz
        119027 by: Alex Shi

How to drop a element from an array
        119017 by: Alex Shi
        119018 by: Timothy J Hitchens
        119019 by: Alex Shi
        119020 by: Timothy J Hitchens
        119021 by: John W. Holmes
        119022 by: Stuart Dallas
        119023 by: Alex Shi

IIS 5 - ASP & PHP dev enviorment
        119026 by: JGreening
        119028 by: Jason Morehouse
        119029 by: John W. Holmes
        119030 by: Sascha Cunz
        119031 by: Brendon G

getimagesize  or loop pblm
        119032 by: arnaud gonzales
        119033 by: Rasmus Lerdorf
        119034 by: arnaud gonzales
        119036 by: Sascha Cunz
        119048 by: Tim Toohey

Re: sessions without cookies *or* URLs
        119035 by: David T-G
        119037 by: John W. Holmes
        119038 by: Justin French

server error sending email from script
        119039 by: John
        119040 by: Jason Reid
        119041 by: Timothy J Hitchens

session.cookie_domain
        119043 by: Peter Houchin

Scrollbars?
        119044 by: Steve Jackson
        119045 by: Justin French

page expires
        119046 by: Wilbert Enserink
        119047 by: Timothy J Hitchens

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 ---
To produce such a JavaScript:

define('_DOMBASE', 'http://yourdomain.com');

echo '<SCRIPT language="JavaScript" type="text/javascript">'."\n"
    .'if (document.location == top.location)'."\n"
    .'  top.location="'._DOMBASE.'/index.php?goto='
       .base64_encode($_SERVER["REQUEST_URI"]).'";'."\n"
    .'</SCRIPT>';

where the index.php works like:

<? if (!isset($_GET['goto']))
     $goto = "home.php"; else
     $goto = base64_decode($_GET['goto']);
?>
<FRAMESET>
  <someframes>
  <FRAME src="http://yourdomain.com/<? echo $goto; ?>">
</FRAMESET>

As Stephen reported me recently, this also works with iframes.

Sascha

Am Sonntag, 6. Oktober 2002 21:37 schrieb Adriano:
> Hi people,
>
> @ Edwin wrore:
> > 'Not really sure, but perhaps, with Javascript.
> >
> > But I'd rather recommend you to give up iframes... ;)
>
> Can you post an example of Javascript code checking for _parent frame?
> By the way, what's wrong with iframes?
> bye,
> Adr

--- End Message ---
--- Begin Message ---
I understand and thank you Sascha.
Curiosity: why do you use the 'base64_encode' function to send querystring
arguments? I'd rather used urlencode...

"Sascha Cunz" <[EMAIL PROTECTED]> ha scritto nel messaggio
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
To produce such a JavaScript:

define('_DOMBASE', 'http://yourdomain.com');

echo '<SCRIPT language="JavaScript" type="text/javascript">'."\n"
    .'if (document.location == top.location)'."\n"
    .'  top.location="'._DOMBASE.'/index.php?goto='
       .base64_encode($_SERVER["REQUEST_URI"]).'";'."\n"
    .'</SCRIPT>';

where the index.php works like:

<? if (!isset($_GET['goto']))
     $goto = "home.php"; else
     $goto = base64_decode($_GET['goto']);
?>
<FRAMESET>
  <someframes>
  <FRAME src="http://yourdomain.com/<? echo $goto; ?>">
</FRAMESET>

As Stephen reported me recently, this also works with iframes.

Sascha

Am Sonntag, 6. Oktober 2002 21:37 schrieb Adriano:
> Hi people,
>
> @ Edwin wrore:
> > 'Not really sure, but perhaps, with Javascript.
> >
> > But I'd rather recommend you to give up iframes... ;)
>
> Can you post an example of Javascript code checking for _parent frame?
> By the way, what's wrong with iframes?
> bye,
> Adr



--- End Message ---
--- Begin Message ---
should be interchangeable.

When i wrote this, i didn't want to show the real url up in browser, so i used 
base64 encoding.

Sascha

Am Sonntag, 6. Oktober 2002 23:52 schrieb Adriano:
> I understand and thank you Sascha.
> Curiosity: why do you use the 'base64_encode' function to send querystring
> arguments? I'd rather used urlencode...
>
> "Sascha Cunz" <[EMAIL PROTECTED]> ha scritto nel messaggio
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> To produce such a JavaScript:
>
> define('_DOMBASE', 'http://yourdomain.com');
>
> echo '<SCRIPT language="JavaScript" type="text/javascript">'."\n"
>     .'if (document.location == top.location)'."\n"
>     .'  top.location="'._DOMBASE.'/index.php?goto='
>        .base64_encode($_SERVER["REQUEST_URI"]).'";'."\n"
>     .'</SCRIPT>';
>
> where the index.php works like:
>
> <? if (!isset($_GET['goto']))
>      $goto = "home.php"; else
>      $goto = base64_decode($_GET['goto']);
> ?>
> <FRAMESET>
>   <someframes>
>   <FRAME src="http://yourdomain.com/<? echo $goto; ?>">
> </FRAMESET>
>
> As Stephen reported me recently, this also works with iframes.
>
> Sascha
>
> Am Sonntag, 6. Oktober 2002 21:37 schrieb Adriano:
> > Hi people,
> >
> > @ Edwin wrore:
> > > 'Not really sure, but perhaps, with Javascript.
> > >
> > > But I'd rather recommend you to give up iframes... ;)
> >
> > Can you post an example of Javascript code checking for _parent frame?
> > By the way, what's wrong with iframes?
> > bye,
> > Adr

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

Adriano wrote:
> Hi people,
> @ Edwin wrore:
> 
> 
>>'Not really sure, but perhaps, with Javascript.
>>
>>But I'd rather recommend you to give up iframes... ;)
>>
> 
> 
> Can you post an example of Javascript code checking for _parent frame?

I think you already got this working... however, what if javascript is
disabled?

> By the way, what's wrong with iframes?

Browser support. (And perhaps, usability and accessiblity.) It seems
like iframes have lesser problems than frames. Anyway, the bottomline
is, if you're concerned about making your site more accessible to more
people, just say "no" to frames and iframes.

- E
--- End Message ---
--- Begin Message ---
Hi,

I need a where clause in following situation:

Say I want to query two tables: A and B. In table A there is field 
Afn, while in table B there are 3 fields: Bfn1, Bfn2 and Bfn3. I want  
to do a query, in which the where clause must do these things: 

if A.Afn=1, then check value of B.Bfn1;
if A.Afn=2, then check value of B.Bfn2;
if A.Afn=3, then check value of B.Bfn3.

So how can I create such a where clause to do this? 
Thanks in advance!

Alex Shi


-- 
---------------------------
TrafficBuilder Network: 
http://www.bestadv.net/index.cfm?ref=7029

--- End Message ---
--- Begin Message ---

 > I need a where clause in following situation:
 > 
 > Say I want to query two tables: A and B. In table A there is field 
 > Afn, while in table B there are 3 fields: Bfn1, Bfn2 and 
 > Bfn3. I want  
 > to do a query, in which the where clause must do these things: 
 > 
 > if A.Afn=1, then check value of B.Bfn1;
 > if A.Afn=2, then check value of B.Bfn2;
 > if A.Afn=3, then check value of B.Bfn3.
 > 
 > So how can I create such a where clause to do this? 

I suspect you'd be better off asking this question in a mailing list for
whatever database you are using.  At the very least, it would probably
help to mention the database but it's still not real relevant here in
this (already high volume) mailing list.

CYA, Dave



--- End Message ---
--- Begin Message ---
A solution on that depends strongly on how much values A.Afn would take. For 
3, it's still okay. But i wouldn't do more.

Against what shall the B.Bfn* be checked? What Data do you want to be returned 
from the query?

try:

SELECT ### FROM A, B WHERE 
  ((A.Afn=1) AND (B.Bfn1 = ...)) OR
  ((A.Afn=2) AND (B.Bfn2 = ...)) OR
  ((A.Afn=3) AND (B.Bfn3 = ...))

where you should replace ### with things you want to select and ... with the 
things you want to check.

On more than 3 different values for A.Afn, you should use a more normalized 
version of B.

i.e.: B contains only one Bfn field and a Reference to A.Afn.
 -> SELECT ### FROM A, B WHERE B.AfnRef = A.Afn AND B.Bfn = ...

Sascha

Am Montag, 7. Oktober 2002 00:33 schrieb Alex Shi:
> Hi,
>
> I need a where clause in following situation:
>
> Say I want to query two tables: A and B. In table A there is field
> Afn, while in table B there are 3 fields: Bfn1, Bfn2 and Bfn3. I want
> to do a query, in which the where clause must do these things:
>
> if A.Afn=1, then check value of B.Bfn1;
> if A.Afn=2, then check value of B.Bfn2;
> if A.Afn=3, then check value of B.Bfn3.
>
> So how can I create such a where clause to do this?
> Thanks in advance!
>
> Alex Shi

--- End Message ---
--- Begin Message ---
Thanks! This is what I need!

Alex Shi



"Sascha Cunz" <[EMAIL PROTECTED]> 写入消息新闻
:[EMAIL PROTECTED]
A solution on that depends strongly on how much values A.Afn would take. For
3, it's still okay. But i wouldn't do more.

Against what shall the B.Bfn* be checked? What Data do you want to be
returned
from the query?

try:

SELECT ### FROM A, B WHERE
  ((A.Afn=1) AND (B.Bfn1 = ...)) OR
  ((A.Afn=2) AND (B.Bfn2 = ...)) OR
  ((A.Afn=3) AND (B.Bfn3 = ...))

where you should replace ### with things you want to select and ... with the
things you want to check.

On more than 3 different values for A.Afn, you should use a more normalized
version of B.

i.e.: B contains only one Bfn field and a Reference to A.Afn.
 -> SELECT ### FROM A, B WHERE B.AfnRef = A.Afn AND B.Bfn = ...

Sascha

Am Montag, 7. Oktober 2002 00:33 schrieb Alex Shi:
> Hi,
>
> I need a where clause in following situation:
>
> Say I want to query two tables: A and B. In table A there is field
> Afn, while in table B there are 3 fields: Bfn1, Bfn2 and Bfn3. I want
> to do a query, in which the where clause must do these things:
>
> if A.Afn=1, then check value of B.Bfn1;
> if A.Afn=2, then check value of B.Bfn2;
> if A.Afn=3, then check value of B.Bfn3.
>
> So how can I create such a where clause to do this?
> Thanks in advance!
>
> Alex Shi

--- End Message ---
--- Begin Message ---
Is there a good way do drop an element from an array?

Alex Shi


--- End Message ---
--- Begin Message ---
Hint... look at array_push etc (like a stack)


Timothy Hitchens (HITCHO)
[EMAIL PROTECTED]

HITCHO has Spoken!






-----Original Message-----
From: Alex Shi [mailto:[EMAIL PROTECTED]] 
Sent: Monday, 7 October 2002 8:35 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How to drop a element from an array


Is there a good way do drop an element from an array?

Alex Shi



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


--- End Message ---
--- Begin Message ---
Yes I have read about the array functions in the manul. But I don't
think they are what I need. What I want is to drop what ever an
element from an array, not just from top or bottom.

I can create a function to do this. But I need a better solution, that
is to say not to cost too much memery.

Alex Shi


"Timothy J Hitchens" <[EMAIL PROTECTED]> 写入消息新闻
:002e01c26d89$780c14c0$[EMAIL PROTECTED]
> Hint... look at array_push etc (like a stack)
>
>
> Timothy Hitchens (HITCHO)
> [EMAIL PROTECTED]
>
> HITCHO has Spoken!
>
>
>
>
>
>
> -----Original Message-----
> From: Alex Shi [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 7 October 2002 8:35 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] How to drop a element from an array
>
>
> Is there a good way do drop an element from an array?
>
> Alex Shi
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
unset $some_variable[4];

then you would need to resort... etc (if needed)


Timothy Hitchens (HITCHO)
[EMAIL PROTECTED]

HITCHO has Spoken!






-----Original Message-----
From: Alex Shi [mailto:[EMAIL PROTECTED]] 
Sent: Monday, 7 October 2002 8:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] How to drop a element from an array


Yes I have read about the array functions in the manul. But I don't
think they are what I need. What I want is to drop what ever an element
from an array, not just from top or bottom.

I can create a function to do this. But I need a better solution, that
is to say not to cost too much memery.

Alex Shi


"Timothy J Hitchens" <[EMAIL PROTECTED]> дϢ
:002e01c26d89$780c14c0$[EMAIL PROTECTED]
> Hint... look at array_push etc (like a stack)
>
>
> Timothy Hitchens (HITCHO)
> [EMAIL PROTECTED]
>
> HITCHO has Spoken!
>
>
>
>
>
>
> -----Original Message-----
> From: Alex Shi [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 7 October 2002 8:35 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] How to drop a element from an array
>
>
> Is there a good way do drop an element from an array?
>
> Alex Shi
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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


--- End Message ---
--- Begin Message ---
That adds an element to an array. Just use unset.

unset($array[0]);

---John Holmes...

> -----Original Message-----
> From: Timothy J Hitchens [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, October 06, 2002 6:41 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] How to drop a element from an array
> 
> Hint... look at array_push etc (like a stack)
> 
> 
> Timothy Hitchens (HITCHO)
> [EMAIL PROTECTED]
> 
> HITCHO has Spoken!
> 
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Alex Shi [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 7 October 2002 8:35 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] How to drop a element from an array
> 
> 
> Is there a good way do drop an element from an array?
> 
> Alex Shi
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
Alex Shi wrote:
> Is there a good way do drop an element from an array?

Unset (http://www.php.net/unset) the element and it will be removed from 
the array.

-- 
Stuart

--- End Message ---
--- Begin Message ---
Thanks!

Alex Shi


"Timothy J Hitchens" <[EMAIL PROTECTED]> 写入消息新闻
:002f01c26d8a$77332470$[EMAIL PROTECTED]
unset $some_variable[4];

then you would need to resort... etc (if needed)


Timothy Hitchens (HITCHO)
[EMAIL PROTECTED]

HITCHO has Spoken!






-----Original Message-----
From: Alex Shi [mailto:[EMAIL PROTECTED]]
Sent: Monday, 7 October 2002 8:43 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] How to drop a element from an array


Yes I have read about the array functions in the manul. But I don't
think they are what I need. What I want is to drop what ever an element
from an array, not just from top or bottom.

I can create a function to do this. But I need a better solution, that
is to say not to cost too much memery.

Alex Shi


"Timothy J Hitchens" <[EMAIL PROTECTED]> 写入消息新闻
:002e01c26d89$780c14c0$[EMAIL PROTECTED]
> Hint... look at array_push etc (like a stack)
>
>
> Timothy Hitchens (HITCHO)
> [EMAIL PROTECTED]
>
> HITCHO has Spoken!
>
>
>
>
>
>
> -----Original Message-----
> From: Alex Shi [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 7 October 2002 8:35 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] How to drop a element from an array
>
>
> Is there a good way do drop an element from an array?
>
> Alex Shi
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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


--- End Message ---
--- Begin Message ---
I have done a little searching and haven't really had a good solid answer
for my question.

I mainly use ASP for development (and will continue to), but I wanted to
dabble in a little PHP for my own curiosity. I am using IIS 5 on Win XP Pro
for my dev machine. I have a few ASP applications going and I am looking for
some questions as to what to expect to happen if I set up IIS 5 to also run
PHP. Am I putting my ASP projects in harms way, buy setting up IIS to use
ASP and PHP?

Any help would be appreciated, links to information would be just fine.

Thanks.






--- End Message ---
--- Begin Message ---
If the PHP interpreter is installed, there is nothing stopping you from
using both (morals aside).

-- 
 Jason Morehouse (jm[@]netconcepts[.]com)
 Netconcepts - http://www.netconcepts.com
 Auckland, New Zealand
 Linux: Because rebooting is for adding hardware.

On Sun, 06 Oct 2002 21:10:22 +0000, Jgreening wrote:

> I have done a little searching and haven't really had a good solid answer
> for my question.
> 
> I mainly use ASP for development (and will continue to), but I wanted to
> dabble in a little PHP for my own curiosity. I am using IIS 5 on Win XP Pro
> for my dev machine. I have a few ASP applications going and I am looking for
> some questions as to what to expect to happen if I set up IIS 5 to also run
> PHP. Am I putting my ASP projects in harms way, buy setting up IIS to use
> ASP and PHP?
> 
> Any help would be appreciated, links to information would be just fine.
> 
> Thanks.

--- End Message ---
--- Begin Message ---
> I have done a little searching and haven't really had a good solid
answer
> for my question.
> 
> I mainly use ASP for development (and will continue to), but I wanted
to
> dabble in a little PHP for my own curiosity. I am using IIS 5 on Win
XP
> Pro
> for my dev machine. I have a few ASP applications going and I am
looking
> for
> some questions as to what to expect to happen if I set up IIS 5 to
also
> run
> PHP. Am I putting my ASP projects in harms way, buy setting up IIS to
use
> ASP and PHP?
> 
> Any help would be appreciated, links to information would be just
fine.

You can run both of them without problems. Since ASP is a default on
IIS, any IIS server set up to run PHP is running them both... I haven't
heard of any problems caused just by having the two running at once.

---John Holmes...


--- End Message ---
--- Begin Message ---
>
> You can run both of them without problems. Since ASP is a default on
> IIS, any IIS server set up to run PHP is running them both... I haven't
> heard of any problems caused just by having the two running at once.
>
> ---John Holmes...

I got this configuration times ago... Works without any problems....
I am still using one machine, which needs IIS and PHP. There is really no big 
deal about that.

Sascha
--- End Message ---
--- Begin Message ---
I don't know how familiar you are with PHP yet.

But I recently decided to learn PHP myself having already learnt ASP.

These 3 things helped me the most.
This is a summary of the language differences between PHP,
JScript/Javascript and VBScript
http://php.weblogs.com/php_jscript_vbscript_1

ADOdb:  encapsulates the different PHP database code into a class that's
very similar to ADO. thus the name.  This enables you to access a MySQL Db,
an Access DB or anything else with little hassle. Handy from a cross
platform point of view and when you might need to change DB's at a later
date.
http://php.weblogs.com/ADOdb

And of course get the latest downloadable PHP manual.

Happy Dabbling!

Cheers

Brendon




-----Original Message-----
From: Jason Morehouse [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 9:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: IIS 5 - ASP & PHP dev enviorment


If the PHP interpreter is installed, there is nothing stopping you from
using both (morals aside).


--- End Message ---
--- Begin Message ---
Hi all,
Does anybody can tell me why i have this error :"Fatal error: Maximum
execution time of 5 seconds exceeded in photos2.php on line 28"
whith this


                        $tab_img = array();
                                $tab_img_size = array();
                                for($i=0;$i=56;$i++){
                                        $tab_img[$i] = 
"images/tof/real_size/techp02_".$i.".jpg";
                                        $tab_img_size = array(
/*      line 28 */                      $i => getimagesize($tab_img[$i]));
                                        }

Is the getimagesize function too long for making it 56 times??
What do u think ?
In fact i want to get all the image size to make a popup link on the
thumnail at the real size of the image.Because images don't have the same
size and i want to have a clean window whith the popup.
I've ever tried this before :

                        $tab_img = array();
                                $tab_img_size = array();
                                for($i=0;$i=56;$i++){
                                        $tab_img[$i] = 
"images/tof/real_size/techp02_".$i.".jpg";
                                        $tab_img_size[$i] = getimagesize($tab_img[$i]);
                                }
Hope you understand.
TIA.
zeg


--- End Message ---
--- Begin Message ---
It could take a while.  Depends how fast your server's disk sub-system is.
Going to disk to stat and open an image and then parse through the initial
headers to get the sizing data can take some time.  I'd suggest caching
this data somewhere if you are going to need it on every request.

-Rasmus

On Mon, 7 Oct 2002, arnaud gonzales wrote:

> Hi all,
> Does anybody can tell me why i have this error :"Fatal error: Maximum
> execution time of 5 seconds exceeded in photos2.php on line 28"
> whith this
>
>
>                       $tab_img = array();
>                               $tab_img_size = array();
>                               for($i=0;$i=56;$i++){
>                                       $tab_img[$i] = 
>"images/tof/real_size/techp02_".$i.".jpg";
>                                       $tab_img_size = array(
> /*    line 28 */                      $i => getimagesize($tab_img[$i]));
>                                       }
>
> Is the getimagesize function too long for making it 56 times??
> What do u think ?
> In fact i want to get all the image size to make a popup link on the
> thumnail at the real size of the image.Because images don't have the same
> size and i want to have a clean window whith the popup.
> I've ever tried this before :
>
>                       $tab_img = array();
>                               $tab_img_size = array();
>                               for($i=0;$i=56;$i++){
>                                       $tab_img[$i] = 
>"images/tof/real_size/techp02_".$i.".jpg";
>                                       $tab_img_size[$i] = getimagesize($tab_img[$i]);
>                               }
> Hope you understand.
> TIA.
> zeg
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
So my code is clean ? There isn't a problem of infiny loop?
My server is free.fr.
How do u suggest i can cach the data?

-----Message d'origine-----
De : Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Envoye : lundi 7 octobre 2002 03:07
A : arnaud gonzales
Cc : Php-General
Objet : Re: [PHP] getimagesize or loop pblm


It could take a while.  Depends how fast your server's disk sub-system is.
Going to disk to stat and open an image and then parse through the initial
headers to get the sizing data can take some time.  I'd suggest caching
this data somewhere if you are going to need it on every request.

-Rasmus

On Mon, 7 Oct 2002, arnaud gonzales wrote:

> Hi all,
> Does anybody can tell me why i have this error :"Fatal error: Maximum
> execution time of 5 seconds exceeded in photos2.php on line 28"
> whith this
>
>
>                       $tab_img = array();
>                               $tab_img_size = array();
>                               for($i=0;$i=56;$i++){
>                                       $tab_img[$i] = 
>"images/tof/real_size/techp02_".$i.".jpg";
>                                       $tab_img_size = array(
> /*    line 28 */                      $i => getimagesize($tab_img[$i]));
>                                       }
>
> Is the getimagesize function too long for making it 56 times??
> What do u think ?
> In fact i want to get all the image size to make a popup link on the
> thumnail at the real size of the image.Because images don't have the same
> size and i want to have a clean window whith the popup.
> I've ever tried this before :
>
>                       $tab_img = array();
>                               $tab_img_size = array();
>                               for($i=0;$i=56;$i++){
>                                       $tab_img[$i] = 
>"images/tof/real_size/techp02_".$i.".jpg";
>                                       $tab_img_size[$i] = getimagesize($tab_img[$i]);
>                               }
> Hope you understand.
> TIA.
> zeg
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



--- End Message ---
--- Begin Message ---
You can calculate the image size when adding the image (rather than when 
displaying it) and store the information in a file or a database. This file 
or database you could use for posting the right sizes for popup windows.

Sascha

Am Montag, 7. Oktober 2002 03:22 schrieb arnaud gonzales:
> So my code is clean ? There isn't a problem of infiny loop?
> My server is free.fr.
> How do u suggest i can cach the data?
>
> -----Message d'origine-----
> De : Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Envoye : lundi 7 octobre 2002 03:07
> A : arnaud gonzales
> Cc : Php-General
> Objet : Re: [PHP] getimagesize or loop pblm
>
>
> It could take a while.  Depends how fast your server's disk sub-system is.
> Going to disk to stat and open an image and then parse through the initial
> headers to get the sizing data can take some time.  I'd suggest caching
> this data somewhere if you are going to need it on every request.
>
> -Rasmus
>
> On Mon, 7 Oct 2002, arnaud gonzales wrote:
> > Hi all,
> > Does anybody can tell me why i have this error :"Fatal error: Maximum
> > execution time of 5 seconds exceeded in photos2.php on line 28"
> > whith this
> >
> >
> >                     $tab_img = array();
> >                             $tab_img_size = array();
> >                             for($i=0;$i=56;$i++){
> >                                     $tab_img[$i] = 
>"images/tof/real_size/techp02_".$i.".jpg";
> >                                     $tab_img_size = array(
> > /*  line 28 */                      $i => getimagesize($tab_img[$i]));
> >                                     }
> >
> > Is the getimagesize function too long for making it 56 times??
> > What do u think ?
> > In fact i want to get all the image size to make a popup link on the
> > thumnail at the real size of the image.Because images don't have the same
> > size and i want to have a clean window whith the popup.
> > I've ever tried this before :
> >
> >                     $tab_img = array();
> >                             $tab_img_size = array();
> >                             for($i=0;$i=56;$i++){
> >                                     $tab_img[$i] = 
>"images/tof/real_size/techp02_".$i.".jpg";
> >                                     $tab_img_size[$i] = getimagesize($tab_img[$i]);
> >                             }
> > Hope you understand.
> > TIA.
> > zeg
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Arnaud Gonzales wrote:

> for($i=0;$i=56;$i++){

should be
for($i=0;$i<56;$i++){

to loop 56 times.

--- End Message ---
--- Begin Message ---
Justin, et al --

...and then Justin French said...
% 
% I think you're under a little misconception about how sessions are used.

Perhaps.  I'm new to them :-)


% Maintaining a session is simply just having a unique identifier for each
% "user", so that the server can recognise the user from page to page,
% maintaining state.

Right.  And since it can recognize the user, it can store all sorts of
things for him, like the fact that he's been authenticated and what
function he did last and so on.  Right?


% 
% Typically this is done by passing a session id around in  he URL or cookies
% or POSTing forms.  A session ID is typically a long unique number -- that's
% it.

Right.  But it's the "in the URL or cookies" that's a problem for me.


% 
% 
% What you then do associate or register data TO that Session ID... this data
% is stored on the SERVER, and NOT passed around in the URL.

I understand enough that the data itself isn't in the URL, and that's
good (because some of these page comments get long!).


% 
% 
% So you pass around PHPSESSID=198235021612423 in the url or a cookie, and
% assign data to that session... all of which is stored server side.

Are those the only ways that I can pass it around?  Is there anything
else?  [Note that I've come to the conclusion that they are and there
isn't except perhaps a POST form, but I'd love to be pleasantly surprised.]


% 
% The session with the id 198235021612423 may have a username, password, shoe
% size, favourite colour, etc etc all attached to it, done with either:

Good deal; that's what I like.


% 
% $_SESSION['shoesize'] = "14"; // new register globals OFF method
% 
% or
% 
% $shoesize = "14";
% session_register("shoesize"); // old method

Right.


% 
% 
% Therefor, I can see no need for anything other than the session ID to be
% passed around in the URL.
% 
% Hope this clears it up!

It's a start; it confirms some of what I think I understand about
sessions.  Now if only I can get the session ID out of the URL without
using any cookies...  Any ideas, anyone?


% 
% 
% Justin French


TIA & HAND

:-D
-- 
David T-G                      * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: msg81325/pgp00000.pgp
Description: PGP signature

--- End Message ---
--- Begin Message ---
You can pass the session ID in a form, too. Just use POST, and make it a
hidden element passed to the next page. 

<input type="hidden" name="PHPSESSID" value="<?=$PHPSESSID?>">

It's no different than passing it in the URL. I hope you're not thinking
that it's more secure by doing it this way. Either way the data is
coming from the user and it can't be trusted and it can be modified. 

I don't know what this phobia is about passing something in the URL...

---John Holmes...

> -----Original Message-----
> From: David T-G [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, October 06, 2002 9:33 PM
> To: PHP General list
> Cc: Justin French
> Subject: Re: [PHP] sessions without cookies *or* URLs
> 
> Justin, et al --
> 
> ...and then Justin French said...
> %
> % I think you're under a little misconception about how sessions are
used.
> 
> Perhaps.  I'm new to them :-)
> 
> 
> % Maintaining a session is simply just having a unique identifier for
each
> % "user", so that the server can recognise the user from page to page,
> % maintaining state.
> 
> Right.  And since it can recognize the user, it can store all sorts of
> things for him, like the fact that he's been authenticated and what
> function he did last and so on.  Right?
> 
> 
> %
> % Typically this is done by passing a session id around in  he URL or
> cookies
> % or POSTing forms.  A session ID is typically a long unique number --
> that's
> % it.
> 
> Right.  But it's the "in the URL or cookies" that's a problem for me.
> 
> 
> %
> %
> % What you then do associate or register data TO that Session ID...
this
> data
> % is stored on the SERVER, and NOT passed around in the URL.
> 
> I understand enough that the data itself isn't in the URL, and that's
> good (because some of these page comments get long!).
> 
> 
> %
> %
> % So you pass around PHPSESSID=198235021612423 in the url or a cookie,
and
> % assign data to that session... all of which is stored server side.
> 
> Are those the only ways that I can pass it around?  Is there anything
> else?  [Note that I've come to the conclusion that they are and there
> isn't except perhaps a POST form, but I'd love to be pleasantly
> surprised.]
> 
> 
> %
> % The session with the id 198235021612423 may have a username,
password,
> shoe
> % size, favourite colour, etc etc all attached to it, done with
either:
> 
> Good deal; that's what I like.
> 
> 
> %
> % $_SESSION['shoesize'] = "14"; // new register globals OFF method
> %
> % or
> %
> % $shoesize = "14";
> % session_register("shoesize"); // old method
> 
> Right.
> 
> 
> %
> %
> % Therefor, I can see no need for anything other than the session ID
to be
> % passed around in the URL.
> %
> % Hope this clears it up!
> 
> It's a start; it confirms some of what I think I understand about
> sessions.  Now if only I can get the session ID out of the URL without
> using any cookies...  Any ideas, anyone?
> 
> 
> %
> %
> % Justin French
> 
> 
> TIA & HAND
> 
> :-D
> --
> David T-G                      * It's easier to fight for one's
principles
> (play) [EMAIL PROTECTED] * than to live up to them. -- fortune
> cookie
> (work) [EMAIL PROTECTED]
> http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl
> Npg!



--- End Message ---
--- Begin Message ---
on 07/10/02 11:32 AM, David T-G ([EMAIL PROTECTED]) wrote:

> It's a start; it confirms some of what I think I understand about
> sessions.  Now if only I can get the session ID out of the URL without
> using any cookies...  Any ideas, anyone?


I Thought I made it clear, but I'll try again :)

You have three options for maintaining state:

- Cookies
- URL
- POSTed forms

The most common method is plain cookies.  But if you want guaranteed state,
then URL is the answer.  My main problem with the URL method is that it
requires the writer(s) to be careful when typing links... ensuring that they
have the session ID in them.  Impossible for a CMS.  The answer is
enabel_trans_sid.

More and more hosts are compiling with enable_trans_sid... what this does
is: attempt to pass the SID around in a cookie.  If this fails, it will
re-write any relative URLs in your pages to include the session ID... it's
the best of both worlds... transparent cookies if possible, otherwise the
SID is passed around in a URL.


So, this rules out a complaint about complicated URLs, because you don't
have to type them.


I urge you to look around all the big sites... if they need to maintain
state (a session) they do so with URLs... amazon.com, whatever -- they all
do it.

Why do you not wish to use URLs?


Justin

--- End Message ---
--- Begin Message ---
Q:
If I'm not on the server that is to be used to send the email, how can I configure PHP 
to send from a certain server?
thanks all
 
Warning: Server Error in c:\program files\apache 
group\apache\htdocs\sonicmailer\sonicadmin.php on line 276

and line 276 is
mail($address, stripslashes($subject), $finalbody, $mailheaders);

and it's not sending the email.
The variables are OK, 
$mailheaders=From: blah Reply-To: [EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
it appears you are on windows, so look in php.ini for the smtp directive.
enter your isp's smtp server address there. then restart apache and it
should work.

Jason Reid
[EMAIL PROTECTED]
--
AC Host Canada
www.achost.ca

----- Original Message -----
From: "John" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, October 06, 2002 8:31 PM
Subject: [PHP] server error sending email from script


Q:
If I'm not on the server that is to be used to send the email, how can I
configure PHP to send from a certain server?
thanks all

Warning: Server Error in c:\program files\apache
group\apache\htdocs\sonicmailer\sonicadmin.php on line 276

and line 276 is
mail($address, stripslashes($subject), $finalbody, $mailheaders);

and it's not sending the email.
The variables are OK,
$mailheaders=From: blah Reply-To: [EMAIL PROTECTED]





--- End Message ---
--- Begin Message ---
I don't use Windows for development/production but I read somewhere that
you needed
to set in your php.ini for windows a config for either the host server
that had
email capabilities.

That's all I can offer.


Timothy Hitchens (HITCHO)
[EMAIL PROTECTED]

HITCHO has Spoken!






-----Original Message-----
From: John [mailto:[EMAIL PROTECTED]] 
Sent: Monday, 7 October 2002 12:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] server error sending email from script


Q:
If I'm not on the server that is to be used to send the email, how can I
configure PHP to send from a certain server? thanks all
 
Warning: Server Error in c:\program files\apache
group\apache\htdocs\sonicmailer\sonicadmin.php on line 276

and line 276 is
mail($address, stripslashes($subject), $finalbody, $mailheaders);

and it's not sending the email.
The variables are OK, 
$mailheaders=From: blah Reply-To: [EMAIL PROTECTED]



--- End Message ---
--- Begin Message ---
howdy,

I have a server running a number of domains  as virtual hosts under apache
if i wanted to set a cookie domain can i set it for all domains in php.ini?
or is it better to set it using ini_set(session.cookie_domain, domain) in
each site?

Cheers

Peter
"the only dumb question is the one that wasn't asked"


--- End Message ---
--- Begin Message ---
This might be off topic but I thought I'd give the list a try...
Does anyone know of any PHP or CSS or something which allows you to
change the appearance of scrollbars in Explorer and navigator?
Kind regards,
 
Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159

--- End Message ---
--- Begin Message ---
yes it is off topic
no it's not PHP
yes it is CSS
yes you can try a newsgroup like comp.infosystems.www.authoring.stylesheets,
or do a simple search of google, which will surely return plenty of answers.

justin

on 07/10/02 5:01 PM, Steve Jackson ([EMAIL PROTECTED]) wrote:

> This might be off topic but I thought I'd give the list a try...
> Does anyone know of any PHP or CSS or something which allows you to
> change the appearance of scrollbars in Explorer and navigator?
> Kind regards,
> 
> Steve Jackson
> Web Developer
> Viola Systems Ltd.
> http://www.violasystems.com
> [EMAIL PROTECTED]
> Mobile +358 50 343 5159
> 

--- End Message ---
--- Begin Message ---
Hi all


I'm using a lot of php in my website. Especially forms. but Aftre a form submit I get 
this message from IE that the page is expired and I have to push Refresh. Does anybody 
know why this is happening and is there a way to avoid this message??

thx. Wilbert


Warning: Page has Expired 
The page you requested was created using information you submitted in a form. This 
page is no longer available. As a security precaution, Internet Explorer does not 
automatically resubmit your information for you. 

To resubmit your information and view this Web page, click the Refresh button. 

-------------------------
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-------------------------
--- End Message ---
--- Begin Message ---
You have posted data from a previous page into this page.. "FORM"


Timothy Hitchens (HITCHO)
[EMAIL PROTECTED]

HITCHO has Spoken!






-----Original Message-----
From: Wilbert Enserink [mailto:[EMAIL PROTECTED]] 
Sent: Monday, 7 October 2002 5:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] page expires


Hi all


I'm using a lot of php in my website. Especially forms. but Aftre a form
submit I get this message from IE that the page is expired and I have to
push Refresh. Does anybody know why this is happening and is there a way
to avoid this message??

thx. Wilbert


Warning: Page has Expired 
The page you requested was created using information you submitted in a
form. This page is no longer available. As a security precaution,
Internet Explorer does not automatically resubmit your information for
you. 

To resubmit your information and view this Web page, click the Refresh
button. 

-------------------------
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-------------------------

--- End Message ---

Reply via email to