Avatar billede l_otto Nybegynder
19. januar 2004 - 09:23 Der er 41 kommentarer og
1 løsning

hjælp med denne fejl

Request object error 'ASP 0207 : 80004005'

Cannot use Request.Form

/idebank/info.asp, line 253

Cannot use Request.Form collection after calling BinaryRead.

linie 253 insætter jeg mine data
Avatar billede l_otto Nybegynder
19. januar 2004 - 09:24 #1
her er min kode

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/connDUpics.asp" -->
<!--#include file="ScriptLibrary/incPureUpload.asp" -->
<%
'*** Pure ASP File Upload -----------------------------------------------------
' Copyright (c) 2001-2002 George Petrov, www.UDzone.com
' Process the upload
' Version: 2.0.9
'------------------------------------------------------------------------------
'*** File Upload to: """doc""", Extensions: "GIF,JPG,JPEG,BMP,PNG,DOC,PDF,XLS", Form: form1, Redirect: "", "file", "", "uniq", "true"

Dim GP_redirectPage, RequestBin, UploadQueryString, GP_uploadAction, UploadRequest
PureUploadSetup

If (CStr(Request.QueryString("GP_upload")) <> "") Then
  on error resume next
  Dim reqPureUploadVersion, foundPureUploadVersion
  reqPureUploadVersion = 2.09
  foundPureUploadVersion = getPureUploadVersion()
  if err or reqPureUploadVersion > foundPureUploadVersion then
    Response.Write "<b>You don't have latester version of ScriptLibrary/incPureUpload.asp uploaded on the server.</b><br>"
    Response.Write "This library is required for the current page. It is fully backwards compatible so old pages will work as well.<br>"
    Response.End   
  end if
  on error goto 0
  GP_redirectPage = ""
  Server.ScriptTimeout = 600
 
  RequestBin = Request.BinaryRead(Request.TotalBytes)
  Set UploadRequest = CreateObject("Scripting.Dictionary") 
  BuildUploadRequest RequestBin, """../idebank/doc""", "file", "", "uniq"
 
  If (GP_redirectPage <> "" and not (CStr(UploadFormRequest("MM_insert")) <> "" or CStr(UploadFormRequest("MM_update")) <> "")) Then
    If (InStr(1, GP_redirectPage, "?", vbTextCompare) = 0 And UploadQueryString <> "") Then
      GP_redirectPage = GP_redirectPage & "?" & UploadQueryString
    End If
    Response.Redirect(GP_redirectPage) 
  end if 
else
  if UploadQueryString <> "" then
    UploadQueryString = UploadQueryString & "&GP_upload=true"
  else 
    UploadQueryString = "GP_upload=true"
  end if 
end if
' End Pure Upload
'------------------------------------------------------------------------------
%>
<%
' *** Edit Operations: (Modified for File Upload) declare variables

MM_editAction = CStr(Request.ServerVariables("URL")) 'MM_editAction = CStr(Request("URL"))
If (UploadQueryString <> "") Then
  MM_editAction = MM_editAction & "?" & UploadQueryString
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>

<%
' *** Insert Record: (Modified for File Upload) construct a sql insert statement and execute it

If (CStr(UploadFormRequest("MM_insert")) <> "") Then

  ' create the sql insert statement
  MM_tableValues = ""
  MM_dbValues = ""
  For i = LBound(MM_fields) To UBound(MM_fields) Step 2
    FormVal = MM_fields(i+1)
    MM_typeArray = Split(MM_columns(i+1),",")
    Delim = MM_typeArray(0)
    If (Delim = "none") Then Delim = ""
    AltVal = MM_typeArray(1)
    If (AltVal = "none") Then AltVal = ""
    EmptyVal = MM_typeArray(2)
    If (EmptyVal = "none") Then EmptyVal = ""
    If (FormVal = "") Then
      FormVal = EmptyVal
    Else
      If (AltVal <> "") Then
        FormVal = AltVal
      ElseIf (Delim = "'") Then  ' escape quotes
        FormVal = "'" & Replace(FormVal,"'","''") & "'"
      Else
        FormVal = Delim + FormVal + Delim
      End If
    End If
    If (i <> LBound(MM_fields)) Then
      MM_tableValues = MM_tableValues & ","
      MM_dbValues = MM_dbValues & ","
    End if
    MM_tableValues = MM_tableValues & MM_columns(i)
    MM_dbValues = MM_dbValues & 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 If

End If
%>

