PDA

View Full Version : I have an 11 outside of my html and cant find the code


2bz2p
06-30-2008, 03:16 PM
Hi,

So this is going to sound mest up, but I have a series of switches on my index.php which grabs the $action from the address bar and outputs the correct function or include. Now when I run the index.php everything is right, but if I go to the pirep action or any action for that matter , I now have an 11 above the html code with nothing around it on the source code just 1 1.

I know what your thinking somewhere theres is an 11, but I have search all the code and cant find it. So I was wondering if anyone else ran across this before.

Thanks
2b

davidj
06-30-2008, 03:25 PM
post ya code

2bz2p
06-30-2008, 03:48 PM
alirght here we go, this is one set of pages, this works out the same for all of them; I have break this into 2 posts, i think

the different pages.
pirep
pirep_sum
roster
hubs

Index.php - creates the page using switches
<?php
include ('source/includes/settings.inc.php') ;
include ('skins/default/index.tmp.php');
/*Get current Action*/
$action = mysql_real_escape_string($_GET['action']);
if ($action == 'logoff'){
include ('source/member/logoff.php');
logoff();
}
session_start();
$callsign = $_SESSION['callsign'] ;

/*Get Security include*/
switch($action) {
case 'pirep' : $security = include ('source/includes/security.inc.php'); break ;
case 'pirep_sum' : $security = include ('source/includes/security.inc.php'); break ;
case 'roster' : $security = include ('source/includes/security.inc.php'); break ;
case 'details' : $security = include ('source/includes/admin_security.inc.php'); break ;
case 'hubs' : $security = include ('source/includes/admin_security.inc.php'); break ;
/*NO default : $security = include ('source/includes/security.inc.php'); break;*/
}
echo $security;

/*Which page needs to be included*/
switch($action) {
case 'pirep' : $include = include ('source/member/pirep.php'); break ;
case 'pirep_sum' : $include = include ('source/member/pirep_summary.php'); break ;
case 'roster' : $include = include ('source/member/roster.php'); break ;
case 'details' : $include = include ('source/admin/manage_airline_details.php'); break ;
case 'hubs' : $include = include ('source/admin/manage_hubs.php'); break ;

}
echo $include;
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
/*title*/
switch($action){
case 'pirep' : $title = '<title>vPilot - File New PIREP</title>'; break;
case 'pirep_sum' : $title = '<title>vPilot - PIREP Summary</title>'; break;
case 'roster' : $title = '<title>vPilot - Pilot Roster</title>'; break;
case 'details' : $title = '<title>vPilot - Admin - Airline Details</title>'; break;
case 'hubs' : $title = '<title>vPilot - Admin - Manage Hubs</title>'; break;
default : $title = '<title>vPilot</title>'; break;
}
echo $title."\n";
/*What page css needs to be used*/
switch($action){
case 'pirep' : $page_css = '<link href="skins/default/CSS/pirep_form.css" rel="stylesheet" type="text/css"/>'; break;
case 'pirep_sum' : $page_css = '<link href="skins/default/CSS/pirep_summary.css" rel="stylesheet" type="text/css" />'; break;
case 'roster' : $page_css = '<link href="skins/default/CSS/roster.css" rel="stylesheet" type="text/css" />'; break;
case 'details' : $page_css = '<link href="skins/default/CSS/airline_details.css" rel="stylesheet" type="text/css" />'; break;
case 'hubs' : $page_css = '<link href="skins/default/CSS/hubs.css" rel="stylesheet" type="text/css" />'; break;

}
echo $page_css."\n";
/*What skin do we need*/
switch($skin){
case 'green' : $skin_css = '<link href="CSS/green_layout.css" rel="stylesheet" type="text/css" />'; break;
default : $skin_css = '<link href="skins/default/CSS/default_layout.css" rel="stylesheet" type="text/css" />'; break;
}
echo $skin_css."\n";
/*Any Java script needed*/
switch($action){
case 'pirep' : $java = pirep_java(); break;
}
echo $java."\n";
?>
</head>
<body>
<?php
/*This is the header and toolboxes, found in index.tmp.php*/
index_header()."\n";?>

