in reply to variable issues (they are mean)

Just quickly looking at the code shows that you're not consistent in your naming. For example, at the top of the loop you define $alltheweb_search_c, but then use $alltheweb_c (notice without the _search.) Try fixing your naming of variables.