General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old October 20th, 2002, 01:32 PM
roberto_nl roberto_nl is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: The Netherlands
Posts: 19 roberto_nl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
header location

ok, so i've got something like this:

session_start();
if ($logout == 1) {
session_destroy();
header("location:index.php");
exit;

as far as i understand php it means that if you log out, you'll go to index.php , right?
i dont want to go to index.php, but stay on current page?
i saw something like it somewhere, but i dont know where.
what sould i put in "location: ?? " to make it stay on the same page?

greetz
roberto

Reply With Quote
  #2  
Old October 20th, 2002, 08:11 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
it should be

header("location: " $_SERVER['PHP_SELF']);

That should do it.

Reply With Quote
  #3  
Old October 21st, 2002, 01:52 PM
crazytrain81 crazytrain81 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 232 crazytrain81 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
it looks like another problem is exit; , should be exit(); , though you don't NEED to use exit() after a header anyway.

and shouldn't it be either header("Location : $_SERVER[PHP_SELF]"); or header("Location : " . $_SERVER[PHP_SELF]); ? I normally just double quote the whole statement , but woudln't it error without the concatenation?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > header location


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway