Hello i need some help finishing The button & form code bellow. It's supposed to be so if you write for example "chicken" in the bot and press "search" it goes to http://mypage.com/file.php?=what was writen in the box Can someone please help me make it work? <input size="15" type="text" name="tag" value="Search for tags" id='tagurl' onclick="highlight('tagurl');" /><input type="submit" value="search" /> PHP:
For the search form: <form action="file.php" method="get" name="form" id="form"><input size="15" type="text" name="tag" value="" id='tagurl'/><input type="submit" value="search" /></form> HTML: For file.php: <?php $tagurl = $_GET["tagurl"]; if($tagurl != ""){ //If the submitted value is not blank, do something } else { //If it is blank, do something else } ?> PHP: Basically, in file.php edit... if($tagurl != ""){ //If the submitted value is not blank, do something } PHP: ... to do something if the input is not empty. What I recommend is you check the database and if there are records with your search string then show them, otherwise if there are no records, do nothing. Let me know if this helped. (+rep would also be nice) This is just a rough bit of code, let me know if you need more help. BMR777