Erik, 1. Did you just try setting a cookie, plain, with no conditions. 2. Have you tested your conditions, or added a test, equivalent to what you do when you set the cookie? In other words, change setcookie to this ....
if ($type_sel) { setcookie("font[type]", $type_sel, time()+3600) ; echo "type_sel: $type_sel; } 3. Are you getting any errors when you try to set the cookie? Miles On Wednesday 26 December 2001 05:07 pm, Erik Price wrote: > I used > > <code> > <?php > // cookie_test.php > > if ($type_sel) setcookie("font[type]", $type_sel, time()+3600) ; > if ($size_sel) setcookie("font[size]", $size_sel, time()+3600) ; > > </code> > (without the <code /> tags) > This is a page which calls itself ($PHP_SELF) (is there a name for > those?). And these variables are set by choosing from a select-list at > a different part of this page. It's very basic, no if or case > statements -- just basically a page that delivers a pair of values > (font[type] and font[size]) to setcookie() and then checks to see if > there is a cookie in the browser that matches this description. If > there is, it outputs some simple data, and at the very bottom it echoes > the contents of all variables so I can check and make sure everything's > working. That's how I know that the setcookie() function doesn't seem > to work -- there's no value in the cookie variables but if I echo the > variables that I used ($type_sel and $size_sel) then it outputs the data. > > I'll read about IE, it's 5.1 for Mac OS X. > > > Erik > > On Wednesday, December 26, 2001, at 03:12 PM, Miles Thompson wrote: > > Erik > > > > What code are you using to set your cookie? > > Are you certain the expiry date is in the future? > > What browser are you using? There are notes in the online manual > > (www.php.net/setcookie()) regarding IE. > > > > Miles > > > > On Wednesday 26 December 2001 04:01 pm, Erik Price wrote: > >> Hello, > >> > >> I am having a problem testing out the use of cookies. I'm using a > >> tutorial from Wrox's "Beginning PHP4". It seems that I'm doing > >> everything correctly, but when I try to access the page in my > >> browser, I > >> am not prompted as to whether or not I'd like to accept a cookie (which > >> is something that I have configured my browser for), nor do the values > >> that I assigned to the cookies show up in the test variables that I > >> included on the page for just this purpose. In other words, I'm not > >> sure that the setcookie() functions are working -- the variables that I > >> set using "setcookie()" don't seem to be turning up on the page, but > >> the > >> standard form-based variables that I used (as values in the setcookie() > >> function) turn up just fine. > >> > >> Do I need to have my web server specially configured for using cookies? > >> I don't see anything in httpd.conf about this. > >> > >> My setup is as follows: > >> > >> Darwin 1.4.1 on PowerBook G3 (Bronze edition, no firewire) > >> Apache 1.3.22 > >> configured with --enable-module=most --enable-shared=max > >> DSOs: mod_dav, mod_hfs_apple, mod_php > >> (PHP 4.0.6) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]