student_it2015-04-19 11:49:55
student_it, 2015-04-19 11:49:55

How can I prevent the Referer from being sent when playing an audio file via the HTML Audio tag?

There is a page on which you need to play the specified file through the audio tag (or its Audio DOM object). It is necessary to make sure that when downloading a file from the server, Referer is not sent on any browsers. How to be? Do not offer Web Audio API, because it is raw and not yet usable. Maybe you can somehow pull the file through XHR and play it through the data pseudo-protocol? Tell me something.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Sanovskiy, 2018-04-09

All wrong.

function calculate($operandOne, $operandTwo, $operator)

    if (!is_numeric($operandOne) || !is_numeric($operandTwo)) {
        return null;

    switch ($operator) {
        case '+':
            return $operandOne + $operandTwo;
        case '-':
            return $operandOne - $operandTwo;
        case '/':
            if ($operandTwo <= 0) {
                return null;
            return $operandOne / $operandTwo;
        case '*':
            return $operandOne * $operandTwo;
            echo 'Допускаются только операторы + - / *';
            return null;

$operandOne = 6;
$operandTwo = 4;

echo calculate($operandOne, $operandTwo, '+');

Here is the working code.
You don't seem to understand what functions are .

sh84, 2015-04-19

Theoretically, bytes received in any way can be put into audio, but here's how to get them without Referer, the browser automatically adds it everywhere, including in ajax requests ..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question