473,394 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Passing data between php files

I have a form with two drop down boxes that are hard coded as in the
example below, and another drop down (pull down) box that is populated
as a result of a MySQL query. All appears to work as it should with
the exception that after choices have been made and the submit button
clicked, (to either enter the data into another database OR work
together in another query - I've tried both), the field that was
populated by the initial query does not pass it's data as the hard
coded fields do. In other words, the 'month' below passes user data
to $month in mmonth.php but the data in the queried cell 'person' does
not pass to $person in mmonth.php - can anyone tell me why is
that? TIA - appreciate all replies...
<form method="post" action="mmonth.php">
<input type="hidden" name="id" value="NULL">
<tr>
<td><b>Month:</b></td>
<td><select name="month">
<option value = "Jan">Jan</option>
<option value = "Feb">Feb</option>
<option value = "Mar">Mar</option>
<option value = "Apr">Apr</option>
<option value = "May">May</option> etc
</select>
</td>
</tr>
Oct 9 '05 #1
4 4085
cover wrote:
I have a form with two drop down boxes that are hard coded as in the
example below, and another drop down (pull down) box that is populated
as a result of a MySQL query. All appears to work as it should with
the exception that after choices have been made and the submit button
clicked, (to either enter the data into another database OR work
together in another query - I've tried both), the field that was
populated by the initial query does not pass it's data as the hard
coded fields do. In other words, the 'month' below passes user data
to $month in mmonth.php but the data in the queried cell 'person' does
not pass to $person in mmonth.php - can anyone tell me why is
that? TIA - appreciate all replies...
<form method="post" action="mmonth.php">
<input type="hidden" name="id" value="NULL">
<tr>
<td><b>Month:</b></td>
<td><select name="month">
<option value = "Jan">Jan</option>
<option value = "Feb">Feb</option>
<option value = "Mar">Mar</option>
<option value = "Apr">Apr</option>
<option value = "May">May</option> etc
</select>
</td>
</tr>


They only way the select box would pass the value to $month in
mmonth.php would be if register_globals were set to "on" - which is a
huge security hole.

Rather, you should have register_globals set to "off" (which it probably
is since you don't see the value passed) and you can find the value in
$_POST['month'].

And next time you might try posting to ONE or TWO newsgroups.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 9 '05 #2
On Sun, 09 Oct 2005 17:09:17 -0500, Jerry Stuckle
<js*******@attglobal.net> wrote:
They only way the select box would pass the value to $month in
mmonth.php would be if register_globals were set to "on" - which is a
huge security hole.

Rather, you should have register_globals set to "off" (which it probably
is since you don't see the value passed) and you can find the value in
$_POST['month'].


Thanks, using $_POST['month'] and $_POST['person'], does indeed pass
the values for 'month', just not 'person'. It reads 'person' just
fine to populate the first query but wont pass the newly populated
drop down value anywhere else in spite of using $_POST['person'] on
that page. There must be some way to retain the value of 'person' and
pass it as much as you like between pages.
Oct 11 '05 #3
cover said the following on 11/10/2005 10:15:
On Sun, 09 Oct 2005 17:09:17 -0500, Jerry Stuckle
<js*******@attglobal.net> wrote:

They only way the select box would pass the value to $month in
mmonth.php would be if register_globals were set to "on" - which is a
huge security hole.

Rather, you should have register_globals set to "off" (which it probably
is since you don't see the value passed) and you can find the value in
$_POST['month'].

Thanks, using $_POST['month'] and $_POST['person'], does indeed pass
the values for 'month', just not 'person'. It reads 'person' just
fine to populate the first query but wont pass the newly populated
drop down value anywhere else in spite of using $_POST['person'] on
that page. There must be some way to retain the value of 'person' and
pass it as much as you like between pages.


The fact that the HTML for the "person" choice was originally
dynamically generated will have *no* bearing on whether GET/POST
variables are being recieved, unless it was dynamically generating
*incorrect* HTML.

Check the HTML source in your browser, and make sure the generated code
is correct.
Note: F'up to alt.php.sql removed.
--
Oli
Oct 11 '05 #4
cover wrote:

Thanks, using $_POST['month'] and $_POST['person'], does indeed pass
the values for 'month', just not 'person'. It reads 'person' just
fine to populate the first query but wont pass the newly populated
drop down value anywhere else in spite of using $_POST['person'] on
that page. There must be some way to retain the value of 'person' and
pass it as much as you like between pages.


OK, but since you didn't post the failing code, it's impossible to tell
what's going on.

Try posting the entire contents of your form.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 11 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
14
by: Antoni | last post by:
Hello, I wondered if anyone could offer some guidance over my php script. I was hoping the example would allow the user to click the submit buttons and the item number increment. And when the...
3
by: Jason | last post by:
Hi folks, I'm trying to create a section of a website with a unique file upload utility. The problem is that in most code and components I find to pass multipart/form data, you need to know the...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
1
by: IMRAN | last post by:
I have created a component which parses some flat files and stores in Sql database. Now I want to move that COM object to database server. Now the scenario will be like this : 1) ASP page...
10
by: amazon | last post by:
Our vender provided us a web service: 1xyztest.xsd file... ------------------------------------ postEvent PostEventRequest ------------------------------------- authetication authentication...
0
by: kencana | last post by:
hi All, I got problem in passing data (more than one) from soap client to the soap server. but if i only passing one data at a time, it works successfully.. The following is the error message i...
2
by: Hakan Örnek | last post by:
Hi , I want to parameter passing to my windows sevice. I call service commands like this ; '------------------------------------------------------------ Dim sc As ServiceController sc = New...
4
by: sofeng | last post by:
The following link shows a chart I created about passing structures among functions. Would you review it and tell me if it requires any corrections? ...
3
by: iu2 | last post by:
Hi all, I need your professional opinion about this. It is more a general programming dilemma rather then a C++ one, but since the project I write is in C++... We handle big structs of data....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.