I am using Go back for going back in php using following code.
mycode.php
<script>
function goBack() {
window.history.back();
}
</script>
<button onclick="goBack()" style="float: right;">Back</button>
but it does not seem to be working. As my previous page is having R code which need to be executed.
previous_code.php
<?php
exec('Rscript code.R '.$tmpdir.'group_selected.txt '.$type.' '.$tmpdir);
$file = fopen($tmpdir."file.txt", "r");
$i=0;
while(!feof($file)){
$line = fgets($file);
if($line){
$line=str_replace('"', "", $line);
echo "<option value='$line'>".$line."</option>";
}
$i++;
if($i%3==0){echo "</tr><tr>";};
}
fclose($file);
?>
When i click Go back on mycode.php, it shows blank page
May i know how can i fix this issue?