syed Posted October 8, 2007 Share Posted October 8, 2007 Hi guys, I have a problem that I can't figure out. Basically I have a html form with one text box, which passes the value to a php page, when a submit buton is clicked. The php page takes the value entered into the search box and performs a search on a mysql database. Example $keyword = $_REQUEST['Keyword']; ...... $sq = "SELECT * FROM table WHERE Keyword='" . $keyword . '" >query database The php code I have is ment to display some data when a keyword is typed in. The problem is, it works fine for me and the people I have got to test it out, but not on my clients computer. My client says, when he enters a keyword into the text box no data is displayed, however if he copies the keyword text from phpmyaddin when browsing the keywords and pastes the keyword into the textbox then it works, but not when he types the keyword into the textbox. Im not sure what to do here, I live in the UK, and have had people in the UK test my script and they say it works fine. My clinet lives in the US and says nothing happens by he types in the keyword, only when he pastes the keyword into the textbox from the database it works. Could be do anything to do with character sets or encoding, im really not sure. Any help would be greate. Quote Link to comment https://forums.phpfreaks.com/topic/72339-help-with-form-input/ Share on other sites More sharing options...
The Little Guy Posted October 8, 2007 Share Posted October 8, 2007 You are not giving enough code. You also don't need to concatenate the strings, you can do this: $sq = "SELECT * FROM table WHERE Keyword='$keyword'" Quote Link to comment https://forums.phpfreaks.com/topic/72339-help-with-form-input/#findComment-364796 Share on other sites More sharing options...
Psycho Posted October 8, 2007 Share Posted October 8, 2007 Have you asked your client EXACTLY what he/she is entering into the search field? Assuming that does not reveal anything significant, I see two good paths to take. 1) See if your client will allow you to use Remote Desktop/Assistance to allow you to attempt to reproduce the problem from his computer. 2) Implement some logging functionality. I would create a table in the database with columns for something like "SessionID", "username", "timestamp", "description". Then create a function to add an entry tot he table. Then in your code for the page call the function at various steps to add an entry. For example, if you had this code: <?php if (isset($_REQUEST['Keyword'])) { $keyword = $_REQUEST['Keyword']; } ?> Change it to this <?php if (isset($_REQUEST['Keyword'])) { $keyword = $_REQUEST['Keyword']; loggingFuntion("Keyword request value was received with the value '$keyword'"); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/72339-help-with-form-input/#findComment-364797 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.