Jump to content

pmicro

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Everything posted by pmicro

  1. In your get_language_text($partner) function, you'll probably want to use a switch statement. That will allow you to see which partner value to use (based on $partner) then return the appropriate value, using the language constants you have
  2. Thanks for your help guys - the process of talking it out with you gave me the idea to instead of deleting the cookie (which I still can't do, even with clearing my cookies at browser level, and echoing after it's been deleted, it's still there) I'm simply changing the value to 0, and checking for that in my code. Shady workaround? Yes. Working? Yes Thanks a ton! I'm not going to mark this as solved, as it's not really. But since I have a workaround, it's solved in my book.
  3. Looking through my browser. And the expiration date doesn't change when I run the delete function. Just stays the same date it was when it was set
  4. Looks like you've got <?php ... ?> nested inside of PHP code, that's not going to work. $maritalstatus = '<option value="<?php echo PARTNER126?>" /><?php echo PARTNER126?></option> <option value="<?php echo PARTNER14?>">Never Married</option> ... That code right there is going to make the value of the first option literally be <?php echo PARTNER126?>, which isn't what you want. You're going to want to set up some function to return the text from the language file. Like this: $maritalstatus = '<option value="' . get_language_text('PARTNER126') . '" />' . get_language_text('PARTNER126') . '</option> <option value="' . get_language_text('PARTNER14') . '">Never Married</option> ... function get_language_text($partner) { ... code to return text based on $partner param here ... return $text; }
  5. I can't find any errors on the server - no logs, and adding taht code to the script doesn't do anything either. All I get is the "Delete: 1" echoed text like I'd expect, but FF3 still says joinfree1 is still in my cookies. Stranger thing is that I can update a cookie and have the expiration date update, but can't change the value to '', or set an expiration date in the past...
  6. I was having this same issue earlier today - try turning off your computer, router, and modem (if you're using a cable or dsl modem/router) for a few minutes, then turning back on your modem, then your router, then your computer - there may be a bad path that was cached in one of them. It took care of my problem, hopefully it will work for yours.
  7. I'm trying to get a cookie to delete after it's used in my code, and I can't get it to delete for the life of me. So I pulled the add/delete code out into a separate file, to see if it was something I did wrong, and if I could fix it outside of my script and get it to work, I could add it back in. Alas, no luck, so I'm here to see if one of you geniuses could lend a hand Here's the code: <?php /** * @desc Sets the joinfree cookie * @param string $value The content you want stored in the cookie. Set to '' to delete the cookie */ function set_join_cookie($value) { $domain = '.mydomain.com'; $path = '/'; return setcookie("joinfree1", $value, time()+604800);//, $path, $domain); } /** * @desc Deletes the joinfree cookie */ function delete_joinfree_cookie() { $domain = '.mydomain.com'; $path = '/'; unset($_COOKIE['joinfree1']); return setcookie("joinfree1", false, time() - 31536000);//, $path, $domain); } //echo 'Add: ' . set_join_cookie('http://mydomain.com/joinfree'); echo 'Delete: ' . delete_joinfree_cookie(); ?> I switched the commented line at the bottom between Add/Delete for the test. It added the cookie with no problem, but I could never get it to delete. Also, is the unset command required? I added it when I saw that as a suggestion, but see no need for it, since the $_COOKIE array never gets sent back to the browser, does it? Thanks for your help!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.