Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. don't even need sql regex... select * from table where email like '%@hotmail.com'
  2. It's not, but it greatly increases your chances of actually getting said help.
  3. hmm not sure if OP wants nested, but rather same level looping. If the array keys are the same, you can do this: foreach($array1 as $key => $val) { echo $val; // echo current $array1 value echo $array2[$key]; // echo current $array2 value } if one is a numeric array ($array1) and one is an associative array ($array2), you can do this: $key = 0; foreach ($array2 as $val) { echo $val; // echo current $array2 (associative) value echo $array1[$key]; // echo current $array1 (numeric) value $key++; } If they are both associative but have different keys, you can do this: foreach ($array1 as $val) { echo $val; // echo current $array1 value echo current($array2); // echo current $array2 value next($array2); } of course, all of these examples assume that both of the arrays have the same number of elements...
  4. hmmm....while my coding techniques do continually improve, my coding "style" (comment convention, indentation, etc..) has not really changed in a very long time. In my own experience, and experience in seeing other people's code, people pretty quickly figure out what works best for them and generally stick to it (for better or worse..)
  5. so what happens when the user doesn't have an @yahoo.com address? You would need to in your query that checks the user name, instead of doing ...where user = '$username' you would do ...where user like '{$username}%'
  6. $url = "http://www.somesite.com/read.php?1,2,2,4,5"; $url = basename($url); preg_match('~^[^,]+(?:,[^,]+)?~',$url,$match); echo $match[0];
  7. .josh

    Hello!

    well if you're rating based off knowledge, then sure. But if you rate based off general problem solving skills and ability to get shit done...
  8. No but I hear the 89 can run the latest pokemon games
  9. the TI-89 is obviously better, as it is "89" whereas the TI-84 is only "84" and 89 is more than 84. I actually did that math in my head, so I don't see how either one of those would be useful IMO .
  10. But is it set up to make it null by default? Anyways, dunno how you have your form setup but in general you could just for instance loop through the $_POST array. foreach($_POST as $key => $value) { if (trim($value) == '') { $_POST[$key] = 'null'; } }
  11. ah yah true forgot about that technicality. You can use basename to get just the image name or just remove $imgdr from the src="..." altogether.
  12. Also, unless you just c/p'd wrong, you are missing a ; on the end of the last line posted.
  13. that's because your path/to/image is probably wack. offhand I see in $imgdr you have it listed as a subfolder of the current working directory (no ../) but in the path/to/image in your image tag, you build it it again instead of using your $imgdr, and it has that "../" at the beginning, which makes it look for the directory above the current working directory. I would suggest changing your img src to src="'$imgdr.$img.'" edit: oops, forgot the concat dot src="'.$imgdr.$img.'"
  14. I think that stuff between the td tags can be cleaned up but I don't know your dir struct so I left it alone... $imgdir = 'uploads/'.$nick.'/'; // the directory, where images are stored $allowed_types = array('png','jpg','jpeg','gif'); // list of filetypes I want to show $a_img = glob($imgdr."*.{".implode(',',$allowed_types)."}",GLOB_BRACE); sort($a_img); echo "<table><tr>"; foreach ($a_img as $img) { if ($colCount % 4 == 0) echo "</tr><tr>"; $colCount++; echo ' <td><a href="../index.php?slika='.$img.'"><img src="../uploads/'.$nick.'/'.$img.'" width="100" height="75" border="0" onclick="changeImg(velika, "'.$kojaslika.'.jpg")" /></a></td>'; } echo "</tr></table>";
  15. You should be validating form info before putting it in the db in the first place, so putting in something if nothing exists shouldn't be a problem.. nonetheless, the default field value in your db as Handy mentioned would be better.
  16. submit the form via curl. Use a cron job to run it every 24 hours.
  17. hmmm...does your code actually have several cards within a single set of brackets, or does each card wrapped around with its own set of brackets? IOW do you really have it like this: [6h 9h 9c] [Kd][Kg] or are all of the cards in the string really like this? [6h] [9h] [9c] [Kd][Kg]
  18. or "gspot" if you want to use technical terms.
  19. 99% of the time the reason is for tracking purposes (like google analytics, yahoo web analytics, omniture sitecatalyst, coremetrics, etc...)
  20. if (($a -> ip != $ip) && ($a -> time > ($time - $days_in_seconds)) && ($a -> time < $b)) {//FIX THIS LINE!
  21. hmm redarrow I don't think you quite understand what the OP is trying to do. Think maybe you should go back and reread
  22. http://www.phpfreaks.com/tutorial/php-basic-database-handling
  23. "level system" is pretty ambiguous... care to be more specific?
  24. http://www.phpfreaks.com/tutorial/php-add-text-to-image
×
×
  • 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.