ASP, big problem, 3 large scripts, need help 
Author Message
 ASP, big problem, 3 large scripts, need help

hey, i got this code to make a guestbook, but i only know javascript, can
any 1 help?????

guestbook.htm

    <FORM NAME="form1" METHOD="post" ACTION="submit.asp">
    <TABLE WIDTH="85%" BORDER="0" CELLPADDING="1">
      <TR>
        <TD WIDTH="28%">
          <DIV ALIGN="CENTER">Name:</DIV>
        </TD>
        <TD WIDTH="72%">
          <INPUT TYPE="text" NAME="naMe">
        </TD>
      </TR>
      <TR>
        <TD WIDTH="28%">
          <DIV ALIGN="CENTER">E-mail:</DIV>
        </TD>
        <TD WIDTH="72%">
          <INPUT TYPE="text" NAME="eMail">
        </TD>
      </TR>
      <TR>
        <TD WIDTH="28%">
          <DIV ALIGN="CENTER">ICQ#:</DIV>
        </TD>
        <TD WIDTH="72%">
          <INPUT TYPE="text" NAME="icqNum">
        </TD>
      </TR>
      <TR>
        <TD WIDTH="28%">
          <DIV ALIGN="CENTER">Homepage:</DIV>
        </TD>
        <TD WIDTH="72%">
          <INPUT TYPE="text" NAME="homePage">
        </TD>
      </TR>
      <TR>
        <TD WIDTH="28%">
          <DIV ALIGN="CENTER">Comments:</DIV>
        </TD>
        <TD WIDTH="72%">
          <INPUT TYPE="text" NAME="comMents">

????????????&nbs
p;????????
          <INPUT TYPE="submit" NAME="Submit" VALUE="Submit">
        </TD>
      </TR>
    </TABLE>
</FORM>

gusetbook.asp

  <%
Option Explicit

Const ForReading = 1, ForWriting = 2, ForAppending = 8

'declare variable
Dim objFS, objFile, objFile2, entries, textstream

'read guestbook entries into textstream
Set objFS = Server.CreateObject ("Scripting.FileSystemObject")
set objFile = objFS.GetFile(server.mappath("entries.dat"))
set textstream = objFile.OpenAsTextStream(ForReading, -2)
entries = textstream.ReadAll
textstream.close
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Guestbook</title>
</head>

<body bgcolor=#000000 text=#FFFFFF link=#FFFFCC vlink=#FFFFCC alink=#FF0000>
<font face=Verdana size=5> Guestbook </font>
<font face=Verdana size=2><blockquote>

<% response.write(entries) %>

</body>
</html>

submit.asp


<% Option Explicit
Const ForReading = 1, ForWriting = 2, ForAppending = 8

'declare variable
  Dim objFS, objFile, entries, textstream
  Dim name, email, url, comment, signed

'read guestbook entries into textstream
  Set objFS = Server.CreateObject ("Scripting.FileSystemObject")
  set objFile = objFS.GetFile(server.mappath("entries.dat"))
  set textstream = objFile.OpenAsTextStream(ForReading, -2)
  entries = textstream.ReadAll
  textstream.close

'read data entered into form
  name = Request.Form("naMe")
  email = Request.Form("eMail")
  url = Request.Form("homePage")
  comment = Request.Form("comMents")
  signed = FormatDateTime(Date, 1) & " " & Time

