Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/72339-help-with-form-input/
Share on other sites

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'");
}
?>

Link to comment
https://forums.phpfreaks.com/topic/72339-help-with-form-input/#findComment-364797
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.