Help! Problem uploading image into database




I have created a website where users can place advertisements and upload complementing photos. I have elected to place the advertiser's contact details and advertisement in 1 table in an Access database and the corresponding photo and Account ID in a second linked table. Once the photo is inserted as a BLOB, the advertiser is forwarded to the payments page. The upload page has a form with a file field and a hidden field with the Account ID which as been passed on the previous page by a session variable. The website is hosted on a remote server by my web host.

My problem is that the image and the Account ID are not inserted into the database even though the processing page successfully redirects to the payments page. I am new to web programming so I am unsure where my problem lies.

The code of the processing page is as follows:





Posted On: Friday 26th of October 2012 04:53:59 AM Total Views:  600
View Complete with Replies

RELATED TOPICS OF ASP PROGRAMMING LANGUAGE




sql problem, help!!

I have a table with one column having values stored as a string. example column : subjectCode values : A4, TM4, ASE4, TMA4 I have a page where the user can select one subjectCode by a radiobutton. I then want to display all the records that are associated with that subjectCode. I can't seem to use the LIKE clause because some records in the table may only have one subjectCode where others have a string of values like in the example above. Say for example I want to display all projects that are associated subjectCode "TMA4" it only displays records that start with TMA4 and not the one above, but if I search for records that have any occurence of the subjectCode then when I search for all records that are associated with A4 then I also get records with TMA4 because this has "A4" at the end. any ideas please cheers Brad
VIEWS ON THIS POST

194

Posted on:

Friday 26th October 2012
View Replies!

ASP Javascript help urgent

i am getting real frustrated with this issue i have a window open event so when the user clicks on the words he sees a window with a image what i am trying to do is put our company logo at the bottom of the window and its not letting me do it here is the code for it Code: View Large Image so when the user clicks on the View large image he sees this page and the code is like this Code: so where i have put the line Hi for debugging i wanted the company logo to be there but its not displaying the logo so i put a response.write and its not working can anyone tell me how i do it
VIEWS ON THIS POST

215

Posted on:

Friday 26th October 2012
View Replies!

Asp/Sql code help

hello again, i started this thread last week but wasn't able to finish. i am trying to do a simple sql statement in asp (dreamweaver) and due to my in experience in coding i am having lots of trouble but below i am gonig to post the code and if anyone could be so kind as to lend a hand i would be much appreciated..
VIEWS ON THIS POST

230

Posted on:

Friday 26th October 2012
View Replies!

need help with Asp Mail !!

I am trying to send an email by using asp in the following way: I get the error in: RCEmail.To= request("Email") The error is Microsoft VBScript compilation (0x800A0408) Invalid character /RegisterConfirmation.asp, line 72, column 21 RCEmail.To= "&Email&" --------------------^ Can anyone help me.
VIEWS ON THIS POST

245

Posted on:

Friday 26th October 2012
View Replies!

SQL statement help

I am getting Syntax error saying Missing operator in query expression... Can someone check this out for me\t
VIEWS ON THIS POST

166

Posted on:

Friday 26th October 2012
View Replies!

fetch data using sql statement...help!!!

i have 2 tables. Products and Quotation. 1st, i fetch prodNumber (value for prodName) and prodName (for display in combo box) into a combo box. then user is able to select any prodName listed in the combo and save it into Quotation after complete insert the description and price. the prob is, only prodNumber go to Quotation, the prodName is failed. how to solve that here is my code Code: ' save data into Quotation Dim sqlCheck, rsCheck, sqlFetch, rsFetch, tmpProdName If Request.Form("Submit") = "Save" Then resID = Request.Form("resID") category = Request.Form("cmbProdNumber") description1 = Request.Form("description1") price = Request.Form("price") 'check existing prodNumber in the Quotation sqlCheck = "select * from Quotation where prodNumber = " & category & " And resID = " & resID Set rsCheck = Server.CreateObject("ADODB.Recordset") rsCheck.Open sqlCheck, dbcon 'try to fetch prodName from Products that match with category sqlFetch = "select prodName from Products where prodNumber = " & category Set rsFetch = Server.CreateObject("ADODB.Recordset") rsFetch.Open sqlFetch, dbcon If rsCheck.EOF = True And rsFetch.EOF = True Then tmpProdName = rsFetch("prodName") sql2 = "INSERT INTO Quotation (resID, prodNumber, prodName, description, price) " & _ "VALUES ("&resID&", "&category&", '"&tmpProdName&"', '"&description1&"', '"&price&"')" dbcon.Execute(sql2) Response.Redirect("quotation_admin.aspid="&resID) Else Session("error") = True End If End If ' below is the code that i used to put all all products in the combo box
VIEWS ON THIS POST

