Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/22/2017 in all areas

  1. I can understand the shared host reluctance ... proxy service might cause problems for them in terms of bandwidth. Your best option is a VPS like Digital Ocean where you can slowly scale up as you need to. The cost starts out very reasonable.
    1 point
  2. That makes sense, you are populating: $responseBody ... with the filter string data. Stef
    1 point
  3. I manage to fix my on code: if (!$urlIsValid) { die("Error: The requested URL was disallowed by the server administrator."); } $response = makeRequest($url); $rawResponseHeaders = $response["headers"]; $responseBody = $response["body"]; $responseInfo = $response["responseInfo"]; //SET THE BANNED WORDS. $banned_words = array("Prick","****","bull****","****","asshole"); //SUBSTITUTE THE BANNED WORDS ON PROXIED PAGE (CONTENT FILTERING). if($responseInfo['http_code'] == '200' ) { $regex = '/\b'; // The beginning of the regex string syntax $regex .= implode('\b|\b', $banned_words); // joins all the banned words to the string with correct regex syntax $regex .= '\b/i'; // Adds ending to regex syntax. Final i makes it case insensitive $substitute = '****'; $responseBody = preg_replace($regex, $substitute, $responseBody); } I changed this: $url = preg_replace($regex, $substitute, $response); to this: $responseBody = preg_replace($regex, $substitute, $responseBody);
    1 point
×
×
  • Create New...