Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About Ustag

  • Rank
  1. Hi, I have a mysqli_query that goes like this: $result = mysqli_query($db, "INSERT INTO device(`Identifier`, `IsAllowedToPost`)VALUES('ABC123', 0)") or die(error_log(mysqli_error($db), 3, "php_error.log")); It does not work and the logs either tells me "1", "0" or nothing depending on which method I try to log the error with. How can I get a better error message to log in my file? 1 or 0 means nothing to me. The current code gives me no error message at all in my file and the data does not get stored in the database.
  2. ok what I did to fix this was to delete my .htaccess and create a new php.ini file and start over.
  3. I've found many topics on how to fix this but nothing seem to work for me.I am uploading files trough ftp with a php script and what I am doing to make this work so far is this: editing .htaccess to make php settings allow a file of 10mb for sure: php_value session.gc_maxlifetime 86400php_value max_input_time 86400php_value max_execution_time 86400php_value upload_max_filesize 1100Mphp_value post_max_size 1100Mphp_value memory_limit 1100M Using custom timeout setting like this:ftp_connect($ftp_server, 21, 120000) Editing the same options as above in the actual php.ini file. I also have th
  4. if I drop 2 files will it do this: create barcreate bar trigger progressFunctiontrigger progressFunction or this: create bartrigger progressFunction create bartrigger progressFunction ?
  5. edit: I regret my post, im just lost ^^
  6. Shouldnt this work? function progressFunction(evt) { //give each bar a % calculator var bars = document.getElementsByTagName('progress'); for (var i=0; i<bars.length; i++) { var progressBar = document.getElementById('progressBar' + i); var percentageDiv = document.getElementById('report' + i); if (evt.lengthComputable) { progressBar.max = evt.total; progressBar.value = evt.loaded; percentageDiv.innerHTML = Math.round(evt.loaded / evt.total * 100) + "%"; } } }
  7. I use the example at the bottom of that page you gave me but I want to edit this to fit my needs. This is my code now to give me one progress bar for each file dragged on to the dropzone, my problem is how I can also give each progrss bar its own % calculator. <script type="text/javascript"> function sendFile(file) { var uri = "upload.php"; var xhr = new XMLHttpRequest(); var fd = new FormData(); xhr.upload.addEventListener("progress", progressFunction, false); xhr.open("POST", uri, true); xhr.onreadystatechange = function() { if (xhr.readyState == 4 &&am
  8. Hello, im trying to create a nice file uploader using XmlHttpRequest so that we can get a nice progress bar and stuff without reloading the page. When I try to upload using my code the progress bar does show and count % up untill completed but no file is being uploded. I will show you my code and tell you what I think is wrong, but I will strip it down a bit. This is my js part: function uploadFile() { var xhrObj = new XMLHttpRequest(); var filesToBeUploaded = document.getElementById("fileControl"); var file = "filename="+filesToBeUploaded.files[0]; xhrObj.upload.addEve
  9. hi I have problem with my file uploader which dont make sense for me. I am trying to upload 3 files with the following code but only one of them is being uploaded and its the .xbst file. Please have a look, it gives me no error message at all: //image file if (($_FILES['image']['error'] == 0) && ($_FILES["image"]["type"] == true)) { $ext = substr(strrchr($_FILES["image"]["name"], '.'), 1); if (($ext == "jpg") || ($ext == "JPG") || ($ext == "jpeg") || ($ext == "JPEG")) { if(file_exists($thisdir ."/inc/scripts/xenobot/hscript/".$name)==false) { mkdir($thisdir ."/inc/scripts/x
  10. Ustag

    sorting arrays

    Hi, I am generating a bunch of arrays but I would like to change the order of these. This is my code now: $players_killed['time'] = strtotime($time);$players_killed['name'] = ': '.$player;arsort($players_killed, SORT_NUMERIC);echo var_dump($players_killed) .'<br>'; And this is the output: array(2) { ["time"]=> int(1334027580) ["name"]=> string(106) ": Brbasher" }array(2) { ["time"]=> int(1334029860) ["name"]=> string(102) ": Dynext" }array(2) { ["time"]=> int(1334029260) ["name"]=> string(110) ": Kronigrass" }array(2) { ["time"]=> int(1334036580) ["name"]=>
  11. Thank you all but my solution will be to break this down and add substr($td2->nodeValue, 0, 3) and substr($td2->nodeValue, 5, 2) in to variables that will give me "Apr" and "08". Thanks !
  12. var_dump(substr($td2->nodeValue, 0, 3)); = string(3) "Apr"var_dump(substr($td2->nodeValue, 0, 4)); = string(4) "Apr´┐Ż"var_dump(substr($td2->nodeValue, 0, 5)); = string(5) "Apr "var_dump(substr($td2->nodeValue, 0, 6)); = string(6) "Apr 0"var_dump(substr($td2->nodeValue, 0, 7)); = string(7) "Apr 08" Does this tell me anything? ^^
  13. Adding "Killed" and using substr($td2->nodeValue, 0, 6) == "Apr 08" did not work eather. And how come echo substr($td2->nodeValue, 0, 7) = "Apr 08" and echo substr($td2->nodeValue, 0, 6) = "Apr 0"? I just noticed in their source code it says "Apr& #160;08", what is "& #160;" (without the whitespace)?
  14. Hi, I am scraping a game page in order to grab certain info about a player. What I scrape is the info under "Character Deaths" for example on this page: http://www.tibia.com...s&name=Brunkarn This code will print all killed players in April: if((substr($td2->nodeValue, 0, 3) == "Apr") && (substr($td2->nextSibling->nodeValue, 0, 6) == Killed)){echo $player.': '.substr($td2->nodeValue, 0, 7).'<br>';} It prints "Brunkarn: Apr 08". now if I replace this: substr($td2->nodeValue, 0, 3) == "Apr") with this: substr($td2->nodeValue, 0, 7) == "Apr 08") I get
  • Create New...