PHP / Dreamweaver programming Help Needed

garymum4d

Idiot
I'm new to php and need some help with some code. I have a page created in Dremweaver with 6 images (buttons) accros the top (Header), Below this is an area i want to display various text using the 'include' function. I can get one page to display with no problem using code like
"<? $x = 'test.php'; ?>"
"<?php include($x); ?>"
But i want the text to change to a diferent specified text depending on what button I press in the header but using code like "onClick="('<? $x = 'test2.php'; ?>')" will not work. What code do I use so when I press a button in the header the value of $x changes? i.e $x = 'test2.php' or $x = 'test3.php'

all help will be most welcome

thanks
 
easiest way is to make a php based switch (if statement) So button one would have something like: a href="file?var=1" button 2 would be: a href="file?var=2" . The in the page do: <?php if(var=="1"){ include"whatever.php"; }else if(var=="2){ include "anotherdoc.php"; } ?>
 
Back
Top