₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,328,232 members, 8,434,750 topics. Date: Saturday, 27 June 2026 at 09:19 AM

Toggle theme

Redirect A Page In Php? - Webmasters - Nairaland

Nairaland ForumScience/TechnologyWebmastersRedirect A Page In Php? (764 Views)

1 Reply (Go Down)

Redirect A Page In Php? by cyberworx(op): 1:55pm On Mar 21, 2016
hello friends i want to know How to redirect a page in PHP?
Re: Redirect A Page In Php? by Jinf: 3:46pm On Mar 21, 2016
Use ---

header("location: Newpage.php " ) ;
Re: Redirect A Page In Php? by ps3o(m): 6:13pm On Mar 21, 2016
cyberworx:
hello friends i want to know How to redirect a page in PHP?
header("location: newpage.php" );
exit;
Re: Redirect A Page In Php? by Adesege(m): 7:14pm On Mar 21, 2016
ps3o:
header("location: newpage.php" );
exit;
The header function, by default, stops running any block of code after it. So exit; is really not important cos the function will exit with or without it.
Re: Redirect A Page In Php? by ps3o(m): 12:41am On Mar 22, 2016
Adesege:
The header function, by default, stops running any block of code after it. So exit; is really not important cos the function will exit with or without it.
I know what I mean when I put exit. exit serves as a break to stop the code below from being executed. many times when ppl use include or require_once and there happens to be an error, the exit stops the below code from execution.
Re: Redirect A Page In Php? by Adesege(m): 2:18pm On Mar 23, 2016
ps3o:
I know what I mean when I put exit. exit serves as a break to stop the code below from being executed. many times when ppl use include or require_once and there happens to be an error, the exit stops the below code from execution.
You are right. But header function will exit immediately it is executed thereby not executing codes after it.

exit; and return; does the same thing.
1 Reply

How To Rank Your Blog Articles On Search Engine First Page Within 30 MinutesHELP: My WP Posts Redirects To A PageActive 15k Likes Page In Exchange Of Two .com.ng Domain.234

Nigerian HOSTED Adsense AccountSeems Like Google Has Broken Down.Skyrocket Your Google Rankings With 100 PR9 High Pr Seo Social Backlinks