Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. The point Daniel was making is that no, there is no way for a server-side language to directly check if a file exists on the user's computer. Javascript has limited capabilities for this, but user has to have permissions set to allow for it. Also, as Dan pointed out, you can use Java to make an applet (or similar item, like an ActiveX control). But that involves the user allowing it to run and giving it permission to do it. So basically to make a long story short, no, there is nothing available for a server to just check what's on a user's computer without them knowing. And no, javascript cannot somehow utilize a form file field (the "browse" button thing you mentioned). It is programmed not to be able to. If you're trying to be sneaky about it, I suggest you write some applet or activeX control or some browser addon or some stand-alone app that's novel or hip or "useful" and get the user to click on some ToS with really fine print very obscurely written, that says your little "widget" can/will do something like that. That is, if you have no problem sleeping at night doing that sort of thing.
  2. and don't forget to make it reset if user enters in right name/pw.
  3. the same way you loaded the iframe up in the first place. Only add the var to it echo "<iframe src='blah.php?variable=" . $variable ."'></iframe>";
  4. how should we know whether the string is a series or not? That's just random data to someone on the outside. You need to explain what in the string makes it a series or not. Same thing with your question about whether its a release or not. Sure, I could tell that the last 2 don't have dots in it, so check if there's dots in there, but that may or may not help you. How would I know whether releases in general would have dots in them or not? It's all just random arbitrary data to us outsiders. In other words, you need to explicitly define what constitutes a series and release.
  5. QFT.
  6. considering he forgot the semicolon on the line before the echo, it won't even do that.
  7. in your database > table where you setup the column you can assign a default value. I'm kind of curious as to why you are hardcoding an array only to turn around and implode it though...why not just format it the way you want to to begin with...
  8. constants you can redefine are called variables.
  9. so..you can't decide whether this is a php or sql question, so you opt for option #3: post in the site comments forum that practically jumps right off your screen screaming at you DON'T POST CODING PROBLEMS HERE. brilliant. I have a sneaking suspicion I know what the real issue is... thread closed.
  10. Are you saying you want php to parse a string as if it were code? eval Though if you explained what your overall goal here is, there's probably a better solution...
  11. see look, I just cloned it: <teaser link removed> Tell you what, I'll sell it to you
  12. If kids put even half as much effort into actually doing the work for themselves as they do in trying to cheat, maybe I wouldn't weep when I think about the future.
  13. you forgot the ? in the query string for the links.
  14. that is true! we could just outsource the math operations to something else and have the value returned! brilliant!
  15. ...and this is why trying to make proprietary software is losing popularity, in favor of open source software. Focus making money on services, not products!
  16. see you're using addition and subtraction though. That will only work in php6+ and if he has that, he could just multiply by 100 in the first place.
  17. php does not support multiplication before version 6. It also features other advanced things like addition and subtraction. They are still working on division; since dividing by zero is impossible, the developers are working on a way for php to fall back on an error message instead of completely crashing. They do not expect for php to be capable of division operations until at least version 7. php6 is relatively new; most people are still using some version of 4 or 5. So unless you've downloaded and installed php6, You will have to do it by other means. You can, for instance, do this (requires php5. If you're still on 4, then I suggest upgrading...): $place = 3; // if you have a leading 0, must make this 1 more to account for it! $string = "0.6278"; $string = str_replace('.','',$string); $string = str_split($string); foreach ($string as $pos => $n) { $newString .= ($pos == $place)? "." . $n : $n; } $newString = (float) $newString; echo $newString;
  18. method 1: run a query that grabs all ids. Store ids in a session array. (only run query if session array doesn't exist, so it's not being run every page load). Use next to get the next id in the array and run your query off that. Wrap it in a condition. If next returns false, use reset instead of next and run your query off that. method 2: user presses the next link, run a query where id > current id, ordering by id asc limit 1. wrap it around a condition. If 0 results are returned, run a query ordering by id asc limit 1 to get first id.
  19. lol umm you fubared your math again...and besides that, you're over-complicating it... substr($file,-3);
  20. I don't know why on earth someone would choose that over substr but regardless, you made a small fubar in judgement. strlen returns length of string but elements start at 0 not 1 so it would be $fl-1,$fl-2,$fl-3 not $fl,$f-1,$fl-2
  21. what's wrong with using substr? anyways...you could always explode at the dot and look at the 2nd element of the returned array
  22. md5 and rand are php functions. They need to be outside of your query string quote so php will parse it.
  23. ah I wasn't 100% whether dot loses its superpower inside class or not and I didn't feel like looking it up :/
  24. If you're highly sought after, then it's more than likely because of word-of-mouth. So if you tell someone to piss off, that may have farther reaching repercussions than you intend. Quickly lose your references and "highly sought after" status. You aren't exactly providing a service that someone else can't duplicate. Not like being an artist or designer or something. Your value is in being able to pump out some decent code in a decent amount of time and being likable in the process. I mean really, the ultimate goal of a freelancer is to have steady work within a pool of reoccurring clients. Less clients the better (just less to keep track of). That sure does sound awfully similar to having a full time regular job... except you have to pay self-employment taxes and you don't get any company benefits like paid vacation, medical, 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.