I have this code that switches templates depending on if the user
fills in a form with a request. The request asks for the $mark &
$number. If that request gets input then it displays a list otherwise
it re-displays the form request. The $template variable changes the
value of which template is displayed.
if($mark&&$num) {
$mark = $mark = strtoupper($mar k);
$TPL_carnumbers = GetHeaders($_SE SSION["LMS_USER_D ESC"]);
$xclheader =
array('CLM_id', 'TRIP_id','Car_ number','Sighti ng_Date','Code' ,'Location','', 'Location_Splc' ,
'L_E','railroad ','Destination' ,
'','Destination _Splc','Car_num ber','',
'Classification ','Origin', '','ETA');
$xclfields =
array('clm_id', 'trip_id','car_ mark','car_numb er','sighting_d ate','sighting_ code',
'location_city' ,'location_stat e','location_sp lc','l_e','rail road','destinat ion_city',
'destination_st ate','destinati on_splc',
'car_mark','car _number','class ification','ori gin_city',
'origin_state',
'eta');
# GET CARS FOR GIVEN ID AND TYPE?
$result = SELECT_clm($mar k,$num);
if(mysql_numrow s($result)==0){
$TPL_error_valu e = "No Data for this Carnumber - Please Enter
Another Mark and Number";
$template = "clm_history_ph p.html";
}else{
while ($row = mysql_fetch_ass oc($result)){
$TPL_carnumbers .=MakeSighting( $_SESSION["LMS_USER_D ESC"],$row);
}
}
$MSG_carlist = "SIGHTING HISTORY FOR ".MakeCarnumber ($mark,$num);
$TPL_carnumbers .="</table>";
$template = "template_carli st.html";
if ($_POST['assign']!='Open in Excel'){
include "header.php ";
include "footer.php ";
}else{
$file_name = str_replace('.p hp?','',$file_n ame);
printxcl($data, $header,$file_n ame){
}
}else{
$template = "clm_history_ph p.html";
}
include "header.php ";
include $template_path. "$template" ;
include "footer.php ";
I have an error in this page on the printxcl() function because there
is the earlier call to include the header.php page, On line 39 of
header.php page is
this line:
header( 'Content-type: text/html; charset=\"$CHAR SET\"' );
which conflicts with the print statement in the printxcl() function.
How can I redirect that function /print statement to another page so I
don't get that error:
Warning: Cannot modify header information - headers already sent by
(output started at /home/allrail/public_html/templates/header.php.html :
15) in /home/allrail/public_html/header.php on line 39
Even though I tried moving the print statement to the function it
still hits on the page and I still get the error.
thanks very much,
fills in a form with a request. The request asks for the $mark &
$number. If that request gets input then it displays a list otherwise
it re-displays the form request. The $template variable changes the
value of which template is displayed.
if($mark&&$num) {
$mark = $mark = strtoupper($mar k);
$TPL_carnumbers = GetHeaders($_SE SSION["LMS_USER_D ESC"]);
$xclheader =
array('CLM_id', 'TRIP_id','Car_ number','Sighti ng_Date','Code' ,'Location','', 'Location_Splc' ,
'L_E','railroad ','Destination' ,
'','Destination _Splc','Car_num ber','',
'Classification ','Origin', '','ETA');
$xclfields =
array('clm_id', 'trip_id','car_ mark','car_numb er','sighting_d ate','sighting_ code',
'location_city' ,'location_stat e','location_sp lc','l_e','rail road','destinat ion_city',
'destination_st ate','destinati on_splc',
'car_mark','car _number','class ification','ori gin_city',
'origin_state',
'eta');
# GET CARS FOR GIVEN ID AND TYPE?
$result = SELECT_clm($mar k,$num);
if(mysql_numrow s($result)==0){
$TPL_error_valu e = "No Data for this Carnumber - Please Enter
Another Mark and Number";
$template = "clm_history_ph p.html";
}else{
while ($row = mysql_fetch_ass oc($result)){
$TPL_carnumbers .=MakeSighting( $_SESSION["LMS_USER_D ESC"],$row);
}
}
$MSG_carlist = "SIGHTING HISTORY FOR ".MakeCarnumber ($mark,$num);
$TPL_carnumbers .="</table>";
$template = "template_carli st.html";
if ($_POST['assign']!='Open in Excel'){
include "header.php ";
include "footer.php ";
}else{
$file_name = str_replace('.p hp?','',$file_n ame);
printxcl($data, $header,$file_n ame){
}
}else{
$template = "clm_history_ph p.html";
}
include "header.php ";
include $template_path. "$template" ;
include "footer.php ";
I have an error in this page on the printxcl() function because there
is the earlier call to include the header.php page, On line 39 of
header.php page is
this line:
header( 'Content-type: text/html; charset=\"$CHAR SET\"' );
which conflicts with the print statement in the printxcl() function.
How can I redirect that function /print statement to another page so I
don't get that error:
Warning: Cannot modify header information - headers already sent by
(output started at /home/allrail/public_html/templates/header.php.html :
15) in /home/allrail/public_html/header.php on line 39
Even though I tried moving the print statement to the function it
still hits on the page and I still get the error.
thanks very much,
Comment