I have a site with dynamic MySQL data incorporated into CMSMS.
I would like to make some basic searches in the MySQL database with user input. But I have not found how to do it. What I would like to have in my user defined tag is something like this: SELECT * FROM table WHERE field=[input]%
I could be a simple "Get" prcedure, where the [input] is included as a Get variable. But it must give the result with two paramaters in the form
index.php?page=name&input=Word
In all the examples I have tried, I get only one of the parameters.
Can anyone help me with some code?
[Solved] Input forms - a very simple(?) question
-
olavt
[Solved] Input forms - a very simple(?) question
Last edited by olavt on Tue Sep 04, 2007 11:57 am, edited 1 time in total.
-
alby
Re: Input forms - a very simple(?) question
Have you add action="get" in your search form?olavt wrote: I have a site with dynamic MySQL data incorporated into CMSMS.
I would like to make some basic searches in the MySQL database with user input. But I have not found how to do it. What I would like to have in my user defined tag is something like this: SELECT * FROM table WHERE field=[input]%
I could be a simple "Get" prcedure, where the [input] is included as a Get variable. But it must give the result with two paramaters in the form
index.php?page=name&input=Word
In all the examples I have tried, I get only one of the parameters.
Or post your search form html code
Alby
-
olavt
Re: Input forms - a very simple(?) question
I have tried something like this:alby wrote: Have you add action="get" in your search form?
Or post your search form html code
Alby
echo '
Name:
';
But the result is: index.php?name=clapton , which only gives the index page, as the parameters are not correct.
-
alby
Re: Input forms - a very simple(?) question
No, the sintax is:olavt wrote: I have tried something like this:
echo '
Name:
';
But the result is: index.php?name=clapton , which only gives the index page, as the parameters are not correct.
If artist is the alias of your page and page is value in config.php of query_var:echo '
Name:
';
$config['query_var'] = 'page';
Alby
Last edited by alby on Tue Sep 04, 2007 11:25 am, edited 1 time in total.
Re: Input forms - a very simple(?) question
or even
works with post also...
Code: Select all
<form action="index.php" method="GET">
<input type="hidden" name="page" value="mypage" />
<input type="text" name="yourvariable" value="" />
</form>-
olavt
{Solved} Re: Input forms - a very simple(?) question
While tsw was writing his reply, I was also trying the "hidden" input, and it worked with a code like this:
echo '
Name:
';
echo '
Name:
';

