OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 14 May 2003 23:35:13 -0000 Issue 2057

php-general-digest-helplists.php.net
Date: Wed May 14 2003 - 18:35:13 CDT


php-general Digest 14 May 2003 23:35:13 -0000 Issue 2057

Topics (messages 147562 through 147659):

Re: PHP + CHM
        147562 by: Greg Beaver
        147636 by: Maxim Maletsky
        147652 by: electroteque

Synchronisation with outlook
        147563 by: Shaun
        147570 by: Marek Kilimajer

Re: Good php application install script?
        147564 by: Marek Kilimajer
        147566 by: Randum Ian
        147587 by: J J

Re: Urls, apache and PHP
        147565 by: Marek Kilimajer

Re: Session Time to Live
        147567 by: Bix

Re: leaching information from a news site
        147568 by: Manuel Lemos

Re: problem uploading larger files
        147569 by: Marek Kilimajer

Re: Checking the contents of a file field
        147571 by: Marek Kilimajer

PDF Problem With Browser
        147572 by: OU Chamroeun
        147573 by: Marek Kilimajer

Re: best way to handle required form fields
        147574 by: Brent Baisley

variable passing between forms
        147575 by: Angelo Zanetti
        147596 by: Jason McCormack

zend engine 2 - nested classes / nested namespaces
        147576 by: Julian Reich
        147586 by: Marco Schuler
        147592 by: Arjen Brouwer

Paginating
        147577 by: Awlad Hussain

echo's "here document" syntax
        147578 by: Micah Bushouse
        147579 by: Dan Joseph
        147588 by: Rey Segundo Guerrero Proenza

Re: Alternate colors
        147580 by: Brian V Bonini

Re: Session files in /tmp are zero length
        147581 by: Johnson, Kirk
        147599 by: Lee Stewart
        147602 by: Johnson, Kirk
        147608 by: Lee Stewart
        147609 by: Johnson, Kirk
        147613 by: Lee Stewart
        147630 by: Jennifer Goodie
        147634 by: Johnson, Kirk
        147635 by: Lee Stewart
        147637 by: Johnson, Kirk
        147643 by: Lee Stewart
        147644 by: James E Hicks III
        147645 by: Lee Stewart

Re: is this good for date calculation
        147582 by: Wendell Brown

downloading files
        147583 by: Amanda McComb
        147589 by: Awlad Hussain

Re: Session Variables
        147584 by: Johnson, Kirk

Insert Record in MySQL Database from eMail
        147585 by: Vernon
        147591 by: Warren Vail

Class Deconstruction...
        147590 by: Dan Joseph
        147594 by: Cal Evans

ldap_list()
        147593 by: Mike Tuller
        147595 by: BigDog
        147597 by: Mike Tuller
        147607 by: Mike Tuller

Re: How force IE6 accept my cookies?
        147598 by: Frappy John

Re: downloading files created by PHP
        147600 by: Amanda McComb
        147601 by: Eddie Shipman
        147603 by: Amanda McComb
        147604 by: Eddie Shipman

tutorials for creating sessions
        147605 by: Prince
        147621 by: Kevin Stone
        147649 by: Kevin Saenz

register_globals
        147606 by: Dan Joseph
        147619 by: Kevin Stone

Getting data into a web form from a card scanner
        147610 by: Denis L. Menezes
        147611 by: Eddie Shipman
        147612 by: CPT John W. Holmes
        147614 by: Eddie Shipman
        147615 by: Denis L. Menezes
        147616 by: Eddie Shipman
        147617 by: Denis L. Menezes
        147620 by: Hugh Bothwell

Re: Can a variable being use twise?
        147618 by: Steve Keller

php based FAQ generator
        147622 by: Richard Baskett

help with PHP
        147623 by: JACK M
        147626 by: CPT John W. Holmes

Thread locking on mysql queries....
        147624 by: Mike Morton

Re: posting to an https server
        147625 by: Jennifer Goodie

php.. refreshing frames..
        147627 by: Bruce Douglas
        147632 by: Frappy John

Re: ?diagramming php classes in a web application
        147628 by: Kevin Ison

questions about php
        147629 by: Marlon Brandao_estag
        147631 by: Bruce Douglas
        147640 by: Marlon Brandao_estag
        147641 by: Cal Evans
        147658 by: Joseph Szobody

Re: questions about php re: invoking php with onclick
        147633 by: Frappy John

Re: A good tutorail on templates?
        147638 by: Maxim Maletsky

Re: iODBC PHP
        147639 by: Andrew Hill

Re: XML / XSL > HTML
        147642 by: James

date() function doesn't automatically pick up TZ environment variable.
        147646 by: John Worsley <jlx.commandprompt.com
        147647 by: Rasmus Lerdorf
        147648 by: John Worsley <jlx.commandprompt.com

Dreamweaver and PHP
        147650 by: Ryan A
        147654 by: Joseph Szobody

Re: Redirect After Edit
        147651 by: Cory Hicks

Re: Redirect After Edit (solved)
        147653 by: Kevin Millecam

increment counter by .1
        147655 by: Brian V Bonini
        147656 by: John Coggeshall
        147657 by: Jennifer Goodie

email body stored in table > remove line breaks
        147659 by: Vernon

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

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

attached mail follows:


Hi Daniel,

You might consider phpDocumentor, the user docs could be created using
the CHM converter, with the option of also creating HTML docs for those
not on windows, or a PDF for those who like to print their docs.

Greg
--
phpDocumentor
http://www.phpdoc.org

danielelectroteque.org wrote:
> hi there , i am nearly finishing off a project , and have to create user
> documentation including help files , i was thinking of the best way to do
> this , should i simply create a popup box with the help html , or i was
> thinking of creating a CHM with php databased content or maybe just html ,
> is there anyway to do this i hope this is still on topic cheers
>
>

attached mail follows:


On Wed, 14 May 2003 12:23:59 +1000 (EST)
<danielelectroteque.org> wrote:

> hi there , i am nearly finishing off a project , and have to create user
> documentation including help files , i was thinking of the best way to do
> this , should i simply create a popup box with the help html , or i was
> thinking of creating a CHM with php databased content or maybe just html ,
> is there anyway to do this i hope this is still on topic cheers

I like thinking that a pop-up will work the best to help on the
application usage. Whenever you need help, you make a link with some ID
that corresponds to a certain help-text in the DB. That then appears in
a pop-up window. CHM is not really a web thingie... And, is harder to
manage.

--
Maxim Maletsky
maximphp.net

attached mail follows:


yes there is the window.showHelp which can launch either a chm or html file,
sorry for the javascript reference

-----Original Message-----
From: Maxim Maletsky [mailto:subscriptionsphpbeginner.com]
Sent: Thursday, May 15, 2003 4:43 AM
To: danielelectroteque.org
Cc: php-generallists.php.net
Subject: Re: [PHP] PHP + CHM

On Wed, 14 May 2003 12:23:59 +1000 (EST)
<danielelectroteque.org> wrote:

> hi there , i am nearly finishing off a project , and have to create user
> documentation including help files , i was thinking of the best way to do
> this , should i simply create a popup box with the help html , or i was
> thinking of creating a CHM with php databased content or maybe just html ,
> is there anyway to do this i hope this is still on topic cheers

I like thinking that a pop-up will work the best to help on the
application usage. Whenever you need help, you make a link with some ID
that corresponds to a certain help-text in the DB. That then appears in
a pop-up window. CHM is not really a web thingie... And, is harder to
manage.

--
Maxim Maletsky
maximphp.net

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

attached mail follows:


Hi,

Is it at all possible to create on online scheduling system that
synchronises with out outlook on their desktop?

attached mail follows:


I think you can use vCard for this, there are classes available.

Shaun wrote:

>Hi,
>
>Is it at all possible to create on online scheduling system that
>synchronises with out outlook on their desktop?
>
>
>
>
>

attached mail follows:


If I remember well, phorum (www.phorum.org) has a good install script.

J J wrote:

>Does anyone know of a good example of an install
>script for a php/mysql application?
>
>Something that you go to install.php and it walks you
>through the install. From config setup, database
>setup, maybe the ability to select an option or two to
>be activated (checkboxes or drop-down) in the
>application.
>
>Something along those lines. Thanks for any examples
>or pointers!
>
>__________________________________
>Do you Yahoo!?
>The New Yahoo! Search - Faster. Easier. Bingo.
>http://search.yahoo.com
>
>
>

attached mail follows:


As does phpBB.

> If I remember well, phorum (www.phorum.org) has a good install script.
>
> J J wrote:
>
>>Does anyone know of a good example of an install
>>script for a php/mysql application?
>>
>>Something that you go to install.php and it walks you
>>through the install. From config setup, database
>>setup, maybe the ability to select an option or two to
>>be activated (checkboxes or drop-down) in the
>>application.
>>
>>Something along those lines. Thanks for any examples
>>or pointers!
>>
>>__________________________________
>>Do you Yahoo!?
>>The New Yahoo! Search - Faster. Easier. Bingo.
>>http://search.yahoo.com
>>
>>
>>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

Randum Ian
ianrandumian.co.uk
DancePortalGlobal Webmaster
http://www.danceportalglobal.com

attached mail follows:


I think that's where I saw something like this
originally, thanks! I'll run through that install
again and pick it apart if possible.

I was hoping maybe there was something a bit more
generic out there that could be applied to an
application, but that's wishful thinking.

--- Randum Ian <ianrandumian.co.uk> wrote:
> As does phpBB.
>
> > If I remember well, phorum (www.phorum.org) has a
> good install script.
> >
> > J J wrote:
> >
> >>Does anyone know of a good example of an install
> >>script for a php/mysql application?
> >>
> >>Something that you go to install.php and it walks
> you
> >>through the install. From config setup, database
> >>setup, maybe the ability to select an option or
> two to
> >>be activated (checkboxes or drop-down) in the
> >>application.
> >>
> >>Something along those lines. Thanks for any
> examples
> >>or pointers!
> >>
> >>__________________________________
> >>Do you Yahoo!?
> >>The New Yahoo! Search - Faster. Easier. Bingo.
> >>http://search.yahoo.com
> >>
> >>
> >>
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
>
>
> Randum Ian
> ianrandumian.co.uk
> DancePortalGlobal Webmaster
> http://www.danceportalglobal.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

attached mail follows:


Have you backed up your configuration files? You should have. Take a
look at the old configuration.

Anderson, P.D. wrote:

>Brian,
>
> Thanks for your answer, but it does not seem to work. I checked
>that php is running as a module (and not cgi) as I know it does not work
>with cgi.
>
>Do I need to set any MultiViewsMatch options? I tried MultiViewsMatch
>Any but it doesn't work.
>
>Patrick.
>
>PS I am running Apache 2.0.40 ..
>
>
>-----Original Message-----
>From: Brian Paulson [mailto:phpspectre013.com]
>Sent: Tuesday, May 13, 2003 5:42 PM
>To: 'Anderson, P.D.'; php-generallists.php.net
>Subject: RE: [PHP] Urls, apache and PHP
>
>
>Patrick,
>
> Here is what I use to accomplish it the path can be to the root
>of where all your virtual hosts are or to a specific site if you only
>want it for that one.
>
><Directory "/path/to/site">
>Options MultiViews
></Directory>
>
>Also, with his you don't have to use the .php in the url like this
>
>http://www.chieftain.com/tuesday/news/index/article/1
>
>www.chieftain.com/ < URL
>tuesday/ < Dir
>news/ < Dir
>index/ < page that does processing
>article/ < variable
>1 < Variable
>
>Hth
>
>Thank You
>Brian Paulson
>Sr. Web Developer
>Email: BpaulsonChieftain.com
>Phone: 1-800-279-6397
>Fax: 1-719-544-0264
>URL: www.chieftain.com
>-------------------------------------------
>
>-----Original Message-----
>From: Anderson, P.D. [mailto:P.D.Andersontue.nl]
>Sent: Tuesday, May 13, 2003 8:55 AM
>To: 'php-generallists.php.net'
>Subject: [PHP] Urls, apache and PHP
>
>
>Hi,
>
>I have been using the url to pass variables to be used in php files. For
>example
>
>Mysite.com/do.php/1/5 ( and not Mysite.com/do.php?var1=1&var2=5 )
>
>Using the list command I extract the variables (for example
>$var1=1;$var2=5)
>
>Always worked perfect for Unix + Apache 1.3x..+ php 2.x/3.x/4.x (as
>modules)
>+ mysql 3.x.
>
>Now, I upgraded to RedHat 9.0 with Apache 2.0 and it complains that
>do.php/1/5 is not a existing object/file (404 error).
>
>Could anyone please help me out and tell me how to change php.ini or
>httpd.conf to accept my 'old' way or passing variables.
>
>Thanks very much,
>
>Patrick
>
>
>
>
>
>
>
>
>

attached mail follows:


Solved it...

I've added a "Expires" variable in the form of a datestamp. How easy was
that!!!

Bit daft me ;)

