Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help...Big Problem!

Status
Not open for further replies.

buzzt

Programmer
Oct 17, 2002
171
CA
When I submit a query using IE, any whitespaces in the search string are ignored (replaced by %20). Netscape does not automatically do this. How can I force Netscape to add the %20 instead of whitespaces when it queries the database?
 
You can't.

You should perform all data cleanup on the server side in PHP. ______________________________________________________________________
TANSTAAFL!
 
Figured it out.

For anyone with a similar problem, try the str_replace function to replace all the whitespaces sent in the query. So if the value sent in the query was "Two Words"

Example: Words

The function would look like this:

$x = "Two Words";
$y = str_replace(" ", "%20", $x);

Instead of submitting the value of $x in the query, you wouls send $y.

So the PHP looks like this:

And in the address bar, looks like this:


Keep in mind the value of $x was pulled from the database, where it already contained whitespaces.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top