246

Posted on:

Friday 26th October 2012
View Replies!

Noob needs urgent help

Hi all, I have to write an ASP page that does the following : Gets several fields of data through the url, processes them using a javascript function, and then send it back to another page, again using the url for the data. for example : I get something like www.mydomain.com/test/test.aspnum1=3&num2=4 , then I have to process these numbers and send a reply like www.theirdomain.com/theirasp.aspreply=x Here is what I already (think) I know, and correct me if I am wrong. 1. I can use Request.QueryString to get the values of the fields in the url. 2. I am using javascript to process the two by calling a function. What I don't know (and I know this is funny, cause it's probably the easiest part) is how to send the data, where sending is actually requesting a page with the result url. Please help.
VIEWS ON THIS POST

300

Posted on:

Friday 26th October 2012
View Replies!

Might be posting in the wrong forum but i need help!

I need to either write or buy a program that will let me Track each user. By this i mean I want to know when the logged on, how long they where on, and what PAGES they visited. Can anyone help me Clayton
VIEWS ON THIS POST

295

Posted on:

Friday 26th October 2012
View Replies!

I need DB help badly

I posted this question in the IIS forum, but it may go here better. http://forums.aspfree.com/t53055/s.html
VIEWS ON THIS POST

232

Posted on:

Friday 26th October 2012
View Replies!

how to omit row in a table help?

do while not rs.EOF if nCount Mod 2 = 0 then szColour = " bgcolor=whitesmoke" else szColour = " bgcolor=white" end if nCount = nCount + 1 Response.Write("" & rs("FieldDisplayName") & _ "") Response.Write("") szColour = szColour & " align=middle" if rsData.EOF = false and rsData.BOF = false then do while not rsData.EOF if IsNull(rsData(CStr(rs("FieldName")))) = true then Response.Write("-") else select case rs("FieldName") case "AcadiaFurnishingName" if CInt(rsData("RemovalistNumber")) = 1 then if ISNULL(rsData(CStr(rs("FieldName")))) = false then Response.Write("" & CStr(rsData(CStr(rs("FieldName")))) & _ "") else Response.Write("-") end if end if case "NumberOfRooms" if CInt(rsData("RemovalistNumber")) = 1 then if ISNULL(rsData(CStr(rs("FieldName")))) = false then Response.Write("" & FormatNumber(rsData(CStr(rs("FieldName"))), 0, true) & _ "") else Response.Write("-") end if end if case "BenefitID" Response.Write("" & rsData("ExpType") & _ "") case "SupplierID" if rsData("ShowSupplierName") 0 then Response.Write("" & rsData("SupplierName") & "") else Response.Write("-") end if case "ManagerID" Response.Write("" & rsData("FullName") & _ "") case "Comments" if len(rsData("FixedComments")) > 50 then Response.Write("") else Response.Write("") end if Response.Write(rsData("FixedComments")) Response.Write("") case else select case rsData(CStr(rs("FieldName"))).Type case 135 Response.Write("" & FormatDateTime(rsData(Cstr(rs("FieldName"))), vbShortDate) & "") case 11 if rsData(CStr(rs("FieldName"))) = 0 then Response.Write("-") else Response.Write("Yes") end if case 131 Response.Write("" & FormatNumber(rsData(CStr(rs("FieldName"))), 2, true) & _ "") case else Response.Write("" & rsData(CStr(rs("FieldName"))) & _ "") end select end select end if select case rs("FieldName") case "AcadiaFurnishingName", "NumberOfRooms" if CInt(rsData("RemovalistNumber")) = 1 then Response.Write("") end if case else Response.Write("") end select rsData.MoveNext loop end if rsData.MoveFirst Response.Write("") rs.MoveNext Hi , this is one of the web pages,I hope I have given enough code for somebody to help me. So the idea is that we have check boxes in our system, if a particular check box is selected then the Supplier Name is displayed and if not it displays a "-", and that works fine,but I need to not only make this work in a way that it doesn't display the name if value is zero,but to hide the entire row if the value is zero and then display the row if the value is not zero. I haven't been able to work out how to do that,all of my attempts mess up the whole thing, so I was hoping that somebody could help me. Response.Write("" & rs("FieldDisplayName") & _ "") FieldDisplayName represents the heading,it is bold and in the next column it is the value against that heading, but how to omit the entire row I don't know.
VIEWS ON THIS POST

