Jump to content

siteturbo

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

About siteturbo

  • Birthday 08/01/1967

Profile Information

  • Gender
    Male
  • Location
    USA

siteturbo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I thought about doing something similar, however, don't all those zeros padded on the right take up storage space?
  2. Hello, I am creating a field for numbers. For example I want to store the following: 94 81.25 689 5 What is the best way to store these numbers if I want to order them later by their numerical value. For example, I want to store and then order them from max to min (DESC), like this: 689 94 81.25 5 If I use a VARCHAR field type it sorts DESC like this (stores correctly, but sorts non-numeric). 94 81.25 689 5 If I use a DECIMAL (10,5) field type for example, it orders/sorts them correctly however it stores and displays the numbers like this (don't want those extra zeros!): 689.00000 94.00000 81.25000 5.00000 However, I want to sort, store, and display like this (no extra zeros and correct numerical order): 689 94 81.25 5 Thanks in advance.
  3. When I do a var_dump(headers_list()); This is what I get: array(5) { [0]=> string(23) "X-Powered-By: PHP/5.3.6" [1]=> string(38) "Expires: Thu, 19 Nov 1981 08:52:00 GMT" [2]=> string(77) "Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0" [3]=> string(16) "Pragma: no-cache" [4]=> string(77) "Set-Cookie: TestCookie=my+cookie+value; expires=Fri, 29-Apr-2011 21:57:57 GMT" } Why does it say Expires: 1981?
  4. Here you go... <?php ini_set('date.timezone', 'America/Los_Angeles'); $expire = time() + 60*60*24*30; // 30 days $value = "my cookie value"; setcookie("TestCookie",$value, $expire, '/', '.mydomain.com'); ?> Do you think the mod_expire module (which is installed per the phpinfo) could have anything to do with it. See apache doc here http://httpd.apache.org/docs/2.0/mod/mod_expires.html
  5. Could it be a cache setting in the php.ini file? Hmmmmm...
  6. I actually got PHP to update using the directions found at http://en.ispdoc.com/index.php/Updating_PHP_in_CentOS_Linux#Updating_PHP_and_MySQL However, the cookie problem is still there even with php 5.3.6. I'm thinking it must be a setting in php.ini, maybe a setting somewhere????
  7. Thanks for the suggestions. I appreciate your help thus far.
  8. I did the "yum update", and it updated all kinds of stuff. After the update I rebooted the machine and did a phpinfo() and everything is the same, ie php 5.1.6. does that mean I need to compile it?
  9. I really don't know. This is a new server that came with PHP already installed. How would I find that out? Thanks. :-)
  10. It's been a while since I've upgraded like this. I have centos 5.5 and yum installed on the server. Do you have any instructions on how to upgrade? Thanks.
  11. I've actually thought of that. However, I thought I would try the least effort approach first. If push comes to shove, I may have to upgrade. :'( You could find that out by upgrading to 5.3.6
  12. Well, I've tried it in 4 browsers: Firefox, Chrome, Safari, and IE, and they all function the same way. The persistent cookie can not be set using PHP on my server. It works using a javascript cookie set. So, it's not a browser problem. I'm wondering if there is a php cookie problem in v5.1.6 which i'm running. Set-Cookie: TestCookie=my+cookie+value; expires=Mon, 25-Apr-2011 15:12:27 GMT well that looks right I think. So it can't be a server problem. Are you sure you don’t have any browser plug-ins to clear cookie on close or anything ?
  13. Anybody have any suggestions? Still can't figure out why my server won't set a persistent cookie.
  14. I'm just staying on the page hitting refresh. The cookie gets set, its just expiring at the end of the session (when I close my browser).
  15. Hello, I am having trouble setting a cookie with a future expiration. I am using PHP Version 5.1.6. Here is my code: $expire = time() + 60*60*24*30; // 30 days setcookie("TestCookie",$value, $expire); The cookie gets set, however, the cookie is not persistent and expires when I close my browser. This should not be the case but should expire in 30 days. The time() is correct on the server. Here is the raw http headers: Status: HTTP/1.1 200 OK Date: Sat, 26 Mar 2011 15:12:27 GMT Server: Apache/2.2.3 (CentOS) X-Powered-By: PHP/5.1.6 Set-Cookie: TestCookie=my+cookie+value; expires=Mon, 25-Apr-2011 15:12:27 GMT Content-Length: 126 Connection: close Content-Type: text/html; charset=UTF-8 However, when I open Firefox or Chrome they both say that the cookie will expire when I close the browser. I know that my browser is accepting cookies properly because I see other cookies from other websites in the cookie list that expire with future dates. I've tried setting a cookie in the future with javascript and it works fine, like the following: $jsExpire = date("D, j M Y H:i:s e", $expire); echo " <script> <!--// document.cookie = 'jscookie=testcookie; expires=$jsExpire; path=/' //--></script> "; However, when still trying to set the cookie (before headers are sent which is how php operates), php fails to set the cookie properly. Is there any kind of setting in php ini that could effect cookie expiration dates? Obviously it's not a browser problem since I can set cookies correctly with javascript but not php. I even tried sending cookie with header() like this and it doesn't set in the future: header("Set-Cookie: TestCookie=my+cookie+value; expires=Mon, 25-Apr-2011 17:26:45 GMT; path=/; domain=.mydomain.com"); Any help appreciated.
×
×
  • 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.