Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 31. Internet-Enabling Your Appli... > Redirecting to a Different Web Site

Redirecting to a Different Web Site

Often, a given URL may want to change the destination of a user's request. A Web application may want to process some data based on a request and then serve back a page that may vary depending on the nature of the request or a database entry. Web advertising does this frequently. Often an ad graphic will point to another URL within the domain where it appears, but clicking it takes the user to the advertiser's home page. Along the way, data is gathered about the request and then the client is handed off to the advertiser's page. Frequently, the HTML code for the advertisement's graphic will contain parameters that describe the ad to the server. The server can log that information and then pass the client on to the proper page. This technique is called redirection, and it can be very useful for a number of tasks.

Delphi's TWebResponse class includes a method called SendRedirect. It takes a single string as a parameter that should contain the full address of the site to which the client should be redirected. The method is declared as follows:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint