1
ASP
2
ASPINTERNET INFORMATION SERVICES
IISWINDOWS XPWINDOWS 2000187
.aspwwwrootinetpub.
3
PROGRAM 1
1. <html>
2. <head>
3. </head>
4. <body>
5. <h3>wellcome reader</h3>
6. <%
7. response.write("<h1><b><u> we hope that you like
asp </u></b></h1>" )
8. %>
9. <br>
10.<h3>have fun</h3>
11.</body>
12.</html>
4
PROGRAM 2
1.<html>
2.<head>
3.</head>
4.<body>
5.<% for i=1 to 6
6.response.write("<h" & i& ">" & "we hope that
you like asp " & "</h" & i & ">")
7.next %>
8.<br>
9.</body>
10.</html>
5
PROGRAM 3
1. <html>
2. <head>
3. <title>odd and even</title>
4. </head>
5. <body>
6. <% for i=1 to 10
7. if(i mod 2=0) then %>
8. <b><%response.write(i)%>is even</b>
9. <br>
10.<% else %>
11.<b><%response.write(i)%>is odd</b>
12.<br>
13.<% end if
14.next %>
15.</body>
16.</html>
6
PROGRAM 4
1. <html>
2. <head>
3. <title>factorial</title>
4. <% sub fact(n,f)
5. f=1
6. for i=1 to n
7. f=f*i
8. next
9. end sub %>
10. </head>
11. <body>
12. <p>
13. <% dim n
14. call fact(5,n)
15. %>
16. the factorial of 5 is <% response.write(n)%>
17. </p>
18. <p>
19. <% fact 5,n%>
20. the factorial of 5 is <% response.write(n)%>
21. </p>
22. </body>
23. </html>
7
PROGRAM 5
1. <html>
2. <head>
3. <title>get </title>
4. </head>
5. <body>
6. <% if request.querystring("name")="" then %>
7. <form method="get" action="">
8. name: <input type="text" name="name">
9. <br/>
10. address: <input type="text" name="address">
11. <br/><br/>
12. <input type="submit" value="send data">
13. </form>
14. <% else %>
15. welcome
16. <% response.write(request.querystring("name"))
17. %>
18. <br>
19. your address is
20. <% response.write("" & request.querystring("address"))
21. %>
22. <%end if%>
23. </body>
24. </html>
8
PROGRAM 6
1. <html>
2. <head>
3. <title> post </title>
4. </head>
5. <body>
6. <% if request.form("name")="" then %>
7. <form method="post" action="">
8. name: <input type="text" name="name">
9. <br/>
10. address: <input type="text" name="address">
11. <br/><br/>
12. <input type="submit" value="send data to server">
13. </form>
14. <% else %>
15. welcome
16. <% response.write(request.form("name"))
17. %>
18. <br>
19. your address is
20. <% response.write("" & request.form("address"))
21. %>
22. <%end if%>
23. </body>
24. </html>
9
PROGRAM 7
1. <h1><marquee><
%response.cookies("name")="ALi"
2. name1=request.cookies("name")
3. response.write("welcome ")
4. response.write("your name is " & name1)
5. response.write("<br>")
6. %></marquee></h1>
7. <HTML>
8. </HTML>
10
PROGRAM 8
<% dim numvisits
response.cookies("NumVisits").Expires=date+365
numvisits=request.cookies("NumVisits")
if numvisits="" then
response.cookies("NumVisits")=1
response.write("Welcome! This is the first time you are
visiting this Web page.")
else
response.cookies("NumVisits")=numvisits+1
response.write("You have visited this ")
response.write("Web page " & numvisits)
if numvisits=1 then
response.write " time before!"
else
response.write " times before!"
end if
end if %>
<html>
<body>
</body>
</html>
11
PROGRAM 9
1. <html >
2. <head>
3. <title></title>
4. </head>
5. <body>
6. <h1><% session("username")="suha"
7. session("age")=50
8. response.write("welcome..... ")
9. response.write("<br>")
10.dim x
11.for each x in session.contents
12.response.write(x & ":" & session.contents(x)&"<br/>")
13.next
14.%></h1>
15.</body>
16.</html>
12
ContentsFor Each
13
PROGRAM 10
1.<% Application("test1")=(“MATH")
Application("test2")=(“ENGLISH")
Application("test3")=(“ARABIC")
2. dim x
3. for each x in Application.Contents
Response.Write(x & "=" &
Application.Contents(x) & "<br />")
4. next
5.%>

ملخص تقنية تصميم صفحات الويب - الوحدة الخامسة

  • 1.
  • 2.
    2 ASPINTERNET INFORMATION SERVICES IISWINDOWSXPWINDOWS 2000187 .aspwwwrootinetpub.
  • 3.
    3 PROGRAM 1 1. <html> 2.<head> 3. </head> 4. <body> 5. <h3>wellcome reader</h3> 6. <% 7. response.write("<h1><b><u> we hope that you like asp </u></b></h1>" ) 8. %> 9. <br> 10.<h3>have fun</h3> 11.</body> 12.</html>
  • 4.
    4 PROGRAM 2 1.<html> 2.<head> 3.</head> 4.<body> 5.<% fori=1 to 6 6.response.write("<h" & i& ">" & "we hope that you like asp " & "</h" & i & ">") 7.next %> 8.<br> 9.</body> 10.</html>
  • 5.
    5 PROGRAM 3 1. <html> 2.<head> 3. <title>odd and even</title> 4. </head> 5. <body> 6. <% for i=1 to 10 7. if(i mod 2=0) then %> 8. <b><%response.write(i)%>is even</b> 9. <br> 10.<% else %> 11.<b><%response.write(i)%>is odd</b> 12.<br> 13.<% end if 14.next %> 15.</body> 16.</html>
  • 6.
    6 PROGRAM 4 1. <html> 2.<head> 3. <title>factorial</title> 4. <% sub fact(n,f) 5. f=1 6. for i=1 to n 7. f=f*i 8. next 9. end sub %> 10. </head> 11. <body> 12. <p> 13. <% dim n 14. call fact(5,n) 15. %> 16. the factorial of 5 is <% response.write(n)%> 17. </p> 18. <p> 19. <% fact 5,n%> 20. the factorial of 5 is <% response.write(n)%> 21. </p> 22. </body> 23. </html>
  • 7.
    7 PROGRAM 5 1. <html> 2.<head> 3. <title>get </title> 4. </head> 5. <body> 6. <% if request.querystring("name")="" then %> 7. <form method="get" action=""> 8. name: <input type="text" name="name"> 9. <br/> 10. address: <input type="text" name="address"> 11. <br/><br/> 12. <input type="submit" value="send data"> 13. </form> 14. <% else %> 15. welcome 16. <% response.write(request.querystring("name")) 17. %> 18. <br> 19. your address is 20. <% response.write("" & request.querystring("address")) 21. %> 22. <%end if%> 23. </body> 24. </html>
  • 8.
    8 PROGRAM 6 1. <html> 2.<head> 3. <title> post </title> 4. </head> 5. <body> 6. <% if request.form("name")="" then %> 7. <form method="post" action=""> 8. name: <input type="text" name="name"> 9. <br/> 10. address: <input type="text" name="address"> 11. <br/><br/> 12. <input type="submit" value="send data to server"> 13. </form> 14. <% else %> 15. welcome 16. <% response.write(request.form("name")) 17. %> 18. <br> 19. your address is 20. <% response.write("" & request.form("address")) 21. %> 22. <%end if%> 23. </body> 24. </html>
  • 9.
    9 PROGRAM 7 1. <h1><marquee>< %response.cookies("name")="ALi" 2.name1=request.cookies("name") 3. response.write("welcome ") 4. response.write("your name is " & name1) 5. response.write("<br>") 6. %></marquee></h1> 7. <HTML> 8. </HTML>
  • 10.
    10 PROGRAM 8 <% dimnumvisits response.cookies("NumVisits").Expires=date+365 numvisits=request.cookies("NumVisits") if numvisits="" then response.cookies("NumVisits")=1 response.write("Welcome! This is the first time you are visiting this Web page.") else response.cookies("NumVisits")=numvisits+1 response.write("You have visited this ") response.write("Web page " & numvisits) if numvisits=1 then response.write " time before!" else response.write " times before!" end if end if %> <html> <body> </body> </html>
  • 11.
    11 PROGRAM 9 1. <html> 2. <head> 3. <title></title> 4. </head> 5. <body> 6. <h1><% session("username")="suha" 7. session("age")=50 8. response.write("welcome..... ") 9. response.write("<br>") 10.dim x 11.for each x in session.contents 12.response.write(x & ":" & session.contents(x)&"<br/>") 13.next 14.%></h1> 15.</body> 16.</html>
  • 12.
  • 13.
    13 PROGRAM 10 1.<% Application("test1")=(“MATH") Application("test2")=(“ENGLISH") Application("test3")=(“ARABIC") 2.dim x 3. for each x in Application.Contents Response.Write(x & "=" & Application.Contents(x) & "<br />") 4. next 5.%>