Solved

Delphi & ISAPI & HTML

Posted on 2000-04-04
8
259 Views
Last Modified: 2010-04-04
hi guys,

I am trying to get my ISAPI to "automatically" direct a user from one URL to another, without him/her doing anything..how do I do that.

I tried various solutions such as a simple one like this one :

HTML := HTML + '<A HREF="http://'+ServerName+'/index.htm">hej.gif</A>';

Had this is been reguliar HTML on a browser - it would have as soon as the gif file is displayed directed me to servername/index.htm - however it does not..this is prop. because of my ISAPI..

What about TWebResponse..can I do something there ?

Any bright ideas ?


Regards,

GOMF
0
Comment
Question by:GOMF
  • 3
  • 2
  • 2
  • +1
8 Comments
 

Author Comment

by:GOMF
Comment Utility
to put aside any confusion..the hej.gif is not complete..should have had a

<img src="hej.gif"> ....
0
 
LVL 10

Expert Comment

by:Lischke
Comment Utility
Try using JavaScript instead:

<script language="JavaScript">
function Redirect() {
  window.location = "http://www.lischke-online.de"}
   
}
}
</script>

<body onload=Redirect>
</body>

Ciao, Mike
0
 
LVL 10

Expert Comment

by:Lischke
Comment Utility
Oops, some typos. It should be:


<script language="JavaScript">
function Redirect() {
  window.location = "http://www.lischke-online.de"}
</script>

<body onLoad="Redirect();">
</body>

Ciao, Mike
0
 
LVL 13

Expert Comment

by:Epsylon
Comment Utility
You can use SendRedirect('http://blahblahblah') for automatic redirection.

But can you describe more in detail what you want to achive 'coz I don't understand your question fully..?
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:GOMF
Comment Utility
I found a solution to the proble myself, I use a meta name

<META http-equiv="refresh" content="3; URL=http://www.myserver.com">

;-)

Thanks for your help.

Regards,

GOMF
0
 
LVL 1

Accepted Solution

by:
Probie earned 200 total points
Comment Utility
Put a "Location" in the header that you are sending back to the browser.

The browser will check the header and jump there direct.

TWebResponse.CustonHeaders.add('Location=http://mynewlocation.com');

rgds
Probie
0
 
LVL 1

Expert Comment

by:Probie
Comment Utility
Opps, sorry...
you can write the new URI direct to the
TWebResponse.Location instead...
(it's the same as my example above but this is an easier way to do it)

rgds
Probie
0
 

Author Comment

by:GOMF
Comment Utility
goodie.


GOMF
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now