Jump to content

How To Transfer A User To Another Page After Log-In?


Eritrea

Recommended Posts

else if(mysql_num_rows($result)==1)  // <-- If ONE row is returned

   {

   $my_session = mysql_result ($result, 0, 'u_id'); // <-- then user is Authentic & Start session
   $_SESSION['clans'] = $my_session;

   header('location:../FINAL/index.php');  

   }

 

As you can see the above, it is a script for a log-in page, basically saying that if row is returned from my MySQL then take user to index page.

Unfortunately, I am having a header already sent error.

 

For two days, I have tried to figure out this problem but no hope.

I recommend reading the error message you are getting, because it tells you where your page is sending output to the browser that is preventing the header from working. It's that output that you must find and eliminate or you must reorder the code on your page so that the logic using the header() statement comes before sending any non-header output to the browser.

This is the structure of the file.

 

<?php include database file ?>

<link style shit or css here >

<?php php file inside there are login queries and login checkers or the script above mentioned ?>

<?php include an html file containing the html form only for login site users ?>

<div simple html for footer of the site. ?

 

Now the problem is happening at the line three, with is called login.php and contains nothing except

 

- check if user is log-in and die

- if user is not logged in, then autheniticate his/her input with database

- If user exits then, perform:

- header("location: loged-in.php")

 

 

 

I keep asking about this problem, and always the same answers. I can't understand it. This thing is driving me crazy. I've never struggle to know about PHP as much as I am doing about header errors.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.