'write out new entry
  set objFile = objFS.CreateTextFile(server.mappath("entries.dat"), true
objFile.WriteLine("<hr noshade>")
objFile.WriteLine("<font face=Verdana size=2>" & comment & "<p>")

  'print name if entered
  if Not(name = "") then objFile.WriteLine(name & "<br> ")

  'print URL if entered
  if Not(url = "") then objFile.WriteLine(url & "<Br> ")

  'print email if entered
  if Not(email = "") then objFile.WriteLine(email & "<Br> ")

  'print date signed
  objFile.WriteLine("- " & signed & "</font>")

  'write out former entries
  objFile.WriteLine(entries)

  'close file
  objFile.close
  response.redirect ("guestbook.asp") %>

<html>
<head>
        <title>Untitled</title>
</head>

<body>

  </body>
</html>



Tue, 03 Feb 2004 19:21:53 GMT  
 ASP, big problem, 3 large scripts, need help
help you do what?  What is the error.

--

Shane


Quote:
> hey, i got this code to make a guestbook, but i only know javascript, can
> any 1 help?????

> guestbook.htm

>     <FORM NAME="form1" METHOD="post" ACTION="submit.asp">
>     <TABLE WIDTH="85%" BORDER="0" CELLPADDING="1">
>       <TR>
>         <TD WIDTH="28%">
>           <DIV ALIGN="CENTER">Name:</DIV>
>         </TD>
>         <TD WIDTH="72%">
>           <INPUT TYPE="text" NAME="naMe">
>         </TD>
>       </TR>
>       <TR>
>         <TD WIDTH="28%">
>           <DIV ALIGN="CENTER">E-mail:</DIV>
>         </TD>
>         <TD WIDTH="72%">
>           <INPUT TYPE="text" NAME="eMail">
>         </TD>
>       </TR>
>       <TR>
>         <TD WIDTH="28%">
>           <DIV ALIGN="CENTER">ICQ#:</DIV>
>         </TD>
>         <TD WIDTH="72%">
>           <INPUT TYPE="text" NAME="icqNum">
>         </TD>
>       </TR>
>       <TR>
>         <TD WIDTH="28%">
>           <DIV ALIGN="CENTER">Homepage:</DIV>
>         </TD>
>         <TD WIDTH="72%">
>           <INPUT TYPE="text" NAME="homePage">
>         </TD>
>       </TR>
>       <TR>
>         <TD WIDTH="28%">
>           <DIV ALIGN="CENTER">Comments:</DIV>
>         </TD>
>         <TD WIDTH="72%">
>           <INPUT TYPE="text" NAME="comMents">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs

- Show quoted text -

Quote:
> p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
>           <INPUT TYPE="submit" NAME="Submit" VALUE="Submit">
>         </TD>
>       </TR>
>     </TABLE>
> </FORM>

> gusetbook.asp

>   <%
> Option Explicit

> Const ForReading = 1, ForWriting = 2, ForAppending = 8

> 'declare variable
> Dim objFS, objFile, objFile2, entries, textstream

> 'read guestbook entries into textstream
> Set objFS = Server.CreateObject ("Scripting.FileSystemObject")
> set objFile = objFS.GetFile(server.mappath("entries.dat"))
> set textstream = objFile.OpenAsTextStream(ForReading, -2)
> entries = textstream.ReadAll
> textstream.close
> %>

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <html>
> <head>
> <title>Guestbook</title>
> </head>

> <body bgcolor=#000000 text=#FFFFFF link=#FFFFCC vlink=#FFFFCC
alink=#FF0000>
> <font face=Verdana size=5> Guestbook </font>
> <font face=Verdana size=2><blockquote>

> <% response.write(entries) %>

> </body>
> </html>

> submit.asp


> <% Option Explicit
> Const ForReading = 1, ForWriting = 2, ForAppending = 8

> 'declare variable
>   Dim objFS, objFile, entries, textstream
>   Dim name, email, url, comment, signed

> 'read guestbook entries into textstream
>   Set objFS = Server.CreateObject ("Scripting.FileSystemObject")
>   set objFile = objFS.GetFile(server.mappath("entries.dat"))
>   set textstream = objFile.OpenAsTextStream(ForReading, -2)
>   entries = textstream.ReadAll
>   textstream.close

> 'read data entered into form
>   name = Request.Form("naMe")
>   email = Request.Form("eMail")
>   url = Request.Form("homePage")
>   comment = Request.Form("comMents")
>   signed = FormatDateTime(Date, 1) & " " & Time

> 'write out new entry
>   set objFile = objFS.CreateTextFile(server.mappath("entries.dat"), true
> objFile.WriteLine("<hr noshade>")
> objFile.WriteLine("<font face=Verdana size=2>" & comment & "<p>")

>   'print name if entered
>   if Not(name = "") then objFile.WriteLine(name & "<br> ")

>   'print URL if entered
>   if Not(url = "") then objFile.WriteLine(url & "<Br> ")

>   'print email if entered
>   if Not(email = "") then objFile.WriteLine(email & "<Br> ")

>   'print date signed
>   objFile.WriteLine("- " & signed & "</font>")

>   'write out former entries
>   objFile.WriteLine(entries)

>   'close file
>   objFile.close
>   response.redirect ("guestbook.asp") %>

> <html>
> <head>
>         <title>Untitled</title>
> </head>

> <body>

>   </body>
> </html>



Tue, 03 Feb 2004 21:49:32 GMT  
 ASP, big problem, 3 large scripts, need help

Quote:
> hey, i got this code to make a guestbook, but i only know javascript, can

Then write the ASP page in JScript.


Thu, 05 Feb 2004 00:49:31 GMT  
 ASP, big problem, 3 large scripts, need help
whats the script that makes javascript write a log file then?


Quote:
> > hey, i got this code to make a guestbook, but i only know javascript,
can

> Then write the ASP page in JScript.



Thu, 05 Feb 2004 11:36:28 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Need big help for big problem

2. {Need Help Big Project Need Help}

3. BIG PROBLEM with MSFLEX GRID CONTROL - Help Needed

4. big help needed

5. Newbie needs help big time..

6. Big Problem With ASP

7. ASP-Access DB : strange but big speed problem

8. Help needed: problem when executing an Excel macro from an asp page

9. Asp problem - Need help

10. Help needed with printing file that's too large

11. Please Help - Big problem using Database environment

12. Need help POSTING from asp script

 

 
Powered by phpBB® Forum Software