Hello,
I am making a project in ASP where am embedding
VBscript in it.. Its about sth like a social networking site.. Am making it in
Microsoft Expression Studio. Here i want to provide user with an option by which he can upload and view his image. my
database is Oracle, what am doing is am providing user with an option of browsing; that comes automatically in Express studio.; with input box of type File,.. where you have a button written browse on it and a text box is provided.. I want that value of that path should be stored in table in oracle along with username and path of the file. amd whenecer user enters log ins the site he should be able to see the pic.
What am i getting is name of reciever is getting stored 4 times and path is not being stored even once.
- <html>
-
<body>
-
<%
-
fname = Request.Form("Text2")
-
'Response.write(fname)
-
-
Response.write(File1)
-
photo= Request.Form("File1") about = Request.Form("Text3")
-
email = Request.Form("Text10")
-
place = Request.Form("Text4")
-
uname= Request.Form("Text5")
-
gender=Request.Form("Text6")
-
relation=Request.Form("Text7")
-
looking=Request.Form("Text8")
-
hobbies=Request.Form("Text9")
-
age=Request.Form("Text11")
-
Username = Session("name")
-
'response.write(Username)
-
%><h2>Your profile has been updated successfully!!
-
</h2>
-
<p>Go back to <a href="profile.asp">profile</a>.</p><%
-
'Build connection with database
-
photo=request.Form("File1")
-
response.write(photo)
-
set conn=server.CreateObject("ADODB.connection")
-
conn.ConnectionString="Provider=MSDAORA.1;Password=tiger;User ID=scott;Persist Security Info=True"
-
conn.open
-
-
set rs = server.CreateObject ("ADODB.Recordset")
-
set rs1 = server.CreateObject ("ADODB.Recordset")
-
set rs3 =server.CreateObject ("ADODB.Recordset")
-
set rs2 = server.CreateObject ("ADODB.Recordset")
- query2="insert into image values('"&photo&"','"&username&"')"
-
rs2.open query2,conn query="update userdata set fname ='"& fname &"',email='"& email &"',age="& age &",gender='"& gender &"' where uname= '"&uname &"' "
-
'response.write(query)
-
'conn.execute query
-
conn.execute "commit"
-
'rs.movefirst
-
-
query1="update profile set about ='"& about &"',place='"& place &"',caption='"& caption &"',relation='"&relation&"',looking='"&looking&"',hobbies='"&hobbies&"' where uname= '"& uname &"' "
-
response.write("<br>")
-
'response.write(query1)
-
conn.execute query1
-
conn.execute "commit"
-
'rs1.movefirst
-
query3="insert into image values('"&photo&"','"&Username&"')"
-
rs3.open query3, conn
-
%>
-
</body>
-
</html>