I just noticed that the image ordering is a bit different than they should be..
Edit: ooops. Its the fault of the original website, not your script!
Printable View
I just noticed that the image ordering is a bit different than they should be..
Edit: ooops. Its the fault of the original website, not your script!
Is there a way to protect the php file from being used from outside domains?. I want to protect my server resources..
edit existing (in your www or public_html folder) or Create a new text file and save it as .htaccess with the following:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?yourdomain/ [NC]
RewriteRule images.(php)$ http://i.imgur.com/qX4w7.gif [L]
replace yourdomain with your own domain and http://i.imgur.com/qX4w7.gif to whatever page you want to show to prevented requests.
Worked very nicely. I tried it from another domain and it showed no images. Thank you SABI sooo much for your time and help.
I want to ask you a different question. My 20 pages have parts with identical html code lines, is it possible to use one centralized file where I save those parts, then all the pages extract those parts from it? Sort of a template but only for specific parts of html not all the page content?.. because right now, every time I want to change a line of code, I have to do it repeatedly in each of the 20 pages..
Yes you can do that in PHP :) using include() directive/function; for this you will need to convert those pages to PHP (or simly rename .html to .php) then you can import external file where ever you want to.
.
.
.
<body>
.
.
.
<?php include('common.html');?>
.
.
.
</body>
.
.
.
you can use html, js, css, txt, php etc...
my nick is ZABI by the way ;)
Ooops.. sorry about that ZABI
So if say there are 5 repeated lines from line 3 to line 7, then 2 repeated lines from line 10 to 11, should I create separate common.html files for each group of lines, and type the include command twice in place of the 2 sets of lines? or use one common.html file for all the parts? and if so, how do I guide the pages to each part in the common file?
An example please?
you can have as many external files as you wish, you can also include a php file that has included another and so on.
for example you have a.php containing 5 lines for all your files.
b.php contains 3 lines to be used in 2 files,
so you can use <?php include('b.php');?>
where as b.php may contain
<?php include('a.php');?>
some other content
.
.
.
.
.
Got it. You've been very helpful ZABI.
Thanks very much for your generosity and kindness.
I love to help always :) Thank you too.
ZABI, please help me. The site has changed the location of the images. Now the images' URLs are like this:
and sometimes like this..Code:spinneys.com/Library/Images/Spinneys%20flyer0-01.jpg
What changes should I make to your script above please?Code:spinneys.com/Library/Images/Spinneys%20flyer01.jpg
Well i think it should still work as expected.
what is the problem you are facing ?
The script is no longer pulling any images.
The script was pulling images from their urls listed in a webpage:
spinneys.com/sites/Egypt/News.aspx?pageid=54
But now there is no webpage, and I have to pull the images from the directory where they are saved:
spinneys.com/Library/Images/