php4-beta | 200004
Date: 04/28/00
- Next message: Glenn Little: "Re: [PHP4BETA] [REF BUG: 4234] Re: [PHP4BETA] php4 and mysql"
- Previous message: Steve Langasek: "Re: [PHP4BETA] call_user_function() in PHP4"
- Next in thread: Christian Wenz: "Re: [PHP4BETA] cookie, post method form, cycling background"
- Reply: Christian Wenz: "Re: [PHP4BETA] cookie, post method form, cycling background"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
This is my first attempt with cookies, I've run into a prob,
and unfortunatelly, it's 3 AM here. Just can't see it.
Apache / 4b RC2-dev on NT, MSIE5.0 & CC4.7 on NT
goal: 5 backgrounds. User clicks the submit button, next
backbround is displayed, and its number is stored in a cookie.
1 -> 2 -> 3 -> 4 -> 5 -> 1 -> 2 ...
The prob:
display the page, submit the form... nothing happens. (1) submit
again, get the next background... ok. go someplace else, then
back to the page (or reload the page), get the next background.
(2) submit the form, nothing happens, submit again, get the next
background.
Why do those two things happen?
<?
if ( ! isset( $HTTP_COOKIE_VARS['divcookie'] ) )
{
$div = 1 ;
}
else
{
$div = $HTTP_COOKIE_VARS['divcookie'] ;
} ;
if ( 1 == $submitted )
{
( 5 == $div ) ? $setdiv = 1 : $setdiv = $div + 1 ;
setcookie( 'divcookie' , $setdiv , time() + 100000000 , '/e2/div/' , 'cynic.bewotec.cz' , 0 ) ;
} ;
?>
+HTML>
+HEAD>
+/HEAD>
+BODY BACKGROUND="/e2/images/div<?= $div ?>.gif" BGCOLOR="#800000">
<?
echo $HTTP_COOKIE_VARS['divcookie'] ;
?>
+TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" COLS="1" HEIGHT="100%">
+TR VALIGN="BOTTOM">
+TD VALIGN="BOTTOM">
+FORM ACTION="<?= $REQUEST_URI ?>" METHOD="post">
+INPUT TYPE="hidden" NAME="submitted" VALUE="1">
+INPUT TYPE="Image" SRC="/e2/images/div.gif">
+/FORM>
+/TD>
+/TR>
+/TABLE>
+/BODY>
+/HTML>
Btw, sorry for the strange HTML tags, but I can't get
my Eudora send mail in a reasonable way.
____________________________________________________________
Cynic:
A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.
cynic <email protected>
ICQ: 2808 2505
-- PHP 4.0 Beta Mailing List <http://www.php.net/version4/> To unsubscribe, e-mail: php4beta-unsubscribe <email protected> For additional commands, e-mail: php4beta-help <email protected> To contact the list administrators, e-mail: php4beta-admin <email protected>
- Next message: Glenn Little: "Re: [PHP4BETA] [REF BUG: 4234] Re: [PHP4BETA] php4 and mysql"
- Previous message: Steve Langasek: "Re: [PHP4BETA] call_user_function() in PHP4"
- Next in thread: Christian Wenz: "Re: [PHP4BETA] cookie, post method form, cycling background"
- Reply: Christian Wenz: "Re: [PHP4BETA] cookie, post method form, cycling background"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

