Reply to PHP newbie - % as hex in URL?

Your name:

Reply:


Posted by b on 10/08/05 19:15

Hello,

I am writing a web based contact relationship program in PHP
and MySql,
and so far all is well, except passing partial queries based
on wildcard
characters. For example, if I search on a term like budget,
or a partial
search with bu as the search term, it works well. Budget
will return all
records with budget in the requested field and bu will
return all records
with bu as any part of the search term. Now, if I do a
search on Calgary
or California, or a partial search such as ca, I get a
strange character
in the URL instead of the wildcard search.

Here is the code I am using for the wildcard based search:

if(isset($_GET('newWild')) {
$newWild = "%".$_GET['newWild']."%";
$wildcard = $newWild;
} else {
$newWild = "%".$_POST[''searchTerm'];
$wildcard = $newWild;
}

I check to see if newWild is set in the URL for pagination
purposes or if
not set, then return the query as posted from a form.

I then surround the search term with %'s to allow for
wildcard searches
based on partial searches.

I think that because I am surrounding the search term in
%'s, PHP is
interpreting any valid %## combination as hex
representation, such as %20
being interpreted as ' space '.

How do I pass the actual value instead of having PHP
interpret any valid
%## combination as a hex representation?

For example, a partial search for provinces/states starting
with cal, is
supposed to be passed as %cal%, but instead, passes as
<hex>l% in the URL.

Forgive the <hex> but I can't reproduce the symbol, (it is
like a capitol
E with an accent above it).

Thanks!

Oh, the version of PHP I am using is version 4.4

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация