php-windows Digest 16 Feb 2004 12:44:51 -0000 Issue 2124

Topics (messages 22826 through 22840):

how to create a image with only 2 colors, B&W ?
        22826 by: yuegong
        22828 by: Svensson, B.A.T. (HKG)

test
        22827 by: pradeep

header-session problem
        22829 by: Sudeep Sarath
        22830 by: Alan McDonald
        22831 by: Svensson, B.A.T. (HKG)
        22832 by: Svensson, B.A.T. (HKG)
        22833 by: Alan McDonald
        22834 by: Donatas
        22835 by: Svensson, B.A.T. (HKG)
        22836 by: Svensson, B.A.T. (HKG)
        22837 by: Svensson, B.A.T. (HKG)
        22838 by: Alan McDonald
        22839 by: Alan McDonald
        22840 by: Svensson, B.A.T. (HKG)

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 ---
Hi:

    I want to create a image which only has 2 colors , B&W , how to do this ?

    thanks !

yuegong

--- End Message ---
--- Begin Message ---
> I want to create a image which only has 2 colors ,
> B&W , how to do this ?

Type some text in notepad.exe, then you
will have an images with only two colors.

If you want a single bit map (monochrome),
then you might use MS paint for this... 

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

--- End Message ---
--- Begin Message ---
Dear php-freaks,
 
My o/s is Windows 98 SE. I am using PWS as my web server and i use recent version of 
php (i guess php 4.3.4). I recently started working on PHP and came across this 
problem.
I have three pages. i.e page1.php, page2.php, page3.php.
 
Page1.php
 
<HTML>
<BODY>
<form name=form1 action=page2.php method=post>
<input type=text name=t1>
</form>
</body>
</HTML>
 
Page2.php
 
<?php ob_start(); ?>
<?php
session_start();
$_SESSION["check"]=$_POST["t1"];
header("Location: http://www.mypage.com/page3.php";);
?>
 
Page3.php
 
<?php
echo $_SESSION["check"];
?>
 
 
So i want page3.php to display what i typed in the text field of page1.php.
 
But page3.php says undefined variable in $_SESSION........
That means session is lost when i redirect to page3.php from page2.php.
 
If i echo that SESSION in page2.php itself. It dispalys correctly. So i think that 
there is a problem with header and session. Please anyone tell me how to get over this.
 
 
 

Yahoo! India Insurance Special: Be informed on the best policies, services, tools and 
more.

