Answer the question
In order to leave comments, you need to log in
How to extract src from img and insert into file_put_contents?
You need to save the image to a directory.
Here is the code:
<?php
function get() {
echo "<script> div1[i].getAttribute('src'); </script>";
}
?>
<script type="text/javascript">
function getSRC() {
var div1 = document.querySelectorAll("img");
for(var i= 0, max = div1.length; i < max; i++) {
<?php file_put_contents("/parse/data", get()); ?>
}
}
</script>
Answer the question
In order to leave comments, you need to log in
@Vadim997
I don't know what exactly you want to do, but your code is just some kind of nonsense.
You clearly do not understand what php is and what js is.
Please check out phpfaq.ru/na_tanke
I have pictures on a page and I can't save them to a directory. How to do it?
it's easy to do - learn a little php. At the moment you have no idea about it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question