Jump to content

[SOLVED] simple POST query - help needed


flashbot

Recommended Posts

Hi everyone,

 

I have a simple query but due to my lack of php knowledge, can't find the right function.

 

Let's say I have a form with 3 input fields.

 

[field1] => 'hello'

[field2] => 'ok'

[field3] => 'goodbye'

 

When I submit the page, I would like to echo this result:

 

[field1]

[field2]

[field3]

 

In other words, I want to have control over the posted header to determine if I should input in database the variable or not. If I use $HTTP_POST_VARS it actually returns the variable inside the header... i actually need the header's name.

 

Thanks in advance,  ::)

 

Sebastian.

 

Link to comment
https://forums.phpfreaks.com/topic/43286-solved-simple-post-query-help-needed/
Share on other sites

Hi George,

 

Sorry, probably not using the right technicality here. I should probably summarize my problem:

 

Keep in mind the "Gmail method for adding another attachment". I'm developing the same system on a site.

 

I have 1 input field and a link "add another color". JS takes care of adding another input field and dynamically giving it a name value.

 

When I submit the page, I need to collect only the name values relating to the input fields and input them in the database. Example,

 

inputfield 1 will have name=color1(dynamically) and value=green

inputfield 2 will have name=color2(dynamically) and value=red

inputfield 3 will have name=color3(dynamically) and value=brown

 

Problem is, as it is named dynamically, I don't actually know their names to invoke them as $thename = $_POST['thename'].

 

So what I figured I should do, is retrieve all the post variables, check if each POST's name contains the word "color", if it does, input into database.

 

Anyone can suggest a better method or knows the function I am so persistently after?

 

Thanks!

 

Sebastian

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.