I want to echo a message before redirecting.the message gets displayed but it disappears very soon.is it possible to increase the time of display before redirect.this is my code

if($result)
 {echo "Data has been edited";
redirect('edit.php');
  }
else
{
echo "<p>cannot update your data<p>";
}
function redirect($loc){	
	echo "Reset done Succesfully!";
	echo "<script>window.location.href='".$loc."'</script>";
	
}

I want to echo a message before redirecting.the message gets displayed but it disappears very soon.is it possible to increase the time of display before redirect.this is my code

if($result)
 {echo "Data has been edited";
redirect('edit.php');
  }
else
{
echo "<p>cannot update your data<p>";
}
function redirect($loc){	
	echo "Reset done Succesfully!";
	echo "<script>window.location.href='".$loc."'</script>";
	
}

use an html redirect so that you can specify how much time to allow before redirect. Just search google for html redirect and you can literally copy and paste.

thanx.i did it using the html redirect code
echo "<meta http-equiv='Refresh' content='2; URL=dis_edit.php'>";

Work perfectly

thanx.i did it using the html redirect code
echo "<meta http-equiv='Refresh' content='2; URL=dis_edit.php'>";

Work perfectly

Awesome!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.