value from a form field - newbie question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
manuel
Forum Newbie
Posts: 3
Joined: Tue Mar 18, 2003 6:01 am

value from a form field - newbie question

Post by manuel »

hi forum,

i have to put the value of a formfield into the action of the form.
my "hardcoded" and working formaction looks like this:

action="mb_city.php?Search=Search&searchbranche=&searchort=Essen&searchname=&searchdetail="

at the point where you see "Essen", i have to insert the value of a form field. how can i manage this?

thanx!

greetz from essen/germany

manuel adler
pootergeist
Forum Contributor
Posts: 273
Joined: Thu Feb 27, 2003 7:22 am
Location: UK

Post by pootergeist »

why do it that way?

you could just set input boxes for name="search" name="searchort" etc and use method="get" which would effect the same URL
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Is the formfield from another form or from the form that needs to be submitted?

Mac
manuel
Forum Newbie
Posts: 3
Joined: Tue Mar 18, 2003 6:01 am

value from a form field - newbie question

Post by manuel »

it's the same form...
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Then as pootergeist pointed out you really don't need to add the value to the query string - you can either send the whole form using the GET method or just access the form variable on the processing page along with the other form variables in the $_POST array.

Mac
manuel
Forum Newbie
Posts: 3
Joined: Tue Mar 18, 2003 6:01 am

get values from a form field - newbee question

Post by manuel »

o.k.

i will try

thanx
Post Reply