"Bix" <phpbix.cc> wrote in message
news:20030514111217.64647.qmailpb1.pair.com...
> Hi all,
>
> Is there any way of setting a time to live on sessions stored in php? I
have
> tried session_cache_expire(10); but the SIDs are still valid and return
> session variables after that time. I am trying to avoid people 'hacking'
my
> user's sessions.
>
> A long winded way i know would be to have a mysql table with sessions and
> datestamps with a crontab to clear old sessions from validity, but this
> means more server load and more time.
>
> Any help is appreciated, thanks.
>
> Bix
>
>

attached mail follows:


Hello,

On 05/13/2003 11:43 PM, Kevin Saenz wrote:
> I am new to the php list. I have a problem and would like to know
> how I could solve it with php.
>
> I would like to grab headlines from a news site in Australia.

Instead of re-inventing the wheel, you may want to try existing RSS
feeds for that site like this:

http://www.newsisfree.com/sources/rss/6296/

All you need to use is a RSS parser to extract the information you want,
but you may find plenty of ready to use PHP classes to do that for
instance here:

http://www.phpclasses.org/search.html?words=rss+parser&go_search=1

--

Regards,
Manuel Lemos

attached mail follows:


Also post_max_size affects the the maximum allowable filesize. This
option should be a little larger then upload_max_filesize.

Francisco Hernandez wrote:

> hello, i've been running into a problem on my server where if i try
> and upload files that are about 2 megs or larger, the apache process
> quits or php.., now i dont know if its an apache problem or a php
> problem but in my php.ini i have upload_max_filesize = 200M and
> uploads are enabled, uploading smaller files works fine, its just the
> larger files i have a problem with, what can i do on the php side or
> apache side of things to find out what exactly is going on and why my
> uploads are woring for large files?
> itll be uploading files then i get a browser error about losing the
> connection, im stumped.
>
> _________________________________________________________________
> MSN 8 with e-mail virus protection service: 2 months FREE*
> http://join.msn.com/?page=features/virus
>
>

attached mail follows:


$_FILES holds info about uploaded files.

Shaun wrote:

