Answer the question
In order to leave comments, you need to log in
How to convert degrees to coordinates?
DD.
Something completely forgotten the school curriculum. Maybe a stupid question, but it already blew the whole brain.
there is 180°:
there are N-elements, it is necessary to distribute them evenly.
example:
1 элемент - 0°
2 элемента:
- 0°
- 180°
3 эл-та:
- 0°
- 90°
- 180°
4 эл-та:
- 0°
- 60°
- 120°
- 180°
и т.д.
0° – x: -80; y: 0
90° – x: 0; y: -80
180° – x: 80; y: 0
Answer the question
In order to leave comments, you need to log in
1. Compare the image binary
2. View the source of the letter, whether everything is present there.
For example, you have no handling of an unsuccessful move_uploaded_file() here at all
And the $boundary variable is not defined
. And yet, you have a vulnerability - $filename is not escaped or checked in any way.
the variable is defined, I just didn't insert it into this piece
$boundary = "--".md5(uniqid(time()));
move_uploaded_file() никаких ошибок не выдает, насчет бинар. буду проверять
Judging by the code, you have extra line breaks inside the email headers.
The email code should look like this:
... Здесь основная часть заголовка...
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary=abcdef
Content-Transfer-Encoding: 7bit
This is a message in multipart MIME format.
--abcdef
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Привет!
--abcdef
Content-Type: application/xlsx; name=hello.xlsx
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=hello.xlsx
/9j/4AAQSkZJRgABAQAAAQABAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJ
...
/9j/4AAQSkZJRgABAQAAAQABAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJ
--abcdef--
To distribute N elements in the range 0...180, you need to divide 180 by (N-1) and place points after each obtained degrees.
That is, Kx = X * 180 / (N-1), where Kx is the next point, X = 0.. N-1
If the points are numbered as X = 1...N, then Kx = (X-1) * 180 / (N-1)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question