Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. Well, that depends. If you were actually using a full 145kb/s it would take you approximately 12 hours to burn through 6gb bandwidth.
  2. No, you are missing the point. Your connection speed is not the same metric as bandwidth. They are two different metrics. Go back to my pipe analogy. Or better yet, here's another analogy: using a hose to fill a pool up with water. The smaller in diameter the hose is, the longer it is going to take to fill the pool up. Your connection speed is like that hose. Now, whether it takes an hour to fill that pool up or 10 hours to fill that pool up, the pool is only so big, and once you fill it up, it's filled. The water being put in the pool is like the data. Bandwidth is how much water is in that pool. So if the pool is a 100 gallon pool, it doesn't matter whether your hose is 145kbps or 20mbps. All that means is how fast the water will flow. But if you have a 6gb cap on your bandwidth, no matter how fast you fill that pool up, once it's filled, it's filled. Point is, bandwidth and connection speed are 2 different metrics, measured 2 different ways.
  3. The question isn't about throughput, it's about consumption limit. Bandwidth is how much data you consume uploading and downloading. Like for instance, if you download a 1mb file, you have used 1mb in bandwidth (well technically a little bit more, but you get the point). So a bandwidth limit is saying for instance "In a month, you can only upload/download x amount of data." Or another way of putting it: it's not how big a pipe the water is going through, but how much water is allowed to go through it, before the door is shut. So for instance, if you had a 50mb/mo bandwidth limit, you could only be able to download that 1mb file 50 times (actually less, if you factor in the bandwidth used for headers, etc..). After that, you would exceed your limit. There would be a block in place saying you have exceeded the limit, and it will not allow you to request anything else until the next month. Or it could kick you to a special rate, kind of like going over on minutes on a cell phone plan...just depends on what's in your ISP's contract/plan.
  4. I am definitely low on the totem pole, but hey, it's better than a McJob. Or working in a...oh I dunno..random example..hmm... grocery store?
  5. You know, I keep hearing good things about it. I might give it a try some day.. But I've never really had the need to use an entire framework before. Never really had a project big enough to warrant it. Don't get me wrong. I'm not saying the whole MVC philosophy is unwarranted. I definitely agree with the principle. But I personally do not do a whole lot of real developing. At least, not on that scale. My job involves making little things to help port data from one thing to another, QA stuff, etc...
  6. Sorry to undermine you too, but the whole racism thing came from when nadeem went back and edited one of his previous posts. That stuff in red wasn't there before. I am guessing that you took me calling you a half-formed monkey as some kind of racist remark? I meant it as imagery for an evolutionary ladder, as you were talking about "progressing" and being "primitive." And nadeem, my comment about us (as in phpfreaks, people who help on the forums) doing your work from you came from you saying the red part here: I mean, I know you can't answer since the thread is locked, but does that not mean that you come here looking help to get your job done? That's how I interpreted it. If that's not what you meant, then I'm sorry. But right here is working proof as to why it is necessary to make an effort in communication.
  7. I never said it was bad nor did i say it wouldn't work but I'm going to leave it with this. Like I already said you are a respected member of this community and i respect your opinion on things and you are right maybe i'm making a to big fuss about it and I now know the pros and cons of using both techniques (I am just someone who doesn't easily do A just because someone said A is better). Anyway thanks for clearing this out! does not seem to go hand-in-hand with And I'm still not so sure about that whole "respected member of the community" thing, but anyways, not blindly taking someone's word for it is a good thing. Always find out why! Always compare! There are some things that are generally a bad idea no matter what. There are also some things that are generally good no matter what. But between those two things is a mile-wide gray zone where everything else falls, because what may work for one situation/setup/whatever may not work for another, etc.. Which is why I question things like that, even if it's apparently included in things like the Zend Framework. I think the odds of me being smarter than everyone involved in the Zend Framework, not to mention everybody who uses it, are pretty damn slim. But I don't see why it should be there. At least, not for this purpose. If someone can jump in and explain it, that would be awesome.
  8. If English is your first language...man I can only imagine what kind of nonsense your urdu, punjabi, hindi and putuhari must be like. Also, it's nice to know that yet another person comes here looking for people to do their work for them. And apparently you don't even care if we don't respect you, as long as we pump out answers for you. Awesome. <placeholder for future sarcasm smiley>
  9. Well I guess pointing someone in the right direction by showing him an example of what won't work is one way to do it, though not if you're telling him that's what he needs to do...
  10. I am not setting anything client-side. For example: <input type="hidden" name="subscription" value="unsubscribe"> <input type="checkbox" name="subscription" value="subscribe"> Yes you are setting something client-side. You are setting a default value. Right. Since you are turning around and validating it server-side, and checking that it's either one or the other, that makes setting the default value in the form superfluous. And to boot: how would you check for allowing only 2 values? You know, I think a ternary would work just fine. Coincidentally, method B already used one. The difference is that in your 2 examples you put that ternary outside of your validating function in method B, whereas right here you are saying that the ternary (or similar condition) would be inside your validating function. In method B, that ternary would be inside the function in the first place, or else there would be no validation function (because a simple on/off would not require it), so in essence, both methods boil down to doing the same exact thing on the server-side, but method A has more client-side coding. Why? Because in this case, you can achieve the same thing by virtue of whether the variable exists or not (or is null, "", "0", etc...) But for intents and purposes, these are all effectively the same thing, so what does that really matter? The point is, in this instance, a checkbox is acting like an on/off switch. Either it is on or it is not. Who cares whether the user tries to change the value or not. Bottom line is that it's either on or it's off. Therefore, you can use a simple ternary to assign one thing if it is on (variable exists), another if it is off (variable does not exist). Are you really proposing that the server-side scripting should somehow further decide whether it is on or off, based on what a user may or may not do to alter the checkbox value? Sure, you can do things like log it as someone potentially trying to hack your system, but you would still be doing that under any scenario, so that's not really something to differentiate these two scenarios. I'm sorry, but I'm just not really coming up with a good reason why you would (or should) bother with kicking back an error to the user if they try to alter a hidden field. "I'm sorry, you have incorrectly filled out this form. Please try again." In the grand scheme of things, there is no reason not to assume a value sent == on, value not sent == off (other than logging it or doing whatever, based on previous paragraph). I don't even know if that bit of code really does what you claim it does. Assuming it does do what you say it does... It sets up a default hidden value of 'subscribe', and a user can over-ride that by checking a visible 'unsubscribe' checkbox. (I assume, based on the context of the code, and the context of this thread). But I'm trying to sit here and think of why that's really necessary, and I'm drawing a blank. Why can't they just assume in the server-side form processing script 'subscribe' and override it based on the existence of the 'unsubscribe' variable? Seriously, I can't think of a reason why not, can you? Which makes adding that hidden field superfluous. In general, just because the Zend framework does something, doesn't automatically make it the right thing to do. Last time I checked, it was made by mere mortals, same as the rest of us mere mortals. But nonetheless, I can't really respond to why it is done in the Zend framework. I'm not really familiar with it. It is an entire framework, not an isolate instance like this here. There could be a lot of reasons why overall it might be better, within the scope of a framework. In general, a framework is meant to cover not just a single instance of something, but cover all sorts of scenarios.
  11. Hey just because I do that you do that doesn't mean everybody else does.
  12. Yeah but...how can you get anywhere or "progress" if nobody can understand you? Or if people don't take you seriously, since you can't be bothered to even make an effort to communicate properly? I mean, I can mostly understand you, but if I were an employer, I would never hire a freelancer that communicates like that. How can I expect you to do the job correctly (or even care enough to do it at all) if you can't (or won't; whatever) even bother with general communication? Not trying to pick on you...you make and live with your own choices. I'm just curious because you previously acknowledged it as a problem, made an effort, and then went back. Thought maybe there was some specific reasoning behind that.
  13. so...you are asserting that by talking like a half-formed monkey, you are actually evolving?
  14. Are you asking how to make a script to do that, as in, getting the contents of a page, altering the content and then display the page? Or are you talking about just seeing an image's alt text instead of the image while randomly surfing some xyz site? If it is the 2nd... that's not really something you would do with php. Disabling images, showing their alt text, etc.. stuff like that is usually built into the browser itself, or addons to the browser.
  15. WolfRage, your solution will cutoff words, which the OP said he does not want. A combo of wordwrap and explode should do the trick: $string = "some really long text"; $string = explode("[TEXTBREAK]",wordwrap($string,110,"[TEXTBREAK]")); // change 110 to whatever amount of chars $newString = $string[0] . "...<a href='somepage.php'>[more]</a>";
  16. <!-- displays a DROPDOWN if it is one --> <?php if ( $rows['gq_type'] == 2 ) { $a = explode(',', $rows['emp_options']); $b = explode(',', $rows['emp_options_value']); echo "<select class='FMselect' name=' " .$rows['emp_id']." '>"; echo "<option>Please Choose</option>"; foreach ($a as $k => $v) { echo "<option value='{$b[$k]}'>" . $v . "</option>"; } echo "</select>"; } ?>
  17. You mean like this? <!-- displays a DROPDOWN if it is one --> <?php if ( $rows['gq_type'] == 2 ) { $a = explode(',', $rows['emp_options']); echo "<select class='FMselect' name=' " .$rows['emp_id']." '>"; echo "<option>Please Choose</option>"; foreach ($a as $v) { echo "<option value='$v'>" . $v . "</option>"; } echo "</select>"; } ?>
  18. Dunno about all that...anyways... Method A: <input type="hidden" name="checkboxName" value="something"> <input type="checkbox" name="checkboxName" value="something_else"> $checkboxName = perform_validation($_POST['checkboxName']); Assuming that perform_validation() performs validation, yes, you are indeed validating the data. But you are setting the default value client-side. Since anybody can change the default value client-side, you are effectively allowing the user to pass anything to perform_validation(). Therefore, perform_validation will have to be scripted to handle that. So at best, if perform_validation() is scripted right, setting a default value clientside is superfluous. At worst, it is a potential security risk, because the user might be able to change the default value to something you didn't think about checking for in perform_validation(). Method B: <input type="checkbox" name="checkboxName" value="something_else"> $checkboxName = $_POST['checkboxName'] ? 'something_else' : 'something'; $checkboxName = perform_validation($checkboxName); No matter what the user sends, it is either going to be changed to 'something_else' or 'something'. Theoretically, with this method, you don't even need to call perform_validation(), as the strings assigned by the ternary is the validation.
  19. See that's my thought. I see a lot of questions that could have easily been googled, or searched for on the forums, but aren't. I think putting up suggestions like that will be kind of like putting up a ToS when registering for something. It's just one more thing to ignore, scroll down and click the 'next' button. Most people just tune out all the stuff between getting from point A to point B. They feel coming to the forum and posting is their due diligence and effort in solving their problem, now someone come in and do their part; wave a magic wand or whatever is done to fix it.
  20. Hey maybe if you slip me some valium I'll become passive and complacent enough to not fight it.
  21. or just like, remove some of the red in the color mix so it's a darker yellow instead of a orange
  22. iknowright everywhere I guess I just emanate destruction. I should be upgraded to Horseman of the Apocalypse.
  23. who says we have to replace them? Why not append instead? Am I the only one who thinks there's some kind of 5'oclock shadow or maybe sunburn shit going on with nrg's smileys?
  24. of course Oh well, was worth a try to mention, alright Hey I'm just one person, and it's just my opinion. No cause for giving up so quickly, lol.
×
×
  • 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.