<link rel="stylesheet" href="css/default.css" type="text/css">
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,tester,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { tester=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (tester.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (tester!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (tester.indexOf('inRange') != -1) { p=tester.indexOf(':');
          min=tester.substring(8,p); max=tester.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (tester.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function checkFileUpload(form,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight) { //v2.09
  document.MM_returnValue = true;
  for (var i = 0; i<form.elements.length; i++) {
    field = form.elements[i];
    if (field.type.toUpperCase() != 'FILE') continue;
    checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight);
} }

function checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight) { //v2.09
  document.MM_returnValue = true;
  if (extensions != '') var re = new RegExp("\.(" + extensions.replace(/,/gi,"|").replace(/\s/gi,"") + ")$","i");
    if (field.value == '') {
      if (requireUpload) {alert('File is required!');document.MM_returnValue = false;field.focus();return;}
    } else {
      if(extensions != '' && !re.tester(field.value)) {
        alert('This file type is not allowed for uploading.\nOnly the following file extensions are allowed: ' + extensions + '.\nPlease select another file and try again.');
        document.MM_returnValue = false;field.focus();return;
      }
    document.PU_uploadForm = field.form;
    re = new RegExp(".(gif|jpg|png|bmp|jpeg|doc|pdf|xls)$","i");
    if(re.tester(field.value) && (sizeLimit != '' || minWidth != '' || minHeight != '' || maxWidth != '' || maxHeight != '' || saveWidth != '' || saveHeight != '')) {
      checkImageDimensions(field,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight);
    } }
}

function showImageDimensions(fieldImg) { //v2.09
  var isNS6 = (!document.all && document.getElementById ? true : false);
  var img = (fieldImg && !isNS6 ? fieldImg : this);
  if (img.width > 0 && img.height > 0) {
  if ((img.minWidth != '' && img.minWidth > img.width) || (img.minHeight != '' && img.minHeight > img.height)) {
    alert('Uploaded Image is too small!\nShould be at least ' + img.minWidth + ' x ' + img.minHeight); return;}
  if ((img.maxWidth != '' && img.width > img.maxWidth) || (img.maxHeight != '' && img.height > img.maxHeight)) {
    alert('Uploaded Image is too big!\nShould be max ' + img.maxWidth + ' x ' + img.maxHeight); return;}
  if (img.sizeLimit != '' && img.fileSize > img.sizeLimit) {
    alert('Uploaded Image File Size is too big!\nShould be max ' + (img.sizeLimit/1024) + ' KBytes'); return;}
  if (img.saveWidth != '') document.PU_uploadForm[img.saveWidth].value = img.width;
  if (img.saveHeight != '') document.PU_uploadForm[img.saveHeight].value = img.height;
  document.MM_returnValue = true;
} }

function checkImageDimensions(field,sizeL,minW,minH,maxW,maxH,saveW,saveH) { //v2.09
  if (!document.layers) {
    var isNS6 = (!document.all && document.getElementById ? true : false);
    document.MM_returnValue = false; var imgURL = 'file:///' + field.value.replace(/\\/gi,'/').replace(/:/gi,'|').replace(/"/gi,'').replace(/^\//,'');
    if (!field.gp_img || (field.gp_img && field.gp_img.src != imgURL) || isNS6) {field.gp_img = new Image();
          with (field) {gp_img.sizeLimit = sizeL*1024; gp_img.minWidth = minW; gp_img.minHeight = minH; gp_img.maxWidth = maxW; gp_img.maxHeight = maxH;
        gp_img.saveWidth = saveW; gp_img.saveHeight = saveH; gp_img.onload = showImageDimensions; gp_img.src = imgURL; }
    } else showImageDimensions(field.gp_img);}
}
//-->
</script><%
'Indsæt denne kode på alle de sider der skal beskyttes...
If Session("Valid") = "" Then
  Response.redirect "nej.asp"
End If
%><HTML>
<HEAD>
<TITLE>Ide Banken</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD><link rel="stylesheet" type="text/css" href="ccs.txt">
<script language="javascript" type="text/javascript">
<!--
/****************************************************
    Author: Eric King
    Url: http://redrival.com/eak/index.shtml
    This script is free to use as long as this info is left in
    Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->
</script>
<BODY><center>
<table width="900" height="560" border="0" cellspacing="0" cellpadding="0" align="center">
<BR><TR>
    <TD valign="top" bgcolor="#EEF0F4">
    <TABLE>
    <TR>
        <TD height="80"></TD>
    </TR>
    </TABLE>
    <TABLE>
    <TR>
        <TD><TABLE>
    <TR>
        <TD class="BoxTop" width="900"><div style="font-family: verdana; font-size: 11px; font-weight: bold;"><FONT COLOR="#003366"><a href="default.asp">Forsiden</a> |<a href="info.asp">Opret Ide</a> |<a href="produkter.asp"> Ret i Ide</a> | <a href="kontakt.asp">Slet ide</a>  </TD>
    </TR>
    </TABLE></TD>
    </TR>
    </TABLE>
   
<center>
<TABLE>
<TR>
    <TD ><TABLE height="20">
    <TR >
        <TD></TD>
    </TR>
    </TABLE>
<%

if request.form("send") <> "" then
' ADODB connection objektet
Set Conn = Server.CreateObject("ADODB.Connection")
' Husk at angive den rigtige sti til din database
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database.mdb")
' Åben databaseforbindelsen
Conn.Open DSN

strSQL = "Insert into Kontor (Fornavn, telefondato, telefonsub, telefonfelt, telefontid, telefonopret, note) values('" & UploadRequest.Form("Fornavn") & "','" & UploadRequest.Form("telefondato") & "','" & UploadRequest.Form("telefonsub") & "','" & UploadRequest.Form("telefonfelt") & "','" & UploadRequest.Form("telefontid") & "','" & UploadRequest.Form("telefonopret") & "','" & UploadRequest.Form("note") & "')"
conn.execute(strSQL)
Alert = "Din ide er nu oprettet "
end if


%>

<center>
<form method="post" action="<%=MM_editAction%>" name="form1" enctype="multipart/form-data" onSubmit="checkFileUpload(this,'GIF,JPG,JPEG,BMP,PNG,DOC,PDF,XLS',true,');return document.MM_returnValue"><a href="default.asp" target='_self'><%=Alert%></a>
<TABLE width="500" bgcolor="#FFCC66" class="Formindhold">
<TR>
    <TD class="BoxTop"><center> <TABLE>
    <TR>
        <TD valign="top" class="BoxTop"width="500"><FONT SIZE="1" COLOR="#FF0000"><b>Opret Ide <TABLE>
    <TR>
        <TD width="80"><FONT SIZE="1" COLOR="#000000">Oprettet af<td><select name="Fornavn" class="Formindhold">
                <option value="" selected><FONT SIZE="1" COLOR="#000000">Vælg person</option>
                <option value="Jesper">Jesper</option>
                    <option value="Peter ">Peter </option>
               
              </select></td></TD>    </TR>
       
        <TD ><FONT SIZE="1" COLOR="#000000">Dato<td><input type="text" name="telefondato" class="Formindhold" size="30" value="<%
Response.Write "Den " & FormatDateTime(Now, vbLongDate)
Response.Write " kl. " & FormatDateTime(Now, vbShortTime)
%>">
</td></TD>    </TR>
       
       
        <TD ><FONT SIZE="1" COLOR="#000000">Emne <td><input type="text" name="telefonsub" class="Formindhold" size="72"></td></TD></TR>   
<TD valign="top"><FONT SIZE="1" COLOR="#000000">Idegrundlag<td><textarea name="telefonfelt" rows="7" cols="100"  class="Formindhold"></textarea></td></TD></TR>
<TD valign="top"><FONT SIZE="1" COLOR="#000000">For<td><textarea name="telefontid" rows="7" cols="100"  class="Formindhold"></textarea></td></TD></TR>
<TD valign="top"><FONT SIZE="1" COLOR="#000000">Imod<td><textarea name="telefonopret" rows="7" cols="100"  class="Formindhold"></textarea></td></TD></TR>
<td nowrap align="right"><font color="#333333">Indsæt fil:
                                  </font></td>
                                <td>
                                  <input type="file" name="note" size="35" class="Fields" onChange="checkOneFileUpload(this,'GIF,JPG,JPEG,BMP,PNG,DOC,PDF,XLS',true,'',150,100,640,480,'PIC_WIDTH','PIC_HEIGHT')">
                                 
                               
                                </td>

    </TR>
   
   
   
    </TR>
    </TABLE>
   
    </TD>
    </TR>
    </TABLE>
    <input type="submit" value="Gem" name="submit" class="Buttons" >



</form>
Avatar billede mm12010 Nybegynder
19. januar 2004 - 11:05 #2
du skal bruge dit upload-object når du sender med enctype="multipart/form-data"

strSQL = "Insert into Kontor (Fornavn, telefondato, telefonsub, telefonfelt, telefontid, telefonopret, note) values('" & UploadFormRequest("Fornavn") & "','" & UploadFormRequest("telefondato") & "','" & UploadFormRequest("telefonsub") & "','" & UploadFormRequest("telefonfelt") & "','" & UploadFormRequest("telefontid") & "','" & UploadFormRequest("telefonopret") & "','" & UploadFormRequest("note") & "')"
Avatar billede l_otto Nybegynder
19. januar 2004 - 11:41 #3
samme fejl

Request object error 'ASP 0207 : 80004005'

Cannot use Request.Form

/idebank/info.asp, line 254

Cannot use Request.Form collection after calling BinaryRead.
Avatar billede l_otto Nybegynder
19. januar 2004 - 11:42 #4
hvor kan jeg finde mit  upload-object  ???
Avatar billede l_otto Nybegynder
19. januar 2004 - 11:44 #5
det er denne linie den fejler på...? kan jeg gøre noget med den ?

if request.form("send") <> "" then
Avatar billede l_otto Nybegynder
19. januar 2004 - 12:28 #6
hjælp.. er du der?
Avatar billede sbm Nybegynder
19. januar 2004 - 14:22 #7
Uden at være sikker, virker det som om den ikke vil have et du kalder request.form("variabelnavn") efter du har åbnet BinaryRead.

Derfor foreslår jeg du lægger værdien over i en midlertidig variabel, og så refererer til den istedet. Dvs helt oppe i toppen af dokumentet indsætter du noget i stil med

dim sendVar
sendVar = request.form("send")

og i din linie 254 retter du så til
if request.form("send") <> "" then
Avatar billede l_otto Nybegynder
19. januar 2004 - 14:30 #8
så vil den slet ikke åbne siden ! :-(
Avatar billede sbm Nybegynder
19. januar 2004 - 14:38 #9
Argh! Nu håber jeg ikke du har indsat det som linie 1 foran din

<%@LANGUAGE="VBSCRIPT"%>

?????

Det skal lidt længere ned. Umiddelbart efter din DIM linie.

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/connDUpics.asp" -->
<!--#include file="ScriptLibrary/incPureUpload.asp" -->
<%
'*** Pure ASP File Upload -----------------------------------------------------
' Copyright (c) 2001-2002 George Petrov, www.UDzone.com
' Process the upload
' Version: 2.0.9
'------------------------------------------------------------------------------
'*** File Upload to: """doc""", Extensions: "GIF,JPG,JPEG,BMP,PNG,DOC,PDF,XLS", Form: form1, Redirect: "", "file", "", "uniq", "true"

Dim GP_redirectPage, RequestBin, UploadQueryString, GP_uploadAction, UploadRequest
PureUploadSetup, sendVar

sendVar = request.form("send")
Avatar billede l_otto Nybegynder
19. januar 2004 - 14:38 #10
hjælp...... jeg er ved at blive vanvittig
Avatar billede sbm Nybegynder
19. januar 2004 - 14:38 #11
Bemærk at jeg har indsat en linie OG har ændret din Dim linie
Avatar billede l_otto Nybegynder
19. januar 2004 - 14:45 #12
her er min kode og siden vil ikke vises sorry.. men skulle denne her ikke også lavet lidt om ?

if request.form("send") <> "" then

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/connDUpics.asp" -->
<!--#include file="ScriptLibrary/incPureUpload.asp" -->
<%
'*** Pure ASP File Upload -----------------------------------------------------
' Copyright (c) 2001-2002 George Petrov, www.UDzone.com
' Process the upload
' Version: 2.0.9
'------------------------------------------------------------------------------
'*** File Upload to: """doc""", Extensions: "GIF,JPG,JPEG,BMP,PNG,DOC,PDF,XLS", Form: form1, Redirect: "", "file", "", "uniq", "true"

Dim GP_redirectPage, RequestBin, UploadQueryString, GP_uploadAction, UploadRequest
PureUploadSetup, sendVar

sendVar = request.form("send")

If (CStr(Request.QueryString("GP_upload")) <> "") Then
  on error resume next
  Dim reqPureUploadVersion, foundPureUploadVersion
  reqPureUploadVersion = 2.09
  foundPureUploadVersion = getPureUploadVersion()
  if err or reqPureUploadVersion > foundPureUploadVersion then
    Response.Write "<b>You don't have latester version of ScriptLibrary/incPureUpload.asp uploaded on the server.</b><br>"
    Response.Write "This library is required for the current page. It is fully backwards compatible so old pages will work as well.<br>"
    Response.End   
  end if
  on error goto 0
  GP_redirectPage = ""
  Server.ScriptTimeout = 600
 
  RequestBin = Request.BinaryRead(Request.TotalBytes)
  Set UploadRequest = CreateObject("Scripting.Dictionary") 
  BuildUploadRequest RequestBin, """../idebank/doc""", "file", "", "uniq"
 
  If (GP_redirectPage <> "" and not (CStr(UploadFormRequest("MM_insert")) <> "" or CStr(UploadFormRequest("MM_update")) <> "")) Then
    If (InStr(1, GP_redirectPage, "?", vbTextCompare) = 0 And UploadQueryString <> "") Then
      GP_redirectPage = GP_redirectPage & "?" & UploadQueryString
    End If
    Response.Redirect(GP_redirectPage) 
  end if 
else
  if UploadQueryString <> "" then
    UploadQueryString = UploadQueryString & "&GP_upload=true"
  else 
    UploadQueryString = "GP_upload=true"
  end if 
end if
' End Pure Upload
'------------------------------------------------------------------------------
%>
<%
' *** Edit Operations: (Modified for File Upload) declare variables

MM_editAction = CStr(Request.ServerVariables("URL")) 'MM_editAction = CStr(Request("URL"))
If (UploadQueryString <> "") Then
  MM_editAction = MM_editAction & "?" & UploadQueryString
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>

<%
' *** Insert Record: (Modified for File Upload) construct a sql insert statement and execute it

If (CStr(UploadFormRequest("MM_insert")) <> "") Then

  ' create the sql insert statement
  MM_tableValues = ""
  MM_dbValues = ""
  For i = LBound(MM_fields) To UBound(MM_fields) Step 2
    FormVal = MM_fields(i+1)
    MM_typeArray = Split(MM_columns(i+1),",")
    Delim = MM_typeArray(0)
    If (Delim = "none") Then Delim = ""
    AltVal = MM_typeArray(1)
    If (AltVal = "none") Then AltVal = ""
    EmptyVal = MM_typeArray(2)
    If (EmptyVal = "none") Then EmptyVal = ""
    If (FormVal = "") Then
      FormVal = EmptyVal
    Else
      If (AltVal <> "") Then
        FormVal = AltVal
      ElseIf (Delim = "'") Then  ' escape quotes
        FormVal = "'" & Replace(FormVal,"'","''") & "'"
      Else
        FormVal = Delim + FormVal + Delim
      End If
    End If
    If (i <> LBound(MM_fields)) Then
      MM_tableValues = MM_tableValues & ","
      MM_dbValues = MM_dbValues & ","
    End if
    MM_tableValues = MM_tableValues & MM_columns(i)
    MM_dbValues = MM_dbValues & 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 If

End If
%>

<link rel="stylesheet" href="css/default.css" type="text/css">
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,tester,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { tester=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (tester.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (tester!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (tester.indexOf('inRange') != -1) { p=tester.indexOf(':');
          min=tester.substring(8,p); max=tester.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (tester.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function checkFileUpload(form,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight) { //v2.09
  document.MM_returnValue = true;
  for (var i = 0; i<form.elements.length; i++) {
    field = form.elements[i];
    if (field.type.toUpperCase() != 'FILE') continue;
    checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight);
} }

function checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight) { //v2.09
  document.MM_returnValue = true;
  if (extensions != '') var re = new RegExp("\.(" + extensions.replace(/,/gi,"|").replace(/\s/gi,"") + ")$","i");
    if (field.value == '') {
      if (requireUpload) {alert('File is required!');document.MM_returnValue = false;field.focus();return;}
    } else {
      if(extensions != '' && !re.tester(field.value)) {
        alert('This file type is not allowed for uploading.\nOnly the following file extensions are allowed: ' + extensions + '.\nPlease select another file and try again.');
        document.MM_returnValue = false;field.focus();return;
      }
    document.PU_uploadForm = field.form;
    re = new RegExp(".(gif|jpg|png|bmp|jpeg|doc|pdf|xls)$","i");
    if(re.tester(field.value) && (sizeLimit != '' || minWidth != '' || minHeight != '' || maxWidth != '' || maxHeight != '' || saveWidth != '' || saveHeight != '')) {
      checkImageDimensions(field,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight);
    } }
}

function showImageDimensions(fieldImg) { //v2.09
  var isNS6 = (!document.all && document.getElementById ? true : false);
  var img = (fieldImg && !isNS6 ? fieldImg : this);
  if (img.width > 0 && img.height > 0) {
  if ((img.minWidth != '' && img.minWidth > img.width) || (img.minHeight != '' && img.minHeight > img.height)) {
    alert('Uploaded Image is too small!\nShould be at least ' + img.minWidth + ' x ' + img.minHeight); return;}
  if ((img.maxWidth != '' && img.width > img.maxWidth) || (img.maxHeight != '' && img.height > img.maxHeight)) {
    alert('Uploaded Image is too big!\nShould be max ' + img.maxWidth + ' x ' + img.maxHeight); return;}
  if (img.sizeLimit != '' && img.fileSize > img.sizeLimit) {
    alert('Uploaded Image File Size is too big!\nShould be max ' + (img.sizeLimit/1024) + ' KBytes'); return;}
  if (img.saveWidth != '') document.PU_uploadForm[img.saveWidth].value = img.width;
  if (img.saveHeight != '') document.PU_uploadForm[img.saveHeight].value = img.height;
  document.MM_returnValue = true;
} }

function checkImageDimensions(field,sizeL,minW,minH,maxW,maxH,saveW,saveH) { //v2.09
  if (!document.layers) {
    var isNS6 = (!document.all && document.getElementById ? true : false);
    document.MM_returnValue = false; var imgURL = 'file:///' + field.value.replace(/\\/gi,'/').replace(/:/gi,'|').replace(/"/gi,'').replace(/^\//,'');
    if (!field.gp_img || (field.gp_img && field.gp_img.src != imgURL) || isNS6) {field.gp_img = new Image();
          with (field) {gp_img.sizeLimit = sizeL*1024; gp_img.minWidth = minW; gp_img.minHeight = minH; gp_img.maxWidth = maxW; gp_img.maxHeight = maxH;
        gp_img.saveWidth = saveW; gp_img.saveHeight = saveH; gp_img.onload = showImageDimensions; gp_img.src = imgURL; }
    } else showImageDimensions(field.gp_img);}
}
//-->
</script><%
'Indsæt denne kode på alle de sider der skal beskyttes...
If Session("Valid") = "" Then
  Response.redirect "nej.asp"
End If
%><HTML>
<HEAD>
<TITLE>Ide Banken</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD><link rel="stylesheet" type="text/css" href="ccs.txt">
<script language="javascript" type="text/javascript">
<!--
/****************************************************
    Author: Eric King
    Url: http://redrival.com/eak/index.shtml
    This script is free to use as long as this info is left in
    Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->
</script>
<BODY><center>
<table width="900" height="560" border="0" cellspacing="0" cellpadding="0" align="center">
<BR><TR>
    <TD valign="top" bgcolor="#EEF0F4">
    <TABLE>
    <TR>
        <TD height="80"></TD>
    </TR>
    </TABLE>
    <TABLE>
    <TR>
        <TD><TABLE>
    <TR>
        <TD class="BoxTop" width="900"><div style="font-family: verdana; font-size: 11px; font-weight: bold;"><FONT COLOR="#003366"><a href="default.asp">Forsiden</a> |<a href="info.asp">Opret Ide</a> |<a href="produkter.asp"> Ret i Ide</a> | <a href="kontakt.asp">Slet ide</a>  </TD>
    </TR>
    </TABLE></TD>
    </TR>
    </TABLE>
   
<center>
<TABLE>
<TR>
    <TD ><TABLE height="20">
    <TR >
        <TD></TD>
    </TR>
    </TABLE>

      <%

if request.form("send") <> "" then
' ADODB connection objektet
Set Conn = Server.CreateObject("ADODB.Connection")
' Husk at angive den rigtige sti til din database
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database.mdb")
' Åben databaseforbindelsen
Conn.Open DSN

strSQL = "Insert into Kontor (Fornavn, telefondato, telefonsub, telefonfelt, telefontid, telefonopret, note) values('" & UploadRequest.Form("Fornavn") & "','" & UploadRequest.Form("telefondato") & "','" & UploadRequest.Form("telefonsub") & "','" & UploadRequest.Form("telefonfelt") & "','" & UploadRequest.Form("telefontid") & "','" & UploadRequest.Form("telefonopret") & "','" & UploadRequest.Form("note") & "')"
conn.execute(strSQL)
Alert = "Din ide er nu oprettet "
end if


%>

<center>
<form method="post" action="<%=MM_editAction%>" name="form1" enctype="multipart/form-data" onSubmit="checkFileUpload(this,'GIF,JPG,JPEG,BMP,PNG,DOC,PDF,XLS',true,');return document.MM_returnValue"><a href="info.asp" target='_self'><%=Alert%></a>
<TABLE width="500" bgcolor="#FFCC66" class="Formindhold">
<TR>
    <TD class="BoxTop"><center> <TABLE>
    <TR>
        <TD valign="top" class="BoxTop"width="500"><FONT SIZE="1" COLOR="#FF0000"><b>Opret Ide <TABLE>
    <TR>
        <TD width="80"><FONT SIZE="1" COLOR="#000000">Oprettet af<td><select name="Fornavn" class="Formindhold">
                <option value="" selected><FONT SIZE="1" COLOR="#000000">Vælg person</option>
                <option value="Jesper">Jesper</option>
                    <option value="Peter ">Peter </option>
               
              </select></td></TD>    </TR>
       
        <TD ><FONT SIZE="1" COLOR="#000000">Dato<td><input type="text" name="telefondato" class="Formindhold" size="30" value="<%
Response.Write "Den " & FormatDateTime(Now, vbLongDate)
Response.Write " kl. " & FormatDateTime(Now, vbShortTime)
%>">
</td></TD>    </TR>
       
       
        <TD ><FONT SIZE="1" COLOR="#000000">Emne <td><input type="text" name="telefonsub" class="Formindhold" size="72"></td></TD></TR>   
<TD valign="top"><FONT SIZE="1" COLOR="#000000">Idegrundlag<td><textarea name="telefonfelt" rows="7" cols="100"  class="Formindhold"></textarea></td></TD></TR>
<TD valign="top"><FONT SIZE="1" COLOR="#000000">For<td><textarea name="telefontid" rows="7" cols="100"  class="Formindhold"></textarea></td></TD></TR>
<TD valign="top"><FONT SIZE="1" COLOR="#000000">Imod<td><textarea name="telefonopret" rows="7" cols="100"  class="Formindhold"></textarea></td></TD></TR>
<td nowrap align="right"><font color="#333333"><FONT SIZE="1" COLOR="#000000">Indsæt fil:
                                  </font></td>
                                <td>
                                  <input type="file" name="note" size="35" class="Formindhold" onChange="checkOneFileUpload(this,'GIF,JPG,JPEG,BMP,PNG,DOC,PDF,XLS',true,'',150,100,640,480,'PIC_WIDTH','PIC_HEIGHT')">
                                 
                               
                                </td>

    </TR>
   
   
   
    </TR>
    </TABLE>
   
    </TD>
    </TR>
    </TABLE>
    <input type="submit" value="Gem" name="submit" class="Formindhold" >



</form>
Avatar billede l_otto Nybegynder
19. januar 2004 - 14:46 #13
og tak fordi du hjælper... der er ingen andre der kan finde ud af det
Avatar billede sbm Nybegynder
19. januar 2004 - 14:52 #14
Hvad laver du med den

if request.form("send") <> "" then

i linie 1???
Avatar billede sbm Nybegynder
19. januar 2004 - 14:54 #15
Væk med den! <%@LANGUAGE="VBSCRIPT"%> skal være din første linie.
Avatar billede l_otto Nybegynder
19. januar 2004 - 15:00 #16
he he ok den er der heller ikke det var fordi jeg spurte til den :-)
Avatar billede sbm Nybegynder
19. januar 2004 - 15:17 #17
Ja, den skal også laves om. Du må åbenbart IKKE referere til request.form dernede... Det må så erstattes med

if (sendVar <> "") then
Avatar billede l_otto Nybegynder
19. januar 2004 - 15:35 #18
øv siden sis ikke:

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/connDUpics.asp" -->
<!--#include file="ScriptLibrary/incPureUpload.asp" -->
<%
'*** Pure ASP File Upload -----------------------------------------------------
' Copyright (c) 2001-2002 George Petrov, www.UDzone.com
' Process the upload
' Version: 2.0.9
'------------------------------------------------------------------------------
'*** File Upload to: """doc""", Extensions: "GIF,JPG,JPEG,BMP,PNG,DOC,PDF,XLS", Form: form1, Redirect: "", "file", "", "uniq", "true"

Dim GP_redirectPage, RequestBin, UploadQueryString, GP_uploadAction, UploadRequest
PureUploadSetup, sendVar

sendVar = request.form("send")

If (CStr(Request.QueryString("GP_upload")) <> "") Then
  on error resume next
  Dim reqPureUploadVersion, foundPureUploadVersion
  reqPureUploadVersion = 2.09
  foundPureUploadVersion = getPureUploadVersion()
  if err or reqPureUploadVersion > foundPureUploadVersion then
    Response.Write "<b>You don't have latester version of ScriptLibrary/incPureUpload.asp uploaded on the server.</b><br>"
    Response.Write "This library is required for the current page. It is fully backwards compatible so old pages will work as well.<br>"
    Response.End   
  end if
  on error goto 0
  GP_redirectPage = ""
  Server.ScriptTimeout = 600
 
  RequestBin = Request.BinaryRead(Request.TotalBytes)
  Set UploadRequest = CreateObject("Scripting.Dictionary") 
  BuildUploadRequest RequestBin, """../idebank/doc""", "file", "", "uniq"
 
  If (GP_redirectPage <> "" and not (CStr(UploadFormRequest("MM_insert")) <> "" or CStr(UploadFormRequest("MM_update")) <> "")) Then
    If (InStr(1, GP_redirectPage, "?", vbTextCompare) = 0 And UploadQueryString <> "") Then
      GP_redirectPage = GP_redirectPage & "?" & UploadQueryString
    End If
    Response.Redirect(GP_redirectPage) 
  end if 
else
  if UploadQueryString <> "" then
    UploadQueryString = UploadQueryString & "&GP_upload=true"
  else 
    UploadQueryString = "GP_upload=true"
  end if 
end if
' End Pure Upload
'------------------------------------------------------------------------------
%>
<%
' *** Edit Operations: (Modified for File Upload) declare variables

MM_editAction = CStr(Request.ServerVariables("URL")) 'MM_editAction = CStr(Request("URL"))
If (UploadQueryString <> "") Then
  MM_editAction = MM_editAction & "?" & UploadQueryString
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>

<%
' *** Insert Record: (Modified for File Upload) construct a sql insert statement and execute it

If (CStr(UploadFormRequest("MM_insert")) <> "") Then

  ' create the sql insert statement
  MM_tableValues = ""
  MM_dbValues = ""
  For i = LBound(MM_fields) To UBound(MM_fields) Step 2
    FormVal = MM_fields(i+1)
    MM_typeArray = Split(MM_columns(i+1),",")
    Delim = MM_typeArray(0)
    If (Delim = "none") Then Delim = ""
    AltVal = MM_typeArray(1)
    If (AltVal = "none") Then AltVal = ""
    EmptyVal = MM_typeArray(2)
    If (EmptyVal = "none") Then EmptyVal = ""
    If (FormVal = "") Then
      FormVal = EmptyVal
    Else
      If (AltVal <> "") Then
        FormVal = AltVal
      ElseIf (Delim = "'") Then  ' escape quotes
        FormVal = "'" & Replace(FormVal,"'","''") & "'"
      Else
        FormVal = Delim + FormVal + Delim
      End If
    End If
    If (i <> LBound(MM_fields)) Then
      MM_tableValues = MM_tableValues & ","
      MM_dbValues = MM_dbValues & ","
    End if
    MM_tableValues = MM_tableValues & MM_columns(i)
    MM_dbValues = MM_dbValues & 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 If

End If
%>

<link rel="stylesheet" href="css/default.css" type="text/css">
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,tester,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { tester=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (tester.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (tester!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (tester.indexOf('inRange') != -1) { p=tester.indexOf(':');
          min=tester.substring(8,p); max=tester.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (tester.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function checkFileUpload(form,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight) { //v2.09
  document.MM_returnValue = true;
  for (var i = 0; i<form.elements.length; i++) {
    field = form.elements[i];
    if (field.type.toUpperCase() != 'FILE') continue;
    checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight);
} }

function checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight) { //v2.09
  document.MM_returnValue = true;
  if (extensions != '') var re = new RegExp("\.(" + extensions.replace(/,/gi,"|").replace(/\s/gi,"") + ")$","i");
    if (field.value == '') {
      if (requireUpload) {alert('File is required!');document.MM_returnValue = false;field.focus();return;}
    } else {
      if(extensions != '' && !re.tester(field.value)) {
        alert('This file type is not allowed for uploading.\nOnly the following file extensions are allowed: ' + extensions + '.\nPlease select another file and try again.');
        document.MM_returnValue = false;field.focus();return;
      }
    document.PU_uploadForm = field.form;
    re = new RegExp(".(gif|jpg|png|bmp|jpeg|doc|pdf|xls)$","i");
    if(re.tester(field.value) && (sizeLimit != '' || minWidth != '' || minHeight != '' || maxWidth != '' || maxHeight != '' || saveWidth != '' || saveHeight != '')) {
      checkImageDimensions(field,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight);
    } }
}

function showImageDimensions(fieldImg) { //v2.09
  var isNS6 = (!document.all && document.getElementById ? true : false);
  var img = (fieldImg && !isNS6 ? fieldImg : this);
  if (img.width > 0 && img.height > 0) {
  if ((img.minWidth != '' && img.minWidth > img.width) || (img.minHeight != '' && img.minHeight > img.height)) {
    alert('Uploaded Image is too small!\nShould be at least ' + img.minWidth + ' x ' + img.minHeight); return;}
  if ((img.maxWidth != '' && img.width > img.maxWidth) || (img.maxHeight != '' && img.height > img.maxHeight)) {
    alert('Uploaded Image is too big!\nShould be max ' + img.maxWidth + ' x ' + img.maxHeight); return;}
  if (img.sizeLimit != '' && img.fileSize > img.sizeLimit) {
    alert('Uploaded Image File Size is too big!\nShould be max ' + (img.sizeLimit/1024) + ' KBytes'); return;}
  if (img.saveWidth != '') document.PU_uploadForm[img.saveWidth].value = img.width;
  if (img.saveHeight != '') document.PU_uploadForm[img.saveHeight].value = img.height;
  document.MM_returnValue = true;
} }

function checkImageDimensions(field,sizeL,minW,minH,maxW,maxH,saveW,saveH) { //v2.09
  if (!document.layers) {
    var isNS6 = (!document.all && document.getElementById ? true : false);
    document.MM_returnValue = false; var imgURL = 'file:///' + field.value.replace(/\\/gi,'/').replace(/:/gi,'|').replace(/"/gi,'').replace(/^\//,'');
    if (!field.gp_img || (field.gp_img && field.gp_img.src != imgURL) || isNS6) {field.gp_img = new Image();
          with (field) {gp_img.sizeLimit = sizeL*1024; gp_img.minWidth = minW; gp_img.minHeight = minH; gp_img.maxWidth = maxW; gp_img.maxHeight = maxH;
        gp_img.saveWidth = saveW; gp_img.saveHeight = saveH; gp_img.onload = showImageDimensions; gp_img.src = imgURL; }
    } else showImageDimensions(field.gp_img);}
}
//-->
</script><%
'Indsæt denne kode på alle de sider der skal beskyttes...
If Session("Valid") = "" Then
  Response.redirect "nej.asp"
End If
%><HTML>
<HEAD>
<TITLE>Ide Banken</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD><link rel="stylesheet" type="text/css" href="ccs.txt">
<script language="javascript" type="text/javascript">
<!--
/****************************************************
    Author: Eric King
    Url: http://redrival.com/eak/index.shtml
    This script is free to use as long as this info is left in
    Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->
</script>
<BODY><center>
<table width="900" height="560" border="0" cellspacing="0" cellpadding="0" align="center">
<BR><TR>
    <TD valign="top" bgcolor="#EEF0F4">
    <TABLE>
    <TR>
        <TD height="80"></TD>
    </TR>
    </TABLE>
    <TABLE>
    <TR>
        <TD><TABLE>
    <TR>
        <TD class="BoxTop" width="900"><div style="font-family: verdana; font-size: 11px; font-weight: bold;"><FONT COLOR="#003366"><a href="default.asp">Forsiden</a> |<a href="info.asp">Opret Ide</a> |<a href="produkter.asp"> Ret i Ide</a> | <a href="kontakt.asp">Slet ide</a>  </TD>
    </TR>
    </TABLE></TD>
    </TR>
    </TABLE>
   
<center>
<TABLE>
<TR>
    <TD ><TABLE height="20">
    <TR >
        <TD></TD>
    </TR>
    </TABLE>

      <%

if (sendVar <> "") then
' ADODB connection objektet
Set Conn = Server.CreateObject("ADODB.Connection")
' Husk at angive den rigtige sti til din database
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database.mdb")
' Åben databaseforbindelsen
Conn.Open DSN

strSQL = "Insert into Kontor (Fornavn, telefondato, telefonsub, telefonfelt, telefontid, telefonopret, note) values('" & UploadRequest.Form("Fornavn") & "','" & UploadRequest.Form("telefondato") & "','" & UploadRequest.Form("telefonsub") & "','" & UploadRequest.Form("telefonfelt") & "','" & UploadRequest.Form("telefontid") & "','" & UploadRequest.Form("telefonopret") & "','" & UploadRequest.Form("note") & "')"
conn.execute(strSQL)
Alert = "Din ide er nu oprettet "
end if


%>

<center>
<form method="post" action="<%=MM_editAction%>" name="form1" enctype="multipart/form-data" onSubmit="checkFileUpload(this,'GIF,JPG,JPEG,BMP,PNG,DOC,PDF,XLS',true,');return document.MM_returnValue"><a href="info.asp" target='_self'><%=Alert%></a>
<TABLE width="500" bgcolor="#FFCC66" class="Formindhold">
<TR>
    <TD class="BoxTop"><center> <TABLE>
    <TR>
        <TD valign="top" class="BoxTop"width="500"><FONT SIZE="1" COLOR="#FF0000"><b>Opret Ide <TABLE>
    <TR>
        <TD width="80"><FONT SIZE="1" COLOR="#000000">Oprettet af<td><select name="Fornavn" class="Formindhold">
                <option value="" selected><FONT SIZE="1" COLOR="#000000">Vælg person</option>
                <option value="Jesper">Jesper</option>
                    <option value="Peter ">Peter </option>
               
              </select></td></TD>    </TR>
       
        <TD ><FONT SIZE="1" COLOR="#000000">Dato<td><input type="text" name="telefondato" class="Formindhold" size="30" value="<%
Response.Write "Den " & FormatDateTime(Now, vbLongDate)
Response.Write " kl. " & FormatDateTime(Now, vbShortTime)
%>">
</td></TD>    </TR>
       
       
        <TD ><FONT SIZE="1" COLOR="#000000">Emne <td><input type="text" name="telefonsub" class="Formindhold" size="72"></td></TD></TR>   
<TD valign="top"><FONT SIZE="1" COLOR="#000000">Idegrundlag<td><textarea name="telefonfelt" rows="7" cols="100"  class="Formindhold"></textarea></td></TD></TR>
<TD valign="top"><FONT SIZE="1" COLOR="#000000">For<td><textarea name="telefontid" rows="7" cols="100"  class="Formindhold"></textarea></td></TD></TR>
<TD valign="top"><FONT SIZE="1" COLOR="#000000">Imod<td><textarea name="telefonopret" rows="7" cols="100"  class="Formindhold"></textarea></td></TD></TR>
<td nowrap align="right"><font color="#333333"><FONT SIZE="1" COLOR="#000000">Indsæt fil:
                                  </font></td>
                                <td>
                                  <input type="file" name="note" size="35" class="Formindhold" onChange="checkOneFileUpload(this,'GIF,JPG,JPEG,BMP,PNG,DOC,PDF,XLS',true,'',150,100,640,480,'PIC_WIDTH','PIC_HEIGHT')">
                                 
                               
                                </td>

    </TR>
   
   
   
    </TR>
    </TABLE>
   
    </TD>
    </TR>
    </TABLE>
    <input type="submit" value="Gem" name="submit" class="Formindhold" >



</form>
Avatar billede sbm Nybegynder
19. januar 2004 - 15:49 #19
Ingen fejlmeddelelse?
Avatar billede Slettet bruger
19. januar 2004 - 15:50 #20
for satan er langt script =S *helt forvirret*
Avatar billede sbm Nybegynder
19. januar 2004 - 15:52 #21
Det er i øvrigt ikke pænt at undlade at lukke sine tags...
Til aller-sidst i dokumentet skal du nok lige tilføje

</body>
</html>
Avatar billede l_otto Nybegynder
19. januar 2004 - 16:02 #22
jeg har bare ikke copy det nederste med:-)
Avatar billede sbm Nybegynder
19. januar 2004 - 16:05 #23
Du svarede ikke på om der var nogen fejlmeddelelse?
Avatar billede l_otto Nybegynder
19. januar 2004 - 16:05 #24
Wollsen.-> ja det er ikke for børn og jeg kan heller ikke gemmenskue det hele.... men jeg vil så gerne have det viker..
Avatar billede l_otto Nybegynder
19. januar 2004 - 16:07 #25
jamen det skrev jeg i toppen :-) sidne vises stadig ikke
Avatar billede mm12010 Nybegynder
19. januar 2004 - 16:14 #26
l_otto >> undskyld jeg ikke lige meldte tilbage - var lige på vej ud af døren tidligere

hvad indeholder "ScriptLibrary/incPureUpload.asp" ?
Avatar billede ellebaek Nybegynder
19. januar 2004 - 16:15 #27
problemet er nok at du laver upload..

Prøv at fjerne din request.form og lav den om til:
UploadFormRequest("formnavn")
Avatar billede mm12010 Nybegynder
19. januar 2004 - 16:18 #28
ellebaek >> det var lige præcis det jeg sagde i mit første indlæg !-)
Avatar billede ellebaek Nybegynder
19. januar 2004 - 16:19 #29
Og det var så min fejl...

Havde ikke set, dette allerede havde været fremme.
Avatar billede ellebaek Nybegynder
19. januar 2004 - 16:19 #30
Jeps det så jeg også lige..

Jeg undskylder.
Avatar billede l_otto Nybegynder
19. januar 2004 - 16:20 #31
det har jeg prøvet samme fejl :-)altså UploadFormRequest("formnavn")

her er pureUpload

<SCRIPT LANGUAGE="VBSCRIPT" RUNAT="SERVER">
'*** Pure ASP File Upload -----------------------------------------------------
' Copyright 2001-2002 (c) George Petrov, www.UDzone.com
'
' Script partially based on code from Philippe Collignon
'              (http://www.asptoday.com/articles/20000316.htm)
'
' New features added:
'  * Fast file save with ADO 2.5 stream object
'  * new file handling, wrapper functions, extra error checking
'  * UltraDev Server Behavior extension
'  * Progress bars, file limit checking, file type checking, file existence checking
'  * Support for UltraDev Insert/Update Server Behavior
'  * and much more ...
'
' Version: 2.0.9
'------------------------------------------------------------------------------
Function getPureUploadVersion()
  getPureUploadVersion = 2.09
End Function

Sub BuildUploadRequest(RequestBin,UploadDirectory,storeType,sizeLimit,nameConflict)

  Dim PosBeg, PosEnd, checkADOConn, AdoVersion, Length, boundary, boundaryPos, Pos
  Dim PosFile, Name, PosBound, FileName, ContentType, Value, ValueBeg, ValueEnd, ValueLen
 
  'Get the boundary
  PosBeg = 1
  PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
  if PosEnd = 0 then
    Response.Write "<b>Form was submitted with no ENCTYPE=""multipart/form-data""</b><br>"
    Response.Write "Please correct and <A HREF=""java script:history.back(1)"">try again</a>"   
    Response.End
  end if
  'Check ADO Version
    set checkADOConn = Server.CreateObject("ADODB.Connection")
  on error resume next
    adoVersion = CSng(checkADOConn.Version)
    if err then
        adoVersion = Replace(checkADOConn.Version,".",",") 
        adoVersion = CSng(adoVersion)
    end if   
      err.clear
  on error goto 0   
    set checkADOConn = Nothing
    if adoVersion < 2.5 then
    Response.Write "<b>You don't have ADO 2.5 installed on the server.</b><br>"
    Response.Write "The File Upload extension needs ADO 2.5 or greater to run properly.<br>"
    Response.Write "You can download the latest MDAC (ADO is included) from <a href=""www.microsoft.com/data"">www.microsoft.com/data</a><br>"
    Response.End
    end if       
  'Check content length if needed
    Length = CLng(Request.ServerVariables("HTTP_Content_Length")) 'Get Content-Length header
    If "" & sizeLimit <> "" Then
    sizeLimit = CLng(sizeLimit) * 1024
    If Length > sizeLimit Then
      Request.BinaryRead (Length)
      Response.Write "Upload size " & FormatNumber(Length, 0) & "B exceeds limit of " & FormatNumber(sizeLimit, 0) & "B"
      Response.Write "Please correct and <A HREF=""java script:history.back(1)"">try again</a>"     
      Response.End
    End If
  End If
  boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg)
  boundaryPos = InstrB(1,RequestBin,boundary)
  'Get all data inside the boundaries
  Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--")))
    'Members variable of objects are put in a dictionary object
    Dim UploadControl
    Set UploadControl = CreateObject("Scripting.Dictionary")
    'Get an object name
    Pos = InstrB(BoundaryPos,RequestBin,getByteString("Content-Disposition"))
    Pos = InstrB(Pos,RequestBin,getByteString("name="))
    PosBeg = Pos+6
    PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34)))
    Name = LCase(getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)))
    PosFile = InstrB(BoundaryPos,RequestBin,getByteString("filename="))
    PosBound = InstrB(PosEnd,RequestBin,boundary)
    'Test if object is of file type
    If  PosFile<>0 AND (PosFile<PosBound) Then
      'Get Filename, content-type and content of file
      PosBeg = PosFile + 10
      PosEnd =  InstrB(PosBeg,RequestBin,getByteString(chr(34)))
      FileName = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
      FileName = RemoveInvalidChars(Mid(FileName,InStrRev(FileName,"\")+1))
      'Add filename to dictionary object
      UploadControl.Add "FileName", FileName
      Pos = InstrB(PosEnd,RequestBin,getByteString("Content-Type:"))
      PosBeg = Pos+14
      PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
      'Add content-type to dictionary object
      ContentType = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
      UploadControl.Add "ContentType",ContentType
      'Get content of object
      PosBeg = PosEnd+4
      PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
      Value = FileName
      ValueBeg = PosBeg-1
      ValueLen = PosEnd-Posbeg
    Else
      'Get content of object
      Pos = InstrB(Pos,RequestBin,getByteString(chr(13)))
      PosBeg = Pos+4
      PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
      Value = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
      ValueBeg = 0
      ValueEnd = 0
    End If
    'Add content to dictionary object
    UploadControl.Add "Value" , Value   
    UploadControl.Add "ValueBeg" , ValueBeg
    UploadControl.Add "ValueLen" , ValueLen   
    'Add dictionary object to main dictionary
    if UploadRequest.Exists(name) then
      UploadRequest(name).Item("Value") = UploadRequest(name).Item("Value") & "," & Value
    else
      UploadRequest.Add name, UploadControl
    end if   
    'Loop to next object
    BoundaryPos=InstrB(BoundaryPos+LenB(boundary),RequestBin,boundary)
  Loop

  Dim GP_keys, GP_i, GP_curKey, GP_value, GP_valueBeg, GP_valueLen, GP_curPath, GP_FullPath
  Dim GP_CurFileName, GP_FullFileName, fso, GP_BegFolder, GP_RelFolder, GP_FileExist, Begin_Name_Num
  Dim orgUploadDirectory
   
  if InStr(UploadDirectory,"""") > 0 then
    on error resume next
    orgUploadDirectory = UploadDirectory
    UploadDirectory = eval(UploadDirectory) 
    if err then
      Response.Write "<B>Upload folder is invalid</B><br><br>"     
      Response.Write "Upload Folder: " & Trim(orgUploadDirectory) & "<br>"
      Response.Write "Please correct and <A HREF=""java script:history.back(1)"">try again</a>"
          err.clear
        response.End
    end if   
    on error goto 0
  end if 
 
  GP_keys = UploadRequest.Keys
  for GP_i = 0 to UploadRequest.Count - 1
    GP_curKey = GP_keys(GP_i)
    'Save all uploaded files
    if UploadRequest.Item(GP_curKey).Item("FileName") <> "" then
      GP_value = UploadRequest.Item(GP_curKey).Item("Value")
      GP_valueBeg = UploadRequest.Item(GP_curKey).Item("ValueBeg")
      GP_valueLen = UploadRequest.Item(GP_curKey).Item("ValueLen")

      'Get the path
      if InStr(UploadDirectory,"\") > 0 then
        GP_curPath = UploadDirectory
        if Mid(GP_curPath,Len(GP_curPath),1)  <> "\" then
          GP_curPath = GP_curPath & "\"
        end if       
        GP_FullPath = GP_curPath
      else
        GP_curPath = Request.ServerVariables("PATH_INFO")
        GP_curPath = Trim(Mid(GP_curPath,1,InStrRev(GP_curPath,"/")) & UploadDirectory)
        if Mid(GP_curPath,Len(GP_curPath),1)  <> "/" then
          GP_curPath = GP_curPath & "/"
        end if
        GP_FullPath = Trim(Server.mappath(GP_curPath))
      end if

     
      if GP_valueLen = 0 then
        Response.Write "<B>An error has occured saving uploaded file!</B><br><br>"
        Response.Write "Filename: " & Trim(GP_curPath) & UploadRequest.Item(GP_curKey).Item("FileName") & "<br>"
        Response.Write "File does not exists or is empty.<br>"
        Response.Write "Please correct and <A HREF=""java script:history.back(1)"">try again</a>"
            response.End
        end if
     
      'Create a Stream instance
      Dim GP_strm1, GP_strm2
      Set GP_strm1 = Server.CreateObject("ADODB.Stream")
      Set GP_strm2 = Server.CreateObject("ADODB.Stream")
     
      'Open the stream
      GP_strm1.Open
      GP_strm1.Type = 1 'Binary
      GP_strm2.Open
      GP_strm2.Type = 1 'Binary
       
      GP_strm1.Write RequestBin
      GP_strm1.Position = GP_ValueBeg
      GP_strm1.CopyTo GP_strm2,GP_ValueLen
   
      'Create and Write to a File
      GP_CurFileName = UploadRequest.Item(GP_curKey).Item("FileName")     
      GP_FullFileName = GP_FullPath & "\" & GP_CurFileName
      Set fso = CreateObject("Scripting.FileSystemObject")
      'Check if the folder exist
      If NOT fso.FolderExists(GP_FullPath) Then
        GP_BegFolder = InStr(GP_FullPath,"\")
        while GP_begFolder > 0
          GP_RelFolder = Mid(GP_FullPath,1,GP_BegFolder-1)
          If NOT fso.FolderExists(GP_RelFolder) Then 
            fso.CreateFolder(GP_RelFolder)
          end if         
          GP_BegFolder = InStr(GP_BegFolder+1,GP_FullPath,"\")         
        wend
        If NOT fso.FolderExists(GP_FullPath) Then       
          fso.CreateFolder(GP_FullPath)       
        end if 
      end if
      'Check if the file already exist
      GP_FileExist = false
      If fso.FileExists(GP_FullFileName) Then
        GP_FileExist = true
      End If     
      if nameConflict = "error" and GP_FileExist then
        Response.Write "<B>File already exists!</B><br><br>"
        Response.Write "Please correct and <A HREF=""java script:history.back(1)"">try again</a>"
                GP_strm1.Close
                GP_strm2.Close
            response.End
      end if
      if ((nameConflict = "over" or nameConflict = "uniq") and GP_FileExist) or (NOT GP_FileExist) then
        if nameConflict = "uniq" and GP_FileExist then
          Begin_Name_Num = 0
          while GP_FileExist   
            Begin_Name_Num = Begin_Name_Num + 1
            GP_FullFileName = Trim(GP_FullPath)& "\" & fso.GetBaseName(GP_CurFileName) & "_" & Begin_Name_Num & "." & fso.GetExtensionName(GP_CurFileName)
            GP_FileExist = fso.FileExists(GP_FullFileName)
          wend 
          UploadRequest.Item(GP_curKey).Item("FileName") = fso.GetBaseName(GP_CurFileName) & "_" & Begin_Name_Num & "." & fso.GetExtensionName(GP_CurFileName)
                    UploadRequest.Item(GP_curKey).Item("Value") = UploadRequest.Item(GP_curKey).Item("FileName")
        end if
        on error resume next
        GP_strm2.SaveToFile GP_FullFileName,2
        if err then
          Response.Write "<B>An error has occured saving uploaded file!</B><br><br>"
          Response.Write "Filename: " & Trim(GP_curPath) & UploadRequest.Item(GP_curKey).Item("FileName") & "<br>"
          Response.Write "Maybe the destination directory does not exist, or you don't have write permission.<br>"
          Response.Write "Please correct and <A HREF=""java script:history.back(1)"">try again</a>"
              err.clear
                  GP_strm1.Close
                  GP_strm2.Close
              response.End
          end if
              GP_strm1.Close
              GP_strm2.Close
              if storeType = "path" then
                  UploadRequest.Item(GP_curKey).Item("Value") = GP_curPath & UploadRequest.Item(GP_curKey).Item("Value")
              end if
        on error goto 0
      end if
    end if
  next

End Sub

'String to byte string conversion
Function getByteString(StringStr)
  Dim i, char
  For i = 1 to Len(StringStr)
      char = Mid(StringStr,i,1)
      getByteString = getByteString & chrB(AscB(char))
  Next
End Function

'Byte string to string conversion (with double-byte support now)
Function getString(StringBin)
  Dim intCount,get1Byte
  getString =""
  For intCount = 1 to LenB(StringBin)
    get1Byte = MidB(StringBin,intCount,1)
    getString = getString & chr(AscB(get1Byte))
  Next
End Function

Function UploadFormRequest(name)
  Dim keyName
  keyName = LCase(name)
  if IsObject(UploadRequest) then
    if UploadRequest.Exists(keyName) then
      if UploadRequest.Item(keyName).Exists("Value") then
        UploadFormRequest = UploadRequest.Item(keyName).Item("Value")
      end if 
    end if 
  end if 
End Function

Function RemoveInvalidChars(str)
  Dim newStr, ci, curChar
  for ci = 1 to Len(str)
    curChar = Asc(LCase(Mid(str,ci,1)))
    if curChar = 95 or curChar = 45 or curChar = 46 or (curChar >= 97 and curChar <= 122) or (curChar >= 48 and curChar <= 57) then
      newStr = newStr & Mid(str,ci,1)
    end if
  next
  RemoveInvalidChars = newStr
End Function

Sub PureUploadSetup()
  UploadQueryString = Replace(Request.QueryString,"GP_upload=true","")
  if mid(UploadQueryString,1,1) = "&" then
      UploadQueryString = Mid(UploadQueryString,2)
  end if
  GP_uploadAction = CStr(Request.ServerVariables("URL")) & "?GP_upload=true"
  If (Request.QueryString <> "") Then 
    if UploadQueryString <> "" then
        GP_uploadAction = GP_uploadAction & "&" & UploadQueryString
    end if
  End If
End Sub

Function FixFieldsForUpload(GP_fieldsStr, GP_columnsStr)
  Dim GP_counter, GP_Fields, GP_Columns, GP_FieldName, GP_FieldValue, GP_CurFileName, GP_CurContentType

  GP_Fields = Split(GP_fieldsStr, "|")
  GP_Columns = Split(GP_columnsStr, "|")
  GP_fieldsStr = ""
  ' Get the form values
  For GP_counter = LBound(GP_Fields) To UBound(GP_Fields) Step 2
    GP_FieldName = LCase(GP_Fields(GP_counter))
    GP_FieldValue = GP_Fields(GP_counter+1)
      if UploadRequest.Exists(GP_FieldName) then
      GP_CurFileName = UploadRequest.Item(GP_FieldName).Item("FileName")
      GP_CurContentType = UploadRequest.Item(GP_FieldName).Item("ContentType")
      else 
        GP_CurFileName = ""
        GP_CurContentType = ""
      end if   
    if (GP_CurFileName = "" and GP_CurContentType = "") or (GP_CurFileName <> "" and GP_CurContentType <> "") then
      GP_fieldsStr = GP_fieldsStr & GP_FieldName & "|" & GP_FieldValue & "|"
    end if
  Next
  if GP_fieldsStr <> "" then
    GP_fieldsStr = Mid(GP_fieldsStr,1,Len(GP_fieldsStr)-1)
  else 
    Response.Write "<B>An error has occured during record update!</B><br><br>"
    Response.Write "There are no fields to update ...<br>"
    Response.Write "If the file upload field is the only field on your form, you should make it required.<br>"
    Response.Write "Please correct and <A HREF=""java script:history.back(1)"">try again</a>"
    Response.End
  end if
 
  FixFieldsForUpload = GP_fieldsStr   
End Function

Function FixColumnsForUpload(GP_fieldsStr, GP_columnsStr)
  Dim GP_counter, GP_Fields, GP_Columns, GP_FieldName, GP_ColumnName, GP_ColumnValue,GP_CurFileName, GP_CurContentType

  GP_Fields = Split(GP_fieldsStr, "|")
  GP_Columns = Split(GP_columnsStr, "|")
  GP_columnsStr = ""
  ' Get the form values
  For GP_counter = LBound(GP_Fields) To UBound(GP_Fields) Step 2
    GP_FieldName = LCase(GP_Fields(GP_counter)) 
    GP_ColumnName = GP_Columns(GP_counter) 
    GP_ColumnValue = GP_Columns(GP_counter+1)
      if UploadRequest.Exists(GP_FieldName) then
        GP_CurFileName = UploadRequest.Item(GP_FieldName).Item("FileName")
        GP_CurContentType = UploadRequest.Item(GP_FieldName).Item("ContentType")     
      else 
        GP_CurFileName = ""
        GP_CurContentType = ""
      end if 
    if (GP_CurFileName = "" and GP_CurContentType = "") or (GP_CurFileName <> "" and GP_CurContentType <> "") then
      GP_columnsStr = GP_columnsStr & GP_ColumnName & "|" & GP_ColumnValue & "|"
    end if
  Next
  if GP_columnsStr <> "" then
    GP_columnsStr = Mid(GP_columnsStr,1,Len(GP_columnsStr)-1)   
  end if
  FixColumnsForUpload = GP_columnsStr
End Function

</SCRIPT>
Avatar billede sbm Nybegynder
19. januar 2004 - 16:20 #32
l_otto >> Ok. Det er desværre bare lidt "intetsigende" at siden ikke vises. Giver det en HTTP-fejlkode? En ASP-fejl? Eller får du bare slet og ret en blank side efter at det hele i princippet er udført?
Avatar billede sbm Nybegynder
19. januar 2004 - 16:22 #33
Jeg er nødt til at løbe. Jeg er på igen engang efter aftensmad... :-)
Avatar billede mm12010 Nybegynder
19. januar 2004 - 16:23 #34
ellebaek >>
hehe - helt ok, nemt at overse i en sådan tråd ;-)
Avatar billede l_otto Nybegynder
19. januar 2004 - 16:23 #35
den kommer ikke med en fejl.... bare en :

Siden kan ikke vises
Der er problemer med den side, du prøver at åbne, og den kan ikke vises.

--------------------------------------------------------------------------------

Prøv følgende:

Åbn hjemmesiden www.trianglens.dk, og søg efter hyperlinks, der fører til de ønskede oplysninger.
Klik på knappen  Opdater, eller prøv igen senere.

Klik på  Søg for at søge efter oplysninger på Internettet.
Du kan også se en liste over relaterede websteder.




HTTP 500 - Intern serverfejl
Internet Explorer
Avatar billede l_otto Nybegynder
19. januar 2004 - 16:24 #36
jeg er på imorgen k.l 09.00
Avatar billede l_otto Nybegynder
19. januar 2004 - 16:27 #37
kan jeg ikke inserte uden bruge fra Request.Form ?

<%

if request.form("send") <> "" then
' ADODB connection objektet
Set Conn = Server.CreateObject("ADODB.Connection")
' Husk at angive den rigtige sti til din database
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database.mdb")
' Åben databaseforbindelsen
Conn.Open DSN

strSQL = "Insert into Kontor (Fornavn, telefondato, telefonsub, telefonfelt, telefontid, telefonopret, note) values('" & UploadFormRequest("Fornavn") & "','" & UploadFormRequest("telefondato") & "','" & UploadFormRequest("telefonsub") & "','" & UploadFormRequest("telefonfelt") & "','" & UploadFormRequest("telefontid") & "','" & UploadFormRequest("telefonopret") & "','" & UploadFormRequest("note") & "')"
conn.execute(strSQL)
Alert = "Din ide er nu oprettet "
end if


%>
Avatar billede ellebaek Nybegynder
19. januar 2004 - 16:31 #38
du kan benytte..
Request.ServerVariables("REQUEST_METHOD") = "POST" i stedet...

Så skal det se sådan her ud:

<%

if Request.ServerVariables("REQUEST_METHOD") = "POST" then
' ADODB connection objektet
Set Conn = Server.CreateObject("ADODB.Connection")
' Husk at angive den rigtige sti til din database
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database.mdb")
' Åben databaseforbindelsen
Conn.Open DSN

strSQL = "Insert into Kontor (Fornavn, telefondato, telefonsub, telefonfelt, telefontid, telefonopret, note) values('" & UploadFormRequest("Fornavn") & "','" & UploadFormRequest("telefondato") & "','" & UploadFormRequest("telefonsub") & "','" & UploadFormRequest("telefonfelt") & "','" & UploadFormRequest("telefontid") & "','" & UploadFormRequest("telefonopret") & "','" & UploadFormRequest("note") & "')"
conn.execute(strSQL)
Alert = "Din ide er nu oprettet "
end if


%>
Avatar billede l_otto Nybegynder
20. januar 2004 - 12:08 #39
den virkede heller ikke jeg har selv løst det.. :-)
Avatar billede l_otto Nybegynder
20. januar 2004 - 12:09 #40
men vil gerne give point til sbm.... venter på svar
Avatar billede sbm Nybegynder
20. januar 2004 - 12:34 #41
Jamen, så bukker jeg og siger tak-tak.

Hvad viste sig så at være problemet?
Avatar billede l_otto Nybegynder
20. januar 2004 - 12:37 #42
puha det er en lang forklaring med jeg valgte at inserte felterne uden Request.Form :)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester