B
B
Boxcraud2015-12-06 14:13:45
PHP
Boxcraud, 2015-12-06 14:13:45

How to execute a PHP script without reloading the page?

<?php
$row = 1;
$handle = fopen("test.csv", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
    $num = count($data);
    echo "<p> $num полей в строке $row:  ";
    $row++;
    for ($c=0; $c < $num; $c++) {
        echo $data[$c] . "       ";
    }
}
fclose($handle);
?>

How to loop without reboot?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2015-12-06
@frost18

You probably don't understand the technology a little. The server receives the request, processes it, and returns a response. In your case, I would write a js code that sends an AJAX request at a frequency of, say, once every 10 seconds, receives a response and displays it on the screen.

X
xfg, 2015-12-06
@xfg

Websocket
HTTP Streaming
Long polling
Polling
Choose.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question