Welcome Guest, Not a member yet? Register   Sign In
trying to refresh browser
#1

I am trying to refresh a web page after making some changes. 

header("refresh: 3");

This line seems to have no affect. But when I press the refresh icon in the browser it works perfectly. Why? 
proof that an old dog can learn new tricks
Reply
#2

@richb201,

How are you updating the page? PHP or Javascript?
Reply
#3

PHP I think. I am using Grocery Crud.
proof that an old dog can learn new tricks
Reply
#4

@richb201,

Have you tried reaching out to the Grocery CRUD community?
Reply
#5

If your request is PHP then, when the process is success you can redirect to the same page :

PHP Code:
$result $this->UserModel->save($data);
if(
$result){
return 
redirect()->to($_SERVER['HTTP_REFERER']);



If it is an ajax request:
Code:
window.setTimeout(function(){location.reload()},1500)
Reply
#6

PHP Code:
$url=$_SERVER['REQUEST_URI'];
header("Refresh: 10; URL=$url"); 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#7

(01-12-2021, 09:55 AM)demyr Wrote: If your request is PHP then, when the process is success you can redirect to the same page :

PHP Code:
$result $this->UserModel->save($data);
if(
$result){
return 
redirect()->to($_SERVER['HTTP_REFERER']);



If it is an ajax request:
Code:
window.setTimeout(function(){location.reload()},1500)
Thanks. I have lots of custom data in session variables. Is this an issue? With the ajax version can I place that in the middle of my php code?
proof that an old dog can learn new tricks
Reply




Theme © iAndrew 2016 - Forum software by © MyBB