Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #21 (permalink)  
Old October 7th, 2006, 02:13 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Ok,
   I have been working on your script this morning, and got it working pretty well (make sure you hit me up on yahoo tonight, we need to talk)

You are right, if your if statement executes you need to do:

..
if o.FileNameOf("ecpFilename") = "" then
%>
//alert here
<%
else
..code
%>

--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
Reply With Quote
  #22 (permalink)  
Old October 7th, 2006, 02:57 PM
Authorized User
 
Join Date: Sep 2006
Location: Jax, NC, USA.
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to misskaos
Default

Okay, I'm leaving work now. I'll get on line once I get home. See ya there ;)

Toni Burgess
misskaos99@yahoo.com
Reply With Quote
  #23 (permalink)  
Old October 9th, 2006, 08:25 AM
Authorized User
 
Join Date: Sep 2006
Location: Jax, NC, USA.
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to misskaos
Default

i forgot to send myself the zip file from home.... anyway u can post it? (relevant part i mean)

Toni Burgess
misskaos99@yahoo.com
Reply With Quote
  #24 (permalink)  
Old October 9th, 2006, 08:58 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I dont have it one me, youll have to wait until i go home at lunch time =
--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
Reply With Quote
  #25 (permalink)  
Old October 9th, 2006, 10:15 AM
Authorized User
 
Join Date: Sep 2006
Location: Jax, NC, USA.
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to misskaos
Default

No problemo, Thanks a bunch :)

Toni Burgess
misskaos99@yahoo.com
Reply With Quote
  #26 (permalink)  
Old October 9th, 2006, 11:13 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You've got mail. =]

--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
Reply With Quote
  #27 (permalink)  
Old October 9th, 2006, 12:07 PM
Authorized User
 
Join Date: Sep 2006
Location: Jax, NC, USA.
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to misskaos
Default

checking it now, thanks!

Toni Burgess
misskaos99@yahoo.com
Reply With Quote
  #28 (permalink)  
Old October 9th, 2006, 01:44 PM
Authorized User
 
Join Date: Sep 2006
Location: Jax, NC, USA.
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to misskaos
Default

Ok I still had to change a few things to get it to work, but it is "half way" working now. The message boxes are coming up now at least. But now, after I do finally put in a valid filename and I press the "submit" button, when it attempts to take me to the postNew1.asp page (the one in which the form is located on) it tells the page cannot be displayed:

The page cannot be displayed
The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings.

--------------------------------------------------------------------------------

Please try the following:

Click the Refresh button, or try again later.

If you typed the page address in the Address bar, make sure that it is spelled correctly.

...etc, etc....

Have any clue as to why it might be doing this now? It's like I keep getting it to work but it's either with one or the other. I changed a few things around to try to fix it, I got it to go to the postNew1.asp page (with the posted data logged to the database) but I lose my alert boxes (gotta try to stop saying msgbox, sorry). And I can get it to work the other way but then it won't post the data nor go back to the page (so it looks like it's resetting itself).

I'll be leaving work in about three hours so if u're tied up, no worries I'll tough it out. And if I still don't get it fixed I'll ask u about it tomorrow. Take care

Toni Burgess
misskaos99@yahoo.com




forgot the code!

<%@ Language=VBScript%>
<% OPTION EXPLICIT%>
<% Response.Buffer = True %>
<% On Error Resume Next %>

<%
if Session("UserID") = "" then
  Response.Redirect("index1.asp")
end if
%>

<%
if Session("UserType") <> "originator" then
  Response.Redirect("noPostNew1.asp")
end if
%>
''''had to take the if statement out, it would not accept it (even with <% %>)-- it was displaying it on the webpage'''''
<html>
<head>

<title>Post New ECP/IMI Impact Form</title>
<script language = "javascript">
<!--
function checkData(){
 if(!document.myForm.ecpFilename.value.length == 0 ) {
       var sText = document.myForm.ecpFilename.value;
       if (sText.indexOf('\\') == -1) {
             alert('That is not a valid file name!');
              return false;
       }
    }
  if (document.myForm.ecpFilename.value.length == 0 ) {
       alert("Please provide a valid file name!");
       return false;
   }
  else {
   alert('Sending data...');
        myForm.submit();
    return true;
 }
}
 -->
</script>
</head>

[...code...]

<table width="750" border="0">
<form name="myForm" method="post" enctype="multipart/form-data" onSubmit=checkData();>
'''''(even without the 'action="postNew1.asp" it still tries to take me to the page and says it's unavailable. if I try to send it to another page; i.e. 'action=viewAll1.asp' it never loads (just times out).)


[...code...]<%
Dim sFile
Dim o
sFile = Request.Form("ecpFilename")
if (sFile <> "" AND inStr(sFile, "\") <> -1) then
  set o = new clsUpload
   if o.Exists("submitButton") then

  'get client file name without path
  sFileSplit = split(o.FileNameOf("ecpFilename"), "\")
  sFile = sFileSplit(Ubound(sFileSplit))



  'Upload filename
  o.FileInputName = "ecpFilename"
o.FileFullPath = Server.MapPath(".") & "\ecpFiles\" & sFile
  o.save
       end if


[...code...]

    Response.Redirect("viewAll1.asp")
  else


 schema = "http://schemas.microsoft.com/cdo/configuration/"
 set cdoConf = CreateObject("CDO.Configuration")
  with cdoConf.Fields
    .Item(schema & "sendusing") = 2
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp-server.ec.rr.com"
    .update
   End with
   Set cdoMsg = CreateObject("CDO.Message")
    With cdoMsg
     Set .Configuration = cdoConf
      .From = Session("UserEmail")
      .To = "tb@ing.com"
      .Cc = "tb@ing.com"
      .Bcc = "9@hoo.com"
      .TextBody = o.error
      .Send
    End with

    set cdoMsg = nothing

   'sJavaScript = "<script language=javascript>"
   'sJavaScript = sJavaScript & "alert('Upload failed, IIS has been contacted!');"
   'sJavaScript = sJavaScript & "self.location.href='./postNew1.asp';"
   'sJavaScript = sJavaScript & "</scr" & "ipt>"
   'response.write(sJavaScript)
'I didn't know if these may have been causing the problem, so i commented it out
end if

set o = nothing
end if
%>
Reply With Quote
  #29 (permalink)  
Old October 9th, 2006, 02:35 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Hey,
   I am crazy busy at work today and have an interview after that, I will take a look at it when i get back from my interview.

--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
Reply With Quote
  #30 (permalink)  
Old October 9th, 2006, 02:55 PM
Authorized User
 
Join Date: Sep 2006
Location: Jax, NC, USA.
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to misskaos
Default

Ok, thanks a bunch!

Toni Burgess
misskaos99@yahoo.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IBM AS400 Message Errors to show them in .NET appl julenis SQL Server 2000 2 July 12th, 2006 01:45 PM
IBM AS400 Message Errors to show them in .NET appl julenis C# 0 July 12th, 2006 10:28 AM
DTS, SQL Server, Show PK value in err message zpluug .NET Framework 2.0 7 March 10th, 2006 12:50 AM
how to show a confirmation message? noor ASP.NET 1.0 and 1.1 Basics 10 May 16th, 2005 03:12 AM
I cannot disabled show windows message “internet e woland666 Visual C++ 0 June 28th, 2004 05:35 AM



All times are GMT -4. The time now is 06:05 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.