Jump to content

shaneR

Members
  • Posts

    20
  • Joined

  • Last visited

Posts posted by shaneR

  1. First you would check the database to see the list of files uploaded by the user. then display that list of files and give the user option to delete. On particular file delete, remove file from server and row from database. If you already started coding post it. Delete file code: http://www.w3schools.com/asp/met_deletefile.asp
    Thankyou after taking your comments into consideration im now able to perform the delete from both the server and database.Regards,Shane
  2. Hi everyone! my database site is now uploading files to my server and at the same time writting this file name and the users id to my database. What i need to do now is allow the user to access their own content and be able to delete this from the server and database.I have already been trying a few different methods but i just cant seem to get my head around it.Any code or advice would be appreciated, Thanks

  3. Are you allowing them to upload files by presenting them with a form that has an input of type file and posts to some ASP page?
    <form action="upload.asp" method="POST" enctype="multipart/form-data"><input type="file" id="uploadFile" /><input type="submit" value="Upload the file!" /></form>

    Or are you providing them access to your site through an FTP program?If you are using ASP, are you keeping track of who is viewing the page? Either by placing a cookie on that person's computer or using Sessions?

    Yes im using a form connected to an asp page. I have not included any cookies or sessions that im aware of so that sounds like the way to go? Thanks
  4. Are you currently already storing the file names and user ids in your database? How are your users able to upload files and are they then able to view those files at a later time? If so, all the data that you need is probably already there. Give us some more information about your database structure and describe in more detail the process you are using to allow the users to upload files and we may be able to help.
    I have created the user log in details in a database and these details are checked when they log into my page that allows them to then upload direct to my server. I now need a way of identifying the files uploaded by the different user in order to call them back into my database for users to view etc.I hope this makes a little more sense, thankyou.
  5. My database is now working fine! thanks to all. However i have now set it up so that users can log in and upload files to my server. How can i automatically have a copy of their file names sent to my database perhaps with their user log on id also?I would appreciate some code if possible (iam currently using dreamweaver to write my pages)Thankyou...

  6. Thanks for all that have taken the tome to look at this problem. I have discovered what was the cause and as usual it is something very simple.Basically one of my field names is called PASSWORD and as this is whats known as a reserved word i have changed it and now the site works.

  7. Hi, i wonder if anybody would be as kind to take a look at the attached code. Im trying to set up a form which when submitted the required information is sent to my database.The error which is displaying is as follows:Microsoft JET Database Engine error '80040e14'Syntax error in INSERT INTO statement./Shane_R/my_music_profile/web_site_construction/www/upload.asp, line 115 Thankyou.....

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%><!--#include file="../Connections/con1.asp" --><%' *** Edit Operations: declare variablesDim MM_editActionDim MM_abortEditDim MM_editQueryDim MM_editCmdDim MM_editConnectionDim MM_editTableDim MM_editRedirectUrlDim MM_editColumnDim MM_recordIdDim MM_fieldsStrDim MM_columnsStrDim MM_fieldsDim MM_columnsDim MM_typeArrayDim MM_formValDim MM_delimDim MM_altValDim MM_emptyValDim MM_iMM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))If (Request.QueryString <> "") Then  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)End If' boolean to abort record editMM_abortEdit = false' query string to executeMM_editQuery = ""%><%' *** Insert Record: set variablesIf (CStr(Request("MM_insert")) = "form1") Then  MM_editConnection = MM_con1_STRING  MM_editTable = "register"  MM_editRedirectUrl = "upload.asp"  MM_fieldsStr  = "Email|value|Prefferedmusictype|value|Password|value|Profilename|value"  MM_columnsStr = "Email|',none,''|Prefferedmusictype|',none,''|Password|',none,''|Profilename|',none,''"  ' create the MM_fields and MM_columns arrays  MM_fields = Split(MM_fieldsStr, "|")  MM_columns = Split(MM_columnsStr, "|")    ' set the form values  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2    MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))  Next  ' append the query string to the redirect URL  If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then      MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString    Else      MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString    End If  End IfEnd If%><%' *** Insert Record: construct a sql insert statement and execute itDim MM_tableValuesDim MM_dbValuesIf (CStr(Request("MM_insert")) <> "") Then  ' create the sql insert statement  MM_tableValues = ""  MM_dbValues = ""  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2    MM_formVal = MM_fields(MM_i+1)    MM_typeArray = Split(MM_columns(MM_i+1),",")    MM_delim = MM_typeArray(0)    If (MM_delim = "none") Then MM_delim = ""    MM_altVal = MM_typeArray(1)    If (MM_altVal = "none") Then MM_altVal = ""    MM_emptyVal = MM_typeArray(2)    If (MM_emptyVal = "none") Then MM_emptyVal = ""    If (MM_formVal = "") Then      MM_formVal = MM_emptyVal    Else      If (MM_altVal <> "") Then        MM_formVal = MM_altVal      ElseIf (MM_delim = "'") Then  ' escape quotes        MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"      Else        MM_formVal = MM_delim + MM_formVal + MM_delim      End If    End If    If (MM_i <> LBound(MM_fields)) Then      MM_tableValues = MM_tableValues & ","      MM_dbValues = MM_dbValues & ","    End If    MM_tableValues = MM_tableValues & MM_columns(MM_i)    MM_dbValues = MM_dbValues & MM_formVal  Next  MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"  If (Not MM_abortEdit) Then    ' execute the insert    Set MM_editCmd = Server.CreateObject("ADODB.Command")    MM_editCmd.ActiveConnection = MM_editConnection    MM_editCmd.CommandText = MM_editQuery    MM_editCmd.Execute    MM_editCmd.ActiveConnection.Close    If (MM_editRedirectUrl <> "") Then      Response.Redirect(MM_editRedirectUrl)    End If  End IfEnd If%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><form method="post" action="<%=MM_editAction%>" name="form1">  <table align="center">    <tr valign="baseline">      <td nowrap align="right">Email:</td>      <td>        <input type="text" name="Email" value="" size="32">      </td>    </tr>    <tr valign="baseline">      <td nowrap align="right">Prefferedmusictype:</td>      <td>        <input type="text" name="Prefferedmusictype" value="" size="32">      </td>    </tr>    <tr valign="baseline">      <td nowrap align="right">Password:</td>      <td>        <input type="text" name="Password" value="" size="32">      </td>    </tr>    <tr valign="baseline">      <td nowrap align="right">Profilename:</td>      <td>        <input type="text" name="Profilename" value="" size="32">      </td>    </tr>    <tr valign="baseline">      <td nowrap align="right"> </td>      <td>        <input type="submit" value="Insert record">      </td>    </tr>  </table>  <input type="hidden" name="MM_insert" value="form1"></form><p> </p></body></html>

  8. you could try and make all the pages short by moving the content onto more pages or you could force the scrollbar to appear on every page by giving the body a height above 100%
    Thankyou, just tried that and i have resized all my pages to 101% and they all now align without any jumping... Regards Shane.
  9. I have been building a website using html and css and the entire site has been constructed within a table and centre aligned. this works perfectly for the pages that do not have default scroll bars on them.Basically all my page width are the same size but the pages that are longer than the browsers can fit (height) a scroll bar is automatically added to the right hand side of the browser and this then causes the site to take the width of the scroll bar into account when centering the page and hence moves theses pages out of line with the ones without scroll bars.Does anybody have any suggestions please on how this can be rectified?Thankyou.

  10. i'm currently writting a website using HTML and have a page which requires quite a lot of scrolling to reach the bottom. Could somebody please offer me some simple code to create a link at the top of the page which when clicked will jump to the bottom.THANKYOU....

  11. I invite people to give there suggestions on the best way of building a site search box. The function of which is to enable site visitors to search the site their on and not the web. thankyou

×
×
  • Create New...