Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. MockY, I don't think so. Personally I don't like relying on strtotime() when there are simpler more straightforward methods. The last day of this month can be just date("Y-m-t") // as I posted beforeLast day of next month can be date("Y-m-d", mktime(0, 0, 0, date("n") + 2, 0)) // day #0 of two months awayor if you don't mind the Y-m-t trick date("Y-m-t", mktime(0, 0, 0, date("n") + 1, 1)) // day=1 guarantees no wrapping
  2. Wow, yeah, you really aren't elaborating on any of this. But okay. <?php ob_start("ob_gzhandler"); switch ($_POST["user"]) { case 8104: echo " test 123 test 456 test 789 "; break; case 8105: echo "test 321 test 654 test 987 "; break; }
  3. Tip: strtr can do a bunch of replacements using an associative array, like array( "first" => "1", "JULY" => "7",[edit] And if you're always converting to a number then you can save yourself some repetition by1. Converting the string to all upper- or lowercase (don't need a "july" and "JULY") 2. Using iconv() to "remove" accents from characters (don't need a "ventitre" and "ventitré")
  4. CLI is "command-line interface". It's Windows' Command Prompt and *nix's terminal/console, and SSH gives you remote access to a CLI. You may need to find yourself a quick primer on them before you continue.
  5. Actually I meant more of a literal "what does this output". That will include all the headers, including the Content-Type and Content-Length. And the request method too.
  6. Change your AJAX URL to something like /page2.php?ajaxthen redirect if !isset($_GET["ajax"]). Yes, it does mean that someone could go to "page2.php?ajax" to see the page without a redirection, but it is not possible to strictly allow AJAX only - this is basically as close as you can get.
  7. With 05-31 + 1 month you get 06-31, which wraps to 07-01. date(Y-m-t) from that will give you 2013-07-31 because t=number of days in the month. The actual Y-m-d date is just 2013-07-01. Using "last day of" changes the arithmetic so it only uses the last day of the month: 2013-05 + 1 month is 2013-06 and the last day is 2013-06-30.
  8. Not sure what you're saying. Are those attributes indicating what type of data is contained by the element? What elements are available? Or what's the XML?
  9. I wouldn't at all be surprised if it was a version difference - anecdotally, strtotime() has fluctuated a bit since 5.3.0. But consider using date('Y-m-t')instead anyways
  10. Include a special flag in the AJAX URL so you know the request is coming from the AJAX and not a normal request. If it's not present then redirect. By the way, what you're doing is horrible. How am I supposed to bookmark a page on your site? Link it to friends? Search engines will absolutely hate it.
  11. It helps because what you're literally asking for is impossible. You need to find another way - like with an associative array.
  12. I forget exactly why but some servers will do reverse lookups on you. That can take a few seconds. Manually connect with telnet and see what the server is doing.
  13. With arrow -> notation, think of it like there can be only one "active" namespace at a time. children() can switch the active namespace, like with $entry->children("cap", true)->event There should be a feature request somewhere to allow variable-variable notation with namespaces, like $entry->{"cap:event"}(which doesn't work now).
  14. Nope. It's not supposed to be very flexible: just a list of tables (and maybe views).
  15. Don't fetch associatively?
  16. false !== $resultpreg_match() returns a number corresponding to how many matches were found (ie, 0 or 1). It never returns false. Embrace the loose typing. if ($result) {
  17. Given a few minutes of thought you should be able to guess what to do. How do you think it should work? [edit] Seriously? s and s?
  18. He calculated the "average" to be over the number of arrays, not the number of inputs. (7.50 + 9 + 4.50 + 6.50 + 3.75) / 3 arrays = ~10.42 per array
  19. Okay, rephrase: What does print_r($row);output?
  20. If it's not deleting it (them) then there's probably an error message (or four)... You're sure the "image" from the form is actually "users/Admin/photos/1334.jpg"?
  21. What is the actual contents of $row?
  22. I am so not inclined to help you since the only effort you've shown here is that you can copy/paste entire posts from another forum. You didn't even bother to copy only the text. But it's a very easy answer so I will anyway. Bound variables don't work like simple string replacements. If you want to LIKE a field against a bound string then the string has to be the entire expression - %s and all. $tok = "%" . $tok . "%"; AND evento.titolo LIKE ? OR evento.sottotitolo LIKE ?
  23. That was confusing. You're saying result.add is that array? Or is a string containing the JSON for that array?
  24. Take a look at the documentation for mysqli_fetch_array and compare what it says to how you're using it. Spoiler: not all mysqli functions need the $con2.
×
×
  • 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.