Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,415 members, 7,812,224 topics. Date: Monday, 29 April 2024 at 10:19 AM

Redirect A Page In Php? - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Redirect A Page In Php? (622 Views)

How To Rank Your Blog Articles On Search Engine First Page Within 30 Minutes / HELP: My WP Posts Redirects To A Page / Active 15k Likes Page In Exchange Of Two .com.ng Domain. (2) (3) (4)

(1) (Reply) (Go Down)

Redirect A Page In Php? by cyberworx(m): 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)

Host For $1 Per Month And Get Domain Free / Woocommerce Security: The 7 Things You Should Do First / UK Adsense For Sale At A Cheap Price

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 11
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.