Jump to content

requinix

Administrators
  • Posts

    15,232
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Depends: has anyone really been far even as decided to use even go to want to do look more like? On a more serious note, What?
  2. Except in IE, and hopefully just the older versions, the filename you link to doesn't matter. Along with the header() that says it's a PDF file, include a header("Content-Disposition: attachment; filename=report.pdf"); That will make the browser prompt to download and will use the filename "report.pdf" by default.
  3. mysql_fetch_array() returns the data duplicated: one array item for each numeric key (0, 1, 2) and one for each string key ("product_supplier_reference", "price", "wholesale_price"). Use mysql_fetch_assoc() to get just the string keys or mysql_fetch_row() to get just the numeric keys. Also, please try to switch to PDO or mysqli. Those two are more efficient, can make your code much safer, and offer more functionality.
  4. 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".
  5. Along with that goes the general question of "Have you tried running the exact same command from a terminal?"
  6. And how would this script help with that?
  7. $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.
  8. Just checked, it is valid. Call the function named whatever the value of $this->y is. call_user_func(array($this, $this->y));
  9. 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.
  10. 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.
  11. ...has been turned off in the new version you have, which is exactly how it should be. $newcontent = (isset($_POST["newcontent"]) ? (string)$_POST["newcontent"] : "");
  12. 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.
  13. You have to get the values of $iterator and such with $unit->iterator, not $unitlist->unit->iterator.
  14. 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 { // ... }
  15. 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.
  16. And have you checked the error logs to see what happened?
  17. And where do you define $dev?
  18. 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.
  19. 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.
  20. 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.
  21. 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"; }
  22. SELECT Team_Name, SUM(Score) AS Total FROM bw3avonscore WHERE MONTH(myDate) = MONTH(NOW()) GROUP BY Team_Name ORDER BY Total DESC
  23. 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?
  24. Do you have a mailserver running on your computer? If not do you know of a mailserver you can connect to?
×
×
  • 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.