php-general Digest 4 Jan 2004 14:46:16 -0000 Issue 2511

Topics (messages 173691 through 173706):

Re: PHP $_SESSION Expiring in IE
        173691 by: Kirk Babb
        173692 by: Tarrant Costelloe
        173694 by: Al
        173702 by: Kirk Babb

How to do this? 6 lines of code...Parse error
        173693 by: Ryan A
        173699 by: Aidan Lister
        173701 by: Ryan A

Question about an array
        173695 by: Vernon
        173697 by: Matt Grimm

Piping email
        173696 by: Adrian Teasdale

Re: Production Websites (error loggin)
        173698 by: Aidan Lister

[Newbie Guide] For the benefit of new members
        173700 by: Ma Siva Kumar

finding phpize
        173703 by: Ryan A
        173706 by: Marek Kilimajer

Server independent URL optimization
        173704 by: Shawn McKenzie
        173705 by: Gerard Samuel

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 ---
Have you tried the header(Cache-control: private) workaround for IE6?  I
seem to remember reading something about that on one of the web dev sites
(devshed probably).  Use that immediately after session_start() and see if
it makes a difference.

Kirk


"Tarrant Costelloe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "Are there any points in the program that redirect the user off site and
> back or something with that affect that IE might be handling in a weird
> way?"
>
> Nope
>
> "Do you have pages that detect the browser and feed alternate content
> based on the browser?"
>
> Nope
>
> "do you always run the session_start before these checks?"
>
> Yes.
>
> The only other thing I guess it could be is the .htaccess mod_rewrite
> maybe? It's just weird that Internet Explorer is the only browser that
> seemingly looses the members $_SESSION where as Mozilla is not effected
> whatsoever.
>
> In Fellowship,
> Tarrant
>
> -----Original Message-----
> From: Larry Brown [mailto:[EMAIL PROTECTED]
> Sent: 03 January 2004 16:34
> To: Tarrant Costelloe; PHP List
> Subject: RE: [PHP] PHP $_SESSION Expiring in IE
>
>
> I use sessions with IE all the time without such a problem.  Are there
> any points in the program that redirect the user off site and back or
> something with that affect that IE might be handling in a wierd way?  Do
> you have pages that detect the browser and feed alternate content based
> on the browser?  If so do you always run the session_start before these
> checks?
>
> -----Original Message-----
> From: Tarrant Costelloe [mailto:[EMAIL PROTECTED]
> Sent: Saturday, January 03, 2004 10:27 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP $_SESSION Expiring in IE
>
>
> Hello,
>
> I have recently launched the new Planet-Tolkien.com, one would think
> that writing a message board from scratch and a dynamic weather system,
> a simple session login would be the least of my problems right? Wrong.
>
> It would appear that for Mozilla and Opera keep a $_SESSION is not an
> issue and the $_SESSION is continued until the member logs out. However
> when members are using Internet Explorer browser (most versions it
> seems), they can go around the site for varied amounts of time, usually
> less than five minutes and then their $_SESSION will expire!!??
>
> I cannot for the life of me figure out why a server side $_SESSION would
> expire on IE but not for MOZ or Opera but it is, and I need to figure
> out why and how can I fix this.
>
> REF. All login information is saved as such:
>
> session_save_path("$path/sessions");
> session_start(); $_SESSION['session_memberID']=$session_memberID;
> $_SESSION['session_username']=$session_username;
> $_SESSION['session_groupID']=$membergroup;
>
> In Fellowship,
> Tarrant
>
> --
> 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 ---
Doesn't seem to have solved the problem... My session include file at
the top of all documents looks like:

session_save_path("$some_path/sessions"); 
ini_set('session.use_cookies', 1);
ini_set('session.gc_probability', 1);
ini_set('session.gc_maxlifetime', 60 * 60);
ini_set('session.auto_start', '1');
session_start();
header("Cache-control: private");

Here is a link to my PHP configuration:
http://www.planet-tolkien.com/test.php

In Fellowship,
Tarrant 

-----Original Message-----
From: Kirk Babb [mailto:[EMAIL PROTECTED] 
Sent: 03 January 2004 21:13
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP $_SESSION Expiring in IE


Have you tried the header(Cache-control: private) workaround for IE6?  I
seem to remember reading something about that on one of the web dev
sites (devshed probably).  Use that immediately after session_start()
and see if it makes a difference.

Kirk


"Tarrant Costelloe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "Are there any points in the program that redirect the user off site 
> and back or something with that affect that IE might be handling in a 
> weird way?"
>
> Nope
>
> "Do you have pages that detect the browser and feed alternate content 
> based on the browser?"
>
> Nope
>
> "do you always run the session_start before these checks?"
>
> Yes.
>
> The only other thing I guess it could be is the .htaccess mod_rewrite 
> maybe? It's just weird that Internet Explorer is the only browser that

> seemingly looses the members $_SESSION where as Mozilla is not 
> effected whatsoever.
>
> In Fellowship,
> Tarrant
>
> -----Original Message-----
> From: Larry Brown [mailto:[EMAIL PROTECTED]
> Sent: 03 January 2004 16:34
> To: Tarrant Costelloe; PHP List
> Subject: RE: [PHP] PHP $_SESSION Expiring in IE
>
>
> I use sessions with IE all the time without such a problem.  Are there

> any points in the program that redirect the user off site and back or 
> something with that affect that IE might be handling in a wierd way?  
> Do you have pages that detect the browser and feed alternate content 
> based on the browser?  If so do you always run the session_start 
> before these checks?
>
> -----Original Message-----
> From: Tarrant Costelloe [mailto:[EMAIL PROTECTED]
> Sent: Saturday, January 03, 2004 10:27 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP $_SESSION Expiring in IE
>
>
> Hello,
>
> I have recently launched the new Planet-Tolkien.com, one would think 
> that writing a message board from scratch and a dynamic weather 
> system, a simple session login would be the least of my problems 
> right? Wrong.
>
> It would appear that for Mozilla and Opera keep a $_SESSION is not an 
> issue and the $_SESSION is continued until the member logs out. 
> However when members are using Internet Explorer browser (most 
> versions it seems), they can go around the site for varied amounts of 
> time, usually less than five minutes and then their $_SESSION will 
> expire!!??
>
> I cannot for the life of me figure out why a server side $_SESSION 
> would expire on IE but not for MOZ or Opera but it is, and I need to 
> figure out why and how can I fix this.
>
> REF. All login information is saved as such:
>
> session_save_path("$path/sessions");
> session_start(); $_SESSION['session_memberID']=$session_memberID;
> $_SESSION['session_username']=$session_username;
> $_SESSION['session_groupID']=$membergroup;
>
> In Fellowship,
> Tarrant
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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

--- End Message ---
--- Begin Message --- IE and Moz have different JAVA script engines. Try turning off JAVA and see if IE maintains it's session.

Tarrant Costelloe wrote:

Hello,

I have recently launched the new Planet-Tolkien.com, one would think
that writing a message board from scratch and a dynamic weather system,
a simple session login would be the least of my problems right? Wrong.

It would appear that for Mozilla and Opera keep a $_SESSION is not an
issue and the $_SESSION is continued until the member logs out. However
when members are using Internet Explorer browser (most versions it
seems), they can go around the site for varied amounts of time, usually
less than five minutes and then their $_SESSION will expire!!??

I cannot for the life of me figure out why a server side $_SESSION would
expire on IE but not for MOZ or Opera but it is, and I need to figure
out why and how can I fix this.

REF. All login information is saved as such:

session_save_path("$path/sessions"); session_start(); $_SESSION['session_memberID']=$session_memberID;
$_SESSION['session_username']=$session_username;
$_SESSION['session_groupID']=$membergroup;


In Fellowship,
Tarrant



--- End Message ---
--- Begin Message ---
Guess I'm being nosy here, so forgive me, but why are you settting an
alternate save path and using ini_set at the start of each document?  I know
that has nothing to do with the problem, but I was just wondering.  Are you
hosting multiple sites off your server and have different session settings
depending on the site?

-Kirk


> session_save_path("$some_path/sessions");
> ini_set('session.use_cookies', 1);
> ini_set('session.gc_probability', 1);
> ini_set('session.gc_maxlifetime', 60 * 60);
> ini_set('session.auto_start', '1');
> session_start();
> header("Cache-control: private");
>
> Here is a link to my PHP configuration:
> http://www.planet-tolkien.com/test.php
>
> In Fellowship,
> Tarrant

--- End Message ---
--- Begin Message ---
Hi,
am a bit confused as to how you do this...first let me explain the flow of
input:
I will be getting $product1,$product2,$product3 etc from another script...I
dont know till what number....right now I am trying to catch the values till
20 with a "for" loop.

My problem is how do I attach the $i that I am using to the $product to
check if its set? Heres my code and below that you will see some of the
stuff I have tried:


for($i=1; $i<21; $i++)
{ if(isset($product$i))
 {echo "Product".$i." is set!<br>";}
 else(!isset($product$i))
  {echo "Product".$i." is NOT set!<br>";}}
exit;


This is what I have tried (in the if-isset part) :
$product.$i
$product."".$i
$product.''.$i
$product($i)

all of the above give me a parse error.

Any help appreciated.

Thanks,
-Ryan
P.S, I didnt write the other script where I am getting the values from...I
just have to work with it as they are not allowing me to touch the older
script so I dont have access to it.

--- End Message ---
--- Begin Message ---
Firstly I'd rewrite your other script to store the data in an array.

The benefits of doing so are simply demonstrated:

<?php
foreach ($products as $product)
  dosomethingto($product);
?>

However, if you are unable to rewrite your script:

The correct syntax is:
<?php
${'product' . $i}
?>

"Ryan A" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> am a bit confused as to how you do this...first let me explain the flow of
> input:
> I will be getting $product1,$product2,$product3 etc from another
script...I
> dont know till what number....right now I am trying to catch the values
till
> 20 with a "for" loop.
>
> My problem is how do I attach the $i that I am using to the $product to
> check if its set? Heres my code and below that you will see some of the
> stuff I have tried:
>
>
> for($i=1; $i<21; $i++)
> { if(isset($product$i))
>  {echo "Product".$i." is set!<br>";}
>  else(!isset($product$i))
>   {echo "Product".$i." is NOT set!<br>";}}
> exit;
>
>
> This is what I have tried (in the if-isset part) :
> $product.$i
> $product."".$i
> $product.''.$i
> $product($i)
>
> all of the above give me a parse error.
>
> Any help appreciated.
>
> Thanks,
> -Ryan
> P.S, I didnt write the other script where I am getting the values from...I
> just have to work with it as they are not allowing me to touch the older
> script so I dont have access to it.

--- End Message ---
--- Begin Message ---
Hey,
OK, got it, thanks!
-Ryan


On 1/4/2004 1:00:04 AM, Aidan Lister ([EMAIL PROTECTED]) wrote:
> Firstly
> I'd rewrite your other script to store the data in an array.
>
> The benefits of doing so are simply demonstrated:
>
> <?php
> foreach ($products as $product)
> dosomethingto($product);
> ?>
>
> However, if you are unable to rewrite your script:
>
> The correct syntax is:
> <?php
> ${'product' . $i}
> ?>
>
> "Ryan A" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi,
> > am a bit confused as to how you do this...first let me explain the flow
of
> > input:
> > I will be getting $product1,$product2,$product3 etc from another
> script...I
> > dont know till what number....right now I am trying to catch the values
> till
> > 20 with a "for" loop.
> >
> > My problem is how do I attach the $i that I am using to the $product to
> > check if its set? Heres my code and below that you will see some of the
> > stuff I have tried:
> >
> >
> > for($i=1; $i<21; $i++)
> > { if(isset($product$i))
> >  {echo "Product".$i." is set!<br>";}
> >  else(!isset($product$i))
> >   {echo "Product".$i." is NOT set!<br>";}}
> > exit;

--- End Message ---
--- Begin Message ---
I want to create an array with some text. Let's say the following:

$sometext = array(explode(" ", "Objective: Position as a Machine Attendant
and or Operator Summary - Over 16 years experience in packaging and
maintenance of various operating machinery. - 13 years experience in cutting
steel and operating a steel press. - Part time experience in packaging and
shipping bread for a bakery."));

I can easily return that text using:

print_r($sometext);

However I want loop through that text for to bold certain words in the
array. In any event I've tried using the following but it only returns
"sometext at[0] is: [Array]" which is not want I want, I want it to show me
each word in the array through the loop. Any ideas what I am doing wrong?

$arrayLength = count($sometext);

for ($i = 0; $i < $arrayLength; $i++){
   echo "sometext at[" . $i . "] is: [" .$sometext[$i] . "]<br>\n";
}

Thanks

--- End Message ---
--- Begin Message ---
If you're going to build your array that way, then you need to loop through
$sometext[0], not $sometext.  You're creating an array in the first element
of the $sometext array, so $sometext element zero is an array containing
your exploded words.

Instead, try:

$sometext = explode(" ", "your long string");

--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org

"Vernon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I want to create an array with some text. Let's say the following:
>
> $sometext = array(explode(" ", "Objective: Position as a Machine Attendant
> and or Operator Summary - Over 16 years experience in packaging and
> maintenance of various operating machinery. - 13 years experience in
cutting
> steel and operating a steel press. - Part time experience in packaging and
> shipping bread for a bakery."));
>
> I can easily return that text using:
>
> print_r($sometext);
>
> However I want loop through that text for to bold certain words in the
> array. In any event I've tried using the following but it only returns
> "sometext at[0] is: [Array]" which is not want I want, I want it to show
me
> each word in the array through the loop. Any ideas what I am doing wrong?
>
> $arrayLength = count($sometext);
>
> for ($i = 0; $i < $arrayLength; $i++){
>    echo "sometext at[" . $i . "] is: [" .$sometext[$i] . "]<br>\n";
> }
>
> Thanks

--- End Message ---
--- Begin Message ---
Is it possible to pipe email directly to PHP like it's possible to do
with perl?  I need to do this using Exim which I'm also unfamiliar with
so if anyone has done this I'd appreciate knowing how! :)

Thanks

Ade

--- End Message ---
--- Begin Message ---
I can't belive it...

I checked the file permissions on so many occasions, I even used
/tmp/phperror_log just to make sure (why that doesn't work I'm not sure).

However sure enough, the directory wasn't world writeable.

Thanks Marek, I really appreciate your help.


"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Does apache have permissions to write to the file and directory?
>
> Aidan Lister wrote:
> > If anyone has successfully got php error logging working on a production
> > website, could you please reply with the steps taken?
> >
> > I'm using RH7.3, Apache1.3x, PHP4.3x
> >
> > My php.ini has:
> >
> > log_errors = On
> > error_log = /var/log/httpd/php/error_log
> >
> > However the errorlog is never created.
> >
> > Thanks for any help.
> >

--- End Message ---
--- Begin Message ---
=======================================
This message is for the benefit of new subscribers 
and those new to PHP.  Please feel free to add 
more points and send to the list.
=======================================
1. If you have any queries/problems about PHP try 
http://www.php.net/manual/en first. You can 
download a copy and use it offline also. 

Please also try http://www.php.net/manual/faq.php 
to get answers to frequently answered questions 
about PHP (added by Christophe Chisogne).

2. Try http://www.google.com next. Searching for 
"php YOUR QUERY" may fetch you relevant results 
within the first 10 results, if you are lucky.

3. There is a searchable archive of the mailing 
list discussion at 
http://phparch.com/mailinglists. Many of the 
common topics are discussed repeatedly, and you 
may get answer to your query from the earlier 
discussions. 

For example: One of the repeatedly discussed 
question in the list is "Best PHP editor". 
Everyone has his/her favourite editor. 
You can get all the opinions by going through the 
list archives. If you want a chosen list try this 
link : http://phpeditors.linuxbackup.co.uk/ 
(contributed by Christophe Chisogne).

4. Not sure if PHP is working or you want find out 
what extensions are available to you?

Just put the following code into a file with a 
.php extension and access it through your 
webserver:

<?php
        phpinfo();
?> 

If PHP is installed you will see a page with a lot 
of information on it. If PHP is not installed (or 
not working correctly) your browser will try
to download the file.

(contributed by Teren and reworded by Chris W 
Parker)

5. If you are stuck with a script and do not 
understand what is wrong, instead 
of posting the whole script, try doing some 
research yourself. One useful trick is to print 
the variable/sql query using print or echo 
command and check whether you get what you 
expected. 

After diagnosing the problem, send the details of 
your efforts (following steps 1, 2 & 3) and ask 
for help.

6. PHP is a server side scripting language. 
Whatever processing PHP does takes 
place BEFORE the output reaches the client. 
Therefore, it is not possible to access the 
users'  computer related information (OS, screen 
size etc) using PHP. You need to go for 
JavaScript and ask the question in a JavaScript 
list.

On the other hand you can access the information 
that is SENT by the user's browser when a client 
requests a page from your server. You can
find details about browser, OS etc as reported by 
this request. - contributed by Wouter van Vliet 
and reworded by Chris W Parker.

7. Provide a clear descriptive subject line. Avoid 
general subjects like "Help!!", "A Question" etc.  
Especially avoid blank subjects. 

8. When you want to start a new topic, open a new 
mail composer and enter the mailing list address 
[EMAIL PROTECTED] instead of replying to 
an existing thread and replacing the subject and 
body with your message.

9. It's always a good idea to post back to the 
list once you've solved your problem. People 
usually add [SOLVED] to the subject line of their
email when posting solutions. By posting your 
solution you're helping the next person with the 
same question. [contribued by Chris W Parker]

10. Ask smart questions  
http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)

Hope you have a good time programming with PHP.

Best regards,

-- 
Integrated Management Tools for leather industry
----------------------------------
http://www.leatherlink.net

Ma Siva Kumar,
BSG LeatherLink (P) Ltd,
Chennai - 600106

--- End Message ---
--- Begin Message ---
Hi guys,
I am trying to install Turck MMCache on our server but have no idea about
linux...I have gone through all the steps a fellow list user (R'twick) gave
me to install this, up till

$PHP_PREFIX/bin/phpize

when I type that it says: no file or directory by that name

so after searching on the web for the correct command I did this:
find / -name phpize -print

and even that came up blank....

My questions are: what the heck is that file and does this system HAVE to
have it? Can I complile MMCache into php without it? and lastly....what to
do?

Thanks,
-Ryan

--- End Message ---
--- Begin Message --- Install php*-devel package for your distribution. I'm sure there is a x-window application in your distribution that will help you in the future, or use rpmfind.net to search for the filename you are missing.

Ryan A wrote:
Hi guys,
I am trying to install Turck MMCache on our server but have no idea about
linux...I have gone through all the steps a fellow list user (R'twick) gave
me to install this, up till

$PHP_PREFIX/bin/phpize

when I type that it says: no file or directory by that name

so after searching on the web for the correct command I did this:
find / -name phpize -print

and even that came up blank....

My questions are: what the heck is that file and does this system HAVE to
have it? Can I complile MMCache into php without it? and lastly....what to
do?

Thanks,
-Ryan


--- End Message ---
--- Begin Message ---
I searched the archives and Google but couldn't find a solution.

I would like to know if there is a good server independent method method for
optimizing URLs that contain GET queries for search engines.  Server URL
rewriting (i.e. mod_rewrite, etc...) is not an option unless it is
compatible with ALL http servers.  I would like to write a portable PHP
script, not a PHP/Apache script or PHP/IIS script.

Any way that is good for search engines, especially replacing ? and & with /
would be great.

I know that most probably use Apache but I have "heard" tales of
multi-platform ways to do this, but have never "seen" the solution.

TIA,
Shawn

--- End Message ---
--- Begin Message ---
On Saturday 03 January 2004 10:37 pm, Shawn McKenzie wrote:
> I searched the archives and Google but couldn't find a solution.
>
> I would like to know if there is a good server independent method method
> for optimizing URLs that contain GET queries for search engines.  Server
> URL rewriting (i.e. mod_rewrite, etc...) is not an option unless it is
> compatible with ALL http servers.  I would like to write a portable PHP
> script, not a PHP/Apache script or PHP/IIS script.
>
> Any way that is good for search engines, especially replacing ? and & with
> / would be great.
>
> I know that most probably use Apache but I have "heard" tales of
> multi-platform ways to do this, but have never "seen" the solution.
>

I haven't heard of one for IIS, but keep me informed if you or anyone knows of 
a cross platform way...

--- End Message ---

Reply via email to