Jump to content

Alex

Staff Alumni
  • Posts

    2,467
  • Joined

  • Last visited

Everything posted by Alex

  1. At a quick glance I noticed a few problems. Your main issue is that in your submit handler your if statement is messed up. if(validateName() & validatePhone() & validateEmail()) You want to be using the AND operator, &&. One other small thing I noticed is that inside of your validateName function you have a typo with one of the variable names: nameo.text("Enter Name"); That should be name, not nameo.
  2. Can you explain how you expect this commission system to work?
  3. 1+i Man, my math is rusty. Is that complex or imaginary? Complex, the "i" is the imaginary part. A complex number just consists of a real and imaginary number, the real part being 1 in this case, and the imaginary part being i. It's pretty simple, actually.
  4. Try: $myVar="friend_form.php?id_property=" . $row_properties_RS['id_property'];
  5. Do you have the function post_chat()? I've tried the example and it works. For example try this: $(function(){ $(document.documentElement).keydown(function(e){ if (e.keyCode == 13) { alert('it works!'); return false; } }); }); And press enter on the page.
  6. Buttons don't trigger key events like an input would. If you want to listen for the enter button being pressed for the whole page then listen on document.documentElement. $(function(){ $(document.documentElement).keydown(function(e){ if (e.keyCode == 13) { post_chat(); // function to run after enter is hit return false; } }); });
  7. This should work too: echo implode(' ', $pers['Steve']); Yeah, in that case that will work just as well, but you might want to be careful. In general associative arrays aren't required to have an associated order. With PHP order will be maintained in associative arrays since they're implemented as essentially being hash tables, but you shouldn't assume this in general. For example, if you want to achieve associative array functionality in JavaScript you're going to have to use objects (which aren't "real" associative arrays for other reasons but that's besides the point in this example) which are an unordered set of name/value pairs, so it's not guaranteed that order will be preserved. So imagine that this array was coming from JSON data, you have no real way of ensuring the order is going to be what you expect, so the output might not be in the order you were after.
  8. The file needs to have the permissions.
  9. If you don't know, Google it. A simple google for "windows file permissions" will yield you all you need. http://support.microsoft.com/kb/308419
  10. @ is used to for error suppression, so that would hide the error but not fix it. First I'd check to make sure your path is correct. Is it supposed to be "images/" and not "mages/" (just a guess ). After that I'd make sure that this file has proper permissions. This means the file must have write permissions to the directory you're trying to remove the file from.
  11. I'd suggest reading the comments on the php manual page for unlink(), there's a fair amount of discussion about this error and the various things that could cause it there. http://php.net/manual/en/function.unlink.php
  12. Well, it's a multidimensional array so $pers["Steve"] itself is an array, so to add one of the elements you'd do something like: $pers["Steve"]["eyes"] For the specific output you asked you'd do something like: echo $pers["Steve"]["eyes"] . " " . $pers["Steve"]["age"] . " " . $pers["Steve"]["race"];
  13. The OP wanted it to be 5-50 exclusive, so you'd need to do range(6, 49). But even then this would only work if $nr can only have integer values. For decimals it wouldn't work.
  14. Google's getting really good with this type of stuff. Here's a blog post from just a few days ago on this: http://swapped.tumblr.com/post/23133779276/google-bot-now-crawls-arbitrary-javascript-sites
  15. 170FPS is probably right. Browsers throttle timers to a minimum limit, so your setTimeout('Main()', 1) isn't being called every millisecond. Each browser is different, I think for chrome the minimum is 3ms and for FF it's 5ms or something like that, but don't quote me on it.
  16. Ever consider WebDrive? That's exactly what that's for.
  17. md5 or sha1 with a salt is enough.
  18. Sure, but I don't want to physically store the files on the computer like dropbox does Dropbox stores the files remotely. But it also stores them on the computer that installs the software, which I don't want. You can modify how dropbox syncs to achieve this functionality, though.
  19. In this case it would be 4, but you have to be careful because that's not necessarily the case just because there are two if/else statements. For example, consider the following code: // $x, $y, $z each given a true or false value if($x) { $y = true; } else { $z = true; } if($x || $z) { } else { } In that case it would be impossible for the else statement on the second if statement to ever be called. If $x had an initial value of true, then the if statement is true, but if $x was false to begin with then $z gets set to true, and as a result the statement, $x || $z is still true.
  20. The n(n+1)/2 is the value for the sum of numbers from 1 to n, so you're just looking for:
  21. Alex

    IE6 Countdown

    http://theie7countdown.com/ http://theie8countdown.com/ http://theie9countdown.com/ and... http://theie10countdown.com/
  22. Do you mean the web? Tim Berners-Lee invented the WWW, not the internet.
  23. Alex

    Json

    Well now you need to loop over data.offers, not just data. So change: $.each(data, function(i,offer){ to: $.each(data.offers, function(i,offer){
  24. In order to prevent any misconception, unless you only worded that badly, empty doesn't "empty the variable". It simply returns whether or not the variable is empty, as the manual states with more detail.
  25. The solution to this debate isn't to ask a bunch of people who have the potential to be biased and uninformed. If anything, the poll will represent the biggest misconception or popular opinion. You should do some research.
×
×
  • 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.