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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.