Oshaka
12-01-2005, 08:55 PM
http://audiospy.net/
The main form has a glitch. In Internet Explorer, if you enter query and hit "enter" instead of clicking the submit button, it does not complete my php post. But if you click the search button it works fine... It works 100% in firefox either ways clicking or just hitting enter
Why is this happening?
Probably browser differences. There really is no mechanism (other than perhaps Javascript) I know of to force 'enter' to submit a form, although most browsers will do so if the field with the focus at the time enter is hit is a text field.
Oshaka
12-01-2005, 09:32 PM
Probably browser differences. There really is no mechanism (other than perhaps Javascript) I know of to force 'enter' to submit a form, although most browsers will do so if the field with the focus at the time enter is hit is a text field.
Funny thing though bear, that i forgot to mention. On my other website I fixed this by using a <input type="hidden" name="submit" value="true">.
But on the new site this simply isn't seeming to fix it. I have no clue what is up. It is bypassing the PHP redirect at the top of that page... Its just going to the "Action="search"" on the form..
Php code:
if($_POST['submit'] == "Search" && $_POST['cat'] == "audio")
{
echo "posted";
header("Location: search?q=$_POST[input]");
}
<input type="hidden" name="submit" value="true">
Looking for the submit value to be true.
if($_POST['submit'] == "Search"
You look for the value "true" above, but specifically assign it to look for "Search" in the PHP?
Oshaka
12-01-2005, 09:49 PM
Nevermind fixed this temp. Thanks though
malenski
12-01-2005, 09:52 PM
I know creating a hidden value the same name as the submit button fixed your page last time but I don't think this is the best practice.
I'm not sure what language (so I'm not going to give suggestions )your using but it looks like in IE when you hit enter it is not sending(posting) the right value of submit.
Then again u look to be debugging it now because I'm getting a mysql error.
Oshaka
12-01-2005, 10:22 PM
I know creating a hidden value the same name as the submit button fixed your page last time but I don't think this is the best practice.
I'm not sure what language (so I'm not going to give suggestions )your using but it looks like in IE when you hit enter it is not sending(posting) the right value of submit.
Then again u look to be debugging it now because I'm getting a mysql error.
What error are you getting? I have not yet escaped apostrophes ( ' ).
malenski
12-01-2005, 10:29 PM
I was getting
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') group by lyricid having totalcount > -1 order by totalcount d
Not anymore though.
Oshaka
12-01-2005, 10:32 PM
I was getting
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') group by lyricid having totalcount > -1 order by totalcount d
Not anymore though.
Ahh yes, small typo in my search class . Thanks for pointing that out though.