193

Posted on:

Friday 26th October 2012
View Replies!

Newbie help

I have the following code: -
VIEWS ON THIS POST

180

Posted on:

Friday 26th October 2012
View Replies!

help with script?

We work in ASP VBScript pages. When a check box is ticked at that moment I need to be able to have certain values selected in two drop down lists, so all of this exists at the moment and works but it has to be done manually, since it is all connected it would be good if it had the values selected when the check box was ticked. I populate values for drop down lists in the following way,select the ID but display the description. Nature of Problem What I was thinking of doing and I can't seem to execute that is to create OnClick() function and assign it to the check box so when it gets checked it selects these values. Function onchange(){ window.thisForm.option1.value = 'whatever'; window.thisForm.option2.value = 'whatever'; } So I don't know if this would work and if it would do I assign the number that represents the ID of the value i want to see selected on click.For example if i want to see "blah" selected and blah has an ID of 10 would I do it "window.thisForm.option1.value = '10' Could somebody advise me on this please
VIEWS ON THIS POST

189

Posted on:

Friday 26th October 2012
View Replies!

help please

hi, i am designing a shopping cart and i am stuck at this point in deleting a record in the cart my global.asa file is as below Code: Dim cart() CART_COLUMNS = 8 ReDim cart( CART_COLUMNS, 0 ) Session("cart") = cart my code is as follows Code: Where by response.write i type the productid but i want to delete it from the cart can someone tell me how to do it
VIEWS ON THIS POST

208

Posted on:

Friday 26th October 2012
View Replies!

adding to a db using a for loop help.?

i am tryin to add to a database using the code below. i wanna add some data s amount of times and a different set of data t amount of times. basically i am addin the same data for the time been a set number of times eact time any ideas
VIEWS ON THIS POST

303

Posted on:

Friday 26th October 2012
View Replies!

urgent help required for Feedback form

Hi I'd like to have a feedback form on my wesite that can receive text and attachements and then forward all this to an email address. Can anyone help me out an dlet me know what is the asp coding to be used. I've read that there are objects to handle mails but not found any proper example to learn from. Please, please could any one direct me.
VIEWS ON THIS POST

202

Posted on:

Friday 26th October 2012
View Replies!

Tacky problem, please help!

