help Needed

A

Anonymous

Guest
your beginning tag should start with <?php and not just <?

:p

i hope
 
So you need it to display two rows of three. What is it displaying right now?
 
sorry.. trying to understand your code. What does $_POST['num'] do? Is that an array? Please post the form you are using to do the post.
Code:
if(is_array($_POST['num']))
{
  $array6 = array();
  foreach($_POST['num'] as $key=>$value)
  {
  $array6[]=$value;
  }
}
//that is a much simpler way to write the same code

Your keys should be zero based.

$test = $array[$i]; not sure what you are doing here.

$data=explode("," , $CVSFile[$test]);
instead try
$data=explode("," , $CVSFile[($i-1)]);
 
Nathan,

three first row
three second row

custumaize under your leyout

Code:
<?
$CVSFile=file("lineup.csv");

reset ($_POST['num']);
$i=0;
while (list ($key, $val) = each ($_POST['num'])) {
	$i++;
$array6[$i]=$val;    
}

if (count($array6) >= 7)
	{
	$numer=7;
} else {
	$numer=count($array6)+1;
}

$id=0;

echo "<table border=0>";
for ($i=0; $i < 2; $i++){
echo "<tr>";
for ($num=1; $num < 4 ; $num++)
{
	$id++;
	$test=$array6[$id];
	
$data=explode("," , $CVSFile[$test]);
	$data['0']=trim($data['0']);   // Last name
	$data['1']=trim($data['1']);   // First name
	$data['2']=trim($data['2']);   // Middle name
	$data['3']=trim($data['3']);
	$data['4']=trim($data['4']);
	$data['5']=trim($data['5']);   // Age
	$data['6']=trim($data['6']);   // DOB
	$data['7']=trim($data['7']);   // Sex
	$data['8']=trim($data['8']);   // Race
	$data['9']=trim($data['9']);   //Height
	$data['10']=trim($data['10']); //Weight
	$data['11']=trim($data['11']); //Hair
	$data['12']=trim($data['12']); //Eyes
	$data['13']=trim($data['13']); //Beard
	$data['14']=trim($data['14']); //Mustache
	$data['15']=trim($data['15']); //Cmplexion
	
echo "<td><table border=0 cellspacing=0 cellpadding=0> ";
echo "<tr><td rowspan=5><center><img src=\"http://livecast.tzo.com/img/".$data['3']."f.jpg\" width=175 height=150></center></td>";
echo "<td>Date of birth $data[6]</td>";
echo "</tr>";
echo "<tr><td>Hair color ";

if ($data['11'] == "BLD") {echo "Bald"; }
elseif ($data['11'] == "BLK") {
	echo "Black"; 
	}
elseif ($data['11'] == "BLO") {
	echo "Blond"; 
	}
elseif ($data['11'] == "GRY") {
	echo "Gray"; 
	}
elseif ($data['11'] == "RED") {
	echo "Red"; 
	}
elseif ($data['11'] == "BRO") {
	echo "Brown"; 
	}
else 	{ 
	echo "UnKnown"; 
	}

echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Eyes color ";

if ($data['12'] == "BLU") {echo "Blue"; }
elseif ($data['12'] == "HZL") {
	echo "Hazel"; 
	}
elseif ($data['12'] == "GRN") {
	echo "Green"; 
	}
elseif ($data['12'] == "GRY") {
	echo "Gray"; 
	}
elseif ($data['12'] == "BRO") {
	echo "Brown"; 
	}
else 	{ 
	echo "UnKnown"; 
	}


	
echo "</td></tr>";
echo "<tr>";
echo "<td>Height $data[9]<br> Weight $data[10]</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Race ";
if ($data['8'] == "A") {echo "Asian"; }
elseif ($data['8'] == "B") {
	echo "Black"; 
	}
elseif ($data['8'] == "H") {
	echo "Hispanic"; 
	}
elseif ($data['8'] == "W") {
	echo "White"; 
	}
else 	{ 
	echo "UnKnown"; 
	}


echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td><center>$data[0] $data[1] $data[2]</center></td>";
echo "<td></td>";
echo "</tr>";
echo "</table></td>";	
}
echo "</tr>";
}
echo "</table>";
?>
 
Back
Top