Jump to content

boen_robot

Members
  • Posts

    8,493
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boen_robot

  1. The key is The timezone could not be found Open up php.ini, find "date.timezone"and set that line to date.timezone = Europe/Athens
  2. Yes. In every page where you need to read or write any string. That's every page where you're currently using "SET NAMES". To be safe, you could use it right after every line you connect to the DB.
  3. boen_robot

    what debugger

    Let me guess, you downloaded the DLL from ApacheLounge?('cause that's what I ended up doing just yesterday...)
  4. You may want to create new tables from scratch, and then create a script that would transfer the data from your old tables into the new ones. It's the best way to ensure things are designed properly. No. It will have as many rows as all permutations between files and mirrors. If a file is at 2 mirrors, that table will have 2 rows (one for each mirror), and if one mirror has 3 files, there will be 3 rows in that table (one for each file).It will contain rows with stuff like "file 1 is at mirror 1, file 1 is at mirror 2, file 1 is at mirror 3, file 2 is at mirror 3...". You're never, at any point, saying "file 1 is at mirror 1, mirror 2 and mirror 3". This is only determined later when you make something like "SELECT `mirror_id` FROM `file_mirrors` WHERE `file_id` = 1".Here's a create statement for the new tables (extracted verbatim from MySQL Workbench; in a DB called "db"; make sure to edit that accordingly):SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';CREATE SCHEMA IF NOT EXISTS `db` ;SHOW WARNINGS;USE `db` ;-- ------------------------------------------------------- Table `db`.`files`-- -----------------------------------------------------CREATE TABLE IF NOT EXISTS `db`.`files` ( `file_id` INT NOT NULL AUTO_INCREMENT , `name` VARCHAR(255) NOT NULL , PRIMARY KEY (`file_id`) )ENGINE = InnoDB;SHOW WARNINGS;-- ------------------------------------------------------- Table `db`.`mirrors`-- -----------------------------------------------------CREATE TABLE IF NOT EXISTS `db`.`mirrors` ( `mirror_id` INT NOT NULL AUTO_INCREMENT , `name` VARCHAR(255) NOT NULL , PRIMARY KEY (`mirror_id`) )ENGINE = InnoDB;SHOW WARNINGS;-- ------------------------------------------------------- Table `db`.`file_mirrors`-- -----------------------------------------------------CREATE TABLE IF NOT EXISTS `db`.`file_mirrors` ( `file_id` INT NOT NULL , `mirror_id` INT NOT NULL , PRIMARY KEY (`file_id`, `mirror_id`) , CONSTRAINT `fk_file_mirrors_files` FOREIGN KEY (`file_id` ) REFERENCES `db`.`files` (`file_id` ) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `fk_file_mirrors_mirrors1` FOREIGN KEY (`mirror_id` ) REFERENCES `db`.`mirrors` (`mirror_id` ) ON DELETE CASCADE ON UPDATE CASCADE)ENGINE = InnoDB;SHOW WARNINGS;CREATE INDEX `fk_file_mirrors_files` ON `db`.`file_mirrors` (`file_id` ASC) ;SHOW WARNINGS;CREATE INDEX `fk_file_mirrors_mirrors1` ON `db`.`file_mirrors` (`mirror_id` ASC) ;SHOW WARNINGS;SET SQL_MODE=@OLD_SQL_MODE;SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; The ON UPDATE CASCADE and ON DELETE CASCADE ensure that if you update/delete a file, all entries in file_mirrors for that file will be updated/deleted (i.e. the file is deleted for all mirrors), and if you update/delete a mirror, all entries in file_mirrors for that mirror will be updated/deleted (i.e. no file will have that mirror associated).And about adding... yes, you add things manually, as before. It's just that now you add mirrors and files at different places, and the association of a file with a mirror is a separate third query (an insert at the file_mirrors table; one per a file's mirror).
  5. With your XML, and an XSLT which in full is: <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <td width="4%"></td><td ><xsl:value-of select="node()"/></td><xsl:variable name="id" select="no"/><td wrap="nowrap"><input type="checkbox" value="{name}"><xsl:attribute name="name"><xsl:text>CONTROL</xsl:text><xsl:value-of select="$id"/></xsl:attribute><xsl:attribute name="onClick">javascript:Control_Click(this)</xsl:attribute><xsl:if test="selected= 1"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if></input></td> </xsl:template></xsl:stylesheet> I get the output <td width="4%"/><td>AnyAnyCRComputed Radiography</td><td wrap="nowrap"><input type="checkbox" value="" name="CONTROL" onClick="javascript:Control_Click(this)"/></td> The line <td ><xsl:value-of select="node()"/></td> outputs the text value of the current node. If this node has any children (as is in this case - the root node has all elements as its children) their collective text is printed.The rest of the XPaths simply don't match any element, which is why they don't output anything related to the document.If you're getting a different result, you'd have to also include the full XSLT.
  6. You can do it with just CSS. Use "position:fixed;" on the element you want frozen when scrolling.
  7. This was not about your mistake (indeed, everyone makes mistakes, so we don't patronize people for that), but about the way you worded the aftermath of it. Saying that anything programming related is "sensitive" about something implies it has the will to act one way or another depending on unknown factors, when in fact it doesn't. Everything else in justomeguy's post is just the consequence of the lack of a computer's free will. "W.E."? Who's that?Kevin Harts... I suppose he can do it too (just looked him up... he's... OK...). I don't know, I find British comedians funnier, but if you find him funnier, then fine - use his voice .
  8. What he says isn't really an opinion... strictly speaking, the computer is... strictly speaking . That's all.When you see something you find "disturbing" in some way, do what I do - read it out in the voice (and pace) of a British comedian (any comedian: Eddie Izzard, Dara O'Briain, Frankie Boyle... doesn't matter), and see if it funny in any way. If it is, chances are that it has a point.
  9. You may want to retrick the way your database is structured. If you do it properly, you can simply define foreign key constraints such that a file could only exist an an actual mirror, and you can easily clean up the mirrors every now and then.I suggest you create a "files" table without any mirror information in it (i.e. this table should contain information that identifies the file across the mirrors). Then create a "mirrors" table with no file information in it, and then create a third table (let's call it "file_mirrors") that has a "file_id" and "mirror_id" in it, with both of these columns being constrained to their respective tables. Also define "ON UPDATE CASCADE" and "ON DELETE CASCADE" actions on both of those, so that this 3rd table is automatically cleaned up after deleted/updated files and mirrors.When you have that, deleting mirrors that have no associated files is as simple as DELETE FROM `mirrors` WHERE `id` NOT IN (SELECT DISTINCT `mirror_id` FROM `file_mirrors`)
  10. The value of "type" is a MIME type.There is a list of official MIME types at IANA, but applications can always define their own.The value you get in the $_FILES array in particular is defined by the browser. A browser could, in theory, send you a ".jpeg" file with "text/plain" MIME type, or something that's not even an official MIME type like "cook/right". In practice, only hackers ever try to do that.Still, the point of a MIME type in general is to let your application know how it should treat a file, regardless of its extension.In theory, it's up to you to define what MIME types you'll be handling, and it's up to the user to provide a file with valid MIME type which you'd then make sure to treat properly. In practice, because users don't have much of a control (or understanding) of how their browser handles MIME types, and only attackers try to abuse MIME types, what you should do is check for file extensions, and treat the files according to their extension, providing error messages when a forbidden one is given.
  11. To avoid that in the future, you can simply omit the "?>" at the end of pure PHP files, such as config.php.
  12. Is that at line 10 by any chance? If not, what is on line 10?
  13. Yes. As the error message tells you So line 10 of config.php is outputting something. Stop it from doing so. BTW, why would you ever output anything at a config.php file?
  14. Find out by also doing var_dump($con). If that's bool(false), then the connection failed.Speaking of which:$sql = "SELECT * FROM login WHERE user='$username' AND pass='$password'";if(!$sql){die('Connect Error: ' . mysqli_connect_error());} That's pointless. $sql is always a non empty string, so this if will never be entered. Plus, you're not even detecting a connection error here.
  15. cPanel is not the same thing as joomla. Joomla is a CMS - it's about managing site content. cPanel is about managing server settings.According to joomla's docs on the subject, all you need to do is alter your configuration.php file appropriately, not create a new file.
  16. Seeing something you are not expecting, when there are problems, using var_dump(), is the very idea behind using this function in the first place. If you knew what value you'll be getting, you're not doing any debugging.The question is what is that other thing you're getting? The thing when you're getting nothing like what you normally get. It is based on that information that you can find out what the error is and how to fix it.For connecting to a different database... perhaps your host has a cPanel or something, from which you can create a new DB, and then you would be able to connect to it?
  17. What do you mean "i also did a var_dump(); and a print_r(); on the query, which nothing displayed nothing"? var_dump() in particular can NEVER display nothing. It always displays something... "bool(false)" or "string(0) """ at least.
  18. Errr... What will be printed is "CONTROL" itself, combined with the text of the XML's "no" element. Those will be printed as the value of a "name" attribute on the resulting "input" element.You'll have to present a sample XML file if you want a more specific answer.
  19. What is on those lines?Anyway... make sure "php/config.php" doesn't output anything - that it doesn't have any whitespace or anything before "<?php". That's about the only possible problem I can think of.
  20. I'm sad to say our means of contacting the admins are the same as those of every other person. We don't have a "dedicated line". We can only hope that kaijim (who is really the only admin we're ever in contact with) sees the messages he receives are from us, and decides to prioritize them.We do have all the power we need though. Most of the stuff we have problems with is stuff that not even kaijim can single handedly fix either, but stuff Invisionzone must fix instead. That's something we have power over too. All users are initially locked until they pass a spam check, and we even have a warning about that on registration. Further locks (if any) are placed and released by mods, typically when said user blatantly breaks advertising rules (i.e. they spam).
  21. There doesn't seem to be one for XSL-FO 1.0 and 1.1. In fact, that's part of the XSL-FO 2.0 requirements document, i.e. future versions of XSL-FO should contain one.
  22. Well, as you said, there isn't one, so the next best thing is to offer alternatives, depending on the reason he would want to unmark a topic to begin with.
  23. Why would you want to do this anyway? If you want to find a topic, there's sear... oh wait... I see. Well, if you're interested in a topic, you can always follow it.
  24. You could (and in fact, should) use mysqli_set_charset() instead.Every time an application reads or writes text, it needs encoding and charset specified to interpret the content properly.In the case of mysqli_set_charset(), you tell the MySQL client how to interpret data from the MySQL server (as well as how to interpret data that needs to be sent to the server), whereas the settings at the database reflect how the MySQL server stores the incoming data (as well as how it sends it to clients).Setting the table collation should not influence the display of the data BUT it will influence string comparisons and sorting, so it's a good idea to keep it in sync with the table charset non the less.
×
×
  • Create New...