Jump to content

tastro

Members
  • Posts

    124
  • Joined

  • Last visited

Everything posted by tastro

  1. Thanks! But why shouldn't i include login, logout, register, check if logged in... In the User class? Only an user will need these methods right? So why should i put it into User? What am i not seeing? I just want to understand why these don't belong in the User class...
  2. So how do you think that i should go about it? Should i make a separate class for login, logout and register? thanks for the 2 examples... i think that i know the basics (i red some posts in the tutorial section of this page, and i think that i got a good enough understanding on the basics for a OO beginner like myself), but i would need some good principles how to ground methods...
  3. Hi, I want to make a user class (oop). Could you point me in the right direction? How should i make one? A simple one with would include: "Register", "Login", "Logout", "Check if logged in" and "Change password" to start for example... I'm new to OOP.
  4. thanks to both Andy-H and salathe! i will use html5 and no quotes. hope that it will do enough. thread solved. best regards, tastro
  5. i wouldn't. but the possibility is there. anyways... i think that i got my answer. Thanks!
  6. although i think that you are right, something doesn't make sense for me. for example, if i would put this two flags together: ENT_QUOTES and ENT_NOQUOTES which one would be applied then? thank you for helping me.
  7. that's the problem... i don't know if one flag can overwrite another flag or not... so i don't know if i should use only one or all... but i need all, because if it's only 1 than it's useless to me. the problem is that i copy text from more different sources and some are html and some are html401 and some xhtml. it would be nice if someone would know it 100% that i can use all at once. i can't find any help for that on php.net thanks for your contribute Andy-H
  8. hi, would that work? html_entity_decode($string,ENT_QUOTES|ENT_HTML5|ENT_HTML401|ENT_XML1|ENT_XHTML,'UTF-8') or must i use it like that? html_entity_decode($string,ENT_QUOTES|ENT_HTML5,'UTF-8') best regards, tastro
  9. i solved my problem and all is working fine now. i hope that this will help some people. also first i had it like this: // months must be -1 !!! because it counts from 0 to 11 and not from 1 to 12 var utcdate = new Date.UTC(2011,2,15); and it didn't work because of the "new" before Date.UTC which i didn't knew that it shouldn't be there, because it has to be if you use only Date and not Date.UTC and now it's working perfect like this: var utcdate = Date.UTC(2011,2,15); and you get the time / date in miliseconds i think... you have to divide the time you get with 1000 to get seconds. and then with 60 to get minutes and then with 60 once more to get hours and then with 24 to get days, etc. ...
  10. how to get the current UTC / GMT date? javascript in php i use gmdate() but i can't find a function here... or can't figure it out how to use it. i found this one: Date.UTC() but it doesn't work for me... no idea why... please help.
  11. thanks to all! i think that i got it now. this one was really helpful too: function my_function_name(t1,t2){ var t3 = t1+" "+t2; }
  12. one more thing... when i make a funcion. is this correct? function my_function_name(var t1,var t2){ } or this one? function my_function_name(t1,t2){ } or somehow else? function my_function_name(t1,t2){ var t1=''; var t2=''; }
  13. thank you for the explanation. also it should be all fine like this: var time_now = new Date(); time_now = time_now.getTime(); right? :>
  14. like this: var time_now = new Date(); var time_now = time_now.getTime(); like this: var time_now = new Date(); time_now = time_now.getTime(); like this: time_now = new Date(); time_now = time_now.getTime(); or maybe like this? var time_now = new Date(); var time_now = var time_now.getTime();
  15. yes exactly that's the unix timestamp. sry for the reply before... i didn't even see that you already provided the answer to me. thanks mate! it's working perfect! <script type="text/javascript"> //year/month/date var time_then = new Date(1995,11,17); document.write(time_then.getTime()); var time_now = new Date(); document.write('<br /> '+time_now.getTime()); </script> one more thing... i'm new to javascript, but i'm pretty good at php (i think) how should i write variables in my code? like this: var time_now = new Date(); var time_now = time_now.getTime(); like this: var time_now = new Date(); time_now = time_now.getTime(); or like this? time_now = new Date(); time_now = time_now.getTime();
  16. the problem is that i don't need the time now. i need the to convert a specific date into the unix timestamp for example: 12.12.2012 or 10.10.2011
  17. this one doesn't work. :S with this: <script type="text/javascript"> /*year/month/date*/ var test = new Date(1995,11,17); document.write(test); </script> i get this: Sun Dec 17 1995 00:00:00 GMT+0100 (Central Europe Standard Time) but i need the outcome time in seconds. by seconds i mean UNIX timestamp.
  18. hi, also i want to convert this date 12.12.2012 into seconds. in php i can do it with mktime() but no idea how to do that with javascript. i already googled like crazy but couldn't find anything helpful. please help. thank you, tastro
  19. i need to submit 1 article (3 input fields: title, category, description), to multiple sites. it must be done with 1 click. one more thing... each site to which i have to submit has different input names, but are the same 3, also 1 is for title 1 for category and 1 for description.
  20. lol, i don't know how i missed your post andy, but your code works like a charm! thank you big time! also this one works perfect! <?php $array=array('22'=>'22','1'=>'1','13'=>'13'); $array=array_flip($array); natsort($array); $array=array_flip($array); print_r($array); ?>
  21. maybe it's because i get an error, this one: "Warning: natsort() expects exactly 1 parameter, 2 given" but i don't know what's wrong and how to fix it. :S this is my code: <?php $array = array( 22 => 22, 1 => 1, 13 => 13 ); uksort($array,'natsort'); print_r($array); ?>
  22. show images after people scroll down the page - don't load them immediately after the page is loaded. also the images which are below the scroll should be first loaded when an user scrolls down. i need a javascript for that, but i don't want jquery! the code should be as short as possible. thank you.
  23. 1. with your code, i get this error: "Warning: natsort() expects exactly 1 parameter, 2 given" 2. i tryed it like this: <?php $array = array( 22 => 22, 1 => 1, 13 => 13 ); uksort($array, 'natsort'); print_r($array); ?> but it doesn't work. i get this: Array ( [13] => 13 [1] => 1 [22] => 22 ) but it should be like this: Array ( [1] => 1 [13] => 13 [22] => 22 )
×
×
  • 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.