RE: Select Values Didn't Get Passed in From Two Different Forms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> Date: Wed, 26 May 2010 09:19:26 -0400
> To: php-general@xxxxxxxxxxxxx; ajwei@xxxxxxxxxxxxx
> From: tedd.sperling@xxxxxxxxx
> Subject: RE:  Select Values Didn't Get Passed in From Two Different  Forms
> 
> At 9:17 PM -0400 5/25/10, Alice Wei wrote:
> >No, the fields are populated in the first and second
> >form, form1 and form2. What I want to do is to get the selections from
> >both forms and pass them on to the third. Does this make sense? For some
> >  reason, the text input and the semester drop down menu result can be
> >passed to process.php, but the results that I try to select from the
> >first and second does not. So, the form is not passing the results of
> >what I had from the radio button selections.
> >
> >To illustrate, the
> >second looks something like this:
> 
> Alice:
> 
> No offense, but "Looking" like something isn't going to cut it.
> 
> I advise you to:
> 
> 1. Show us the code. -- give us a url where your code is located.
> 
> 2. Tell us what you *want* to do -- and don't show us with "it looks 
> something like this" nonsense.
> 
> 3. Get the simple stuff to work first before jumping into the harder stuff.
> 
> If you are willing to do the above, then I'll help you with your problem.
> 
> Please understand that forms are very simple with very simple rules 
> to follow. Enhancing forms with javascript routines can become 
> complicated very quickly. But if you can describe it, it can be done.
> 
> Cheers,
> 
> tedd
> 
> 


I thought I provided the whole code, but looks like it somehow got lost in the thread. 

Here is the main file I would like to use for my data entry:

Main:

<?php
// Make a MySQL Connection
mysql_connect("localhost", "xxx", "xxx") or die(mysql_error());
mysql_select_db("yyy") or die(mysql_error());

//The variables posted from the PHP form
$start = $_POST["start"];

?>
 <ul>
                <form action="" method="post">
                <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>                                                
                                </form></div></li>  </ul>           

  <form action="process.php" method="post">
                      
                        <input type="hidden" name="form1" value="<?php echo $start?>"/>
                       <input type="submit" value="Submit" name="submit"/>
                        <input type="reset" value="Reset" name="reset"/>
                        </form>
         
</body>
</html>

This is the script that I use to construct the drop down menu in test_getrss.php

<?php
//get the q parameter from URL
// Make a MySQL Connection
mysql_connect("localhost", "xxx", "xxx") or die(mysql_error());
mysql_select_db("xxxe") or die(mysql_error());
$q=$_GET["q"];

$query="SELECT name FROM start_from WHERE type='" . $q . "'";
//find out which feed was selected
$result = mysql_query ($query);
echo "<select name='start_location'>";
// printing the list box select command

while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
echo "<option value=$nt[0]>$nt[0]</option>";
/* Option values are added by looping through the array */
}
echo "</select>";// Closing of list box 
?> 


See, I am trying to get the users pick something from the <select name="start_location"> and have the info in there to pass on to process.php

<?php


//get the q parameter from URL


// Make a MySQL Connection


mysql_connect("localhost", "xxx", "xxx") or die(mysql_error());


mysql_select_db("yyy") or die(mysql_error());


$form1 = $_POST['form1'];





echo "Start Location " . $form1 . "<br />";





?>

Therefore, the radio button info. does not need to be recorded. This is not the only field I need to pass to process.php, which the data would be used to enter into a database. I am leaving what is not working in my code. I hope this helps in understanding what my problem may be. 

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

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux