I have read the online docs and reviewed lots of samples on this forum and else where. No matter what I try, I cannot get it to work.
I have written a PHP page which basically uses mostly functions. This method leaves me with the variable scope problem. No problem, I said, as I figured I can always use session variables. Well, I was mistaken.
To give you an idea, this is some what the PHP page structure:
This function loads data grid to screen
As user clicks on link to expand a record, new window is opened with that record information. This is done by passing variables on URL. The opened PHP document goes out and loads the data as needed. Within this document, user ha options to [ ] Add, [ ] Edit, [ ] Delete. Each of these triggers the same PHP page passing an action trigger variable which is then used to determine proper course of action.
The action page at this point has several functions and it is written kind of like this:
This is pretty much the code structure. No matter where I place session_start() I get the following error:
I do not know why the error shows twice, that got me worried even more.
Your help, as usual, will be greatly appreciated.
Jose Lerebours
PS: Please excuse the lengthly message but I figure I needed to be as detailed as possible.
KNOWLEDGE: Something you can give away endlessly and gain more of it in the process! - Jose Lerebours
I have written a PHP page which basically uses mostly functions. This method leaves me with the variable scope problem. No problem, I said, as I figured I can always use session variables. Well, I was mistaken.
To give you an idea, this is some what the PHP page structure:
This function loads data grid to screen
Code:
<?PHP
function ShowDataGrid() { ... }
As user clicks on link to expand a record, new window is opened with that record information. This is done by passing variables on URL. The opened PHP document goes out and loads the data as needed. Within this document, user ha options to [ ] Add, [ ] Edit, [ ] Delete. Each of these triggers the same PHP page passing an action trigger variable which is then used to determine proper course of action.
The action page at this point has several functions and it is written kind of like this:
Code:
<?PHP
function GetDataInput ( varA, varB, varC ...)
{
.... do some stuff ...
}
function ValidateDataInput ( varA, varB, varC ...)
{
... check data here ...
... if not good, build varERR and return it with error ...
}
function LoadDefaultData ( varA ... )
{
... gets data from in-house application. Data is written
... to text file which is then read-in to a variable, this
... variable is then returned to calling routine
}
function WriteData ( varA )
{
... Write data to text file and call in-house app to
... process it
}
?>
<?PHP
// Here is where the actual work begin and functions are
// called
/* I use a sequence of if(){...}else{...} statements to
/* check for $_GET[] and $_POST[]. This is what happens in
/* a nutshell
if ($_POST['submit' != "" ) // user submitted form
{ $ckERR = ValidateData( ... vars to validate ...)
if $ckERR != "" { GetDataInput( ... variables ...); }
WriteData( ... variables ... );
} else {
LoadDefaultData( ... variables ... );
GetDataInput ( ... variables ... );
}
Code:
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/websites/axzas/html/josel/aff_attp.php:1) in /home/websites/axzas/html/josel/aff_attp.php on line 151
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/websites/axzas/html/josel/aff_attp.php:1) in /home/websites/axzas/html/josel/aff_attp.php on line 151
I do not know why the error shows twice, that got me worried even more.
Your help, as usual, will be greatly appreciated.
Jose Lerebours
PS: Please excuse the lengthly message but I figure I needed to be as detailed as possible.
KNOWLEDGE: Something you can give away endlessly and gain more of it in the process! - Jose Lerebours