rastaX: Are you sure that code won't give you parse errors?
Maybe you can put these three array into one, and get a code like this:
<?
$a=Array(
Array(
'text'=>'lab one',
'link'=>'labalone.php',
'desc'=>'e reports'
),
Array(
'text'=>'progress report',
'link'=>'progressreport.ph
'desc'=>'Progress report for Nuc.'
)
);
foreach ($a as $item)
{
// $item consists of three elements: $item['text'], $item['link'] and $item['desc']
echo '<a name="',htmlspecialchars($
}
?>
Main Topics
Browse All Topics





by: ThGPosted on 2003-05-30 at 09:59:17ID: 8615675
There are some serious syntax errors in your code.
1) make sure strings are always enclosed in ' ', for example $Desc[1] and $Desc[2] are not correctly declared, and the result is something you don't want surely.
2) PHP is case sensitive, $Desc is not the same as $desc
3) Usually (but this is NOT mandatory) arrays start from index 0 and goes to count($array) - 1, so you can use the condition $x < count($arr) in the for loops..
4) for() body must be enclosed in { }
I suggest you to read
http://fr2.php.net/manual/
Here there is your code fixed code:
<?
$Text[0] ='Lab one';
$Link[0] ='labalone.php';
$Desc[0] = 'e reports';
$Text[1] = 'progress';
$Link[1] ='progressreport.php';
$Desc[1] = 'Progress report for Nuc.';
//*for loop*//
for ($x = 0; $x < count($Text); $x++) {
$curLink = $Link[$x];
$curDesc = $Desc[$x];
print "<a name=$curLink></a>\n".
"<b>$curDesc</b>\n\n".
"<blockquote>\n";
}
?>