Jump to content

knsito

Members
  • Posts

    86
  • Joined

  • Last visited

    Never

Everything posted by knsito

  1. Strange, because I know someone using Yahoo Hosting for several months now and did not have any problem with include/require
  2. Of course. I can also play this game, in some other parts of the world $8/hr is not much at all
  3. is 'Code' a string? WHERE Code = '$tempval' Also as Maq said you should sanitize your variables
  4. if (strlen($instr) < 149000) { to if (filesize($myfile) < 149000) { Where $myfile is the path to your file ("latest.img") $instr is just a handle / pointer to your file, you are probably getting 0 returned from that strlen function Also you can use $_FILES['imagefile']['size'] even before you do a file move
  5. Sorry I have to disagree.. I cant see $8/hr being a fair rate for web development even if you are still a college student. In New York the minimum wage is $7.25. You can do better.
  6. You need to look up associative arrays in php. I just hit the feeling lucky button on google search http://www.informit.com/articles/article.aspx?p=31840&seqNum=3 To get this 'Pharamacisist 10 Trial Lotto 01' echo $row['ownerName'] .' '. $row['amount'] .' '. $row['reason'];
  7. Basically all you need to do is just keep track of the '1's, if any '0's are met, reset the 1-counter Below will look for onsecutive 1's $a = array(1,0,1,0,1,0,0,1,1); $error = false; $found = 0; //keep track with counter $count = count($a); for($i=0;$i<$count;$i++){ if($a[$i] === 1){ $found++; }else{ $found = 0; } if($found == 2){ $error = true; break; } } if($error){ echo 'Duplicate "1" found at:'. $i; } You could also treat the array as a stack using array_pop() / array_shift() functions If you are looking for any consecutive values then just compare the previous and current array values.
  8. I think you want to change if ($query) { to if (mysqli_num_rows($query) === 0) { ------ By the way, just wondering why you dont just scramble the password to access the page after the user views it...
  9. I think its $row['MIN(price)']; to access the min-price value or do something like SELECT *, min(price) as min_price FROM `products` and $row['min_price']; will have the min-price value
  10. try $arr['169:67700e59c283ae4bc5550efa3e273762']['attributes'][1] = 105; ?
  11. Hi, what I gave you is the delete procedure. it should be in your delete function/file other than that I dont see what would cause your new error
  12. What are the few lines above it
  13. function roundTo($number, $to){ return number_format(round($number/$to, 0)* $to, 2); } echo roundTo($number,.05); taken from http://www.php.net/manual/en/function.round.php#93747
  14. Where is the error occurring? by the way $path = "/var/www/html/uploads/";
  15. Not as yet I haven't. Any help would be appreciated please. Thanks Simplified: $yourlink = "<a href=http://www.2asmooth.com/Kingfisher_Trust/showNews.php?NewsID=".mysql_insert_id($connection).">Link</a>"; $query2 = "UPDATE News SET Link ='$yourlink' WHERE Title ='$newTitle' AND Content ='$newContent'";
  16. Looks like you never define $image. so unlink is removing all your files. I would use is_file() function along with unlink() <?php $path = "Whatever your path is"; $image = $_GET['delete']; $pf = $path.$image; if(is_file($pf)){ unlink($pf); } ?>
  17. this is the same problem as before -- 'mysqli' not 'mysql'
  18. I would echo out your unlink path+file to make sure you are actually getting the correct location/file. By the way the $_FILES array only is used when there is a file uploaded from your script via POST. If the file has already been uploaded your sever previously, it wont be in $_FILES.
  19. This is the same concept as a stopwatch. If the timer is inside the loop, it will record the time it takes for one iteration of your loop If it is outside your loop, it will record the time it takes for the entire loop to complete. Whatever you want to time, you place between the timer start and end.
  20. Sure, //loop start //timer start //do stuff //timer end -- save/echo time elapsed //loop end
  21. You mean this? $time_start = microtime(true); //Your code here $time_end = microtime(true); $time = $time_end - $time_start; echo "Finished in $time";
  22. You want these functions: http://us3.php.net/manual/en/function.intval.php http://us3.php.net/manual/en/function.array-map.php here you go: $theChartData = array_map('intval',$theChartData);
  23. Hi Just to clarify If you do this: $tel = ""; //empty string isset($tel); //variable has been set, this will return true,even if it is just an empty string
  24. oh right. didnt see that. The actual error message might be helpful
  25. I prefer using the string compare functions. http://us3.php.net/manual/en/function.strcasecmp.php
×
×
  • 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.