0
I have a form of texts and photos that you send to records.php
And in write.php redirects to.php result with:
<script>window.open("resultado.php?id="+<?=$id?>+"","_parent");</script>
pag result.php receives the id and takes the BD photo (new or changed) and text
<?php
ob_start('ob_gzhandler');
?>
<!DOCTYPE HTML><html dir="ltr" lang="pt-BR">
<head>basico,css,viewport</head>
<body>
<?php
$id=(isset($_GET['id'])) ? (int)$_GET['id'] : 0 ;
if($id>0){
include $_SERVER['DOCUMENT_ROOT'].'/abre/conexao.php';
$sel=mysqli_fetch_array(mysqli_query($con,"select * FROM XXXX WHERE id=".$id." LIMIT 1"));
$foto=$sel['foto'];$texto=$sel['texto'];
mysqli_close($con);
if($foto<>''){
echo"<img src='xxxx/foto.jpg'>";
}
echo'<br><b>Texto</b><br>',$texto;
}
echo'</body></html>';
ob_end_flush();
Problem: Qdo the user barter photo and record, the result pag shows the old photo.
You need to update pag or clear cache. (but most do not update)
Question: It is possible to include a refresh in this js ?
or clear the pag cache. result.php?
Thank you in advance
Do not use window.open. Use
location.href = "resultado.php";
.– Sam
Hello Sam, can you take a look at my problem? I used the suggestion of Taffarel and did not solve. And it seems that it is absent. I thank you very much
– Geo
you can set the name and origin by passing a random string...
var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes"; window.open("http://www.sua-url.com.br/", "nome_"+randUrl(), strWindowFeatures);
you don’t need to define how_parent
...– Ivan Ferrer
Ivan, include in grava.Asp but do not redirect (white screen) I did so: <script>var strWindowFeatures = "menubar=yes,Location=yes,resizable=yes,scrollbars=yes,status=yes"; window.open("https://site/dir1/pasta1/result.php?ir=2&id=2", "name_"+randUrl(), strWindowFeatures); </script>
– Geo
This save.php is inside an iframe?
– Sam
Caro Geo don’t use
date()
ortime()
to force the cache to update, this will simply cause that at each access you have to repeat the download, the consumption of data of the person will be spent without need, if usingfilemtime()
as I suggested in https://answall.com/a/169846/3635 it will use the modification date of the new file itself as parameter and the browser cache will still be able to take advantage. Here I explain in more detail: https://answall.com/a/57048/3635. Remember to place on every page containing this image.– Guilherme Nascimento
Related: How can I force refresh after deploy?
– Wallace Maxters
I used filemtime() conf. example in issue 169846 and it worked. I thank you all for the super class and teaching material. Sorry for the duplicity (before posting search by window.open)
– Geo