show variables inside of html table?

I am new to php and don’t know how to go through this: generally i want to set different values to some buttoms within a site, when the user click on different buttoms, a variable inside of a html table of the site will change to different include values so it can display different page within that table, but i tried some times and can’t do it, because the the buttoms required to link to a url, so i decided to use the $_GET method for this(is there any better method?) here is a example of my test code to make it more clearer:[code]…

<?php //addressing error: ini_set ('display_errors',1); error_reporting (E_ALL & ~E_NOTICE);

$select=$_GET[‘select’];

if (empty ($select)){
$body=include “hello.php”;
}else{
$body=include “example.php”;
}
?>

<?php print /*try print out this var, but can't*/"$body"; ?>
...[/code] I am trying to show the variable generated by the buttom which have url: "value.php?select=home" to show in the table with $body variable, (i named the file variable.php) but the syntax are just wrong and can't see the result i expected, is there any other method can make the same result? thanks alot in advence

try something like this:

[code]…

<?php //addressing error: ini_set ('display_errors',1); error_reporting (E_ALL & ~E_NOTICE);

$select=$_GET[‘select’];

if (empty ($select)){
$body= “hello.php”;
}else{
$body= “example.php”;
}
?>

<?php include $body; ?>
...[/code]

got it! thaaaaaaanx! :D can i ask one more additional question? how can i add a slide bar at the right, of the table so that can create a frameset effect within the table? thanx again. (if you can’t answer me here, i can ask out side of this topic instead)

Sponsor our Newsletter | Privacy Policy | Terms of Service