--- End Message ---
--- Begin Message ---
I'm afraid that's not what the seesion is all about.
The session is a unique value. It is assigned to a cookie if specified in
php.ini or is tagged along in all your URLs as a query string or $_GET and
has the name PHPSESSID by default unless you change it.
If you want to save something fro page 1 and retrieve it in page 3, then you
will need to do the same hing and store this value as a cookie.
$_COOKIE['cookiename'] will retrieve it.
But there are some provisos. You cannot assign a cookie value and set
header("Location.. etc on the same page, the cookie will not be set. You
need to set a cookie and let the page return to the browser.
That's with Windows environments anyway.

Alan

"Sudeep sarath" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Dear php-freaks,
>
> My o/s is Windows 98 SE. I am using PWS as my web server and i use recent
version of php (i guess php 4.3.4). I recently started working on PHP and
came across this problem.
> I have three pages. i.e page1.php, page2.php, page3.php.
>
> Page1.php
>
> <HTML>
> <BODY>
> <form name=form1 action=page2.php method=post>
> <input type=text name=t1>
> </form>
> </body>
> </HTML>
>
> Page2.php
>
> <?php ob_start(); ?>
> <?php
> session_start();
> $_SESSION["check"]=$_POST["t1"];
> header("Location: http://www.mypage.com/page3.php";);
> ?>
>
> Page3.php
>
> <?php
> echo $_SESSION["check"];
> ?>
>
>
> So i want page3.php to display what i typed in the text field of
page1.php.
>
> But page3.php says undefined variable in $_SESSION........
> That means session is lost when i redirect to page3.php from page2.php.
>
> If i echo that SESSION in page2.php itself. It dispalys correctly. So i
think that there is a problem with header and session. Please anyone tell me
how to get over this.
>
>
>
>
> Yahoo! India Insurance Special: Be informed on the best policies,
services, tools and more.

--- End Message ---
--- Begin Message ---
Try with a session_start() in page 3. Does that help?

-----Original Message-----
From: Sudeep Sarath
To: [EMAIL PROTECTED]
Sent: 2004-02-16 10:18
Subject: [PHP-WIN] header-session problem
 
Page3.php
 
<?php
echo $_SESSION["check"];
?>
 
 
So i want page3.php to display what i typed in the text field of
page1.php.
 
But page3.php says undefined variable in $_SESSION........
That means session is lost when i redirect to page3.php from page2.php.

--- End Message ---
--- Begin Message ---
Are saying that session can not persist over different pages?

-----Original Message-----
From: Alan McDonald
To: [EMAIL PROTECTED]
Sent: 2004-02-16 10:57
Subject: [PHP-WIN] Re: header-session problem

I'm afraid that's not what the seesion is all about.
The session is a unique value. It is assigned to a cookie if specified
in php.ini or is tagged along in all your URLs as a query string or $_GET
and has the name PHPSESSID by default unless you change it.
If you want to save something fro page 1 and retrieve it in page 3, then
you will need to do the same hing and store this value as a cookie.
$_COOKIE['cookiename'] will retrieve it.
But there are some provisos. You cannot assign a cookie value and set
header("Location.. etc on the same page, the cookie will not be set. You
need to set a cookie and let the page return to the browser.
That's with Windows environments anyway.

Alan

--- End Message ---
--- Begin Message ---
session is a session ID and it's stored as a cookie. cookies persist but
when you setup php as a cgi it's a cgi appliaction - that means nothing
persists in the context of the application running on the server. Unlike
e.g. ASP where an application and a session has a persistance layer. WHen
you make an application start point on IIS with ASP and have a global.asa
file - this signifiies an application start point. You will notice that you
can "unload" the application and set new application and new session
variables each time you close the browser and staert a new session. With
CGI - that's not the case. You need to manage your own session with cookies
and the PHPSESSID cookie is where you start to do that.
Alan

Alan

"B.A.T. Svensson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Are saying that session can not persist over different pages?
>
> -----Original Message-----
> From: Alan McDonald
> To: [EMAIL PROTECTED]
> Sent: 2004-02-16 10:57
> Subject: [PHP-WIN] Re: header-session problem
>
> I'm afraid that's not what the seesion is all about.
> The session is a unique value. It is assigned to a cookie if specified
> in php.ini or is tagged along in all your URLs as a query string or $_GET
> and has the name PHPSESSID by default unless you change it.
> If you want to save something fro page 1 and retrieve it in page 3, then
> you will need to do the same hing and store this value as a cookie.
> $_COOKIE['cookiename'] will retrieve it.
> But there are some provisos. You cannot assign a cookie value and set
> header("Location.. etc on the same page, the cookie will not be set. You
> need to set a cookie and let the page return to the browser.
> That's with Windows environments anyway.
>
> Alan

--- End Message ---
--- Begin Message --- bullshit, I have apache and php setup as CGI... in most of my scripts that require to store unsensitive user info while he's online I use sessions. I never used PHPSESSID as well...

replying to orriginal poster:
if you would add session_start(); to your first page I bet things would start working. That's related to the fact mentioned before that cookies/sessions do not save/start if you use redirect. Starting them earlier would do the thing.


/Donny


Alan McDonald wrote:


session is a session ID and it's stored as a cookie. cookies persist but
when you setup php as a cgi it's a cgi appliaction - that means nothing
persists in the context of the application running on the server. Unlike
e.g. ASP where an application and a session has a persistance layer. WHen
you make an application start point on IIS with ASP and have a global.asa
file - this signifiies an application start point. You will notice that you
can "unload" the application and set new application and new session
variables each time you close the browser and staert a new session. With
CGI - that's not the case. You need to manage your own session with cookies
and the PHPSESSID cookie is where you start to do that.
Alan

Alan

"B.A.T. Svensson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]


Are saying that session can not persist over different pages?

-----Original Message-----
From: Alan McDonald
To: [EMAIL PROTECTED]
Sent: 2004-02-16 10:57
Subject: [PHP-WIN] Re: header-session problem

I'm afraid that's not what the seesion is all about.
The session is a unique value. It is assigned to a cookie if specified
in php.ini or is tagged along in all your URLs as a query string or $_GET
and has the name PHPSESSID by default unless you change it.
If you want to save something fro page 1 and retrieve it in page 3, then
you will need to do the same hing and store this value as a cookie.
$_COOKIE['cookiename'] will retrieve it.
But there are some provisos. You cannot assign a cookie value and set
header("Location.. etc on the same page, the cookie will not be set. You
need to set a cookie and let the page return to the browser.
That's with Windows environments anyway.

Alan






--- End Message ---
--- Begin Message ---
Thank u a lot for that information Alan! 

(that explains some few things I have had no time to look into yet. ;)

-----Original Message-----
From: Alan McDonald
To: [EMAIL PROTECTED]
Sent: 2004-02-16 11:35
Subject: Re: [PHP-WIN] Re: header-session problem

session is a session ID and it's stored as a cookie. cookies persist but
when you setup php as a cgi it's a cgi appliaction - that means nothing
persists in the context of the application running on the server. Unlike
e.g. ASP where an application and a session has a persistance layer.
WHen you make an application start point on IIS with ASP and have a
global.asa file - this signifiies an application start point. You will
notice that you can "unload" the application and set new application and new
session variables each time you close the browser and staert a new session.
With CGI - that's not the case. You need to manage your own session with
cookies and the PHPSESSID cookie is where you start to do that.
Alan

Alan

"B.A.T. Svensson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Are saying that session can not persist over different pages?
>

--- End Message ---
--- Begin Message ---
Well, but it does not seams to work that way under ISS6.0.
 
But I need to test this a bit more before I can make any strong statements
about it.

What I seen, however, is this: I have a page that requires one to login. If
one login on this page, and then try to change to another page, then I need
to redo the login procedure again - so it appears like the session is not
persisten over different pages here. However, I need to do some other test
in order to see that I haven't missed some silly things before I can state
that this is really the case.


-----Original Message-----
From: Donatas
To: [EMAIL PROTECTED]
Sent: 2004-02-16 11:41
Subject: Re: [PHP-WIN] Re: header-session problem

bullshit, I have apache and php setup as CGI... in most of my scripts 
that require to store unsensitive user info while he's online I use 
sessions. I never used PHPSESSID as well...

replying to orriginal poster:
if you would add session_start(); to your first page I bet things would 
start working. That's related to the fact mentioned before that 
cookies/sessions do not save/start if you use redirect. Starting them 
earlier would do the thing.

/Donny


Alan McDonald wrote:

>session is a session ID and it's stored as a cookie. cookies persist
but
>when you setup php as a cgi it's a cgi appliaction - that means nothing
>persists in the context of the application running on the server.
Unlike
>e.g. ASP where an application and a session has a persistance layer.
WHen
>you make an application start point on IIS with ASP and have a
global.asa
>file - this signifiies an application start point. You will notice that
you
>can "unload" the application and set new application and new session
>variables each time you close the browser and staert a new session.
With
>CGI - that's not the case. You need to manage your own session with
cookies
>and the PHPSESSID cookie is where you start to do that.
>Alan
>
>Alan
>
>"B.A.T. Svensson" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>  
>
>>Are saying that session can not persist over different pages?
>>
>>-----Original Message-----
>>From: Alan McDonald
>>To: [EMAIL PROTECTED]
>>Sent: 2004-02-16 10:57
>>Subject: [PHP-WIN] Re: header-session problem
>>
>>I'm afraid that's not what the seesion is all about.
>>The session is a unique value. It is assigned to a cookie if specified
>>in php.ini or is tagged along in all your URLs as a query string or
$_GET
>>and has the name PHPSESSID by default unless you change it.
>>If you want to save something fro page 1 and retrieve it in page 3,
then
>>you will need to do the same hing and store this value as a cookie.
>>$_COOKIE['cookiename'] will retrieve it.
>>But there are some provisos. You cannot assign a cookie value and set
>>header("Location.. etc on the same page, the cookie will not be set.
You
>>need to set a cookie and let the page return to the browser.
>>That's with Windows environments anyway.
>>
>>Alan
>>    
>>
>
>  
>

--- End Message ---
--- Begin Message ---
> Well, but it does not seams to work that way under ISS6.0.

Sorry, "ISS6.0" should be "IIS6.0".

--- End Message ---
--- Begin Message ---
Do you have session_auto_start set to on? If so do this and see if things
change. IIS6 does not suffer the same problem as IIS5 in this area
Alan

"B.A.T. Svensson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Well, but it does not seams to work that way under ISS6.0.
>
> But I need to test this a bit more before I can make any strong statements
> about it.
>
> What I seen, however, is this: I have a page that requires one to login.
If
> one login on this page, and then try to change to another page, then I
need
> to redo the login procedure again - so it appears like the session is not
> persisten over different pages here. However, I need to do some other test
> in order to see that I haven't missed some silly things before I can state
> that this is really the case.
>
>
> -----Original Message-----
> From: Donatas
> To: [EMAIL PROTECTED]
> Sent: 2004-02-16 11:41
> Subject: Re: [PHP-WIN] Re: header-session problem
>
> bullshit, I have apache and php setup as CGI... in most of my scripts
> that require to store unsensitive user info while he's online I use
> sessions. I never used PHPSESSID as well...
>
> replying to orriginal poster:
> if you would add session_start(); to your first page I bet things would
> start working. That's related to the fact mentioned before that
> cookies/sessions do not save/start if you use redirect. Starting them
> earlier would do the thing.
>
> /Donny
>
>
> Alan McDonald wrote:
>
> >session is a session ID and it's stored as a cookie. cookies persist
> but
> >when you setup php as a cgi it's a cgi appliaction - that means nothing
> >persists in the context of the application running on the server.
> Unlike
> >e.g. ASP where an application and a session has a persistance layer.
> WHen
> >you make an application start point on IIS with ASP and have a
> global.asa
> >file - this signifiies an application start point. You will notice that
> you
> >can "unload" the application and set new application and new session
> >variables each time you close the browser and staert a new session.
> With
> >CGI - that's not the case. You need to manage your own session with
> cookies
> >and the PHPSESSID cookie is where you start to do that.
> >Alan
> >
> >Alan
> >
> >"B.A.T. Svensson" <[EMAIL PROTECTED]> wrote in message
> >news:[EMAIL PROTECTED]
> >
> >
> >>Are saying that session can not persist over different pages?
> >>
> >>-----Original Message-----
> >>From: Alan McDonald
> >>To: [EMAIL PROTECTED]
> >>Sent: 2004-02-16 10:57
> >>Subject: [PHP-WIN] Re: header-session problem
> >>
> >>I'm afraid that's not what the seesion is all about.
> >>The session is a unique value. It is assigned to a cookie if specified
> >>in php.ini or is tagged along in all your URLs as a query string or
> $_GET
> >>and has the name PHPSESSID by default unless you change it.
> >>If you want to save something fro page 1 and retrieve it in page 3,
> then
> >>you will need to do the same hing and store this value as a cookie.
> >>$_COOKIE['cookiename'] will retrieve it.
> >>But there are some provisos. You cannot assign a cookie value and set
> >>header("Location.. etc on the same page, the cookie will not be set.
> You
> >>need to set a cookie and let the page return to the browser.
> >>That's with Windows environments anyway.
> >>
> >>Alan
> >>
> >>
> >
> >
> >

--- End Message ---
--- Begin Message ---
"Donatas" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> bullshit, I have apache and php setup as CGI... in most of my scripts
> that require to store unsensitive user info while he's online I use
> sessions. I never used PHPSESSID as well...
>

you don't think you do - but you'd better look at your headers
and in any case - watch your language and your attitude
Alan

--- End Message ---
--- Begin Message ---
Actually I have no idea about that.

Most settings are default, including the one you now mention,
since I know I have not changed it. But, thanx for the hint,
I will check that out a.s.a.p.


On Mon, 2004-02-16 at 12:36, Alan McDonald wrote:
> Do you have session_auto_start set to on? If so do this and see if things
> change. IIS6 does not suffer the same problem as IIS5 in this area
> Alan
> 
> "B.A.T. Svensson" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Well, but it does not seams to work that way under ISS6.0.
> >
> > But I need to test this a bit more before I can make any strong statements
> > about it.
> >
> > What I seen, however, is this: I have a page that requires one to login.
> If
> > one login on this page, and then try to change to another page, then I
> need
> > to redo the login procedure again - so it appears like the session is not
> > persisten over different pages here. However, I need to do some other test
> > in order to see that I haven't missed some silly things before I can state
> > that this is really the case.
> >
> >
> > -----Original Message-----
> > From: Donatas
> > To: [EMAIL PROTECTED]
> > Sent: 2004-02-16 11:41
> > Subject: Re: [PHP-WIN] Re: header-session problem
> >
> > bullshit, I have apache and php setup as CGI... in most of my scripts
> > that require to store unsensitive user info while he's online I use
> > sessions. I never used PHPSESSID as well...
> >
> > replying to orriginal poster:
> > if you would add session_start(); to your first page I bet things would
> > start working. That's related to the fact mentioned before that
> > cookies/sessions do not save/start if you use redirect. Starting them
> > earlier would do the thing.
> >
> > /Donny
> >
> >
> > Alan McDonald wrote:
> >
> > >session is a session ID and it's stored as a cookie. cookies persist
> > but
> > >when you setup php as a cgi it's a cgi appliaction - that means nothing
> > >persists in the context of the application running on the server.
> > Unlike
> > >e.g. ASP where an application and a session has a persistance layer.
> > WHen
> > >you make an application start point on IIS with ASP and have a
> > global.asa
> > >file - this signifiies an application start point. You will notice that
> > you
> > >can "unload" the application and set new application and new session
> > >variables each time you close the browser and staert a new session.
> > With
> > >CGI - that's not the case. You need to manage your own session with
> > cookies
> > >and the PHPSESSID cookie is where you start to do that.
> > >Alan
> > >
> > >Alan
> > >
> > >"B.A.T. Svensson" <[EMAIL PROTECTED]> wrote in message
> > >news:[EMAIL PROTECTED]
> > >
> > >
> > >>Are saying that session can not persist over different pages?
> > >>
> > >>-----Original Message-----
> > >>From: Alan McDonald
> > >>To: [EMAIL PROTECTED]
> > >>Sent: 2004-02-16 10:57
> > >>Subject: [PHP-WIN] Re: header-session problem
> > >>
> > >>I'm afraid that's not what the seesion is all about.
> > >>The session is a unique value. It is assigned to a cookie if specified
> > >>in php.ini or is tagged along in all your URLs as a query string or
> > $_GET
> > >>and has the name PHPSESSID by default unless you change it.
> > >>If you want to save something fro page 1 and retrieve it in page 3,
> > then
> > >>you will need to do the same hing and store this value as a cookie.
> > >>$_COOKIE['cookiename'] will retrieve it.
> > >>But there are some provisos. You cannot assign a cookie value and set
> > >>header("Location.. etc on the same page, the cookie will not be set.
> > You
> > >>need to set a cookie and let the page return to the browser.
> > >>That's with Windows environments anyway.
> > >>
> > >>Alan
> > >>
> > >>
> > >
> > >
> > >

--- End Message ---

Reply via email to