Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. [daniel@phpfreaks ~]$ uptime 11:09:38 up 50 days, 17:49, 1 user, load average: 0.12, 0.13, 0.09 Not our server at least.
  2. Personally, I prefer OOP over procedural any time. I simply think it's much better suited for especially larger applications. It's much easier to structure your code, encapsulate things and extend things. In PHP I virtually never write procedurally unless it's a small test snippet I'm writing.
  3. Depends on the context.
  4. That is not OOP, sorry. Try to read the tutorials we have on the main site.
  5. If you just want today +90 days you can just do strtotime('+90 days'). No need for a date to add it to.
  6. http://lmgtfy.com/?q=whois+lookup+php&l=1
  7. That's going to be difficult unless you can teach PHP to speak English.
  8. Sweet! I got +50 gigs on my already infinite plan! They mean "unmetered", their is a limit of usage but its not revealed, its just sale talk. Unlimited mean unlimited. You cannot put a limit on something that is unlimited. This has been discussed numerous times though.
  9. Why do you want to frames? That's been outdated for several years.
  10. Daniel0

    wtf???

    It's the aliens. Finally, we've made contact!
  11. Routing is just a collective term for mapping a request to some sort of resource in your business logic. In fact, it means what you call "bootstrapping" here. Specifically how you do it is not so important (to some extent). You will obviously want some sort of way that has some degree of modularity. E.g., having to alter a switch all the time would be cumbersome, and it would eventually result in a rather large switch; you would want something dynamically defined.
  12. OOP is not just using "classes". OOP is about objects and how these naturally interact with each other. Each object has a state represented by it's internal properties, and they can be manipulated using the public methods they expose (also called the interface). You need to think about objects not classes. A class is merely a blueprint for an object, so to speak. You needn't use OOP if you don't want to. You can use procedural programming. You just need to know that OOP and procedural are not the same thing even though they're both part of the imperative paradigm.
  13. Not if you're like me and your books are all over the place at least.
  14. That would be okay, with a few exceptions: 1) Your properties shouldn't be public. 2) What is up with $this->obj = $obj; all over the place? 3) A width is a numeric value. Why are you storing it as a string? Use a float or int depending on your needs.
  15. lkdjflksjdflkajsdflajsdfk ^^^ what does that say? Now, what do you think will happen if a browser received a load of binary junk?
  16. I don't want to sound demeaning, but looking at your topics, maybe you should reconsider your hobby/career choice? Or maybe you should just stop for a while and take a look at what you're doing. You are failing at really elementary logic all the time. Before someone says I can't say that, I'm saying this as Daniel, not as PHP Freaks admin.
  17. I don't see session_start() anywhere on that page...
  18. Ah, sorry. I could have sworn I saw the word "checkbox" somewhere. Looks so. You could try it out and see if it works You'll need to use isset to make sure you aren't accessing an invalid index though.
  19. First of all, remember that enumerated arrays are zero indexed! Secondly, $_POST is an array, as you know, so if you need to access an array inside $_POST you do like $_POST['some_array']['some_index']. As for the form, you can do like you did, but you can also explicitly specify the index like this: <input type="text" class="text" name="score[5]" id="score_5" /> You'll need to set a value for the checkboxes though. To make it checked when the page loads you will have to add checked="checked".
  20. $unique = true; foreach ($array as $i => $elem) { foreach ($array as $j => $elem2) { if ($i != $j && $elem === $elem2) { $unique = false; break 2; } } } $unique = count(array_unique($array)) == count($array); Plenty of ways. I'm a super genius Edit: So is Maq
  21. You can just do this: if(!empty($_POST['checkbox'])) { // checkbox is checked } It's impossible to have isset($_POST['checkbox']) == false and !empty($_POST['checkbox']) == true simultaneously.
  22. Performance-wise it's irrelevant, but I would recommend using an array. It's much easier to work with, and it's a data structure specifically designed to hold groups of data.
  23. Actually, don't bump at all unless you've shown some sort of progress or are able to provide additional information:
×
×
  • 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.