Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. Why can I override certain functions, but not others? Example: (not the real code) [code]<?php Class myClass{   var $str     function extract(){       return $this->str;   }   function print(){     return $this->str;   } } ?>[/code] It's fine with extract(), but when I add in the print() one, I get a parse error saying unexpected print. Why can I do this with extract but not print?
  2. manual... http://us2.php.net/set_cookie the expire arg. Read the examples.
  3. ini_set does not affect register_globals. If you go to the appendix it tells you to and click on register_globals you'll see [quote]register_globals  boolean     Whether or not to register the EGPCS (Environment, GET, POST, Cookie, Server) variables as global variables.     As of PHP 4.2.0, this directive defaults to off.     Please read the security chapter on Using register_globals for related information.     [b]Please note that register_globals cannot be set at runtime (ini_set()). Although, you can use .htaccess if your host allows it as described above. An example .htaccess entry: php_flag register_globals off. [/b]         Note: register_globals is affected by the variables_order directive.     This directive was removed in PHP 6.0.0. [/quote]
  4. mktime is not a datatype, so saying you've got a mktime doesn't help, because it doesn't make sense. I think what you have is a timestamp. $timestamp = 1170115200; echo date("Y-m", $timestamp);
  5. If you just want to use today's time, you can leave the timestamp part blank. echo date("Y-m-d"); to get the current time, do time(), not mktime.
  6. We need to know what's not working. Errors, etc?
  7. Is there any reason to use constants over variables when creating a config-type file? For instance, I have a file which gets included on every page, which contains paths, settings, etc. Is there any good reason they should be constants rather than variables? The only thing I can see is that "the scope of a constant is global", meaning if I want to use it in a function I don't have to use global $var; Your thoughts? Which is better? Does one save time somehow, etc?
  8. The best editor I have ever used is Textpad. Not to be rude, but this is your first PHP project, and you're planning on selling it? Okay, but you don't NEED to obfuscate it. Plenty of php programs are sold without being obscured. File for a copyright for $30 instead of wasting your money on those programs.
  9. break it into substrings and use mktime(); Year, month, day, hour, minutes, seconds. 2007 01 29 00 00 00
  10. Paul - think maybe the 20 is for, oh...2007? :-P The other 6 0's are likely H:i:s - so it's midnight. (edit: didn't preview, sorry.)
  11. Anytime you open a { you must close it.} Get a decent editor (Textpad is good) and it will do syntax highlighting and help with indentation.
  12. Format the timestamp with just "Y-m-d" then use "WHERE datefield LIKE '$tomorrow%'"
  13. Next time in the posting form, highlight your code and press the # button. I don't see what your question/problem is either.
  14. Are you using a huge resolution? :-P
  15. probably some regular expression.
  16. you're using mysql_fetch_array() wrong. Turn on error reporting!
  17. It's my kitten. He's actually grown up now, my new kitten is black. http://jesirose.com/the-cats/
  18. If the server's times are different, time() will be different.
  19. IIRC, ./ means the root directory. I've never seen that in HTML. you'll need to store the username in the session, then before printing the HTML form, check if the username is in the session. If it is, print it out, if not, print the form.
  20. "i dont think u can include like that." Of course you can. Can you show us a live example? "I don't know what you mean by "My login page follows me". I still don't know either. Where is the processing for this form? It goes to itself, but doesn't do anything with the post data?
  21. Out of curiosity, how did you find out the users were doing this?
  22. No, you have to start somewhere, and we'll help you when you get stuck. Where are you stuck? You know how to get the words out of the database? If so, use a function like substr to get the first X chars.
  23. After your insert, do $id = mysql_insert_id(); To get the most recent id at a later time, "SELECT * FROM admin ORDER BY id DESC LIMIT 1"
  24. "what do i put beneath session_start? " The rest of your code. Huggie: you know you can even just do php.net/function and it goes right to it? (I'm a sucker for any shortcuts) so php.net/array is for arrays, php.net/substr, etc.
×
×
  • 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.