teamatomic
Members-
Posts
1,202 -
Joined
-
Last visited
Everything posted by teamatomic
-
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
-
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
-
Put the general restriction first followed by the bot specific rules. HTH Teamatomic
-
To pass the invoice number HTH Teamatomic
-
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
-
Perhaps you should look at parse_str() HTH Teamatomic
-
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
-
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
-
need to load alternate content to currently displayed site
teamatomic replied to Digitry Designs's topic in PHP Coding Help
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 -
maintaining query results while navigating through pages
teamatomic replied to husslela03's topic in PHP Coding Help
Put it in a session var HTH Teamatomic -
Try this: foreach ( $indexL[$var] as $val ){ foreach ( $val as $final_val ){ $content .= "$final_val[firstname]<br>"; } } HTH Teamatomic
-
$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
-
http://www.phpfreaks.com/forums/index.php/topic,295790.msg1400908.html#msg1400908 HTH Teamatomic
-
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
-
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
-
$str='CEE500 - Open'; $string=substr("$str", 0, 6); HTH Teamatomic
-
So explode it anyways then: $array=array_filter($array); HTH Teamatomic
-
Try: /[^a-z0-9-]+/gm http://php.net/manual/en/reference.pcre.pattern.modifiers.php HTH Teamatomic
-
Its gzipped. curl_setopt($ch,CURLOPT_ENCODING,"gzip,deflate"); HTH Teamatomic
-
explode it on the comma to an array then loop using this: preg_match('@(?:http://).*>(.*?)</a>@i', $string, $matches); HTH Teamatomic
-
Close the if statement HTH Teamatomic
-
How can I let admins through via the maintenance?
teamatomic replied to TeddyKiller's topic in PHP Coding Help
Have an admin login that ignores the maintenance flag. HTH Teamatomic -
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
-
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
-
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