A little PHP question

Associate
Joined
3 Aug 2006
Posts
610
Location
London, UK
Is there any way of creating a hyperlink that simply changes a variable in a php file?

I am trying to make a site which just loads in the required content when a link is clicked but it just displays the one mentioned last in the code

My current code:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

<html>

   <head> 
      <title>London Dude</title>
      <link rel="stylesheet" type="text/css" href="mainstyles.css" />
<?php
	$index = "http://127.0.0.1/london-dude%201.1/frontpage.php";				//Index Page
	$about = "http://127.0.0.1/london-dude%201.1/about.php";					//About Page
	$page = $index								//Default Page
?>
   </head>

   <body>
		<div class="topbar">
			<img alt="London Dude" src="images/logo.jpg" />
		</div>
		<div class="menubar">
		<a href="<?php
	$page = $index
?>"><img alt="Home |" src="images/home.jpg" /></a>
		<a href="<?php
	$page = $about
?>"><img alt="Home |" src="images/about.jpg" /></a>
		</div>
		<center>
			<div class="body">
				<?php
	include $page;
?>
			</div>
		</center>
   </body>
</html>
 
seems to be a step in the right direction but all it seems to be doing is displaying the page url, not the content of the page
 
now that I have gone back to "include($page);" it will display the contents of the page, but now it doesn't switch between pages when I click the link
 
Cheers for the help. Using Clarkey's method now, works perfectly.

Sic's method lookes a little complicated but thanks for the help anyway
 
Back
Top Bottom