Jump to content

Problem With Session Variables


sagnik

Recommended Posts

I've a problem with the function "session_register();". When I'm using this function. I'm getting the following message:

Warning: Cannot

modify header

information - headers

already sent by (output

started at /home/sb/

public_html/global/

admin_header2.php:4) in

/home/sb/

public_html/admin/

login.php on line 75

Here is the url of the file "admin_header2.php": www.sbook.ga/global/admin_header2.php

and the file "login.php" is: www.sbook.ga/admin/login.php

Please help me to resolve the problem.

Link to comment
Share on other sites

Sir, here is my full "admin_header2.php" file script.

<!DOCTYPE html>

<html lang="en">

<head>

<?php

require "/home/sb/config/directories.php";

require $cnf."refids.php";

require $cnf."admins.php";

?>

<link rel="stylesheet" type="text/css" href="/global/styles/admin/global.css">

 

<script src="/includes/libraries/jquery/1.11.1/jquery-1.11.1.min.js"></script>

<script src="/includes/libraries/jquery/1.11.1/jquery-1.11.1.js"></script>

 

<?php

require "/home/sb/public_html/global/styles/sbook2013.php";

?>

 

 

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<title></title>

</head>

 

<body class="nontouch">

<div class="logo">

<table cellspacing="0">

<td>

<a href="index.php?refid=2<?php if(isset($sess_id) && !empty($sess_id)) { echo "&sess_id=$sess_id"; }?>"><?php require $global."logos/logo.php";?></a>

</td>

<td align="right" valign="bottom" style="width:25%;height:5%"><a class="btn btnS" align="right" href="/members/apanel/register">Sign Up</a></td>

</table>

</div>

Now tell me where is the problem and how to fix this!

Link to comment
Share on other sites

Those HTML tags at the very top should be after the php block. It needs to be like this:

 

<?php

require "/home/sb/config/directories.php";

require $cnf."refids.php";

require $cnf."admins.php";

require "/home/sb/public_html/global/styles/sbook2013.php";

?>

<!DOCTYPE html>

<html lang="en">

<head>

<link rel="stylesheet" type="text/css" href="/global/styles/admin/global.css">

 

<script src="/includes/libraries/jquery/1.11.1/jquery-1.11.1.min.js"></script>

<script src="/includes/libraries/jquery/1.11.1/jquery-1.11.1.js"></script>

 

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<title></title>

</head>

 

<body class="nontouch">

<div class="logo">

<table cellspacing="0">

<td>

<a href="index.php?refid=2<?php if(isset($sess_id) && !empty($sess_id)) { echo "&sess_id=$sess_id"; }?>"><?php require $global."logos/logo.php";?></a>

</td>

<td align="right" valign="bottom" style="width:25%;height:5%"><a class="btn btnS" align="right" href="/members/apanel/register">Sign Up</a></td>

</table>

</div>

 

  • Like 1
Link to comment
Share on other sites

Ok, I've fixed the problem. Now I am seeing that, my "login.php" file is not working. The form inside the "login.php" file is not sending any data. Can you tell me why this happens and how to redirect logged users to another page with the "sess_id=sess_id"? Please check the "login.php" file at: http://www.sbook.ga/admin/login.php

Link to comment
Share on other sites

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.   Paste as plain text instead

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