Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. You should probably fix it then. If you need more specific advice than that, give us more to go on than "it doesn't work".
  2. Along with that goes the general question of "Have you tried running the exact same command from a terminal?"
  3. And how would this script help with that?
  4. $protocol = strpos(strtolower($_SERVER['SERVER_PROTOCOL']),'https') === FALSE ? 'http' : 'https'; The SERVER_PROTOCOL will never contain "https". It is always in the form "HTTP/1.x". Check $_SERVER["HTTPS"] ("on" or "off") or, if that's not available, the less reliable $_SERVER["SERVER_PORT"] (80=http, 443=https). Speaking of, you don't take into account the port number. As for $currentUrl, $name and $value do not have what you want them to have. They're only useable inside the foreach loop.
  5. Just checked, it is valid. Call the function named whatever the value of $this->y is. call_user_func(array($this, $this->y));
  6. By the way, return $this->{ $this->y }(); is quite wrong. Even if it's syntactically valid (might be) it won't do what you want it to do.
  7. Unless you have something unusual you'll do a lot more reading than writing. Keep it in the session (or a cache) and update your database when it changes.
  8. ...has been turned off in the new version you have, which is exactly how it should be. $newcontent = (isset($_POST["newcontent"]) ? (string)$_POST["newcontent"] : "");
  9. But rest assured that the REMOTE_ADDR will be a valid IP address. There's just no guarantee that it's actually the IP address of the user - could be a proxy, could be spoofed.
  10. You have to get the values of $iterator and such with $unit->iterator, not $unitlist->unit->iterator.
  11. There's also the inverse: $types = array('Word','Excel','PDF'); $row = $db->get_row("SELECT doctype FROM documents WHERE id = 100"); if (in_array($row["doctype"], $types)) { // ... } else { // ... }
  12. Yes, it's definitely the standard way to include files. There are alternatives for different circumstances. And yes, it will work on your local server. It'll work anywhere so long as the DOCUMENT_ROOT is defined (it practically always is) and the path to the file from there is "/template.php" (it's in that directory). If your local setup is different and you need a subfolder, like "/mydomain/template.php", then it will not work because the path is different.
  13. And have you checked the error logs to see what happened?
  14. And where do you define $dev?
  15. The number of fields you mention in your INSERT does not match up with the number of values you provided. Something's extra or something's missing.
  16. Try without the WHERE, and then make sure the myDate is a DATE/DATETIME column and there's at least one row from this month. And you know the query will return the total score as "Total" and not "Score", right? That's what you looked for in the original query but you're free to rename it.
  17. What's in conn.php? [edit] Assuming there's a mysql_connect() in there, be sure to not post the username you tried to connect with. And while I'm at it, the error message is telling you that you didn't put the password in. You probably need to.
  18. foreach ($foo->new_occ as $room => $occupants) { $adults = (isset($occupants["adults"]) ? $occupants["adults"] : 0); $children = (isset($occupants["children"]) ? array_sum($occupants["children"]) : 0); echo "Room {$room} has ", $adults + $children, "occupants\n"; }
  19. SELECT Team_Name, SUM(Score) AS Total FROM bw3avonscore WHERE MONTH(myDate) = MONTH(NOW()) GROUP BY Team_Name ORDER BY Total DESC
  20. Does the server require authentication? Can you connect to it? Are there any error messages? Have you tried troubleshooting this on your own? Tried running some search terms through Google?
  21. Do you have a mailserver running on your computer? If not do you know of a mailserver you can connect to?
  22. Recursively, function buildArrayFromLists($parent, &$item) { for each $ul directly under the $parent { $item[id from $ul] = array(); for each $li directly under $ul { $item[id from $ul][] = id from $li; buildArrayFromLists($li, $item); } // optionally if $item[id from $ul] is empty then unset($item[id from $ul]); } }
  23. It won't. PHP and Javascript are entirely separate, and the only way to send something from Javascript to PHP is with AJAX.
  24. But what format is it? What type of column? DATE? DATETIME? VARCHAR? MySQL uses Y-M-D so try with your $today formatted that way.
×
×
  • 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.