V
V
Vadim9972014-10-19 18:05:26
PHP
Vadim997, 2014-10-19 18:05:26

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

4 answer(s)
D
Dmitry Entelis, 2014-10-19
@DmitriyEntelis

@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

S
Sergey Melnikov, 2014-10-19
@mlnkv

what kind of crazy code do you have, how does it even work?

V
Vadim997, 2014-10-19
@Vadim997

I have pictures on a page and I can't save them to a directory. How to do it?

A
Alexander Zelenin, 2014-10-20
@zelenin

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 question

Ask a Question

731 491 924 answers to any question