Hello Everyone,

I'm trying to change the page content based on which link is pressed. Can someone tell em hwy my code doesn't work, please? Last error I got was a parse error on line 43. Thanks

<!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" />
<title>PHP content Change </title>
<style type="text/css">
li {
	list-style-type: none;
	display: inline;
	margin-right: 15px;
}
</style>
</head>

<body>
<img src="http://www.grass-rootsfoundation.org/images/grass4_r1_c1.jpg" width="980" height="114" />
<h1>ABOUT US</h1>
<ul>
  <li><a href="contentchange.php?link=1">President</a></li>
  <li><a href="contentchange.php?link=2">Staff</a></li>
  <li><a href="contentchange.php?link=3">Board of Directors</a></li>
</ul>
<?php
if (isset($_REQUEST['link'])) {
$link = $_REQUEST['link'];} 
else {$link = 1;}
  switch ($link) {
  case 1:
  include ("aboutroots.html");
  break;
  case 2:
  include ("rootsstaff.html");
  break;
  case 3:
  include ("rootsdirectors.html");
  break;
  default:
  	$link = 1;
	break;
 ?>
</body>
</html>
Member Avatar for P0lT10n

The error is that you forgot a } after line 40 !

please specify in which line there is an error accoding to your code....as line 43 is last line...

Member Avatar for P0lT10n

please specify in which line there is an error accoding to your code....as line 43 is last line...

Look at line 40... he forgot a "}"...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.