Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-10-2012, 01:15 AM   PM User | #1
100asa
New Coder

 
Join Date: May 2012
Posts: 35
Thanks: 4
Thanked 0 Times in 0 Posts
100asa is an unknown quantity at this point
Redirect

For some reason the following code isn't working:
PHP Code:
header("Location: index.php");
exit; 
Any ideas?

Cheers!
100asa is offline   Reply With Quote
Old 07-10-2012, 01:31 AM   PM User | #2
100asa
New Coder

 
Join Date: May 2012
Posts: 35
Thanks: 4
Thanked 0 Times in 0 Posts
100asa is an unknown quantity at this point
Got it working by placing it into a function. Don't know why it wasn't working without being placed into a function. Anyone have any ideas?
100asa is offline   Reply With Quote
Old 07-10-2012, 03:18 AM   PM User | #3
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
That should work unless you have it in some other context or scope.
Inigoesdr is offline   Reply With Quote
Old 07-10-2012, 07:53 PM   PM User | #4
Arcticwarrio
Regular Coder

 
Arcticwarrio's Avatar
 
Join Date: May 2012
Location: UK
Posts: 590
Thanks: 15
Thanked 65 Times in 65 Posts
Arcticwarrio is on a distinguished road
try

PHP Code:
header('Location: /index.php'); 
Arcticwarrio is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:17 AM.


Advertisement
Log in to turn off these ads.