<?php
/*this is the body switch follow each switch to find each function page usually the name of the function will give you a clue*/
switch($action) {
case 'pirep' : pirep_body(); break ;
case 'pirep_sum' : pirep_sum() ; break;
case 'roster' : mroster() ; break;
case 'details' : airline_details() ; break;
case 'hubs' : manage_hubs() ; break;
default : index_body() ; break ;
}
?>
<?php
/*This is the footer, found in index.tmp.php*/
index_footer()
?>
</body>
</html>
<?php mysql_close();


?>

2bz2p
06-30-2008, 03:48 PM
settings.inc.php - db connections and what not

<?php
$hostname_conn_abrv = "localhost"; ////database hostname, usually always localhost
$database_conn_abrv = "vpilot"; ////database name
$username_conn_abrv = ""; /// database username
$password_conn_abrv = ""; //// database
$conn_abrv = mysql_pconnect($hostname_conn_abrv, $username_conn_abrv, $password_conn_abrv) or trigger_error(mysql_error(),E_USER_ERROR);

/*Get airlines info*/
mysql_select_db($database_conn_abrv, $conn_abrv);
$query_al = "SELECT * FROM airline_details";
$al = mysql_query($query_al, $conn_abrv) or die(mysql_error());
$row_al = mysql_fetch_assoc ($al);
$total_rows_al = mysql_num_rows($al);

$cfg = array(
'domain' => $row_al[airline_website]."/" ,
'name' => $row_al[airline_name] ,
'copyright' => '<a href="http://www.vpilot.org" target="_blank">&copy; 2008, vPilot Software</a>');
/*echo $cfg[domain] . "login.php" ;*/

?>

toolboxes.inc.php - creates the navigation/tool boxes.
<?php
/************************************************** ******************\
* vPilot: Virtual Pilot Software *
************************************************** ********************
* File Name: Toolboxes.inc.php File Version: 1.0 *
* ================================================== =================*
* Software Version: vPilot 1.0 *
* Software by: Michael Leslie *
* Copyright 2008 by: vPilot *
* Our URL: http://www.vPilot.org *
************************************************** ********************
* This program is distributed in the hope that it is and will be *
* useful, but WITHOUT ANY WARRANTIES. *
* *
* USE: This file creates the navigation menus *
\************************************************* *******************/
/* Copy this where you want the info boxes*/
/*
<!--Begin User Info Box -->
<?php echo user_info_box() ;?>
<!--End pilot info Box-->
<!--Pilot Panel-->
<?php echo user_tool_box() ; ?>
<!--End Pilot Panel-->
<!--Admin Panel-->
<?php echo admin_tool_box() ; ?>
<!--End Admin Panel-->
*/
function user_info_box(){

include ('settings.inc.php');
session_start();
include ('security.inc.php');
$callsign = $_SESSION['callsign'] ;
mysql_select_db($database_conn_abrv, $conn_abrv);
$query_pilot = "SELECT * FROM pilot WHERE callsign = '$callsign' ";
$pilot = mysql_query($query_pilot, $conn_abrv) or die(mysql_error());
$row_pilot = mysql_fetch_assoc($pilot);
$user_i_box = array(
'logout' => '<a href="index.php?action=logoff">Log Out</a>');

/*Get info from db about the pilot*/

echo '<div id="pilot_info_box">';
echo "<h2>User Panel</h2>";
echo "<p><strong>Name:</strong>";
echo $row_pilot['name'] ;
echo "</p>" ;
echo "<p><strong>Call Sign:</strong>";
echo $row_pilot['callsign'] ;
echo "</p>";
echo "<p><strong>Flight Hours:</strong>";
include('total_hours.inc.php') ;
echo "</p>";
echo "<p><strong>Total Flights:</strong> ";
echo $row_pilot['flight_serial'] ;
echo "</p>";
echo "<p><strong>Rank:</strong>";
include('ranks.inc.php') ;
echo "</p>";
echo "<p><strong>";
echo $user_i_box['logout'] ;
echo "</strong></p>";
echo '</div>';

return;
}


