Re: Pass var from JavaScript to PHP
| From: | TorrentUK | Date: | Tue, 13 Nov 2001 12:56:49 +0000 |
| Subject: | Re: Pass var from JavaScript to PHP | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-14276@lists.php.net to get a copy of this message | ||
err...what javascript the form is HTML?
Try...
<form name="<NAME>" method="get OR post" action="<?php echo
$PHP_SELF?>">
Then in your page have a php tag that checks for the presence of $Find (in
your case), e.g.
if ($Find) {
sql = (SELECT * FROM table WHERE $criteria = "value");
then the rest...
}
-torrent
"George Lioumis" <glioumis@adacom.com> wrote in message
news:009401c16c3d$e529a0c0$05041fac@adacom.com...
Good day to all!
Consider the following code:
<FORM ...>
<INPUT type="Text" name="criteria" size="50">
<BR>
<INPUT type="Button" name="Find" value="Find">
</FORM>
I want to get the text that the user writes into the text field into a php
variable to use it in the same page.
I want to use this text as a criteria to search for an entry in my mySQL DB
using a LIKE statement in the select.
Does anyone knows how to do it?
Thanx inadvance.