The ThtmlViewer and TFrameViewer components provide an easy way to display HTML documents in a Delphi program. ThtmlViewer supports single HTML document display and TFrameViewer allows multiple document display within separate frames.
When I try to open any site that has double-quotes (
' ) inside the link , for ex. user.php?name='stackoverflow' it just cuts ' or sometimes it redirects me to Google!?Used code:
Hijerarhija UzasaHijerarhija Uzasa
1 Answer
You need use a fully qualified
URL including the http:// and escape/encode the URL by replacing the double-quotes (' ) with %22 .
Also you are passing wrong parameters.
See MSDN: Use ShellExecute to launch the default Web browser
Example:
You should always encode the URL parameters, not only double-quotes. You can use Indy with
TIdURI.URLEncode - IdURI unit.You could also use HTTPEncode from the HTTPApp unit to encode each parameter in the URL .
Note that
TIdURI.URLEncode will encode the ? and the & separators also. so I think it's a better idea to encode each parameter separately with HTTPEncode e.g:
kobikkobik
Not the answer you're looking for? Browse other questions tagged delphiwinapibrowserdelphi-7 or ask your own question.Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |