-2

I have one php website in which I am using pagination. I am doing some action with mysqli query in page. I am redirecting to home page after finish query using header with below code.

header( "Location:manage_quotes.php");

I want stay in same page after finish query. I have tried many solution from stackoverflow but not got any proper solution. Anyone can please suggest me solution for this ?

I have tried

$currentpage='http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header( "Location:".$currentpage);

but due to I am using query with page its reloading that query page instead of url on which I was before perform action.

Thanks

Meera
  • 3
  • 3
  • 1
    State the solutions you've tried out. And FYI, to stay on the same page, remove the `header()` line – Rotimi Jan 14 '18 at 17:44
  • The answer is in this question: https://stackoverflow.com/questions/48251817/join-value-in-php-for-reload-page – Paul Spiegel Jan 14 '18 at 17:48
  • Hi @Akintunde007! thanks for comment. Can You please check my edited question. Thanks – Meera Jan 14 '18 at 17:50
  • 3
    Possible duplicate of [Back to previous page with header( "Location: " ); in PHP](https://stackoverflow.com/questions/5285031/back-to-previous-page-with-header-location-in-php) – Paul Spiegel Jan 14 '18 at 17:56

1 Answers1

0

You have to add a space after the colon. Additionnaly, add a exit() call to avoid extra execution of code.

header("Location: manage_quotes.php");
exit(0) ;
Syscall
  • 19,327
  • 10
  • 37
  • 52