ساخت نظرسنجي در صفحه وب

salavat13

New Member
چگونه مي توانم يك نظرسنجي در صفحه وب خود ايجاد نمايم؟كمك كنيد...ـ(جتي الامكان با جاوا يا اچ تي ام ال باشه)
ضمنا مي خوام خواهش كنم از جناب آقاي مجيد علوي زاده كه اجازه بدن از مقالاتشون با آدرس كامل و بنر تبليغاتي مجيد آنلاين و نام نويسنده مقاله در سايت خود استفاده كنم.
---------------------------
فربد آنلاين
 

Majid

مدیر سایت
عضو کادر مدیریت
سلام

نميتونيد با جاوا اسكريپت يا HTML اينكارو بكنيد چون كه كار نظر سنجي نياز به ديتا بيس داره كه بايد با زبانهاي برنامه نويسي تحت سرور برنامه نويسي بشه .. مث ASPو CGI و PHPوCFMو JSP و....

ضمنا آقا براي استفاده از مقالات اينحا رو بخونيد:
http://www.majidonline.com/modules.php?name=Forums&file=viewtopic&t=3031


موفق باشيد

مجيد
 

purya

Member
با سلام

پوريا هستم از كرمانشاه

خدمت عزيز خودم عرض كنم كه من يه نظر سنجي خيلي ساده با ASP نوشتم كه اطلاعات رو توي فايل متني ميريزه و براي هر سوال يك فال متني نياز داره


[align=left:6269dfdb9f]
<%@ LANGUAGE=VBSCRIPT %>
<% const forreading = 1
dim objopenfile1,objopenfile2,objopenfile3,objopenfile4,objopenfile5,objopenfile6,objopenfile7,objopenfile8,feadsee,objopenfile9,objopenfile10objfso,strpath,icount,rq1,rq2,rq3,rq4,rq5,rq6,rq7,rq8,rq9,rq10,n
rq1=request("r1")
rq2=request("r2")
rq3=request("r3")
rq4=request("r4")
rq5=request("r5")
rq6=request("r6")
rq7=request("r7")
rq8=request("r8")
rq9=request("r9")
rq10=request("r10")
select case rq1
case "-2"
n1=(-2)
case "-1"
n1=(-1)
case "0"
n1=(0)
case "1"
n1=(1)
case "2"
n1=(2)
end select
select case rq2
case "-2"
n2=(-2)
case "-1"
n2=(-1)
case "0"
n2=(0)
case "1"
n2=(1)
case "2"
n2=(2)
end select
select case rq3
case "-2"
n3=(-2)
case "-1"
n3=(-1)
case "0"
n3=(0)
case "1"
n3=(1)
case "2"
n3=(2)
end select
select case rq4
case "-2"
n4=(-2)
case "-1"
n4=(-1)
case "0"
n4=(0)
case "1"
n4=(1)
case "2"
n4=(2)
end select
select case rq5
case "-2"
n5=(-2)
case "-1"
n5=(-1)
case "0"
n5=(0)
case "1"
n5=(1)
case "2"
n5=(2)
end select
select case rq6
case "-2"
n6=(-2)
case "-1"
n6=(-1)
case "0"
n6=(0)
case "1"
n6=(1)
case "2"
n6=(2)
end select
select case rq7
case "-2"
n7=(-2)
case "-1"
n7=(-1)
case "0"
n7=(0)
case "1"
n7=(1)
case "2"
n7=(2)
end select
select case rq8
case "-2"
n8=(-2)
case "-1"
n8=(-1)
case "0"
n8=(0)
case "1"
n8=(1)
case "2"
n8=(2)
end select
select case rq9
case "-2"
n9=(-2)
case "-1"
n9=(-1)
case "0"
n9=(0)
case "1"
n9=(1)
case "2"
n9=(2)
end select

select case rq10
case "-2"
n10=(-2)
case "-1"
n10=(-1)
case "0"
n10=(0)
case "1"
n10=(1)
case "2"
n10=(2)
end select

strpath1 = request.querystring("image")
strpath1 = strpath1 & "se1.asp"
strpath1 = server.mappath(strpath1)
set objfso1 = _
server.createobject("scripting.filesystemobject")
if objfso1.fileexists(strpath1) then
set objopenfile1 = _
objfso1.opentextfile(strpath1,forreading)
i1 = (objopenfile1.readline)+(n1)

objopenfile1.close
else
i1 = 2
end if

set objopenfile1 = _
objfso1.createtextfile(strpath1,true)
objopenfile1.writeline(i1)
objopenfile1.close
set objopenfile1 = nothing
set objfso1 = nothing

strpath2 = request.querystring("image")
strpath2 = strpath2 & "se2.asp"
strpath2 = server.mappath(strpath2)
set objfso2 = _
server.createobject("scripting.filesystemobject")
if objfso2.fileexists(strpath2) then
set objopenfile2 = _
objfso2.opentextfile(strpath2,forreading)
i2 = (objopenfile2.readline)+(n2)

objopenfile2.close
else
i2 = 2
end if

set objopenfile2 = _
objfso2.createtextfile(strpath2,true)
objopenfile2.writeline(i2)
objopenfile2.close
set objopenfile2 = nothing
set objfso2 = nothing

strpath3 = request.querystring("image")
strpath3 = strpath3 & "se3.asp"
strpath3 = server.mappath(strpath3)
set objfso3 = _
server.createobject("scripting.filesystemobject")
if objfso3.fileexists(strpath3) then
set objopenfile3 = _
objfso3.opentextfile(strpath3,forreading)
i3 = (objopenfile3.readline)+(n3)

objopenfile3.close
else
i3 = 2
end if

set objopenfile3 = _
objfso3.createtextfile(strpath3,true)
objopenfile3.writeline(i3)
objopenfile3.close
set objopenfile3 = nothing
set objfso3 = nothing

strpath4 = request.querystring("image")
strpath4 = strpath4 & "se4.asp"
strpath4 = server.mappath(strpath4)
set objfso4 = _
server.createobject("scripting.filesystemobject")
if objfso4.fileexists(strpath4) then
set objopenfile4 = _
objfso4.opentextfile(strpath4,forreading)
i4 = (objopenfile4.readline)+(n4)

objopenfile4.close
else
i4 = 2
end if

set objopenfile4 = _
objfso4.createtextfile(strpath4,true)
objopenfile4.writeline(i4)
objopenfile4.close
set objopenfile4 = nothing
set objfso4 = nothing

strpath5 = request.querystring("image")
strpath5 = strpath5 & "se5.asp"
strpath5 = server.mappath(strpath5)
set objfso5 = _
server.createobject("scripting.filesystemobject")
if objfso5.fileexists(strpath5) then
set objopenfile5 = _
objfso5.opentextfile(strpath5,forreading)
i5 = (objopenfile5.readline)+(n5)

objopenfile5.close
else
i5 = 2
end if

set objopenfile5 = _
objfso5.createtextfile(strpath5,true)
objopenfile5.writeline(i5)
objopenfile5.close
set objopenfile5 = nothing
set objfso5 = nothing

strpath6 = request.querystring("image")
strpath6 = strpath6 & "se6.asp"
strpath6 = server.mappath(strpath6)
set objfso6 = _
server.createobject("scripting.filesystemobject")
if objfso6.fileexists(strpath6) then
set objopenfile6 = _
objfso6.opentextfile(strpath6,forreading)
i6 = (objopenfile6.readline)+(n6)

objopenfile6.close
else
i6 = 2
end if

set objopenfile6 = _
objfso6.createtextfile(strpath6,true)
objopenfile6.writeline(i6)
objopenfile6.close
set objopenfile6 = nothing
set objfso6 = nothing

strpath7 = request.querystring("image")
strpath7 = strpath7 & "se7.asp"
strpath7 = server.mappath(strpath7)
set objfso7 = _
server.createobject("scripting.filesystemobject")
if objfso7.fileexists(strpath7) then
set objopenfile7 = _
objfso7.opentextfile(strpath7,forreading)
i7 = (objopenfile7.readline)+(n7)

objopenfile7.close
else
i7 = 2
end if

set objopenfile7 = _
objfso7.createtextfile(strpath7,true)
objopenfile7.writeline(i7)
objopenfile7.close
set objopenfile7 = nothing
set objfso7 = nothing

strpath8 = request.querystring("image")
strpath8 = strpath8 & "se8.asp"
strpath8 = server.mappath(strpath8)
set objfso8 = _
server.createobject("scripting.filesystemobject")
if objfso8.fileexists(strpath8) then
set objopenfile8 = _
objfso8.opentextfile(strpath8,forreading)
i8 = (objopenfile8.readline)+(n8)

objopenfile8.close
else
i8 = 2
end if

set objopenfile8 = _
objfso8.createtextfile(strpath8,true)
objopenfile8.writeline(i8)
objopenfile8.close
set objopenfile8 = nothing
set objfso8 = nothing

strpath9 = request.querystring("image")
strpath9 = strpath9 & "se9.asp"
strpath9 = server.mappath(strpath9)
set objfso9 = _
server.createobject("scripting.filesystemobject")
if objfso9.fileexists(strpath9) then
set objopenfile9 = _
objfso9.opentextfile(strpath9,forreading)
i9 = (objopenfile9.readline)+(n9)

