i need to check if a user exist and if not to redirect him to a certain page
how do i do thatT?
i cant use includes and i know it a problem to use
Header(Location:index.php)
if its not written in the first line so what the best way to do?
thnaks in advance
peleg
[SOLVED] checking if a user exist
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
I use:
because you can put it anywhere after output
Code: Select all
<script language="javascript">document.location.href = "http://domain.com";</script>- pelegk2
- Forum Regular
- Posts: 633
- Joined: Thu Nov 27, 2003 5:02 am
- Location: Israel - the best place to live in after heaven
- Contact:
well i cant use header() beacuse i have out put
but what abput ob_start()? i read but didnt understand execlly how it helps me 
can u lighten me?
thnaks in advance
peleg
can u lighten me?
thnaks in advance
peleg
- launchcode
- Forum Contributor
- Posts: 401
- Joined: Tue May 11, 2004 7:32 pm
- Location: UK
- Contact:
Yeah I would agree with that.. there are cases for ob_start, but they are far and few between. Just use a correctly defined Header Location - if you do it right, there isn't a browser out there that will actively not support it - and it can appear anywhere in your PHP script so long as you haven't echo'd anything out by that point.