Hi again,
This time am outputting some html using a switch statement, but the outputted html code is not acting as coded, seems a very strange error as in both the case statements (first and third) its plain html but the link is just not acting correctly, but the main case (middle one) is working perfectly.
Here is what i have written:
# Displays Previous and Next line options table
# Output HTML with Active Links
# Implementing switch-case to output different html based on chapter number.
switch($chapter)
{
case '0';{
print '<table width="685" align="center" cellspacing="1"><tr class="title_colour"><td align="center">table width="100%" border="0" cellspacing="0"><tr class="title_colour"><td><center>';
echo "<a href'tao.php?chapter=$next_chapter'>Take the first step on your journey!</a><br>"; #METHOD 1
print '<a href"tao.php?chapter=1" target="_self">Take the first step on your journey!</a>'; #METHOD 2
print '</center></td></tr></table></td></tr></table>';
}
break;
case (($chapter >= '1') && ($chapter <= '81'));{
print '<table width="685" align="center" border="0" cellspacing="0"><tr class="title_colour"><td align="center"><center><< ';
echo "<a href='tao.php?chapter=$prev_chapter'>Previous Chapter</a>";
print '</center></td><td><center>';
echo "<a href='tao.php?chapter=$next_chapter'>Next Chapter</a>";
print ' >></center></td></tr></table></td></tr></table>';
}
break;
case '82';{
print '<table width="685" align="center" cellspacing="1"><tr class="title_colour"><td align="center"><table width="100%" border="0" cellspacing="0"><tr class="title_colour"><td><center>';
echo "<a href'homepage.php?view=home'>Take me back to the Homepage</a>";
print '</center></td></tr></table></td></tr></table>';
}
break;
#default:
# {
# print '<table width="685" align="center" border="0" cellspacing="0"><tr class="title_colour">
# <td align="center"><center><< ';
# echo "<a href='tao.php?chapter=$prev_chapter'>Previous Chapter</a>";
# print '</center></td><td><center>';
# echo "<a href='tao.php?chapter=$next_chapter'>Next Chapter</a>";
# print ' >></center></td></tr></table></td></tr></table>';
# }
# break;
} # End of Switch
the output of case '0' = tao.php?chapter=0 on both the echo and the print
the output of case '82' = tao.php?chapter=82 even though the link is for a different file within the same directory (on the site root)
Its clearly reading the switch because i made small differences to the code, but i cannot understand why the a href links are not working as coded.
If anyone can shed any light on this i would be very grateful.