Hi,
I have had a problem with sessions, and passing data from one page to the next, but I thought I sorted it last night. Today it seems to be worse! All I want to do is pass some form data to the next page if a username exists, as I said, it worked fine last night, now I must have done something for it to stop working completely.
Here is the code:
<?php require_once('Connections/fmcrentals.php');?>
<?php
session_start();
session_register("Admin_Fname"
;
$HTTP_SESSION_VARS['Admin_Fname'] = $_POST['Admin_Fname'];
session_register("Admin_Lname"
;
$HTTP_SESSION_VARS['Admin_Lname'] = $_POST['Admin_Lname'];
session_register("Admin_DOB"
;
$HTTP_SESSION_VARS['Admin_DOB'] = $_POST['Admin_DOB'];
session_register("Admin_Email"
;
$HTTP_SESSION_VARS['Admin_Email'] = $_POST['Admin_Email'];
session_register("Admin_Password"
;
$HTTP_SESSION_VARS['Admin_Password'] = $_POST['Admin_Password'];
and the error message:
Warning: Cannot send session cookie - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\rentals\adminaddadmin.php:3) in C:\Program Files\Apache Group\Apache2\htdocs\rentals\adminaddadmin.php on line 4
It also says that:
Warning: Cannot add header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\rentals\adminaddadmin.php:3) in C:\Program Files\Apache Group\Apache2\htdocs\rentals\adminaddadmin.php on line 51
and that line in the code is:
// *** Restrict Access To Page: Grant or deny access to this page
$FF_authorizedUsers=" Admin";
$FF_authFailedURL="nopermission.php";
$FF_grantAccess=0;
session_start();
if (isset($HTTP_SESSION_VARS["MM_Username"])) {
LINE 51.....if (false || !(isset($HTTP_SESSION_VARS["MM_UserAuthorization"])) || $HTTP_SESSION_VARS["MM_UserAuthorization"]=="" || strpos($FF_authorizedUsers, $HTTP_SESSION_VARS["MM_UserAuthorization"])) {
$FF_grantAccess = 1;
}
}
if (!$FF_grantAccess) {
$FF_qsChar = "?";
if (strpos($FF_authFailedURL, "?"
) $FF_qsChar = "&";
$FF_referrer = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING']) && strlen($HTTP_SERVER_VARS['QUERY_STRING']) > 0) $FF_referrer .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
$FF_authFailedURL = $FF_authFailedURL . $FF_qsChar . "accessdenied=" . urlencode($FF_referrer);
header("Location: $FF_authFailedURL"
;
exit;
}
I am well stuck, please could anyone shed some light on my gloomy evening?!
Thank you
I have had a problem with sessions, and passing data from one page to the next, but I thought I sorted it last night. Today it seems to be worse! All I want to do is pass some form data to the next page if a username exists, as I said, it worked fine last night, now I must have done something for it to stop working completely.
Here is the code:
<?php require_once('Connections/fmcrentals.php');?>
<?php
session_start();
session_register("Admin_Fname"
$HTTP_SESSION_VARS['Admin_Fname'] = $_POST['Admin_Fname'];
session_register("Admin_Lname"
$HTTP_SESSION_VARS['Admin_Lname'] = $_POST['Admin_Lname'];
session_register("Admin_DOB"
$HTTP_SESSION_VARS['Admin_DOB'] = $_POST['Admin_DOB'];
session_register("Admin_Email"
$HTTP_SESSION_VARS['Admin_Email'] = $_POST['Admin_Email'];
session_register("Admin_Password"
$HTTP_SESSION_VARS['Admin_Password'] = $_POST['Admin_Password'];
and the error message:
Warning: Cannot send session cookie - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\rentals\adminaddadmin.php:3) in C:\Program Files\Apache Group\Apache2\htdocs\rentals\adminaddadmin.php on line 4
It also says that:
Warning: Cannot add header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\rentals\adminaddadmin.php:3) in C:\Program Files\Apache Group\Apache2\htdocs\rentals\adminaddadmin.php on line 51
and that line in the code is:
// *** Restrict Access To Page: Grant or deny access to this page
$FF_authorizedUsers=" Admin";
$FF_authFailedURL="nopermission.php";
$FF_grantAccess=0;
session_start();
if (isset($HTTP_SESSION_VARS["MM_Username"])) {
LINE 51.....if (false || !(isset($HTTP_SESSION_VARS["MM_UserAuthorization"])) || $HTTP_SESSION_VARS["MM_UserAuthorization"]=="" || strpos($FF_authorizedUsers, $HTTP_SESSION_VARS["MM_UserAuthorization"])) {
$FF_grantAccess = 1;
}
}
if (!$FF_grantAccess) {
$FF_qsChar = "?";
if (strpos($FF_authFailedURL, "?"
$FF_referrer = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING']) && strlen($HTTP_SERVER_VARS['QUERY_STRING']) > 0) $FF_referrer .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
$FF_authFailedURL = $FF_authFailedURL . $FF_qsChar . "accessdenied=" . urlencode($FF_referrer);
header("Location: $FF_authFailedURL"
exit;
}
I am well stuck, please could anyone shed some light on my gloomy evening?!
Thank you