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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RESPONSE.REDIRECT 1

Status
Not open for further replies.

Takis

Instructor
Oct 12, 2001
57
GR
Using Response.redirect from one server to another i get a new window of IE with the same content as the first.
what have i done wrong?

Thx, anyone...
 
This looks like client-side behavior. Server side code (like Response.Redirect) shouldnot be able to open new browser windows on the client side.

You might be clicking an HTML anchor element with a TARGET attribute set.
Bryan Wilhite
info@songhaysystem.com
 
No need to be heronic, here is the code, thx for your help!
<html>
<body>
<%
Set adoConnection = server.CreateObject(&quot;ADODB.Connection&quot;)
Set adoRecordset = server.CreateObject(&quot;ADODB.Recordset&quot;)
Dim iLength,iFieldCount
adoConnection.Open (&quot;DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=&quot; & Server.MapPath(&quot;\pekap\db\Database.mdb&quot;))
iFieldCount = 0
FirstHalfSQL = &quot;insert into [professors] (&quot;
SecondHalfSQL = &quot;) Values (&quot;
EndSQL = &quot;)&quot;%>
<!--Óõíäåóç ìå âáóç -->
<%
varidiotita = request.form(&quot;idiotita&quot;)
If varidiotita <> &quot;&quot; then
iFieldCount = iFieldCount + 1
varidiotita = Replace(varidiotita, &quot;'&quot;, &quot;''&quot;)
If iFieldCount = 1 Then
FirstHalfSQL = FirstHalfSQL & &quot;[idiotita]&quot;
Else
FirstHalfSQL = FirstHalfSQL & &quot;,[idiotita]&quot;
End If
If iFieldCount = 1 Then
SecondHalfSQL = SecondHalfSQL & &quot;'&quot; & varidiotita & &quot;'&quot;
Else
SecondHalfSQL = SecondHalfSQL & &quot;,'&quot; & varidiotita & &quot;'&quot;
End If
End If
%>
<%
vardieyth = request.form(&quot;dieyth&quot;)
If vardieyth <> &quot;&quot; then
iFieldCount = iFieldCount + 1
vardieyth = Replace(vardieyth, &quot;'&quot;, &quot;''&quot;)
If iFieldCount = 1 Then
FirstHalfSQL = FirstHalfSQL & &quot;[dieyth]&quot;
Else
FirstHalfSQL = FirstHalfSQL & &quot;,[dieyth]&quot;
End If
If iFieldCount = 1 Then
SecondHalfSQL = SecondHalfSQL & &quot;'&quot; & vardieyth & &quot;'&quot;
Else
SecondHalfSQL = SecondHalfSQL & &quot;,'&quot; & vardieyth & &quot;'&quot;
End If
End If
%>
<%
vartilefono = request.form(&quot;tilefono&quot;)
If vartilefono <> &quot;&quot; then
iFieldCount = iFieldCount + 1
vartilefono = Replace(vartilefono, &quot;'&quot;, &quot;''&quot;)
If iFieldCount = 1 Then
FirstHalfSQL = FirstHalfSQL & &quot;[tilefono]&quot;
Else
FirstHalfSQL = FirstHalfSQL & &quot;,[tilefono]&quot;
End If
If iFieldCount = 1 Then
SecondHalfSQL = SecondHalfSQL & &quot;'&quot; & vartilefono & &quot;'&quot;
Else
SecondHalfSQL = SecondHalfSQL & &quot;,'&quot; & vartilefono & &quot;'&quot;
End If
End If
%>
<%
vartaxkod = request.form(&quot;taxkod&quot;)
If vartaxkod <> &quot;&quot; then
iFieldCount = iFieldCount + 1
vartaxkod = Replace(vartaxkod, &quot;'&quot;, &quot;''&quot;)
If iFieldCount = 1 Then
FirstHalfSQL = FirstHalfSQL & &quot;[taxkod]&quot;
Else
FirstHalfSQL = FirstHalfSQL & &quot;,[taxkod]&quot;
End If
If iFieldCount = 1 Then
SecondHalfSQL = SecondHalfSQL & &quot;'&quot; & vartaxkod & &quot;'&quot;
Else
SecondHalfSQL = SecondHalfSQL & &quot;,'&quot; & vartaxkod & &quot;'&quot;
End If
End If
%>
<%
varperioxi = request.form(&quot;perioxi&quot;)
If varperioxi <> &quot;&quot; then
iFieldCount = iFieldCount + 1
varperioxi = Replace(varperioxi, &quot;'&quot;, &quot;''&quot;)
If iFieldCount = 1 Then
FirstHalfSQL = FirstHalfSQL & &quot;[perioxi]&quot;
Else
FirstHalfSQL = FirstHalfSQL & &quot;,[perioxi]&quot;
End If
If iFieldCount = 1 Then
SecondHalfSQL = SecondHalfSQL & &quot;'&quot; & varperioxi & &quot;'&quot;
Else
SecondHalfSQL = SecondHalfSQL & &quot;,'&quot; & varperioxi & &quot;'&quot;
End If
End If
%>
<%
varpolis = request.form(&quot;polis&quot;)
If varpolis <> &quot;&quot; then
iFieldCount = iFieldCount + 1
varpolis = Replace(varpolis, &quot;'&quot;, &quot;''&quot;)
If iFieldCount = 1 Then
FirstHalfSQL = FirstHalfSQL & &quot;[polis]&quot;
Else
FirstHalfSQL = FirstHalfSQL & &quot;,[polis]&quot;
End If
If iFieldCount = 1 Then
SecondHalfSQL = SecondHalfSQL & &quot;'&quot; & varpolis & &quot;'&quot;
Else
SecondHalfSQL = SecondHalfSQL & &quot;,'&quot; & varpolis & &quot;'&quot;
End If
End If
%>
<%
varemail = request.form(&quot;email&quot;)
If varemail <> &quot;&quot; then
iFieldCount = iFieldCount + 1
varemail = Replace(varemail, &quot;'&quot;, &quot;''&quot;)
If iFieldCount = 1 Then
FirstHalfSQL = FirstHalfSQL & &quot;&quot;
Else
FirstHalfSQL = FirstHalfSQL & &quot;,[email]&quot;
End If
If iFieldCount = 1 Then
SecondHalfSQL = SecondHalfSQL & &quot;'&quot; & varemail & &quot;'&quot;
Else
SecondHalfSQL = SecondHalfSQL & &quot;,'&quot; & varemail & &quot;'&quot;
End If
End If
%>
<%
varlname = request.form(&quot;lname&quot;)
If varlname <> &quot;&quot; then
iFieldCount = iFieldCount + 1
varlname = Replace(varlname, &quot;'&quot;, &quot;''&quot;)
If iFieldCount = 1 Then
FirstHalfSQL = FirstHalfSQL & &quot;[lname]&quot;
Else
FirstHalfSQL = FirstHalfSQL & &quot;,[lname]&quot;
End If
If iFieldCount = 1 Then
SecondHalfSQL = SecondHalfSQL & &quot;'&quot; & varlname & &quot;'&quot;
Else
SecondHalfSQL = SecondHalfSQL & &quot;,'&quot; & varlname & &quot;'&quot;
End If
End If
%>
<%
varfname = request.form(&quot;fname&quot;)
If varfname <> &quot;&quot; then
iFieldCount = iFieldCount + 1
varfname = Replace(varfname, &quot;'&quot;, &quot;''&quot;)
If iFieldCount = 1 Then
FirstHalfSQL = FirstHalfSQL & &quot;[fname]&quot;
Else
FirstHalfSQL = FirstHalfSQL & &quot;,[fname]&quot;
End If
If iFieldCount = 1 Then
SecondHalfSQL = SecondHalfSQL & &quot;'&quot; & varfname & &quot;'&quot;
Else
SecondHalfSQL = SecondHalfSQL & &quot;,'&quot; & varfname & &quot;'&quot;
End If
End If
%>
<% adoRecordset.ActiveConnection = AdoConnection
SQLInsert = FirstHalfSQL & SecondHalfSQL & EndSQL
if SQLInsert <> &quot;insert into [professors] () Values ()&quot; then
on error resume next
call adoRecordset.Open(SQLInsert)
if err.number = -2147467259 then
response.redirect(&quot;[URL unfurl="true"]http://www.ppols.gr/contact.htm?duplicatedata=true&quot;)[/URL]
end if
on error goto 0
else
response.redirect(&quot;[URL unfurl="true"]http://www.ppols.gr/contact.htm?nodata=true&quot;)[/URL]
end if
response.redirect(&quot;[URL unfurl="true"]http://www.ppols.gr/contact.htm?successful=true&quot;)[/URL]
%>
</BODY>
</HTML>
 
Try making this script print something out using Response.Write. If it is this page that is responsible for opening a new browser, than the response.write should be written to the original browser window and the new page should still open.
I suspect the problem actually lies in your previous page where you have your form. Make sure you don't have a target set (as was mentioned above) as this will cause the form to be posted to the window named in your target statement, creating it first if needs be.

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
This space has nothing in it, it's all ni your imagination
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top