Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. If you say "$y=$x+$z" you are not defining a math equation but are doing an assignment: take $x, add $z, and save that to $y. If $x or $z changes that won't affect $y because you're changing them after you did the addition and assignment.
  2. If you do it that way (with a fixed format, contrary to the requirements) do a preg_match() for the basic format then a checkdate for the real validation. Writing a regex for all valid dates is pretty complex.
  3. He said the table will have millions of rows. Unless there's going to be a very specific WHERE, there'll be some amount of pagination.
  4. Learn the math and write the code to translate it. Don't use their form. What coordinate systems are you converting from and to?
  5. If the problem is that the include()s are simply not working then you need to use absolute paths when giving filenames: "menu.php" alone isn't enough. include ($_SERVER["DOCUMENT_ROOT"] . "/menu.php");If the problem is the links lead to 404s then you need to use absolute paths when giving URLs: "menu.php" alone isn't enough. Menu
  6. Those two are not compatible: the second requires the "content" be only letters, numbers, and underscores while email addresses need @s.
  7. So the criteria is "everything up to the first hyphen, underscore, or number"? if (preg_match('/^[^0-9_-]+/', $device, $matches)) { echo $matches[0]; }Or only letters? '/^[a-z]+/i'
  8. ...Which would require querying for and downloading all howevermanymillion rows. No thanks.
  9. Did you also change the -11s? [edit] And the last line should be $host = substr($host, 0, -11);
  10. With that WHERE the question makes more sense. If you need accuracy then a SELECT COUNT(*) will do it, but make sure you have indexes on the fields you're using. If you don't need an exact figure an EXPLAIN SELECT may give you numbers close enough.
  11. Then I think you'd be best suited by putting the breadcrumbs in those *hero.html files directly. Simple HTML.
  12. ...You're doing the exact same thing in not just three places but in both branches of an if. It's not a problem of code reuse but of code redundancy.
  13. If it'll have that much data then you don't need to bother with a count, right?
  14. I'm pretty sure this thread is spiraling away from the really simple problem of removing "www" and "mysite.com" from the HTTP_HOST. $host = "www.john.smith.mysite.com"; // $_SERVER["HTTP_HOST"] if (strncmp($host, "www.", 4) == 0) { $host = substr($host, 4); } if (substr_compare($host, ".mysite.com", -11 /* -strlen(".mysite.com") */) == 0) { $host = substr($host, -11); }
  15. 1. Maybe it's just what you've posted but it appears you're trying to search for a user with the email address "test". Try without the WHERE condition. 2. You can make it check for errors anywhere you want. You should check a] after connecting, b] after preparing, and c] after executing.
  16. Depends on how your site works. Really, really depends. So how does it?
  17. "unlock" is a reserved word.
  18. It'd be much easier to if we had some code to look at...
  19. PayPal is successful: they've been in business for about 15 years now.
  20. If you use $url elsewhere there's an unrelated problem: $_SERVER['QUERYSTRING'] needs an underscore: QUERY_STRING. And there needs to be a ? between PHP_SELF and the QUERY_STRING.
  21. Go to the YouTube video, click Share, click Embed, and copy/paste that HTML into the page. No PHP involved.
  22. It works. Did you know that it will return multiple rows?
×
×
  • 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.