473,398 Members | 2,120 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,398 software developers and data experts.

Odd, _GET variable is missing from my form submission...

I'm using a form element to alter (or not alter) a variable used to adjust the page layout. This is a basic PHP, MYSQL and CSS page. The form element is supposed to send the name of the form and the adjustment value.

The adjustment value is set with a select element. The form name is set with an invisible input element. The form is sent with an OnChange event in the select element. (oddly in my test case, below, this is working without the action parameter).

The trouble is the invisible input is not being set in the URL. To test what is going on I simplified the page removing the MYSQL data and replaced it with a print_r of the variable used to adjust the layout. I also removed all the content and CSS. What remains is the display of a variable, a pulldown, a variable, a pulldown, etc.

The test page performs perfectly, but the actual content page does not. The differences are:
-- The test page has no actual content from MYSQL, and instead only the variable;
-- Looking at the URL for the real page does it does not include the form name (from the hidden input) while the test does;
-- There is no CSS in the test page;
-- The URL of the test page is shorter;

Any ideas what could be happening?

PS. had a trouble with the post window, I hope this thread isn't repeated...
May 23 '10 #1
2 2676
Atli
5,058 Expert 4TB
Hey.

Could you show us the three elements from the broken page, exactly like they appear in the browser? (Just the <form>, <input> and <select> elements should be fine.)

My first though was that you might have accidentally put the input outside the form, or forgotten to name it. Or that you set the form's method attribute to post instead of get. - I'm just guessing here. I need to see the code to be able to do any more than that.
May 23 '10 #2
Thanks for the speedy reply. I don't know what I did, but its fixed. Well, I do know what I did. I copied the form processing code *again* and all of the forms into another blank page. This time I removed all the comments, and extra spaces. And, I was more methodical while removing MYSQL bits, and anything using the MYSQL vars. (Such as when I use count() on the fetch_array() results. I simply commented the original code to the side and entered a hard value.)

Again the new page worked perfectly. Then I copied the entire lot back to the content page, reversed the comments, and this time it worked. I honestly don't know what I did to fix the situation. Though I do recall I specifically ensured the URL was reset to just the page (and removing the old urls _GET variables)--it was really long. Certainly this would cause the page to load the variables incorrectly on the first load; however, I tested several form select elements each time I made a correction (which is to say I didn't just load the page and cry foul). Each time I saw the print_r of the form array change the general data, but not include the specific form name from the invisible input.

I can only conclude my code practices were sloppy and I put in a foul line (that amazingly also didn't cause an error) or I was somehow stuck in some unknown loop that would not allow the form to submit its full set of _GET vars...? More experience programming with _GET is necessary before I'll be sure.

Again thanks for the help.
May 23 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Martin the Mac Addict | last post by:
Good evening to the skilled Ladies and Gentlemen of the PHP world. I am fairly new to all of this but learning quickly. I have run in to a need to remove blank lines from a form submission after...
5
by: ratlhead | last post by:
Hey all, I'm attempting to do some form processing on a server that has register_globals off, however, I've run into a confusing situation and need some help. Basically, the form is a...
6
by: Charles Banas | last post by:
weird subject - i hope more than just one curious regular will hear me out. :) ok, i've got a bit of a big problem, and i need answers as soon as possible. i know this forum is meant for web...
8
by: CJM | last post by:
How do people go about preventing the user from submitting a form for a 2nd time? For example, the user submits a form, clicks on the back button, and the submits the form again. I have used...
3
by: Chris Smith | last post by:
Good morning, Is there a good way to use JavaScript to send a form submission, but get back the response as a string, rather than loading it into a page? I could write the code to send the...
4
by: kschneider | last post by:
Assume there's a form with it's action attribute all set to post to a URL, but without a submit control. Form submission is done via a link and I want to prevent the classic "double submit"....
6
by: Oleg Konovalov | last post by:
Hi, I have a Java/JavaScript GUI application where I perform a lot of long DB operations , which takes 5-60 secs to perform. Sometimes user double-clicks the button or just gets impatient and...
1
by: Homer | last post by:
Hi, I just got a requirement from my HR department to automate their form submission process and integrate it into the Intranet project that I had just completed Phase 1 of. Because of the...
1
by: rn5arn5a | last post by:
Nowadays, most websites make use of CAPTCHA to prevent automated Form submission. Can someone please give me examples of how automated Form submission can be achieved? It's not that I intend to...
6
by: Stanimir Stamenkov | last post by:
I have a form without a submit button like: <form name="form1" action="" onsubmit="alert('submit ' + this.name);"> <div> <label>Field 1: <input type="text" name="field1"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.