/*This is the user box*/
function user_tool_box(){
global $cfg;
$url = $cfg['domain'];
$user_box = array(
'home' => '<a href="index.php">Home</a>',
'pirep' => '<a href="index.php?action=pirep">New Pilot Report </a>',
'messages' => '<a href="../source/manage_pireps.php"> Message Center </a>',
'roster' => '<a href="index.php?action=roster"> Pilot Roster </a>',
'profile' => '<a href=../source/manage_pireps.php> Profile Control Panel </a>' );



echo '<div id="pilot_box">' ;
echo '<h2>Pilot Tool Box</h2>';
echo '<ul>';
echo '<li>' ;
echo $user_box['home'] ;
echo '</li>' ;
echo '<li>' ;
echo $user_box['pirep'] ;
echo '</li>' ;
echo '<li>' ;
echo $user_box['messages'] ;
echo '</li>' ;
echo '<li>' ;
echo $user_box['profile'] ;
echo '</li>' ;
echo '<li>' ;
echo $user_box['roster'] ;
echo '</li>' ;
echo '</ul>';
echo '</div>';


return;
}

/*Function for admin box, the array holds the links and the function spits out the html*/
function admin_tool_box(){
if ($_SESSION['site_level'] == admin){
/*Create all the links for it*/
$admin_box = array(
'airline_details' => '<a href="index.php?action=details">Airline Details</a>',
'airline_hubs' => '<a href="index.php?action=hubs">Manage Hubs</a>',
'manage_news' => '<a href=../admin/manage_pireps.php>Manage News</a>' );
/*Create the list*/
echo '<div id="admin_box">';
echo '<h2>Admin Panel</h2>';
echo '<ul>';
echo '<li>' ;
echo $admin_box['airline_details'] ;
echo '</li>' ;
echo '<li>' ;
echo $admin_box['airline_hubs'] ;
echo '</li>' ;
echo '<li>' ;
echo $admin_box['manage_news'] ;
echo '</li>' ;
echo '</ul>';
echo '</div>';


return;
}
}
?>

index.tmp.php - holds the main layout in the html.

<?php
function index_header() {
global $database_conn_abrv, $conn_abrv,$cfg;
include ('source/includes/toolboxes.inc.php');

//catch data
$user_id = $_POST['user_id'] ;
$password = $_POST['password'] ;
$submitted = $_POST['submitted'] ;
if ($user_id and $password) {
/////////////////////////////////////////////////////////////////////////////////////////////////
$query = sprintf ("SELECT * FROM PILOT WHERE user_name = '$user_id' AND password = '$password'");
$results = @mysql_query($query);
$row_account = @mysql_fetch_array($results);
/////////////////////////////////////////////////////////////////////////////////////////////////
}
if ($row_account) {
$_SESSION['id'] = $row_account['id'] ;
$_SESSION['callsign'] = $row_account['callsign'] ;
$_SESSION['site_level'] = $row_account['site_level'] ;
}
else if ($submitted) {
echo '<script>alert("Incorrect username or password.");</script>';
echo '<script>history.back(1);</script>';
exit; ;
}
$callsign = $_SESSION['callsign'] ;
/*Get info from db about the pilot*/
mysql_select_db($database_conn_abrv, $conn_abrv);
$query_pilot = "SELECT * FROM pilot WHERE callsign = '$callsign' ";
$pilot = mysql_query($query_pilot, $conn_abrv) or die(mysql_error());
$row_pilot = mysql_fetch_assoc($pilot);
?>

<div id="wrapper">
<div id="header">
<h1> <?php echo $cfg['name'];?> </h1>
<p>Virtual Pilot Management Application
</div>
<div id="content">
<div id="left_column">
<?php if ($_SESSION['id'] == NULL) {?>
<!--User Panel-->
<div id="login_box">
<h2>Log In Box</h2>
<form id="login" name="login" method="post" action="<?php $_SERVER['PHP_SELF'];?>">
<ul>
<li><strong>
<label for="user_id">User Name:</label>
</strong>
<input type="text" name="user_id" id="user_id" />
</li>
<li><strong>
<label for="password">Password:</label>
</strong> <br />
<input type="password" name="password" id="password" />
</li>
<li>
<input name="submitted" type="hidden" id="submitted" value="1" />
<input type="submit" name="submit" id="submit" value="Submit" />
</li>
</ul>
</form>
</div>
<!--End pilot info Box-->
<?php }
else { ?>
<?php echo user_info_box() ; ?>
<!--Pilot Panel-->
<?php echo user_tool_box() ; ?>
<!--End Pilot Panel-->
<!--Admin Panel-->
<?php echo admin_tool_box() ; } ?>
<!--End Admin Panel-->
</div>
<!--End Left Column-->
<?php
return ;
}
?>
<?php
////////////////////////////// Index Body Section ////////////////////////////////////////////
?>
<?php
function index_body() {
?>
<div id="main_content">
<h2>Content Title</h2>

<p> eniad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.

Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet domin id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p>
<p>Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p>
<p>Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p>
<p>Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>
</div><!-- End Main Content-->
<?php
return ;
}
?>
<?php
function index_footer() {
global $cfg;
?>
</div> <!--End Content-->
<div id="footer">
<h2 align="right"> <?php echo $cfg['copyright'];?></h2>
<p>&nbsp;</p>
</div><!--end footer-->
</div><!--end wrapper-->
<?php
return ;
}
?>


roster.php - holds the function for the pilot roster body.

<?php
/************************************************** ******************\
* vPilot: Virtual Pilot Software *
************************************************** ********************
* File Name: roster.php File Version: 1.1 *
* ================================================== =================*
* Software Version: vPilot 1.0 *
* Software by: Michael Leslie *
* Copyright 2008 by: vPilot *
* Our URL: http://www.vPilot.org *
************************************************** ********************
* This program is distributed in the hope that it is and will be *
* useful, but WITHOUT ANY WARRANTIES. *
* *
* USE: Breaks out the pilot list and tells info on each pilot. *
* Listed Functions: *
* mroster() *
\************************************************* *******************/

function mroster() {
global $callsign,$database_conn_abrv,$conn_abrv,$cfg;
// how many rows to show per page
$rowsPerPage = 10;
// by default we show first page
$pageNum = 1;
// if $_GET['page'] defined, use it as page number
if(isset($_GET['page']))
{
$pageNum = $_GET['page'];
}
// counting the offset
$offset = ($pageNum - 1) * $rowsPerPage;
/*Get info from db for a list of pilotsc*/
mysql_select_db($database_conn_abrv, $conn_abrv);
$query_roster = "SELECT * FROM pilot WHERE Activated = '1' ORDER BY id LIMIT $offset, $rowsPerPage";
$roster = mysql_query($query_roster, $conn_abrv) or die(mysql_error());
$row_roster = mysql_fetch_assoc($roster);
$total_rows_roster = mysql_num_rows($roster);

// how many rows we have in database
$query = "SELECT COUNT(callsign) AS numrows FROM pilot";
$result = mysql_query($query) or die('Error, query failed');
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$numrows = $row['numrows'];
// how many pages we have when using paging?
$maxPage = ceil($numrows/$rowsPerPage);
// print the link to access each page
$self ='index.php';
$nav = '';
for($page = 1; $page <= $maxPage; $page++)
{
if ($page == $pageNum)
{
$nav .= " $page "; // no need to create a link to current page
}
else
{
$nav .= " <a href=\"$self?action=roster&page=$page\">$page</a> ";
}
}
// ... the previous code
// creating previous and next link
// plus the link to go straight to
// the first and last page
if ($pageNum > 1)
{
$page = $pageNum - 1;
$prev = " <a href=\"$self?action=roster&page=$page\">[<]</a> ";
$first = " <a href=\"$self?action=roster&page=1\">[<<]</a> ";
}
else
{
$prev = '&nbsp;'; // we're on page one, don't print previous link
$first = '&nbsp;'; // nor the first page link
}
if ($pageNum < $maxPage)
{
$page = $pageNum + 1;
$next = " <a href=\"$self?action=roster&page=$page\">[>]</a> ";
$last = " <a href=\"$self?action=roster&page=$maxPage\">[>>]</a> ";
}
else
{
$next = '&nbsp;'; // we're on the last page, don't print next link
$last = '&nbsp;'; // nor the last page link
}
?>
<div id="main_content">
<h2>Pilot Roster</h2>

<table width="97%" border="0" align="center" cellpadding="2" cellspacing="3" id="roster">
<!--DWLayoutTable-->
<tr align="center" valign="middle" class="head_row">
<td width="54" height="23"><div align="center">Country</div></td>
<td width="97"><div align="center">Callsign</div></td>
<td width="81" ><div align="center">Name</div></td>
<td width="64"><div align="center">Flight Hrs</div></td>
<td width="82"><div align="center">Rank</div></td>
<td width="62"><div align="center">VATSIM ID</div></td>
<td width="90"><div align="center">Time in Service</div></td>
<td width="74"><div align="left">Status</div></td>
</tr>
<?php do { ?>
<tr class="info">
<td height="24" valign="middle"><div align="center"><img src="skins/default/images/flags/<?php echo $row_roster['location']; ?>.gif" alt="<?php echo $row_roster['location']; ?>" width="20" height="20"></div></td>
<td valign="middle"><div align="left"><?php echo $row_roster['callsign']; ?></div></td>
<td valign="middle"><div align="left"><a href="pilot_area/profile.php?id=<?php echo $row_roster['id']; ?>"><?php echo $row_roster['name']; ?></a></div></td>
<td valign="middle">
<div align="left"">
<?php

$pilot = $row_roster['callsign'];


mysql_select_db($database_conn_abrv, $conn_abrv);
$tt = 0;
$midnight = strtotime(date('Y-m-d') . ' 00:00:00');

$hour = $row_roster['callsign'];
mysql_select_db($database_conn_abrv, $conn_abrv);
$query_h = "SELECT duration FROM filed_pireps where pilot = '$hour'";
$h = mysql_query($query_h, $conn_abrv) or die(mysql_error());


while($r = mysql_fetch_assoc($h))
$tt += strtotime($r['duration']) - $midnight;
$hours = floor($tt/3600);
$x = $tt - floor($tt/3600)*3600;
$mins = floor($x/60);
$secs = $x - floor($x/60) * 60;
echo $hours . ':' . $mins;
?>
&nbsp;</div></td>
<td valign="middle">
<div align="left">
<?php include ('source/includes/ranks.inc.php')?> </div></td>
<td valign="top"><div align="center">
<?php if ($row_roster['vatsim_id'] == '') { ?>
<?php } else { ?>
<a href="http://www.vataware.com/pilot.cfm?cid=<?php echo $row_roster['vatsim_id']; ?>"><img src="skins/default/images/icons/vatsim.gif" alt="Vatsim Account ID <?php echo $row_roster['vatsim_id']; ?>" border="0" /></a>
<?php } ?>
</div></td>
<td>

<?php
$string = $row_roster['join_date'];
$jdate = explode("-",$string);
/*print_r ($jdate);*/
$date = date(Y)."-".date(m)."-".date(d) ;
$str = $date ;

$broke = explode("-",$str) ;

$year = $broke[0] - $jdate[0] ;
if ($broke[1] > $jdate[1]) {
$month = $broke[1] - $jdate[1];
}
else {
$month = $jdate[1] - $broke[1];
}
if ($broke[2] > $jdate[2]) {
$day = $broke[2] - $jdate[2];
}
else {
$day = $jdate[2] - $broke[2];
}
/*1y, 2m, 3d*/
if ($year !== 0 and $month !== 0 and $day !== 0) {
$tis = $year."y, ".$month."m, ".$day."d";
}
/*1 day*/
else if ($year == 0 and $month == 0 and $day !== 0){
if ($day == 1) {
$tis = $day." Day";
}
else {
$tis = $day." Days";
}
}
/*1 month*/
else if ($year == '0' and $month !== '0' and $day == '0'){
if ($month == 1) {
$tis = $month." Month";
}
else {
$tis = $month." Months";
}

}
/*1 year*/
else if ($year !== '0' and $month == '0' and $day == '0'){
if ($year == 1) {
$tis = $year." Year";
}
else {
$tis = $year." Years";
}
}
/*1y 2m*/
else if ($year !== '0' and $month !== '0' and $day == '0'){
$tis = $year." y, ".$month."m";
}
/*1y, 3d*/
else if ($year !== '0' and $month == '0' and $day !== '0'){
$tis = $year." y, ".$day."d";
}
/*2m, 3d*/
else if ($year == '0' and $month !== '0' and $day !== '0'){
$tis = $month."m, ".$day."d";
}
echo $tis;

?> </td>
<td>
<div align="left">
<?php
$status = $row_roster['status'];

if ($status == 'leave') {
echo "<font color=#FF0000>".$status."</font>";
}
else
echo "<font color=#006633>".$status."</font>";
?> </td>
</tr>


<?php } while ($row_roster = mysql_fetch_assoc($roster)); ?>
<tr class="info">
<td height="24" colspan="8" valign="middle">


<?php


// print the navigation link
echo '<div align="center">';
if ($rowsPerPage < $numrows){
echo $first . $prev .
"Page $pageNum of $maxPage Pages " . $next . $last;
}
echo '</div>
</td>
</tr>';
?>

</table>

</div><!-- End Main Content-->
<?php
return ;
}
?>

davidj
06-30-2008, 05:41 PM
first off where you have your switches.

This is not nessessary to assign the include to a var

example which is valid...


switch($action) {
case 'pirep': include ('source/includes/security.inc.php'); break ;
case 'pirep_sum': include ('source/includes/security.inc.php'); break ;
case 'roster': include ('source/includes/security.inc.php'); break ;
case 'details':include ('source/includes/admin_security.inc.php'); break ;
case 'hubs': include ('source/includes/admin_security.inc.php'); break ;
}


nor do you need to echo the include if you do it this way

you can do this with the rest of the switches

/////

2bz2p
06-30-2008, 05:43 PM
Oh so you dont have to echo the variable cool, thats a quick and easy fix.
Did you find anything on the 11? its blowing my mind.

Thanks
again

davidj
06-30-2008, 05:52 PM
it has to be in your includes

change your switches as i have advised and run it again

2bz2p
06-30-2008, 06:08 PM
Went from this:


/*Get Security include*/
switch($action) {
case 'pirep' : $security = include ('source/includes/security.inc.php'); break ;
case 'pirep_sum' : $security = include ('source/includes/security.inc.php'); break ;
case 'roster' : $security = include ('source/includes/security.inc.php'); break ;
case 'details' : $security = include ('source/includes/admin_security.inc.php'); break ;
case 'hubs' : $security = include ('source/includes/admin_security.inc.php'); break ;
/*NO default : $security = include ('source/includes/security.inc.php'); break;*/
}
echo $security;



to this on the includes


/*Get Security include*/
switch($action) {
case 'pirep' : include ('source/includes/security.inc.php'); break ;
case 'pirep_sum' : include ('source/includes/security.inc.php'); break ;
case 'roster' : include ('source/includes/security.inc.php'); break ;
case 'details' :include ('source/includes/admin_security.inc.php'); break ;
case 'hubs' : include ('source/includes/admin_security.inc.php'); break ;
}




and changed these switches from:

switch($action){
case 'pirep' : $title = '<title>vPilot - File New PIREP</title>'; break;
case 'pirep_sum' : $title = '<title>vPilot - PIREP Summary</title>'; break;
case 'roster' : $title = '<title>vPilot - Pilot Roster</title>'; break;
case 'details' : $title = '<title>vPilot - Admin - Airline Details</title>'; break;
case 'hubs' : $title = '<title>vPilot - Admin - Manage Hubs</title>'; break;
default : $title = '<title>vPilot</title>'; break;
}
echo $title."\n";

to:

switch($action){
case 'pirep' : echo '<title>vPilot - File New PIREP</title>'; break;
case 'pirep_sum' : echo '<title>vPilot - PIREP Summary</title>'; break;
case 'roster' : echo '<title>vPilot - Pilot Roster</title>'; break;
case 'details' : echo '<title>vPilot - Admin - Airline Details</title>'; break;
case 'hubs' : echo '<title>vPilot - Admin - Manage Hubs</title>'; break;
default : echo'<title>vPilot</title>'; break;
}



and the 11s are gone, I dont get it but cool

thanks again
2b