I cant solve this prob,can someone help! At the moment, if the user does not select any date, the system will either capture mm/dd/yyyy or 0/0/0 as shown below. Is it possible that i write an IF ELSE statement that says if empty(as in the user does not select any date) den the data field in the DB is therefore empty too Is there something wrong with my insert statement please help, im really clueless! Code: If Request("Submit")="Submit" then Set Rs = Server.CreateObject("ADODB.RecordSet") Rs.Open "Select * from EmployeeParticulars",CONN,1,3 Rs.AddNew Rs("Name")=Request("txtName") Rs("NRICWPNo")=Request("txtNRIC") Rs("WPNo")=Request("txtWPNo") Rs("DOA")=Request("DOAM")&"/"&Request("DOAD")&"/"&Request("DOAY") Rs("DOE")=Request("DOEM")&"/"&Request("DOED")&"/"&Request("DOEY") Rs("DOB")=Request("DOBM")&"/"&Request("DOBD")&"/"&Request("DOBY") Rs("Age") = (age) Rs("Address")=Request("txtAddress") Rs("TelephoneNo")=Request("txtPhone") Rs("MobilePhone")=Request("txtMPhone") Rs("Gender")=Request("txtSex") Rs("MaritalStatus")=Request("txtMarital") Rs("Race")=Request("txtRace") Rs("Nationality")=Request("txtNationality") Rs("DateJoin")=Request("DOJM")&"/"&Request("DOJD")&"/"&Request("DOJY") Rs("Status")="Yes" Rs.Update Add another employee Else Enter Employee's Personal Particulars Biodata Date of Application:    --- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 --- Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec --- Date of Expiry:   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec i hope this is readable to you all.
VIEWS ON THIS POST

267

Posted on:

Friday 26th October 2012
View Replies!

Please help with DSN-Less connection code

Hi Guys, I've just managed to set up a DSN-less connection for my first project But unfortunately I can't seem to figure out where to specify the database password in the code and so I can't connect to the database. My password for the database is : test This is my code : Code: Where do I specify the username and password in this connection
VIEWS ON THIS POST

178

Posted on:

Friday 26th October 2012
View Replies!

Delete items help

i am working on shopping cart using sessions and here is my code for delete items in the cart Code: UBound(arr, 2) Then Response.Write("Out of Bounds") Exit Sub Else ReDim newArray((UBound(arr) - 1), UBound(arr, 2)) Dim hasSkipped, r, c hasSkipped = False For r = 1 To 4 If r = int Then hasSkipped = True End If For c = 1 To 4 If (c > UBound(newArray, 2)) Or (c > UBound(arr, 2)) Then Exit For If hasSkipped = False Then newArray(r, c) = arr(r, c) Else newArray((r - 1), c) = arr(r, c) End If Next Next Session("cart") = newArray Erase newArray Erase arr End If Else Response.Write("No cart!") End If End Sub %> its giving an error like this Microsoft VBScript runtime error '800a000d' Type mismatch: 'lbound' /store/mainwebsite/removeitems.asp, line 34 and line 34 is this one For i = lbound(CartArray,2) to UBound(CartArray,2) i tried doing like this For i = LBound(CartArray,2) to UBound(CartArray,2) but it still gives the same error can someone tell me what i am doing wrong any help is highly appreciated
VIEWS ON THIS POST

211

Posted on:

Friday 26th October 2012
View Replies!

Help In Freeze User after 3 failed login attempts-->Pls help

Hi.. I am actually new to ASP. I m still a student but i am having my attachment in this software company. i m actually required to do a login page.. which have this feature when the user login after 3 unsuccessful time, it will lock the user from logging again. i have create a checkbox in the access and my SQL statment can tick it n freeze the user.. but the problem is my counter don't work.. I written the prog such as the index.asp is the login page.. after submitting it will direct to processlogin.asp... in processlogin.asp i have set the counter=0 and if the login is correct direct to cart.asp.. if it is wrong counter+1 and direct back to index.asp... heres the problem... the counter will restart again as when the value of the counter is 1 pass back to the index, after user submitting again.. it will go to the processlogin.. and the counter=0 will reset everything... any1 have any idea of how to solve this prob.. or where to put the counter=0 or other ways to do this kind of problem
VIEWS ON THIS POST

218

Posted on:

Friday 26th October 2012
View Replies!

newbie Asp form help

Please help, I have a form created in dreamwaever and want to send the text box contents to a txt file on my server. I know i need to have script on the server (not sure how to achive this) and script on my form page. Im ok with html and have a little understanding of programming (basic functions, ifs etc). Could anyone please help\t Any advice or code would be appreciated,
VIEWS ON THIS POST

230

Posted on:

Friday 26th October 2012
View Replies!