Re: Select Values Didn't Get Passed in From Two Different Forms
| From: | Adam Richardson | Date: | Tue, 25 May 2010 17:31:13 +0000 |
| Subject: | Re: Select Values Didn't Get Passed in From Two Different Forms | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-305511@lists.php.net to get a copy of this message | ||
On Tue, May 25, 2010 at 1:17 PM, Alice Wei <ajwei@alumni.iu.edu> wrote:
>
> Hi,
>
> It is kind of difficult to explain what I am trying to do here, I will
> provide the form here to give a better idea.
>
> <ul>
> <li>Select the type of your starting point of
> interest:<br/>
> <div id="start_menu"><form
> action="test_getrss.php" name="form1" method="post">
> <span><input type="radio"
> value="Apartment" name="start"
>
> onclick="check(document.form1.start)"/> Apartment </span>
> <span><input type="radio"
> value="Grocery" name="start"
>
> onclick="check(document.form1.start)"/> Grocery </span>
> <span><input type="radio"
> value="Drugstore" name="start"
>
> onclick="check(document.form1.start)"/> Drug Store </span>
> </form></div></li>
> <li>Select the type of your ending point of
> interest:<br/>
> <div id="end_menu"><form
> action="test_getrss2.php" name="form2" method="post">
> <span><input type="radio"
> value="Apartment" name="end"
>
> onclick="check2(document.form2.end)"/> Apartment </span>
> <span><input type="radio"
> value="Grocery" name="end"
>
> onclick="check2(document.form2.end)"/> Grocery </span>
> <span><input type="radio"
> value="Drugstore" name="end"
>
> onclick="check2(document.form2.end)"/> Drug Store </span>
> </form></div></li>
> <form action="process.php" method="post">
> <li>Start Time: <input type="text"
> size="12"
> name="start_time"/></li>
> <li>Arrive Time: <input type="text"
> size="12"
> name="end_time"/></li>
> <li>Which Semster is this: <select
> name="semester">
> <option value="Fall">Fall</option>
> <option value="Spring">Spring</option>
> <option value="Summer">Summer</option>
> </select><br/></li>
> <input type="hidden" name="form1"
> value="<?php echo
> $start?>"/>
> <input type="hidden" name="form2"
> value="<?php echo $end?>"/>
> <li style="list-style:none"><input
> type="submit"
> value="Submit" name="submit"/>
> <input type="reset" value="Reset"
> name="reset"/></form>
>
> </ul>
>
> For some reason, when I pass in the output with process.php, the hidden
> input does not get passed in. Here is the process.php:
>
> <?php
> //get the q parameter from URL
>
> $start_time = $_POST['start_time'];
> $end_time = $_POST['end_time'];
> $semester = $_POST['semester'];
> $form1 = $_POST['form1'];
> $form2 = $_POST['form2'];
>
> echo "Start Time " . $start_time . "<br />";
> echo "End Time " . $end_time . "<br />";
> echo "Semester " . $semester . "<br />";
> echo "Start Location " . $form1 . "<br />";
> echo "End Location " . $form2 . "<br />";
>
> ?>
>
> I get values for start_time, end_time and semester, but not the last two
> values. What have I done wrong here?
>
> Thanks for your help.
>
> Alice
>
>
> _________________________________________________________________
> The New Busy is not the old busy. Search, chat and e-mail from your inbox.
>
>
> http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3
Where are you setting the variables $start and $end?
Adam
--
Nephtali: PHP web framework that functions beautifully
http://nephtaliproject.com