>Hi,
>
>how can i make sure that someone has selected a file to upload, the
>following doesn't seem to work:
>
>if(empty($_POST['document'])){
> $error = "Please select a file";
>
>
>Thanks for our help
>
>
>
>
>

attached mail follows:


Hi!

I have problem with PDF. When the browser is Netscape, my PDF
is displayed correctly. But
when the broswer is IE, it sometimes shows up and sometimes
blank screen is seen instead. I
think that's becuase of the problem of header.

I wish you could help me out with this problem as i spend many
days already with this.

Thanks
Chamroeun

attached mail follows:


Search the archives, this was discused recently.

OU Chamroeun wrote:

>Hi!
>
>I have problem with PDF. When the browser is Netscape, my PDF
>is displayed correctly. But
>when the broswer is IE, it sometimes shows up and sometimes
>blank screen is seen instead. I
>think that's becuase of the problem of header.
>
>I wish you could help me out with this problem as i spend many
>days already with this.
>
>Thanks
>Chamroeun
>
>
>

attached mail follows:


I use both Javascript alerts and server side validation for security
reasons. I use Javascript simply from a user interface point of view.
You shouldn't rely on client side validation for security since anyone
can submit any URL to your system.

I typical have one page that handles view, new, edit and save
functions. I first check if the operation is a save. If it is, I do a
validation on the data. If validation fails I update an error variable
with an error message and change the operation to new or edit, whatever
it was before. The page then continues to load as before, including
echoing the error message which now contains something whereas before
it didn't.

That's the simple way of doing it. I also use red hilighting on the
fields, but I use templates which makes it much easier.

On Tuesday, May 13, 2003, at 08:20 PM, <danielelectroteque.org> wrote:

> hi there i was wondering what would be the most ideal way to handle
> required form fields say if they were empty and are required , should
> i do
> a check and send an error and return to the page with the required
> fields
> in red or would a javascript alert box (ugly) be ok ? reason being my
> prefered way would be sending an error although with my previous issue
> with
> custom error handlers might be tedious :|
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

attached mail follows:


Hello I am new to php.

I have a table that is populated with entries. when a user clicks on 1 I want it to open a new php form and send the ID (field in table) to the newly opened php form.

everything seems to be working well I see that the variable is passed the value (ID) in the URL but when I reference the variable in the called php page the variable seems empty.

here is the anchor link from first page with table:

echo("<a href='indpaper.php?ID=" .$row["BiblioID"]. "'>");

this seems to be working fine.

the URL:

http://localhost/ebusiness/indpaper.php?ID=42

as you can see is being passed the value 42.
however when I go to the indpaper.php and try use the ID variable it is empty,

echo("ID to delete: " . $ID );

why is it empty?? can anyone help??

thanx in advance

attached mail follows:


Angelo,

Try this.

$var = $_GET["ID"];

Remember variables are case sensitive. Using the above method allows you to
not have to use "Register Globals" which can be a security risk.

Hope this helps,
Jason

"Angelo Zanetti" <binc2ctech.ac.za> wrote in message
news:014501c31a16$9f062a90$c75dee9bebus...
Hello I am new to php.

I have a table that is populated with entries. when a user clicks on 1 I
want it to open a new php form and send the ID (field in table) to the newly
opened php form.

everything seems to be working well I see that the variable is passed the
value (ID) in the URL but when I reference the variable in the called php
page the variable seems empty.

here is the anchor link from first page with table:

echo("<a href='indpaper.php?ID=" .$row["BiblioID"]. "'>");

this seems to be working fine.

the URL:

http://localhost/ebusiness/indpaper.php?IDB

as you can see is being passed the value 42.
however when I go to the indpaper.php and try use the ID variable it is
empty,

echo("ID to delete: " . $ID );

why is it empty?? can anyone help??

thanx in advance

attached mail follows:


hi,

does anyone know whether there will be nested classes in zend engine 2?? and what's about nested namespaces (like in my example)??

background info:
we're working on a cms and don't want to mix up function libraries and data objects.

example:

<?PHP
namespace x_db_mysql
{
        class select()
        {
                function startQuery()
                {
                        // function
                }
                
                // more functions
        }
        
        // more classes
}

namespace data_types
{
        namespace x_db_mysql
        {
                class select
                {
                        var $var1;
                        var $var2;
                        
                        function __construct($var1, $var2)
                        {
                                $this->var1 = $var1;
                                $this->var2 = $var2;
                        }
                        
                        class startquery
                        {
                                var $var1;
                                var $var2;
                                
                                function __construct($var1, $var2)
                                {
                                        $this->var1 = $var1;
                                        $this->var2 = $var2;
                                }
                        }
                        
                        // more classes
                }
                
                // more classes
        }
        
        // more namespaces ...
}
?>

Yours sincerly,
Julian Reich

julianreich.cx

attached mail follows:


Hi Julian

You can find information on Zend engine 2 on

http://www.php.net/ZEND_CHANGES.txt

Hope it helps!

--
Cheers!
 Marco

Am Mittwoch, 14. Mai 2003 um 15:17 schrieb Julian Reich:

> hi,

> does anyone know whether there will be nested classes in zend engine 2?? and what's about nested namespaces (like in my example)??

> background info:
> we're working on a cms and don't want to mix up function libraries and data objects.

> example:

> <?PHP
> namespace x_db_mysql
> {
> class select()
> {
> function startQuery()
> {
> // function
> }
                
> // more functions
> }
        
> // more classes
> }

> namespace data_types
> {
> namespace x_db_mysql
> {
> class select
> {
> var $var1;
> var $var2;
                        
> function __construct($var1, $var2)
> {
> $this->var1 = $var1;
> $this->var2 = $var2;
> }
                        
> class startquery
> {
> var $var1;
> var $var2;
                                
> function __construct($var1, $var2)
> {
> $this->var1 = $var1;
> $this->var2 = $var2;
> }
> }
                        
> // more classes
> }
                
> // more classes
> }
        
> // more namespaces ...
> }
?>>

> Yours sincerly,
> Julian Reich

> julianreich.cx

attached mail follows:


This file is outdated, nested classes wil NOT be supported, even as
namespaces. Namespaces will be implemented but can not be nested.

Cheers,
Arjen

----- Original Message -----
From: "Marco Schuler" <marco.schulerscopein.ch>
To: <php-generallists.php.net>
Sent: Wednesday, May 14, 2003 4:32 PM
Subject: Re: [PHP] zend engine 2 - nested classes / nested namespaces

> Hi Julian
>
> You can find information on Zend engine 2 on
>
> http://www.php.net/ZEND_CHANGES.txt
>
> Hope it helps!
>
> --
> Cheers!
> Marco
>
>
> Am Mittwoch, 14. Mai 2003 um 15:17 schrieb Julian Reich:
>
> > hi,
>
> > does anyone know whether there will be nested classes in zend engine 2??
and what's about nested namespaces (like in my example)??
>
> > background info:
> > we're working on a cms and don't want to mix up function libraries and
data objects.
>
> > example:
>
> > <?PHP
> > namespace x_db_mysql
> > {
> > class select()
> > {
> > function startQuery()
> > {
> > // function
> > }
>
> > // more functions
> > }
>
> > // more classes
> > }
>
> > namespace data_types
> > {
> > namespace x_db_mysql
> > {
> > class select
> > {
> > var $var1;
> > var $var2;
>
> > function __construct($var1, $var2)
> > {
> > $this->var1 = $var1;
> > $this->var2 = $var2;
> > }
>
> > class startquery
> > {
> > var $var1;
> > var $var2;
>
> > function __construct($var1, $var2)
> > {
> > $this->var1 = $var1;
> > $this->var2 = $var2;
> > }
> > }
>
> > // more classes
> > }
>
> > // more classes
> > }
>
> > // more namespaces ...
> > }
> ?>>
>
> > Yours sincerly,
> > Julian Reich
>
> > julianreich.cx
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Does anyone know any database records paginating scripts or tutorials where the search criteria is stored in the database..

similar to phpbb.com's search... I checked their codes its too advance for me .. hard to follow :(

thanks

awlad

attached mail follows:


Dear list,

I was looking through the documentation of PHP and I came across this in
ECHO's page

echo <<<END
This uses the "here document" syntax to output
multiple lines with $variable interpolation. Note
that the here document terminator must appear on a
line with just a semicolon no extra whitespace!
END;

I tried this out in my scripts and it works great! I've never been a fan of
smarty or templates in general, and this seems to be right up my alley as a
not-quite-as-good but better-than-nothing substitute.

Does anybody know the history of this method? "here document" wha? Where'd
it come from? What are its shortfalls? Is it significantly slower than the
echo " [huge block of text with php vars] "; method?

Thanks,
Micah

attached mail follows:


Hi,

> echo <<<END
> This uses the "here document" syntax to output
> multiple lines with $variable interpolation. Note
> that the here document terminator must appear on a
> line with just a semicolon no extra whitespace!
> END;
> Does anybody know the history of this method? "here document"
> wha? Where'd

        I don't know the history, but that method is like using:

        print qq|
                sdlkjsdjlks whole bunch of stuf fhere ....
        |;

        .. in Perl. You can replace the | with any character you want.

-Dan Joseph

attached mail follows:


Hello:

On Wed, 14 May 2003, Micah Bushouse wrote:

>
> Does anybody know the history of this method? "here document" wha? Where'd
> it come from? What are its shortfalls? Is it significantly slower than the
> echo " [huge block of text with php vars] "; method?

I suppose it came from Unix; where I first found this kind of sintax
construction. But may it was taken from other language...

--
Regards,

Prof. Rey Segundo Guerrero Proenza
      Dpto Computación Universidad de Granma
      Bayamo Cuba
      http://www.geocities.com/reysgp/

attached mail follows:


On Tue, 2003-05-13 at 20:48, Aris Santillan wrote:
> hi
>
> im querying data from database
> fetching all the rows in it.
>
> how can i display it in html
> with an alternate colors in
> the rows!!!

$bgcolor = ($i++ & 1) ? '#FFFFFF' : '#CCCCCC';

attached mail follows:


> Hi..
> I'm migrating a web application from PHP 4.0.3 on Linux to 4.2.2 and
> having trouble with the session variables.
>
> The code has various statements like:
> session_register("varname");
>
> I get the sess_... files in /tmp, but they're all zero length, so of
> course the application doesn't work...
>
> register_globals is ON and I've even tried sticking a
> global $varname;
> ahead of the session_register, but nothing seems to force it
> to save it
> in the sess_... file.

Start by setting the error reporting level to max, using:

error_reporting(E_ALL);

We may need to see some representative code to help.

Kirk

attached mail follows:


I did add the error_reporting, but still saw no errors...

Here's the majority of the code:
error_reporting(E_ALL);
$errmsg = '';
session_start();
if( isset($username) ) {
         require_once('Connections/mySql.php');
         mysql_select_db($database_mySql, $mySql) or
die(mysql_error($mySql));
         $rs = mysql_query("select * from employee where initials = '" .
strtoupper($username) . "'", $mySql) or die(mysql_error($mySql));
         if( !(mysql_num_rows($rs)) ) { // not valid username
                 mysql_free_result($rs);
                         $errmsg = "Invalid Userid";
                         unset($username);
         }
         else { // valid user, now validate password and status
                 $row = mysql_fetch_assoc($rs);
                 mysql_free_result($rs);
                 if( $row['pw'] == $password ) { // if correct password
                         if( $row['status'] == 'a' || $row['status'] ==
'm' ) { // if active user
                                 $_SESSION["username"] = $username;
                                 $username = strtoupper($username);
                                 session_register("username");
                                 $authlevel = $row['status']=='a'?1:2;
                                 session_register("authlevel");
                                 mysql_query("update employee set
lastlogin = " . (time()-10800) . " where initials = '$username'",
$mySql) or die(mysql_error($mySql));
                                 echo "<meta http-equiv=refresh
content=\"0; url=browse.php\">";
                                 exit;

What follows just closes out the if's and has the html for the page to
be redisplayed on an invalid userid/password.

It does accept the userid/password, validates it, but when it gets to
the second page (browse.php), it does not know the username or authlevel.

When I take a look at /tmp (it's on Linux), I see the sess_.... file(s),
but it's zero length... No variable names, no values.

Like I mentioned, I'm migrating this from a PHP 4.0.3 system to 4.2.2.
register_globals is ON. And /tmp is world writable..

I've even tried the "new" '$_SESSION["username"] = $username;' syntax,
with the same results. (Though I have to admit that I'd hate to have to
recode the entire app to change all the session_register stmts!)

Thanks for any adivce...
Lee

Kirk Johnson wrote:
>
> Start by setting the error reporting level to max, using:
>
> error_reporting(E_ALL);
>
> We may need to see some representative code to help.
>
> Kirk

attached mail follows:


It looks like the coding style is a mix of register_globals "on" and "off".
Here's a summary of what it should be:

If register_globals is "On" in php.ini, then do the following:

- use session_register() to create your session variables;
- use the global variable to access (assign, print) the variable, not the
$HTTP_SESSION_VARS (or $_SESSION) array.

Example:

$myVar = 'test';
session_register('myVar');
$myVar = 'some new value';
print $myVar;

Note: the value of $myVar is what is stored to the session at the end of the
script. And, since it is stored after the script ends, its value is not
available via $HTTP_SESSION_VARS[] until the next page.

If register_globals is "Off" in php.ini, then do the following:

- do not use session_register(), etc.
- use $HTTP_SESSION_VARS (or $_SESSION) for all accesses.

Example:

$HTTP_SESSION_VARS['myVar'] = 'test';
$HTTP_SESSION_VARS['myVar'] = 'some new value';
print $HTTP_SESSION_VARS['myVar'];

Kirk

> -----Original Message-----
> From: Lee Stewart [mailto:lstewartdsgroup.com]
> Sent: Wednesday, May 14, 2003 9:45 AM
> To: php-generallists.php.net
> Subject: Re: [PHP] Session files in /tmp are zero length
>
>
> I did add the error_reporting, but still saw no errors...
>
> Here's the majority of the code:
> error_reporting(E_ALL);
> $errmsg = '';
> session_start();
> if( isset($username) ) {
> require_once('Connections/mySql.php');
> mysql_select_db($database_mySql, $mySql) or
> die(mysql_error($mySql));
> $rs = mysql_query("select * from employee where
> initials = '" .
> strtoupper($username) . "'", $mySql) or die(mysql_error($mySql));
> if( !(mysql_num_rows($rs)) ) { // not valid username
> mysql_free_result($rs);
> $errmsg = "Invalid Userid";
> unset($username);
> }
> else { // valid user, now validate password and status
> $row = mysql_fetch_assoc($rs);
> mysql_free_result($rs);
> if( $row['pw'] == $password ) { // if
> correct password
> if( $row['status'] == 'a' ||
> $row['status'] ==
> 'm' ) { // if active user
> $_SESSION["username"] = $username;
> $username = strtoupper($username);
> session_register("username");
> $authlevel = $row['status']=='a'?1:2;
> session_register("authlevel");
> mysql_query("update employee set
> lastlogin = " . (time()-10800) . " where initials = '$username'",
> $mySql) or die(mysql_error($mySql));
> echo "<meta http-equiv=refresh
> content=\"0; url=browse.php\">";
> exit;
>
> What follows just closes out the if's and has the html for
> the page to
> be redisplayed on an invalid userid/password.
>
> It does accept the userid/password, validates it, but when it gets to
> the second page (browse.php), it does not know the username
> or authlevel.
>
> When I take a look at /tmp (it's on Linux), I see the
> sess_.... file(s),
> but it's zero length... No variable names, no values.
>
> Like I mentioned, I'm migrating this from a PHP 4.0.3 system
> to 4.2.2.
> register_globals is ON. And /tmp is world writable..
>
> I've even tried the "new" '$_SESSION["username"] =
> $username;' syntax,
> with the same results. (Though I have to admit that I'd hate
> to have to
> recode the entire app to change all the session_register stmts!)
>
> Thanks for any adivce...
> Lee
>
>
>
> Kirk Johnson wrote:
> >
> > Start by setting the error reporting level to max, using:
> >
> > error_reporting(E_ALL);
> >
> > We may need to see some representative code to help.
> >
> > Kirk
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


I'm really coding only for register_globals ON. I only added the
$_SESSION statment just to test and see if that made any difference (it
didn't).

I think I'm doing just what you described:

$username = strtoupper($username);
session_register("username");
$authlevel = $row['status']=='a'?1:2;
session_register("authlevel");

I just never have anything but the zero length session (sess_...) file
-- therefore the next page has nothing passed to it...

Lee

Kirk Johnson wrote:
> It looks like the coding style is a mix of register_globals "on" and "off".
> Here's a summary of what it should be:
>
> If register_globals is "On" in php.ini, then do the following:
>
> - use session_register() to create your session variables;
> - use the global variable to access (assign, print) the variable, not the
> $HTTP_SESSION_VARS (or $_SESSION) array.
>
> Example:
>
> $myVar = 'test';
> session_register('myVar');
> $myVar = 'some new value';
> print $myVar;
>
> Note: the value of $myVar is what is stored to the session at the end of the
> script. And, since it is stored after the script ends, its value is not
> available via $HTTP_SESSION_VARS[] until the next page.
>
> If register_globals is "Off" in php.ini, then do the following:
>
> - do not use session_register(), etc.
> - use $HTTP_SESSION_VARS (or $_SESSION) for all accesses.
>
> Example:
>
> $HTTP_SESSION_VARS['myVar'] = 'test';
> $HTTP_SESSION_VARS['myVar'] = 'some new value';
> print $HTTP_SESSION_VARS['myVar'];
>
> Kirk
>
>
>>-----Original Message-----
>>From: Lee Stewart [mailto:lstewartdsgroup.com]
>>Sent: Wednesday, May 14, 2003 9:45 AM
>>To: php-generallists.php.net
>>Subject: Re: [PHP] Session files in /tmp are zero length
>>
>>
>>I did add the error_reporting, but still saw no errors...
>>
>>Here's the majority of the code:
>>error_reporting(E_ALL);
>>$errmsg = '';
>>session_start();
>>if( isset($username) ) {
>> require_once('Connections/mySql.php');
>> mysql_select_db($database_mySql, $mySql) or
>>die(mysql_error($mySql));
>> $rs = mysql_query("select * from employee where
>>initials = '" .
>>strtoupper($username) . "'", $mySql) or die(mysql_error($mySql));
>> if( !(mysql_num_rows($rs)) ) { // not valid username
>> mysql_free_result($rs);
>> $errmsg = "Invalid Userid";
>> unset($username);
>> }
>> else { // valid user, now validate password and status
>> $row = mysql_fetch_assoc($rs);
>> mysql_free_result($rs);
>> if( $row['pw'] == $password ) { // if
>>correct password
>> if( $row['status'] == 'a' ||
>>$row['status'] ==
>>'m' ) { // if active user
>> $_SESSION["username"] = $username;
>> $username = strtoupper($username);
>> session_register("username");
>> $authlevel = $row['status']=='a'?1:2;
>> session_register("authlevel");
>> mysql_query("update employee set
>>lastlogin = " . (time()-10800) . " where initials = '$username'",
>>$mySql) or die(mysql_error($mySql));
>> echo "<meta http-equiv=refresh
>>content=\"0; url=browse.php\">";
>> exit;
>>
>>What follows just closes out the if's and has the html for
>>the page to
>>be redisplayed on an invalid userid/password.
>>
>>It does accept the userid/password, validates it, but when it gets to
>>the second page (browse.php), it does not know the username
>>or authlevel.
>>
>>When I take a look at /tmp (it's on Linux), I see the
>>sess_.... file(s),
>>but it's zero length... No variable names, no values.
>>
>>Like I mentioned, I'm migrating this from a PHP 4.0.3 system
>>to 4.2.2.
>>register_globals is ON. And /tmp is world writable..
>>
>>I've even tried the "new" '$_SESSION["username"] =
>>$username;' syntax,
>>with the same results. (Though I have to admit that I'd hate
>>to have to
>>recode the entire app to change all the session_register stmts!)
>>
>>Thanks for any adivce...
>>Lee
>>
>>
>>
>>Kirk Johnson wrote:
>>
>>>Start by setting the error reporting level to max, using:
>>>
>>>error_reporting(E_ALL);
>>>
>>>We may need to see some representative code to help.
>>>
>>>Kirk
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>

attached mail follows:


Sorry, I am stumped. I would start out with the simplest test page I could
make, and see if you can get that to work:

page.php
<?
session_start();
$test='foobar';
session_register('test');
header('Location: page2.php');
?>

page2.php
<?
session_start();
echo "test is $test<br>";
?>

> -----Original Message-----
> From: Lee Stewart [mailto:lstewartdsgroup.com]
> Sent: Wednesday, May 14, 2003 10:32 AM
> To: php-generallists.php.net
> Subject: Re: [PHP] Session files in /tmp are zero length
>
>
> I'm really coding only for register_globals ON. I only added the
> $_SESSION statment just to test and see if that made any
> difference (it
> didn't).
>
> I think I'm doing just what you described:
>
> $username = strtoupper($username);
> session_register("username");
> $authlevel = $row['status']=='a'?1:2;
> session_register("authlevel");
>
> I just never have anything but the zero length session
> (sess_...) file
> -- therefore the next page has nothing passed to it...
>
> Lee
>
> Kirk Johnson wrote:
> > It looks like the coding style is a mix of register_globals
> "on" and "off".
> > Here's a summary of what it should be:
> >
> > If register_globals is "On" in php.ini, then do the following:
> >
> > - use session_register() to create your session variables;
> > - use the global variable to access (assign, print) the
> variable, not the
> > $HTTP_SESSION_VARS (or $_SESSION) array.
> >
> > Example:
> >
> > $myVar = 'test';
> > session_register('myVar');
> > $myVar = 'some new value';
> > print $myVar;
> >
> > Note: the value of $myVar is what is stored to the session
> at the end of the
> > script. And, since it is stored after the script ends, its
> value is not
> > available via $HTTP_SESSION_VARS[] until the next page.
> >
> > If register_globals is "Off" in php.ini, then do the following:
> >
> > - do not use session_register(), etc.
> > - use $HTTP_SESSION_VARS (or $_SESSION) for all accesses.
> >
> > Example:
> >
> > $HTTP_SESSION_VARS['myVar'] = 'test';
> > $HTTP_SESSION_VARS['myVar'] = 'some new value';
> > print $HTTP_SESSION_VARS['myVar'];
> >
> > Kirk
> >
> >
> >>-----Original Message-----
> >>From: Lee Stewart [mailto:lstewartdsgroup.com]
> >>Sent: Wednesday, May 14, 2003 9:45 AM
> >>To: php-generallists.php.net
> >>Subject: Re: [PHP] Session files in /tmp are zero length
> >>
> >>
> >>I did add the error_reporting, but still saw no errors...
> >>
> >>Here's the majority of the code:
> >>error_reporting(E_ALL);
> >>$errmsg = '';
> >>session_start();
> >>if( isset($username) ) {
> >> require_once('Connections/mySql.php');
> >> mysql_select_db($database_mySql, $mySql) or
> >>die(mysql_error($mySql));
> >> $rs = mysql_query("select * from employee where
> >>initials = '" .
> >>strtoupper($username) . "'", $mySql) or die(mysql_error($mySql));
> >> if( !(mysql_num_rows($rs)) ) { // not valid username
> >> mysql_free_result($rs);
> >> $errmsg = "Invalid Userid";
> >> unset($username);
> >> }
> >> else { // valid user, now validate password and status
> >> $row = mysql_fetch_assoc($rs);
> >> mysql_free_result($rs);
> >> if( $row['pw'] == $password ) { // if
> >>correct password
> >> if( $row['status'] == 'a' ||
> >>$row['status'] ==
> >>'m' ) { // if active user
> >> $_SESSION["username"] = $username;
> >> $username = strtoupper($username);
> >> session_register("username");
> >> $authlevel =
> $row['status']=='a'?1:2;
> >> session_register("authlevel");
> >> mysql_query("update employee set
> >>lastlogin = " . (time()-10800) . " where initials = '$username'",
> >>$mySql) or die(mysql_error($mySql));
> >> echo "<meta http-equiv=refresh
> >>content=\"0; url=browse.php\">";
> >> exit;
> >>
> >>What follows just closes out the if's and has the html for
> >>the page to
> >>be redisplayed on an invalid userid/password.
> >>
> >>It does accept the userid/password, validates it, but when
> it gets to
> >>the second page (browse.php), it does not know the username
> >>or authlevel.
> >>
> >>When I take a look at /tmp (it's on Linux), I see the
> >>sess_.... file(s),
> >>but it's zero length... No variable names, no values.
> >>
> >>Like I mentioned, I'm migrating this from a PHP 4.0.3 system
> >>to 4.2.2.
> >>register_globals is ON. And /tmp is world writable..
> >>
> >>I've even tried the "new" '$_SESSION["username"] =
> >>$username;' syntax,
> >>with the same results. (Though I have to admit that I'd hate
> >>to have to
> >>recode the entire app to change all the session_register stmts!)
> >>
> >>Thanks for any adivce...
> >>Lee
> >>
> >>
> >>
> >>Kirk Johnson wrote:
> >>
> >>>Start by setting the error reporting level to max, using:
> >>>
> >>>error_reporting(E_ALL);
> >>>
> >>>We may need to see some representative code to help.
> >>>
> >>>Kirk
> >>
> >>
> >>--
> >>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
>

attached mail follows:


Thanks for the suggestion... Trying your simple test, page2 comes up
with "test is". And I get another new sess_... file in /tmp, also zero
bytes....

Lee

Kirk Johnson wrote:
> Sorry, I am stumped. I would start out with the simplest test page I could
> make, and see if you can get that to work:
>
> page.php
> <?
> session_start();
> $test='foobar';
> session_register('test');
> header('Location: page2.php');
> ?>
>
> page2.php
> <?
> session_start();
> echo "test is $test<br>";
> ?>
>
>>-----Original Message-----
>>From: Lee Stewart [mailto:lstewartdsgroup.com]
>>Sent: Wednesday, May 14, 2003 10:32 AM
>>To: php-generallists.php.net
>>Subject: Re: [PHP] Session files in /tmp are zero length
>>
>>
>>I'm really coding only for register_globals ON. I only added the
>>$_SESSION statment just to test and see if that made any
>>difference (it
>>didn't).
>>
>>I think I'm doing just what you described:
>>
>>$username = strtoupper($username);
>>session_register("username");
>>$authlevel = $row['status']=='a'?1:2;
>>session_register("authlevel");
>>
>>I just never have anything but the zero length session
>>(sess_...) file
>>-- therefore the next page has nothing passed to it...
>>
>>Lee
>>
>>Kirk Johnson wrote:
>>
>>>It looks like the coding style is a mix of register_globals
>>
>>"on" and "off".
>>
>>>Here's a summary of what it should be:
>>>
>>>If register_globals is "On" in php.ini, then do the following:
>>>
>>>- use session_register() to create your session variables;
>>>- use the global variable to access (assign, print) the
>>
>>variable, not the
>>
>>>$HTTP_SESSION_VARS (or $_SESSION) array.
>>>
>>>Example:
>>>
>>>$myVar = 'test';
>>>session_register('myVar');
>>>$myVar = 'some new value';
>>>print $myVar;
>>>
>>>Note: the value of $myVar is what is stored to the session
>>
>>at the end of the
>>
>>>script. And, since it is stored after the script ends, its
>>
>>value is not
>>
>>>available via $HTTP_SESSION_VARS[] until the next page.
>>>
>>>If register_globals is "Off" in php.ini, then do the following:
>>>
>>>- do not use session_register(), etc.
>>>- use $HTTP_SESSION_VARS (or $_SESSION) for all accesses.
>>>
>>>Example:
>>>
>>>$HTTP_SESSION_VARS['myVar'] = 'test';
>>>$HTTP_SESSION_VARS['myVar'] = 'some new value';
>>>print $HTTP_SESSION_VARS['myVar'];
>>>
>>>Kirk
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>From: Lee Stewart [mailto:lstewartdsgroup.com]
>>>>Sent: Wednesday, May 14, 2003 9:45 AM
>>>>To: php-generallists.php.net
>>>>Subject: Re: [PHP] Session files in /tmp are zero length
>>>>
>>>>
>>>>I did add the error_reporting, but still saw no errors...
>>>>
>>>>Here's the majority of the code:
>>>>error_reporting(E_ALL);
>>>>$errmsg = '';
>>>>session_start();
>>>>if( isset($username) ) {
>>>> require_once('Connections/mySql.php');
>>>> mysql_select_db($database_mySql, $mySql) or
>>>>die(mysql_error($mySql));
>>>> $rs = mysql_query("select * from employee where
>>>>initials = '" .
>>>>strtoupper($username) . "'", $mySql) or die(mysql_error($mySql));
>>>> if( !(mysql_num_rows($rs)) ) { // not valid username
>>>> mysql_free_result($rs);
>>>> $errmsg = "Invalid Userid";
>>>> unset($username);
>>>> }
>>>> else { // valid user, now validate password and status
>>>> $row = mysql_fetch_assoc($rs);
>>>> mysql_free_result($rs);
>>>> if( $row['pw'] == $password ) { // if
>>>>correct password
>>>> if( $row['status'] == 'a' ||
>>>>$row['status'] ==
>>>>'m' ) { // if active user
>>>> $_SESSION["username"] = $username;
>>>> $username = strtoupper($username);
>>>> session_register("username");
>>>> $authlevel =
>>>
>>$row['status']=='a'?1:2;
>>
>>>> session_register("authlevel");
>>>> mysql_query("update employee set
>>>>lastlogin = " . (time()-10800) . " where initials = '$username'",
>>>>$mySql) or die(mysql_error($mySql));
>>>> echo "<meta http-equiv=refresh
>>>>content=\"0; url=browse.php\">";
>>>> exit;
>>>>
>>>>What follows just closes out the if's and has the html for
>>>>the page to
>>>>be redisplayed on an invalid userid/password.
>>>>
>>>>It does accept the userid/password, validates it, but when
>>>
>>it gets to
>>
>>>>the second page (browse.php), it does not know the username
>>>>or authlevel.
>>>>
>>>>When I take a look at /tmp (it's on Linux), I see the
>>>>sess_.... file(s),
>>>>but it's zero length... No variable names, no values.
>>>>
>>>>Like I mentioned, I'm migrating this from a PHP 4.0.3 system
>>>>to 4.2.2.
>>>>register_globals is ON. And /tmp is world writable..
>>>>
>>>>I've even tried the "new" '$_SESSION["username"] =
>>>>$username;' syntax,
>>>>with the same results. (Though I have to admit that I'd hate
>>>>to have to
>>>>recode the entire app to change all the session_register stmts!)
>>>>
>>>>Thanks for any adivce...
>>>>Lee
>>>>
>>>>
>>>>
>>>>Kirk Johnson wrote:
>>>>
>>>>
>>>>>Start by setting the error reporting level to max, using:
>>>>>
>>>>>error_reporting(E_ALL);
>>>>>
>>>>>We may need to see some representative code to help.
>>>>>
>>>>>Kirk
>>>>
>>>>
>>>>--
>>>>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
>>
>

attached mail follows:


Try adding a session_write_close() before pushing the header.

> -----Original Message-----
> From: Lee Stewart [mailto:lstewartdsgroup.com]
> Sent: Wednesday, May 14, 2003 9:54 AM
> To: php-generallists.php.net
> Subject: Re: [PHP] Session files in /tmp are zero length
>
>
> Thanks for the suggestion... Trying your simple test, page2 comes up
> with "test is". And I get another new sess_... file in /tmp, also zero
> bytes....
>
> Lee
>
> Kirk Johnson wrote:
> > Sorry, I am stumped. I would start out with the simplest test
> page I could
> > make, and see if you can get that to work:
> >
> > page.php
> > <?
> > session_start();
> > $test='foobar';
> > session_register('test');
> > header('Location: page2.php');
> > ?>
> >
> > page2.php
> > <?
> > session_start();
> > echo "test is $test<br>";
> > ?>
 

attached mail follows:


Be sure to check your server error logs for any errors associated with the
request to page.php.

Is there an .htaccess file sitting around that has register_globals set to
'off'?

Kirk

> -----Original Message-----
> From: Lee Stewart [mailto:lstewartdsgroup.com]
> Sent: Wednesday, May 14, 2003 10:54 AM
> To: php-generallists.php.net
> Subject: Re: [PHP] Session files in /tmp are zero length
>
>
> Thanks for the suggestion... Trying your simple test, page2
> comes up
> with "test is". And I get another new sess_... file in /tmp,
> also zero
> bytes....
>
> Lee

attached mail follows:


Thanks for the thought, but same behavior.. Zero length session file, no
vaules passed...
Lee

At 12:06 PM 5/14/2003, Jennifer Goodie wrote:
>Try adding a session_write_close() before pushing the header.
>
> > -----Original Message-----
> > From: Lee Stewart [mailto:lstewartdsgroup.com]
> > Sent: Wednesday, May 14, 2003 9:54 AM
> > To: php-generallists.php.net
> > Subject: Re: [PHP] Session files in /tmp are zero length
> >
> >
> > Thanks for the suggestion... Trying your simple test, page2 comes up
> > with "test is". And I get another new sess_... file in /tmp, also zero
> > bytes....
> >
> > Lee
> >
> > Kirk Johnson wrote:
> > > Sorry, I am stumped. I would start out with the simplest test
> > page I could
> > > make, and see if you can get that to work:
> > >
> > > page.php
> > > <?
> > > session_start();
> > > $test='foobar';
> > > session_register('test');
> > > header('Location: page2.php');
> > > ?>
> > >
> > > page2.php
> > > <?
> > > session_start();
> > > echo "test is $test<br>";
> > > ?>
>

----------
Lee A. Stewart
Senior Systems Engineer
Sytek Services, a division of DSG
www.sytek-services.com
www.dsgroup.com
Email: lstewartdsgroup.com
Phone: (719) 566-0188
Fax: (719) 566-0655

attached mail follows:


Do you have cookies enabled in your browser? If not, then two session files
would have been created in the 2-page test below, one with 18 bytes, one
with 0 bytes.

> > > Thanks for the suggestion... Trying your simple test,
> page2 comes up
> > > with "test is". And I get another new sess_... file in
> /tmp, also zero
> > > bytes....
> > >
> > > Lee
> > >
> > > Kirk Johnson wrote:
> > > > Sorry, I am stumped. I would start out with the simplest test
> > > page I could
> > > > make, and see if you can get that to work:
> > > >
> > > > page.php
> > > > <?
> > > > session_start();
> > > > $test='foobar';
> > > > session_register('test');
> > > > header('Location: page2.php');
> > > > ?>
> > > >
> > > > page2.php
> > > > <?
> > > > session_start();
> > > > echo "test is $test<br>";

attached mail follows:


Sorry, no errors mentioning php anything anywhere... No .htaccess
either And I had to turn on register_globals in php.ini to get it to
read the web forms the way it's coded. Since turning that on now gets
data from the web form, I know it's working...

And yes, cookies are enabled, but I'm not telling it to create cookies,
just the session data...

The more I look around, the more I can't help but wonder since it worked
on 4.0.3 and now fails on 4.2.2, and even your simple example fails, it
must be either something in PHP that's broken, or something in the PHP
setup... Yes?

Lee

Kirk Johnson wrote:
> Do you have cookies enabled in your browser? If not, then two session files
> would have been created in the 2-page test below, one with 18 bytes, one
> with 0 bytes.
>
>
>>>>Thanks for the suggestion... Trying your simple test,
>>>
>>page2 comes up
>>
>>>>with "test is". And I get another new sess_... file in
>>>
>>/tmp, also zero
>>
>>>>bytes....
>>>>
>>>>Lee
>>>>
>>>>Kirk Johnson wrote:
>>>>
>>>>>Sorry, I am stumped. I would start out with the simplest test
>>>>
>>>>page I could
>>>>
>>>>>make, and see if you can get that to work:
>>>>>
>>>>>page.php
>>>>><?
>>>>>session_start();
>>>>>$test='foobar';
>>>>>session_register('test');
>>>>>header('Location: page2.php');
>>>>>?>
>>>>>
>>>>>page2.php
>>>>><?
>>>>>session_start();
>>>>>echo "test is $test<br>";
>>>>

attached mail follows:


>>>>>$test='foobar';
>>>>>session_register('test');

reverse these two lines in your test script.
register the variable first, then assign a value to it.

session_register('test');
$test='foobar';

Jame Hicks

-----Original Message-----
From: Lee Stewart [mailto:lstewartdsgroup.com]
Sent: Wednesday, May 14, 2003 3:24 PM
To: php-generallists.php.net
Subject: Re: [PHP] Session files in /tmp are zero length

Sorry, no errors mentioning php anything anywhere... No .htaccess
either And I had to turn on register_globals in php.ini to get it to
read the web forms the way it's coded. Since turning that on now gets
data from the web form, I know it's working...

And yes, cookies are enabled, but I'm not telling it to create cookies,
just the session data...

The more I look around, the more I can't help but wonder since it worked
on 4.0.3 and now fails on 4.2.2, and even your simple example fails, it
must be either something in PHP that's broken, or something in the PHP
setup... Yes?

Lee

Kirk Johnson wrote:
> Do you have cookies enabled in your browser? If not, then two session files
> would have been created in the 2-page test below, one with 18 bytes, one
> with 0 bytes.
>