anyone know how to block/hide images in PHP page ?? I have site with 5000+ image from example.com, that make mysite load very slow, i want to block/hide that images from example.com. how can i do? Please help me... Thanks
typically i store my images inside the "assets" folder under the "img" folder and place an index.html page inside the img folder so that no one can see the images but myself hope this helps regards
thanks mirosoft1 i meam, i want to hide image from tinypic.com in my site, because tinypic.com make my site load very slow. anyone know how to hide images in PHP page ??
Depending on how the list is being generated, you could add an if statement and check whether the URL contains the given domain name or not.
If your displaying the images using a remote source (theirfore don't physically have access to modify the HTML) - you can modify the remote source...to replace all tinypic urls which can be done by using a regex with a preg_* function; another method would be calling a function (replace_tinypic) with ob_start('replace_tinypic') at the top of your script/file...and within that function place the code to replace tinypic urls, in which case we'd need the source to help you.
Thanks danx10 i display image using direct link from tinypic.com can you give the example php code, please!!
$image = "http://www.domain.com/uploads/image.png"; if (strstr($image, "domain.com") == false) { // Not hosted by domain.com - proceed ( default route ) } else { // Hosted by domain.com - skip ( do nothing ) } PHP:
thanks Wolf Security for the example, can you give to me the direct example, please! i want to hide this image from my site: - tinypic.com - s256.photobucket.com - s268.photobucket.com i try to add this in my site: <?php $image = "http://www.domain.com/uploads/image.png"; if (strstr($image, "tinypic.com") == false) { // Not hosted by domain.com - proceed ( default route ) } else { // Hosted by domain.com - skip ( do nothing ) } ?> PHP: but still cant :'( Please help me!!
maybe try this, <?php $image = "http://www.domain.com/uploads/image.png"; $url = parse_url($url, PHP_URL_HOST); if (stristr($url, "tinypic.com") == false) { // Not hosted by domain.com - proceed ( default route ) } else { // Hosted by domain.com - skip ( do nothing ) } ?> regards.