Jump to content

teamatomic

Members
  • Posts

    1,202
  • Joined

  • Last visited

Everything posted by teamatomic

  1. Its your quotes. Whats with the double double quotes? \"" echo "<a href=\"domain.com\"><img src=\"image.gif\"></a>"; also, inside a double quoted echo you dont need to use a dot. echo "$this$that$everything"; will do just fine HTH Teamatomic
  2. I would set it in the header. Include the general stylesheet then check for a page specific stylesheet, if it exists then include it. HTH Teamatomic
  3. Put the general restriction first followed by the bot specific rules. HTH Teamatomic
  4. To pass the invoice number HTH Teamatomic
  5. Nothings wrong with the code. Just seems like a lot of lines to do just this: $length=45; $str='this is a test for the string length split it should work just fine with a lot less code'; $max=strlen("$str"); $sub1=substr("$str", 0, "$length"); $sub2= substr("$str", "$length","$max" ); echo "$sub1::$sub2"; HTH Teamatomic
  6. Perhaps you should look at parse_str() HTH Teamatomic
  7. get the day of the month: if($day<3){do the image} that would show the image the first and second of each month. HTH Teamatomic
  8. parent=>child. On sub-categories you keep track of the parent. The when you load the main cat you grab all the subs that have that parent. You then go through those subs and grab any sub-sub-cats that have the sub-cat for a parent...and so on and so on. HTH Teamatomic
  9. google: javascript preload images as for a good ajax framework I'd suggest prototype. One reason is that if you want to get pretty, scriptaculous lays right over the top of it. For simple boxes and images I'd suggest iBox. HTH Teamatomic
  10. Try this: foreach ( $indexL[$var] as $val ){ foreach ( $val as $final_val ){ $content .= "$final_val[firstname]<br>"; } } HTH Teamatomic
  11. $1 is not allowed anywhere except inside a regex, vars may not begin with a number. Instead of recreating the wheel why not look at something like tinymce. http://tinymce.moxiecode.com/ HTH Teamatomic
  12. http://www.phpfreaks.com/forums/index.php/topic,295790.msg1400908.html#msg1400908 HTH Teamatomic
  13. compressing an mp3 will not gain you anything unless you want to "hide" it from bro'bamas new IP police. Only text based files really benefit from compression. HTH Teamatomic
  14. Habit. As examples, I prefer: "this is a $var to echo out" over 'this is a'.$var.'to echo out' and file("$file") over file($file) HTH Teamatomic
  15. $str='CEE500 - Open'; $string=substr("$str", 0, 6); HTH Teamatomic
  16. So explode it anyways then: $array=array_filter($array); HTH Teamatomic
  17. Try: /[^a-z0-9-]+/gm http://php.net/manual/en/reference.pcre.pattern.modifiers.php HTH Teamatomic
  18. Its gzipped. curl_setopt($ch,CURLOPT_ENCODING,"gzip,deflate"); HTH Teamatomic
  19. explode it on the comma to an array then loop using this: preg_match('@(?:http://).*>(.*?)</a>@i', $string, $matches); HTH Teamatomic
  20. Close the if statement HTH Teamatomic
  21. Have an admin login that ignores the maintenance flag. HTH Teamatomic
  22. 800Mb is a kinda large file I would think. You might be best to work on it daily with a cron job collecting the lines you want into a file then appending the daily data onto a monthly log and clearing the daily log. Actually, handling large log files is better done by a shell script as you dont have to worry about the script timing out, and I think it would be a bit faster. HTH Teamatomic
  23. print_r your $completelink array. Unless 'rel="nofollow"' is the exact string as one of the element values it will not be "found". in_array requires an exact match. Thats why the preg into the array. You get the results if the link is found then can check for the nofollow in the array. You kill two pigs with one statement(and get a bacon sandwich to boot!) just a thought; if you concatenate the beginning and end links vars and explode it into an array on spaces, then clean it up you should be able to get 'rel="nofollow"' into an element alone. Then in_array will find it. HTH Teamatomic
  24. Dont use rand(), instead use arrays and array_rand. $array1=array(range(1,4),range(10,20),range(50,58)); $nums=array_merge($array1[0],$array1[1],$array1[2]); $key = array_rand($nums, 1); echo $nums[$key]; echo "<br><pre>"; print_r($nums); Another way would be to use one array for the excluded ranges and another for the entire range and do an array_unique then an array_rand on the resulting array. HTH Teamatomic
×
×
  • 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.