Jump to content

pass variable to script action


slashpine

Recommended Posts

hypothetically, if I have a script that executes using a variable %$query%

how do I pass a "value option" from a drop down menu or a text box on an HTML form to the script?

i.e., how do I make the form submit the selected or entered value option as %$query%  ?
I don't really have any code...I saw a script that I may be able to use.

the script executes on a variable  that is called by " %$query% "

I am wanting to change the sql query in the script to match my tables but I need to be able to use a couple of different html forms and I can't recall how to pass an option value(drop down menu) or an entered value(text box) to the action script as " %$query% "

hope you can help...
[quote]/path/action.php?query=value option[/quote]
if you really want to do it that way, use the $_GET form method, and name your input "query".
in it's simplest form:
[code]<form action="action.php" method="GET">
<input name="query" type="text" />
<input name="submit" action="submit" value="submit" />
</form>[/code]

Whatever you select in your input will be passed across in the URL.

Or am I getting the wrong end of the stick?

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.