Professional Documents
Culture Documents
ASP
ASP
ASP
. ..
: ).. ASP .
ASP
HTML
HTML
.. .. ..
.. ..
ASP
HTML . ASP
HTML ..
. ..
ASP :
: Personal Web ServerInternet Information Server
ASP PHP CGI
. Server . ) (
Hosting Providers ( Servers
http://www1.domaindlx.com ASP
MS Access).
.
Server.
).
: pws asp.
:
http://www.alnoor-world.com/download/PWS.zip
2000 NT :
: ASP :
ASP .
Front Page
. NotePad
. Note Pad
Front Page
: :
SQL Microsoft Access ..
Microsoft Access 2000 .
..( : .
..
.
.. ..
.
.
::
. .
. .
::
. .
. .
::
. ) ).
. .
..
. ! .
.. .. ..
.
. Windows 98 .
. Start Run
. x:\add-ons\pws\setup.exe
. X .
Next Custom
.. .
.
Taskbar. ..
)
Favorites) http://localhost/iishelp :
:
http://www.alnoor-world.com/download/PWS.zip
.
. http://www1.domaindlx.com
default.asp
><hr
>"<p align="center"><font face="Simplified Arabic" size="3
></font></p
>"<p align="center"><font face="Simplified Arabic" size="3
></font></p
>"<p align="center"><font face="Simplified Arabic" size="3
></font></p
"<p align="center"><font face="Simplified Arabic" size="3
>"color="#AD1212
></font></p
><hr
"<p align="center"><font face="Simplified Arabic
>"size="3"><b><a href="tech.asp
</a>| <a >" </a>| <a href="news.asp
></a>"href="search.asp
>" </a>| <a href="admin.asp >"| <a href="guest.asp
></a></b></font></p
"<p align="center"><b><font face="Simplified Arabic
>"size="2
></font></b></p
></body
></html
SSI
.. ..
.. SSI
.. .
: ..
.. .
..:
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1256">
<meta http-equiv="Content-Language" content="ar-qa">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>< /title>
</head>
<body>
<p align="center"><img border="0" src="thetitel.gif"></p>
<hr>
<p align="center"><font face="Simplified Arabic"
size="3"><b><a href="tech.asp">
< /a>| <a href="news.asp">< /a>| <a
href="search.asp"></a>
| <a href="guest.asp">< /a>| <a href="admin.asp">
</a></b></font></p>
<hr>
:
<hr>
<p align="center"><font face="Simplified Arabic"
size="3"><b><a href="tech.asp">
< /a>| <a href="news.asp">< /a>| <a
href="search.asp"></a>
| <a href="guest.asp">< /a>| <a href="admin.asp">
</a></b></font></p>
<p align="center"><b><font face="Simplified Arabic"
size="2">
< /font></b></p>
</body>
</html>
.
: .
<html dir=rtl>
'
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1256">
<meta http-equiv="Content-Language" content="ar-qa">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>< /title>
</head>
<body>
<p align="center"><img border="0" src="thetitel.gif"></p>
<hr>
<p align="center"><font face="Simplified Arabic"
size="3"><b><a href="tech.asp">
< /a>| <a href="news.asp">< /a>| <a
href="search.asp"></a>
| <a href="guest.asp">< /a>| <a href="admin.asp">
</a></b></font></p>
<hr>
'
<p align="center"><font face="Simplified Arabic" size="3">
< /font></p>
<p align="center"><font face="Simplified Arabic" size="3">
></font></p
>"<p align="center"><font face="Simplified Arabic" size="3
></font></p
"<p align="center"><font face="Simplified Arabic" size="3
>"color="#AD1212
></font></p
'
><hr
"<p align="center"><font face="Simplified Arabic
>"size="3"><b><a href="tech.asp
</a>| <a >" </a>| <a href="news.asp
></a>"href="search.asp
>" </a>| <a href="admin.asp >"| <a href="guest.asp
></a></b></font></p
"<p align="center"><b><font face="Simplified Arabic
>"size="2
></font></b></p
></body
></html
! ..
.. .. ..
!! ..
!!
!! .
pageheader.txt pagefooter.txt
default.asp :
><html dir=rtl
><!--#include file="pageheader.txt" --
>"<p align="center"><font face="Simplified Arabic" size="3
></font></p
>"<p align="center"><font face="Simplified Arabic" size="3
></font></p
>"<p align="center"><font face="Simplified Arabic" size="3
></font></p
"<p align="center"><font face="Simplified Arabic" size="3
>"color="#AD1212
></font></p
><!--#include file="pagefooter.txt" --
.. .. ..
) ( ..
.. .
project.mdb
Microsoft Access 2000.
.
-
Blank Access database Ok.
C:\Inetpub\wwwroot .
database ( news
).
!Error
4-1-1
project.mdb
!Error
4-2-2
Create :
-
( Field Properties ) Text, Memo, AutoNumber
Save .
tech_news. No
!Error
-
) .(- .
4-5
) id )
1
30/9/2001
31/9/2001
..
.
: Ms Access :
ASP
Microsoft Access 2000.
ASP .
) (default.asp . (tech.asp).
tech.asp
.:
.. .. ASP .
ASP <% %> . HTML
VBScript . ) (
:
<%
Dim ConnectionString
Dim ADO
& "=ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source
)"Server.MapPath("\database\project.mdb
)"Set ADO=Server.CreateObject("ADODB.Connection
ADO.ConnectionString =ConnectionString
ADO.Open
>%
(Dim):
.
(ConnectionString):
. .
project.mdb .
: .
.
. ADO.open:
(selectSQL): Select
. :
. ( *) , .
. tech_news
(set rs): .
. ) set rs=ADO.execute(selectSQL:
response.write rs(*) .
" "
Address Bar :
default.asp/news/http://asp
ASP : .
Panel Control Network Identification:
Computer Name
localhost :
http://localhost/news/default.asp
:
: . :
: // : :
.
. Code .
.
.
ADO.close
HTML
> <p></p :
: ASP <% .
> : " & rs(subject)%></p" <p><%response.write
> : " & rs(add_dat)%></p" <p><%response.write
> : " & rs(body)%></p" <p><%response.write
:
.
. .
:
>"<div align="center
><center
"<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse
>"bordercolor="#111111" width="90%
><tr
:
:
// :
:
.
. :
. .
.
tech.asp. HTML :
><%@ Language=VBScript CodePage = "1256"%
><html dir=rtl
><!--#include file="pageheader.txt" --
>"<p align="center"><font face="Simplified Arabic
></font></p
<%
'
Dim ConnectionString
Dim ADO
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" &
Server.MapPath("\database\project.mdb")
Set ADO=Server.CreateObject("ADODB.Connection")
ADO.ConnectionString =ConnectionString
ADO.Open
'
%>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"
bordercolor="#111111" width="90%">
<tr>
<td width="100%" dir="rtl" bgcolor="#DFDFFF"><b> : <%response.write
rs(subject)%></b></td>
</tr>
<tr>
<td width="100%" dir="rtl"><b> : <%response.write rs(add_dat)%></b>
<p><b> : <%response.write rs(body)%></b></td>
</tr>
</table>
</center>
</div>
<hr color="#DFDFFF" width="90%">
<% ADO.close %>
<!--#include file="pagefooter.txt" -->
: HTML
. :
<%@ Language=VBScript CodePage = "1256"%>
<html dir=rtl>
<!--#include file="pageheader.txt" -->
<p align="center"><font face="Simplified Arabic">
< /font></p>
<%
'
Dim ConnectionString
Dim ADO
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" &
Server.MapPath("\database\project.mdb")
Set ADO=Server.CreateObject("ADODB.Connection")
ADO.ConnectionString =ConnectionString
ADO.Open
'
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"
bordercolor="#111111" width="90%">
<tr>
<td width="100%" dir="rtl" bgcolor="#DFDFFF"><b> : <%response.write
rs(subject)%></b></td>
</tr>
<tr>
<td width="100%" dir="rtl"><b> : <%response.write rs(add_dat)%></b>
<p><b> : <%response.write rs(body)%></b></td>
</tr>
</table>
</center>
</div>
<hr color="#DFDFFF" width="90%">
<%
rs.movenext
loop
ADO.close
%>
<!--#include file="pagefooter.txt" -->
:
:
// :
:
.
:
// :
:
.
:
) Do ) Loop
Do Loop
) Loop).
rs.movenext .
)(Loop . Do . Do
rs . rs
Loop rs .
SSI Code :
tech.asp Notpad connection.txt.
<%
'
Dim ConnectionString
Dim ADO
& "=ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source
)"Server.MapPath("\database\project.mdb
)"Set ADO=Server.CreateObject("ADODB.Connection
ADO.ConnectionString =ConnectionString
ADO.Open
>%
tech.asp ) ( :
><!--#include file="connection.txt" --
:
<%@ Language=VBScript CodePage = "1256"%>
<html dir=rtl>
<!--#include file="pageheader.txt" -->
<p align="center"><font face="Simplified Arabic">
< /font></p>
<!--#include file="connection.txt" -->
<%
'
></div
>"<hr color="#DFDFFF" width="90%
<%
rs.movenext
loop
ADO.close
>%
><!--#include file="pagefooter.txt" --
. .
)(QueryString
tech.asp :
:
// :
:
.
:
// :
:
.
.
.
)( . .
teach.asp
><%@ Language=VBScript CodePage = "1256"%
<html dir=rtl>
<!--#include file="pageheader.txt" -->
<p align="center"><font face="Simplified Arabic">
< /font></p>
<!--#include file="connection.txt" -->
<%
'
<%
rs.movenext
loop
ADO.close
>%
><!--#include file="pagefooter.txt" --
. :
<b><a href="body.asp?field=tech_news&id=<%=rs("id")%>"><%response.write
>rs("subject")%></a></b
.
)( . .
)(QueryString
body.asp :
>body.asp?field=tech_news&id=<%=rs("id")%
body.asp .
teach.asp body.asp .
.. :
. :
)"field=request.querystring("field:
. field =: field
. : request.querystring
. field )": ("field
:
>body.asp?field=tech_news&id=<%=rs("id")%
. field
. tech_news . .. :
>body.asp?section=tech_news&id=<%=rs("id")%
)" field=request.querystring("field
field=request.querystring("section") .
)" id=request.querystring("id
. > body.asp?field=tech_news&id=<%=rs("id")%
id . selectSQL
.
selectSQL .
( ) From ) ) Field .
SelectSQL Field ..
Where SelectSQL ..
: id="&id : id id
.
Code .
: news.asp
.
. news.asp tech.asp
- general_news . tech_news
: . .
Copy .
.Past
.general_news Structure :
Only Structure and Data .Append Data to Exiting Table
.Structure Only
.ok
- tech.asp news.asp .
) (
. )( )( .
<%("rs("id=%>=id&body.asp?field=tech_news tech_news
general_news
.news.asp
search.asp
search.asp . tech.asp
search.asp. . :
:( Normal).
Textbox. Form Insert
:
Reset
Submit
Reset .( :
: . )(
: Form Properties
:
Action Form .
. .
GETPOST :
Method Post Get. :
Post : . )
Get : .
) Post.
Ok Ok.
. Form Field Properties
:
Name . Ok.
.: . Submit . Value/lable
: search.asp Code ..
<%@ Language=VBScript CodePage = "1256"%>
<html dir=rtl>
<!--#include file="pageheader.txt" -->
<form method="GET" action="search_result.asp">
<p align="center">
<input type="text" name="keyword" size="20"></p>
<p align="center"><input type="submit" value=" "name="B1"></p>
</form>
<!--#include file="pagefooter.txt" -->
search_result.asp
search_result.asp
: Code .search_result.asp search.asp
<%@ Language=VBScript CodePage = "1256"%>
<html dir=rtl>
<!--#include file="pageheader.txt" -->
<form method=>"GET" action="search_result.asp" >
<p align="center">
.. . )(
serach.asp keyword
. Request.QueryString .
:
:
<%
)"keyword=request.querystring("keyword
>%
Select:
><%@ Language=VBScript CodePage = "1256"%
><html dir=rtl
><!--#include file="pageheader.txt" --
><!--#include file="connection.txt" --
<%
)"keyword=request.querystring("keyword
" 'SelectTechSQL="select * from tech_news where subject like '%"&keyword&"%
)set rs=ADO.execute(SelectTechSQL
>%
><!--#include file="pagefooter.txt" --
: ..
Like .. Keyword
Like ..
"&keyword&" :
Keyword '%"&keyword&"%' :
Select : Tech
Subject . Keyword :
:
. ASP .
. PHP .
. ++C.
"" .
. Or SelectTechSQL : Or
:
..
..
. .
Tech_news ) Tech_news
( General_news :
.
. Select
. SelectGeneralSQL SelectTechSQL .
)(guest.asp
: guest.asp
sign_book.asp . sign_book.asp .
.
guest_book :
.
view_book.asp
Select Response.Write )(
. HTML . . Code
view_book.asp .
(sign_book.asp)
HTML ASP . Code sign_book.asp
.( Microsoft Frontpage)
. sign_book.asp guest.asp
. Code
:
:
:
(URL):
:
:
Forms ) (.
Insert . Form .
o
: . Textbox
: . Drop-Down Box
: ) Option Button (.
: . Area Text
)
)
name
email
website
link
ranking
comment
) (
. Properties Form Field Add
)(
. Properties . Submit
Properties Form :
Method ) .( POST
sign_book.asp
add_to_book.asp .
. ) (
.
Code
.
. )=(
. .
GET Request.QueryString
. POST Request.Form . .
. . ( name, email,
)=(
Request.Form
)" "( :
add_dat . )( now
: . :
)(Now
)(Date
)(Year
)(Time
)(Hour
if . .:
If something Then
something
Else
something
End if
something : . :
. ) : ( . ) :
( . if . Then
. . Else
if End
:
If something Then
something
Else If something Then
something
Else If something Then
something
Else
something
End if
End if
End if
Code .
If name="" or comment="" then
: Name Comment )
( ...
"" : .. :.
Or And
:
.. " & ">response.write "<center
"
: ) : ..
(.
. > <center : . .
: "" )( &
. ) (
:
insert : .
. insert into .
. values
.
'"&add_dat&"' :
insert :
)ADO.execute(addSQL
addSQL .
:
"response.redirect "guest.asp
: .
.
End if
.
: .
. .
. :
. . ) (
) : ..
( ) (
. ....
, adminsection :
admin.asp ,validentry.asp
) :(admin.asp ) (Form
) :(validentry.asp
.
) :(adminsection
.
.. ..
admin ( id ) Autonumber Name( Pass Text).
. .
..
):(admin.asp
:
: ) (Form :
:
:
Code HTML:
>"<form method="POST" action="validentry.asp" name="Login
> </p ><p
>: <input type="text" name="Name" size="20"> </p ><p
>: <input type="password" name="Password" size="20"> </p ><p
>" name="submit"> </p"=<p> <input type="submit" value
></form
) ) Name ) ( Password .
:
Code ) (Form ><form/
validentry.asp
error validentry.asp.
<%
error error=Request.querystring("error") ' validentry.asp
( )( ) ' 1.
) (error Name_Null ' 2.
"></font></b >Response.write "<b><font color=#FF0000
Else
) (error Pass_Null '3.
If
:
If error <> "" then . error
validentry.asp .
If .
End If.
" "Name_Null ( )
. "
"
.
.
" "Name_Entry ( )
( ) .
" ". error
" "Name_Entry 5.
( ) .
" ". .
Admin.asp ..
Admin.asp
) (validentry.asp
error admin.asp .
validentry.asp
error admin.asp .
adminsection
Code :
<%
Name Name=Request.form("Name") 'admin.asp
Password Password=Request.form("Password") 'admin.asp
Name Name = "" Then ' 1.
If
Else ' 3.
%><!--#include file="connection.txt" --><%
SelectSql = "Select * from admin where name = '"& Name &"' ' Admin
)set rs=ADO.execute (SelectSql
If rs.EOF Then '4. Name
rs EOF
response.Redirect ("admin.asp?error=Name_Entry") ' Name_Entry
admin.asp
Else
If rs("pass") <> password Then '5.
)" rs("pass
response.redirect ("admin.asp?error=Pass_Entry") ' Pass_Entry
admin.asp
Else '6.
Name_Cooky= request.cookies("Name") ' Name_Cooky
Name_Cooky <> Name Then '7.
If
End If
End If
>%
ASP html
.
Code .
: admin.asp
("Request.form("Name
Name
("Request.form("Password
Password
1. If Name = "" Then :
error
Name_Null .
respons.redirect .
> <html > <html
.
(admin.asp).
. error=Name_Null
Name_Null
Name .
. :
error
Pass_Null .
Password Else
Else
If Password = "" Then '2.
Password
response.redirect ("admin.asp?error=Pass_Null") ' Pass_Null
admin.asp
3. Else
. .
) (Connection.txt Include
File .
admin
admin
. = where name '"& '"& Name .
SelectSql = "Select * from admin where name = '"& Name &"' ' Admin
)set rs=ADO.execute (SelectSql
4. If rs.EOF Then : ( rs
( EOF :End Of the File
: ("response.Redirect ("admin.asp?error=Name_Entry
EOF admin
.
("response.redirect ("admin.asp?error=Pass_Entry
Else6
Else
If rs("password") <> password Then '5.
)" rs("password
response.redirect ("admin.asp?error=Pass_Entry") ' Pass_Entry
admin.asp
6.
Cooky
("Name_Cooky= request.cookies("Nam
("request.cookies("Name_Cooky
response.cookies ("Name") = Name
("response.Redirect ("adminsection.asp
adminsection.asp
adminsection.asp
Else '6.
Name_Cooky= request.cookies("Name") ' Name_Cooky
Name_Cooky <> Name Then '7.
' response.cookies ("Name") = Name
If
End IF
' )"response.Redirect ("adminsection.asp
End If
)(adminsection.asp
adminsection.asp :
.
. Cooky
. Code :
<%
Name_Cooky=Request.cookies("Name") ' Name_Cooky
' If Name_Cooky="" Then
' )"response.redirect ("admin.asp
End If
>%
admin.asp .
.
Cooky .
. :
:
.
.
: /
.
.
.
.
.
.
Code :
<%@ Language=VBScript CodePage = "1256"%>
<%
Name_Cooky=Request.cookies("Name")
If Name_Cooky="" Then
response.redirect ("admin.asp")
End If
%>
<html dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<title>< /title>
</head>
<body dir="rtl">
<p align="center"><b><font face="Simplified Arabic">< /font></b></p>
<p align="justify"><b><font face="Simplified Arabic"> :</font></b></p>
<ul>
<li>
:( add_news.asp).
:
:
:
section .
subject .
body .
Code:
></b></p ><p align="center"><b
>"<form method="POST" action="add_news.asp
>": <select size="1" name="section><p><b
></option >"<option value="general_news
:
: ) (section Drop-Down Box.
:
) ) Add :
: .
.
Add :
. .
. .
. .
.. .
.
)( .
.
Form Properties
: add_news.asp
. ASP ..
<%@language=VBScript CodePage="1256"%>
<!--#include file="connection.txt"-->
<%
section=request.form("section")
subject=request.form("subject")
body=request.form("body")
%>
<%
Function AddF()
addSQL= " insert into "§ion&" (subject,body) values ('"&subject&"','"&body&"')"
ADO.execute(addSQL)
%><p><font face="Simplified Arabic" size="3"> ..
</font></p><%
End Function
%>
<body>
<%
If subject="" or body="" or then
response.write " ..
"
Else
AddF()
End If
>%
></b></p ><p align="center"><b
>"<form method="POST" action="add_news.asp
>": <select size="1" name="section><p><b
></option >"<option value="general_news
></option >"<option value="tech_news
></select></b></p
>: <input type="text" name="subject" size="20"></b></p><p><b
>:</b></p><p><b
><p><b> <textarea rows="11" name="body" cols="78"></textarea></b></p
>" name="add"></p"=<p><input type="submit" value
></form
<%
ADO.close
Set ADO=Nothing
>%
></body
></html
: addSQL
"& "§ion .
.
: Function .
Function
Function . )( addf
Else End if .
) (news_list.asp
'
selectnewsSQL="select * from general_news order by add_dat desc"
set rsnews=ADO.execute(selectnewsSQL(
'
selecttechSQL="select * from tech_news order by add_dat desc"
set rstech=ADO.execute(selecttechSQL(
<%
>p align"=center><"b><font face"=Simplified Arabic "color#"=C11111 "size<""=
/> font/><b/><p<
>p><b><font face"=Simplified Arabic/>"< font/><b/><p<
>table border ""=cellpadding ""=cellspacing ""=style"=border-collapse :collapse "
bordercolor "#"=width "%"=id"=AutoNumber1<"
>tr<
>td width<"%"=
>td width<"%"=
>p align"=center><"font face"=Simplified
Arabic><"b=%><rsnews("subject&<%("nbsp/>;b/><font/><td<
>td width "%"=align"=center><"font face"=Simplified Arabic><"a
href"=news_upd.asp?id =%>=rsnews("id><"<%("b/><b/><font/><td<
href"=news_del.asp?id=%>=rsnews("id><"<%("b/><b/><font/><td<
/>tr<
/>table<
%>
rsnews.movenext
loop
<%
>p&<nbsp/>;p<
>p><b><font face"=Simplified Arabic/>"< font/><b/><p<
>tr<
>td width<"%"=
>p align"=center><"font face"=Simplified Arabic><"b/><b/><font/><td<
>td width "%"=align"=center><"font face"=Simplified Arabic><"b/><b/><font/><td<
>td width "%"=align"=center><"font face"=Simplified Arabic><"b/><b/><font/><td<
/>tr<
/>table<
%>
'
do while not rstech.eof
<%
>table border ""=cellpadding ""=cellspacing ""=style"=border-collapse :collapse "
bordercolor "#"=width "%"=id"=AutoNumber1<"
>tr<
>td width<"%"=
>p align"=center><"font face"=Simplified
Arabic><"b=%><rstech("subject&<%("nbsp/>;b/><font/><td<
href"=tech_del.asp?id=%>=rstech("id><"<%("b/><b/><font/><td<
/>tr<
/>table<
%>
rstech.movenext
loop
ADO.close
Set ADO=Nothing
<%
</>body
</>html
..
:
tech_upd.asp .
id .
.
.
.
) (news_upd.asp ) (tech_upd.asp
. Update
. Code news_upd.asp
:
End If
<%
>html dir=rtl<
#--!>include file="connection.txt<-- "
%>
function updatef()
updateSQL= " update general_news set subject&"' = subject , '"&body&"' = body '"&where
id&"=id
ADO.execute(updateSQL(
><%p><font face"=Simplified Arabic "size .."< "=
/>font/><p%><
end function
id=request.querystring("id("
subject=request.form("subject("
body=request.form("body("
'
selectSQL="select * from general_news where id&"=id
set rs=ADO.execute(selectSQL(
<%
>p align"=center ><"b><font face"=Simplified Arabic "color#"=C11111 "size<""=
/>font/><b/><p<
%>
<cols="53%><"response.write rs("subject/><%("textarea/><font/><p
update :
. .
. .
. ) = ( .
. ) (, .
. id .
.:
subject Subject
"POST"=form method>:
tech_upd.asp news_upd.asp
<"<%id=%>=news_upd.asp?id"=action
( news_del.asp)
( tech_del.asp).
news_del.asp Code ..
: delete
. .
. id .
id .
news_list.asp response.redirect .
delete .
http://www.alnoor-world.com/asp
http://www.books4arab.15x.com