objopenfile9.close
else
i9 = 2
end if

set objopenfile9 = _
objfso9.createtextfile(strpath9,true)
objopenfile9.writeline(i9)
objopenfile9.close
set objopenfile9 = nothing
set objfso9 = nothing

strpath10 = request.querystring("image")
strpath10 = strpath10 & "se10.asp"
strpath10 = server.mappath(strpath10)
set objfso10 = _
server.createobject("scripting.filesystemobject")
if objfso10.fileexists(strpath10) then
set objopenfile10 = _
objfso10.opentextfile(strpath10,forreading)
i10 = (objopenfile10.readline)+(n10)

objopenfile10.close
else
i10 = 2
end if

set objopenfile10 = _
objfso10.createtextfile(strpath10,true)
objopenfile10.writeline(i10)
objopenfile10.close
set objopenfile10 = nothing
set objfso10 = nothing


strpath = request.querystring("image")
strpath = strpath & "feadc.asp"
strpath = server.mappath(strpath)
set objfso = _
server.createobject("scripting.filesystemobject")
if objfso.fileexists(strpath) then
set objopenfile = _
objfso.opentextfile(strpath,forreading)
feadsee = (objopenfile.readline) + 1
objopenfile.close
else
feadsee = 1
end if
set objopenfile = _
objfso.createtextfile(strpath,true)
objopenfile.writeline(feadsee)
objopenfile.close
set objopenfile = nothing
set objfso = nothing
%>
[align=right]
اين اطلاعاتي رو كه از فرو Submit شده رو با اطلاعات قبلي موجود در هر فايل متني جمع ميكنه


براي گزارش گيري از نظر سنجي هم به صورت زير متغير ها از داخل فايل متني جمع ميشن



[align=left]


<%@ LANGUAGE=VBSCRIPT %>
<% const forreading = 1
dim objopenfile1,objopenfile2,objopenfile3,objopenfile4,objopenfile5,objopenfile6,objopenfile7,objopenfile8,objopenfile9,objopenfile10objfso,strpath

strpath1 = request.querystring("image")
strpath1 = strpath1 & "se1.asp"
strpath1 = server.mappath(strpath1)
set objfso1 = _
server.createobject("scripting.filesystemobject")
if objfso1.fileexists(strpath1) then
set objopenfile1 = _
objfso1.opentextfile(strpath1,forreading)
i1 = (objopenfile1.readline)

objopenfile1.close
else
i1 = 2
end if

set objopenfile1 = _
objfso1.createtextfile(strpath1,true)
objopenfile1.writeline(i1)
objopenfile1.close
set objopenfile1 = nothing
set objfso1 = nothing

strpath2 = request.querystring("image")
strpath2 = strpath2 & "se2.asp"
strpath2 = server.mappath(strpath2)
set objfso2 = _
server.createobject("scripting.filesystemobject")
if objfso2.fileexists(strpath2) then
set objopenfile2 = _
objfso2.opentextfile(strpath2,forreading)
i2 = (objopenfile2.readline)

objopenfile2.close
else
i2 = 2
end if

set objopenfile2 = _
objfso2.createtextfile(strpath2,true)
objopenfile2.writeline(i2)
objopenfile2.close
set objopenfile2 = nothing
set objfso2 = nothing

strpath3 = request.querystring("image")
strpath3 = strpath3 & "se3.asp"
strpath3 = server.mappath(strpath3)
set objfso3 = _
server.createobject("scripting.filesystemobject")
if objfso3.fileexists(strpath3) then
set objopenfile3 = _
objfso3.opentextfile(strpath3,forreading)
i3 = (objopenfile3.readline)

objopenfile3.close
else
i3 = 2
end if

set objopenfile3 = _
objfso3.createtextfile(strpath3,true)
objopenfile3.writeline(i3)
objopenfile3.close
set objopenfile3 = nothing
set objfso3 = nothing

strpath4 = request.querystring("image")
strpath4 = strpath4 & "se4.asp"
strpath4 = server.mappath(strpath4)
set objfso4 = _
server.createobject("scripting.filesystemobject")
if objfso4.fileexists(strpath4) then
set objopenfile4 = _
objfso4.opentextfile(strpath4,forreading)
i4 = (objopenfile4.readline)

objopenfile4.close
else
i4 = 2
end if

set objopenfile4 = _
objfso4.createtextfile(strpath4,true)
objopenfile4.writeline(i4)
objopenfile4.close
set objopenfile4 = nothing
set objfso4 = nothing

strpath5 = request.querystring("image")
strpath5 = strpath5 & "se5.asp"
strpath5 = server.mappath(strpath5)
set objfso5 = _
server.createobject("scripting.filesystemobject")
if objfso5.fileexists(strpath5) then
set objopenfile5 = _
objfso5.opentextfile(strpath5,forreading)
i5 = (objopenfile5.readline)

objopenfile5.close
else
i5 = 2
end if

set objopenfile5 = _
objfso5.createtextfile(strpath5,true)
objopenfile5.writeline(i5)
objopenfile5.close
set objopenfile5 = nothing
set objfso5 = nothing

strpath6 = request.querystring("image")
strpath6 = strpath6 & "se6.asp"
strpath6 = server.mappath(strpath6)
set objfso6 = _
server.createobject("scripting.filesystemobject")
if objfso6.fileexists(strpath6) then
set objopenfile6 = _
objfso6.opentextfile(strpath6,forreading)
i6 = (objopenfile6.readline)

objopenfile6.close
else
i6 = 2
end if

set objopenfile6 = _
objfso6.createtextfile(strpath6,true)
objopenfile6.writeline(i6)
objopenfile6.close
set objopenfile6 = nothing
set objfso6 = nothing

strpath7 = request.querystring("image")
strpath7 = strpath7 & "se7.asp"
strpath7 = server.mappath(strpath7)
set objfso7 = _
server.createobject("scripting.filesystemobject")
if objfso7.fileexists(strpath7) then
set objopenfile7 = _
objfso7.opentextfile(strpath7,forreading)
i7 = (objopenfile7.readline)

objopenfile7.close
else
i7 = 2
end if

set objopenfile7 = _
objfso7.createtextfile(strpath7,true)
objopenfile7.writeline(i7)
objopenfile7.close
set objopenfile7 = nothing
set objfso7 = nothing

strpath8 = request.querystring("image")
strpath8 = strpath8 & "se8.asp"
strpath8 = server.mappath(strpath8)
set objfso8 = _
server.createobject("scripting.filesystemobject")
if objfso8.fileexists(strpath8) then
set objopenfile8 = _
objfso8.opentextfile(strpath8,forreading)
i8 = (objopenfile8.readline)

objopenfile8.close
else
i8 = 2
end if

set objopenfile8 = _
objfso8.createtextfile(strpath8,true)
objopenfile8.writeline(i8)
objopenfile8.close
set objopenfile8 = nothing
set objfso8 = nothing

strpath9 = request.querystring("image")
strpath9 = strpath9 & "se9.asp"
strpath9 = server.mappath(strpath9)
set objfso9 = _
server.createobject("scripting.filesystemobject")
if objfso9.fileexists(strpath9) then
set objopenfile9 = _
objfso9.opentextfile(strpath9,forreading)
i9 = (objopenfile9.readline)

objopenfile9.close
else
i9 = 2
end if

set objopenfile9 = _
objfso9.createtextfile(strpath9,true)
objopenfile9.writeline(i9)
objopenfile9.close
set objopenfile9 = nothing
set objfso9 = nothing

strpath10 = request.querystring("image")
strpath10 = strpath10 & "se10.asp"
strpath10 = server.mappath(strpath10)
set objfso10 = _
server.createobject("scripting.filesystemobject")
if objfso10.fileexists(strpath10) then
set objopenfile10 = _
objfso10.opentextfile(strpath10,forreading)
i10 = (objopenfile10.readline)

objopenfile10.close
else
i10 = 2
end if

set objopenfile10 = _
objfso10.createtextfile(strpath10,true)
objopenfile10.writeline(i10)
objopenfile10.close
set objopenfile10 = nothing
set objfso10 = nothing

strpath = request.querystring("image")
strpath = strpath & "feadc.asp"
strpath = server.mappath(strpath)
set objfso = _
server.createobject("scripting.filesystemobject")
if objfso.fileexists(strpath) then
set objopenfile = _
objfso.opentextfile(strpath,forreading)
feadsee = (objopenfile.readline)
objopenfile.close
else
feadsee = 1
end if
set objopenfile = _
objfso.createtextfile(strpath,true)
objopenfile.writeline(feadsee)
objopenfile.close
set objopenfile = nothing
set objfso = nothing


t=(i1*1)+(i2*1)+(i3*1)+(i4*1)+(i5*1)+(i6*1)+(i7*1)+(i8*1)+(i9*1)+(i10*1)
%>
[/align:6269dfdb9f]
البته بايد حتماْ فايل هي مورد استفاده تو مسير جاري باشند .




[align=center:6269dfdb9f] با تشكر
[/align:6269dfdb9f] پوريا
 

جدیدترین ارسال ها

بالا