[web] An Uber Simple Question!

Started by
4 comments, last by caseyd 18 years, 3 months ago
I would like to know, when using PHP, is it possible, on submission of an html form, to access other forms inputs not just the posting one? I know that you use $_POST[ blah ] to access the elements of the submitting form, but what about the data in the non submitting forms of the page? Dave
Advertisement
I don't think you can. Only the data in the submitted form is sent by the browser.

[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]

well the data in the non submital area is most likely static. just send it back in the post as extra data in relation to the page content?
All the data you want to submit must come from the client -- that means you have to figure out how to make the client send it.

One way is to have some input type hidden fields in your submittal form, and populate them with whatever data you're interested in, using &#106avascript, before you actually submit the form.

Another way is to make the entire web page one single form, so that all fields on the form go to the submittal. On the server, you can then tell which submit button was pressed by looking at the value of the submit button field.
enum Bool { True, False, FileNotFound };
Ok cool.

Thanks guys.
I might be missing something here, but if I have a form setup and press the submit button for that form, all the form elements get sent to the server, where your script just pulls out what you need.

This topic is closed to new replies.

Advertisement