Hi,
What I'm trying to do is this.
Have the user select an option from a form
and depending on the option include a file.
here is my code
<FORM action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<P> I want to :
<SELECT name="option">
<OPTION selected value="null"></OPTION>
<OPTION value="read">read a book</OPTION>
<OPTION value="movies">watch a movie</OPTION>
<OPTION value="music">listen to music</OPTION>
</SELECT>
<INPUT type="submit" value="Exécuter">
</P>
</FORM>
<?php
$option = $_POST['option'];
if ($option==read)
{
include"book.inc";
}
?>
if by it self, this codes work fine but when include in another file it keep bringing me to my index page........why ?
Start Free Trial