[Solved] Input forms - a very simple(?) question

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
olavt

[Solved] Input forms - a very simple(?) question

Post by olavt »

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?
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

Post by alby »

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.
Have you add action="get" in your search form?
Or post your search form html code

Alby
olavt

Re: Input forms - a very simple(?) question

Post by olavt »

alby wrote: Have you add action="get" in your search form?
Or post your search form html code

Alby
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.
alby

Re: Input forms - a very simple(?) question

Post by alby »

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.
No, the sintax is:
echo '
Name:


';
If artist is the alias of your page and page is value in config.php of query_var:
$config['query_var'] = 'page';

Alby
Last edited by alby on Tue Sep 04, 2007 11:25 am, edited 1 time in total.
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: Input forms - a very simple(?) question

Post by tsw »

or even

Code: Select all

<form action="index.php" method="GET">
<input type="hidden" name="page" value="mypage" />

<input type="text" name="yourvariable" value="" />
</form>
works with post also...
olavt

{Solved} Re: Input forms - a very simple(?) question

Post by olavt »

While tsw was writing his reply, I was also trying the "hidden" input, and it worked with a code like this:

echo '

Name:


';
Locked

Return to “CMSMS Core”