Advertisement

07.11.2005 at 08:10PM PDT, ID: 21488016
[x]
Attachment Details

PHP Form Action Self submit

Asked by C-begin in PHP Scripting Language

Tags: self, form, php, action

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
[+][-]07.11.2005 at 08:28PM PDT, ID: 14418291

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.11.2005 at 08:28PM PDT, ID: 14418293

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.11.2005 at 10:01PM PDT, ID: 14418557

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP Scripting Language
Tags: self, form, php, action
Sign Up Now!
Solution Provided By: dovlet187
Participating Experts: 4
Solution Grade: B
 
 
[+][-]07.11.2005 at 11:22PM PDT, ID: 14418809

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.11.2005 at 11:29PM PDT, ID: 14418844

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2005 at 09:13AM PDT, ID: 14422874

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.12.2005 at 07:33PM PDT, ID: 14427778

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2005 at 07:40PM PDT, ID: 14427811

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2005 at 08:33AM PDT, ID: 14510296

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32