Slight end of script problem

This is a discussion on "Slight end of script problem" within the Classic ASP section. This forum, and the thread "Slight end of script problem are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 19th, 2006, 10:59
Junior Member
Join Date: Jan 2006
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Question Slight end of script problem

At the end of a particular ASP script I'm working on, I have the following:

[ <a href="http://www.pagename.???">Back to home page</a>
</body>
</html> ].

Basically, this displays the anchor tag "Back to home page" on a blank background after presing the 'Submit' button in a HTM form, and subsequently clicking on this takes you to the destination page (href="http..... ).

This is OK in itself, but far from ideal and it doesn't look very good.

Basically, is there a way of directing visitors directly to a destination page (that would display a 'thank you' message) without them first having to click on an anchor link?

Last edited by a.jenery; Apr 19th, 2006 at 11:01.
Reply With Quote

  #2 (permalink)  
Old Apr 19th, 2006, 12:47
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Re: Slight end of script problem

Try:-
Code: Select all
<%
Response.write "thankyou for your submission<br /><br />"
Response.write "Please wait whilst we transfer you...<br /><br /><br />"
Response.write "If you are not transferred, please <a href=""your url here"">click here</a>"
Response.redirect "http://www.yoururl.com/yourpage.htm"
%>
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work

Last edited by Rob; Apr 21st, 2006 at 06:50.
Reply With Quote
  #3 (permalink)  
Old Apr 21st, 2006, 01:27
Junior Member
Join Date: Jan 2006
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Slight end of script problem

Many thanks - that looks like it will work (though I don't really have a clue with my limited ASP knowledge...). I'll try it.
Reply With Quote
  #4 (permalink)  
Old Apr 21st, 2006, 02:15
Junior Member
Join Date: Jan 2006
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Re: Slight end of script problem

This is what was displayed on the screen after pressing the 'Submit' button.

Response.write "thankyou for your submission
" Response.write "Please wait whilst we transfer you...
" Response.write "If you are not transferred, please click here" Response.redirect "http://www....."

What I ment was, how can I redirect a visitor to a target/destination page without them having to click on an anchor tag?
Reply With Quote
  #5 (permalink)  
Old Apr 21st, 2006, 06:50
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Re: Slight end of script problem

you forgot to open and close the ASP tags....lol

I amended the code above.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #6 (permalink)  
Old Apr 22nd, 2006, 00:50
Junior Member
Join Date: Jan 2006
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Slight end of script problem

Many thanks. The ASP script is:

[ <%@ Language=VBScript %>
<html>
<head>
</head>
<body>
<%
Dim iMsg
Set iMsg = CreateObject("CDO.Message")
Dim iConf
Set iConf = CreateObject("CDO.Configuration")
Dim Flds
Set Flds = iConf.Fields
Flds( "http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup" '<-----xxx this path needs to point to the right place on the server. The hosts will know what it should say. Most probably, it will stay the same.
Flds.Update

Set iMsg.Configuration = iConf
iMsg.To = "v_post2001@hotmail.com" '<----xxx Andy, change this to the email address you want the form to be sent to
iMsg.From = Request.Form.Item("email")
iMsg.Subject = "SND Article Submission"
iMsg.AddAttachment Request.Form.Item("file"), Request.Form.Item("file")
iMsg.TextBody = "LastName: " & Request.Form.Item("LastName") & vbCrLf & "Initial: " & Request.Form.Item("Initial") & vbCrLf & "Location: " & Request.Form.Item("Location") & vbCrLf & "email: " & Request.Form.Item("email")
iMsg.Send
%>
<a href="http://www.....">Back to home page</a>
</body>
</html> ]

So, do I replace

%>
<a href="http://www.....">Back to home page</a>

with

<%
Response.write "thankyou for your submission<br /><br />"
Response.write "Please wait whilst we transfer you...<br /><br /><br />"
Response.write "If you are not transferred, please <a href="http://www...">click here</a>"
Response.redirect "http://www..../yourpage.htm"
%>

Last edited by a.jenery; Apr 22nd, 2006 at 00:53.
Reply With Quote
Reply

Tags
slight, end, script, problem

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Action Script shaza2007 Flash & Multimedia Forum 4 Apr 5th, 2007 19:01
DHTML script problem! Bruni Web Page Design 6 Feb 28th, 2007 12:09
slight problem with rollover menu antonyx Web Page Design 1 Feb 5th, 2007 21:43
Problem with script structure ??? DavidinLondon PHP Forum 1 Jun 9th, 2006 08:52
Pop-up Window Script Problem James Lake JavaScript Forum 4 Mar 24th, 2006 16:36


All times are GMT. The time now is 06:19.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43