|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
more database issues
I have just a couple more databases questions and I promise I won't ask any more.....for a couple days anyways. ;)
I have my DB set up now and I used the harvest script tutorial by Matt to get keywords off the site. But now I need it to search. I have my text field on my site that is named search_term. But when I type something in and press on search it takes me to a blank page, namely that is called search.php... Here is my search script: php Code:
Here is my form to activate the script: Code:
<form name="Search" method="post" action="search.php">
<input type="Search" name="search_term" size="15" value="search here">
<a href="Search.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Go Search','','Graphics/Right/Sliced/3R.png',1)"><img src="Graphics/Right/Sliced/3.png" alt="Go Search!" name="search_term" width="130" height="21" border="0" id="search_term"></a>
</form>
Also, I thought I read somewhere that you cannot have a roll-over image as your submit button for a search. Is this correct? Thanks for any help, The Squirrel |
|
#2
|
||||
|
||||
|
RE: more database issues
Yes your problem is the picture is just a link to search.php as opposed to a submit button which submits the form.
|
|
#3
|
|||
|
|||
|
RE: more database issues
"Also, I thought I read somewhere that you cannot have a roll-over image as your submit button for a search. Is this correct?"
Actually, I think you could work around that if you place the submit button of the form in a div with display:none and then use javascript to submit the form on the 'onclick' event handler of the rollover. In fact, I think you don't even need a submit button, because I perhaps javascript can submit the form without a submit button even being present. This is speculation, but I think it would work. |
|
#4
|
||||
|
||||
|
RE: more database issues
Yes actually if you name your form you can use the javascript command: document.FormName.submit() or something similar. Of course, this poses a problem if JS is disabled on the browser.
|
|
#5
|
|||
|
|||
|
RE: RE: more database issues
Ok, I'm working on this once more after taking the weekend off. (I'll worry about the rollover lateR)
As it stands now, if I put in the submit button nothing happens still. The URL field changes to something like this "http://eislogan.com/search.php?search_term= whateverwasinthetextareahere&Submit=Submit" But it just takes me to the search.php page and nothing is displayed. I am using keywords I know are in my database and I am getting no error messages saying that it's not connecting or anything like that. Do any of you wizards here have any suggestions? Thanks, The Squirrel |
|
#6
|
|||
|
|||
|
RE: more database issues
Post your form code as it is now. If you can see the querystring in the url, then the form action must be set to GET not POST.
|
|
#7
|
|||
|
|||
|
RE: RE: more database issues
Here is my form code. The form is already set to GET instead of POST. I will cap
Code:
<form name="search_term" method="GET" action="search.php">
<div id="Search Bar" style="position:absolute; left:740px; top:-9px; width:7px; height:470px; z-index:1"><img src="Graphics/Line.png" width="1" height="597"></div>
<div id="Search" style="position:absolute; left:742px; top:95px; width:130; height:150; z-index:3"><img src="Graphics/Right/Sliced/1.png" width="130" height="33"><img src="Graphics/Right/Sliced/2.png" width="130" height="41"><a href="Search.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Go Search','','Graphics/Right/Sliced/3R.png',1)">
<img src="Graphics/Right/Sliced/3.png" alt="Go Search!" name="search_term" width="130" height="21" border="0" id="search_term"></a><a href="searchtips.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('SearchTips','','Graphics/Right/Sliced/4R.png',1)"><img src="Graphics/Right/Sliced/4.png" alt="Search Tips" name="SearchTips" width="130" height="21" border="0"></a><img src="Graphics/Right/Sliced/5.png" width="130" height="34"></div>
<div id="Search Field" style="position:absolute; left:750px; top:141px; width:118px; height:30px; z-index:5">
<input type="Search" name="search_term" size="15" value="search unavailable">
<!--<input name="Submit" type="submit" value="Submit">-->
</div>
</form>
I do not see any errors in the code itself. But I may be missing something... |
|
#8
|
|||
|
|||
|
RE: more database issues
Note that on the page where you are executing the search query, you are referring to your form elements using the $_POST superglobal. $_POST will not work with a form action of GET, change the form action to POST or...Change all references of $_POST on the search page to $_GET.
Just to clarify, I was not stateing that the action HAD to be set to GET, I was making an observation that because you could see the querystring on the url, that you had already set the action to get. |
|
#9
|
|||
|
|||
|
RE: RE: more database issues
Ahh ok, my mistake. I changed everything in my search.php script to $_GET and my forms call for GET but I am still getting the same result. I tried changing everything to POST and $_POST but then it wouldn't even show in the address bar my query. |
|
#10
|
|||
|
|||
|
RE: more database issues
That is the whole idea behind POST, it is not supposed to show the form values in the address bar,so that is working correctly. It looks like your submit button is named Submit, but you are referencing submit on the search page, so nothing is getting processed because that if statement is returning false and skipping everything....PHP is case sensitive...
|
|
#11
|
|||
|
|||
|
RE: RE: more database issues
Quote:
Ok, POST is working correctly and everything else appears to be just fine. I guess I skipped over the name of the submit button and the reference to it in the search file. Thanks for all your help! |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > more database issues |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|