This is a discussion on Re: [mp2] how to add data to posted form? - modperl ; newgaton new wrote: > my pleasure for receiving your reply! > > Maybe I didn't describe clearly the question . now I give a example to > show my question. > > First, browser post a form(the method of form ...
newgaton new wrote:
> my pleasure for receiving your reply!
> Maybe I didn't describe clearly the question . now I give a example to
> show my question.
> First, browser post a form(the method of form is POST) data, and it
> include some input element.
> . client fill some data
> to the element,for example "1234".
> Second, the Apache2 server receive the request,maybe the raw data is
> Line-based text data: application/x-www-form-urlencoded
> Third, the Apache2 will parse the raw data to some format, I don't
> know the what the format is, but
> it is not the key point.
Actually, that IS the key point.
> My question is how change the value "1234" of the key "id" to "4321".
> is there some class or interface?
> if there is, then I want to add some KEY, VALUE pairs to the request
> data, how to do?
I think you might have some misunderstandings about how the HTTP
protocol works and how to write web applications. I would suggest
looking at some basic tutorials on CGI programming. If I have
misunderstood you, please send us some code that you are using and show
us why you need to do what you are asking. That will help everyone.
> I hope I can change/add some form data in a Apache2 stage.
Perrin told you at which stages you can change the returned form data,
if I recall. However, like Perrin, I doubt that you should be trying to
modify the incoming form data directly, but, instead, should be focusing
on using the data in a CGI script or in a modperl Request handler.
> hi Sean! if I didn't misunderstand your meaning, I can't change any
> request data in the Apache2 server, and only
> read some data from it . is it right ?
This is getting close to understanding, it seems. Yes, you will
typically want to write software that parses the incoming request into
perl data structures and then uses it. In fact, the parsing is done for
you by modules like CGI:
Or you can use modperl Apache::Request object to do similar parsing.