can't deal wit it

Last post 01-13-2005, 7:06 AM by zbres. 6 replies.
Sort Posts: Previous Next
  •  01-12-2005, 3:30 PM 3443

    can't deal wit it

    Hi.
    It has been 3 days that i read the forum & try anything, but still:
    1- Can't see an existing values from my DB
    2- Can't insert anything.

    I install the cute editor in a sub folder from my root:   (root > zbres > cuteEditor ) .
    I build an upload dir in my root.

    My editor file(edit_article) is locate in:
    root > zbres > admin > edit_article.asp

    here is my code, what's wrong?

    <!-- #include virtual = "zbres/CuteEditor/include_CuteEditor.asp" -->
    <%
    Response.Buffer = True
     If Request.Cookies("admin") <> "Ok" Then
      Response.Redirect "entry.html"
     End If
     
     Set con = Server.CreateObject("ADODB.connection")
     con.Open "Provider=Microsoft.Jet.OleDB.4.0; data source=" & Server.MapPath("../mainDB/admin.mdb")
     Set rs = Server.CreateObject("ADODB.recordset")
     sSQL = "select * from articles where article_id=" & cInt(Request.QueryString("id")) & ";"
     rs.Open sSQL,con,3,3
    %>
    <HTML>
    <HEAD>
    <title>UPDATE</title>
    <meta http-equiv="content-type" content="text/html;charset=windows-1255">
    <meta name="author" content="ZZZ">
    </HEAD>

    <form action="" method="post" id="form1" name="form1" onsubmit="return formCheck()">
     <tr>
      <td align="right">
       <input type="text" id="aTitle" name="aTitle" size=77 dir="rtl" value="<%=rs("title")%>" tabindex=1>
      </td>
      <td dir="rtl"><b>TITLE</b></td>
     </tr>
     <tr>
      <td align=right>
    <%
       Dim editor
       Set editor = New CuteEditor  'Create a new editor class
     
        article = Request.Form("Editor1_HTMLContent") &"<FONT size=2 color=#2f4f4f>   Type here...   </FONT>"
       editor.ID = "Editor1" 'Set the ID of this editor class
       editor.Text = article 'Set the initial HTML value of editor control
       editor.FilesPath = "../CuteEditor/CuteEditor_Files"
       editor.ImageGalleryPath = "/Uploads"
       editor.MaxImageSize = 50
       editor.AutoConfigure = "enableall"
       editor.DisableItemList = "Save"
       editor.ShowLogo = false
       editor.Width = 440
       editor.Height = 200                                                                                                     
       
       editor.Draw()
     %>       
      </td>
      <td dir="rtl" valign="top"><b>CONTENT</b></td>
     </tr>
     <tr>
      <td colspan=2 align="center">
       <input type="submit" value="?????" id="editArticle" name="editArticle" tabindex=10 style="font-weight:bold;cursor:hand"  onfocus="save(Editor1)">
      </td>
     </tr>
    </form>
    <%
     If Request("editArticle") <> "" Then
        rs("title") = setData(Request("aTitle")) 
       rs("article") =   Request.Form("Editor1_HTMLContent") 
       rs.Update
      rs.Close
      Response.Redirect "edit_article.asp?id=" & Request.QueryString("id") & "
     End If
    %>
    </BODY>
    </HTML>


    thank you.
    Zbres
  •  01-12-2005, 7:28 PM 3461 in reply to 3443

    Re: can't deal wit it

    i have checked your code, running on our server.
    with the editor filespath like that it doesn't work
     editor.FilesPath = "../CuteEditor/CuteEditor_Files"

    but like this it 's ok
     editor.FilesPath = "CuteEditor/CuteEditor_Files"


  •  01-13-2005, 4:36 AM 3463 in reply to 3443

    Re: can't deal wit it

    Hi.

    I have changed the :             editor.FilesPath = "CuteEditor/CuteEditor_Files"
    and
    the replay is:                        Failed to load the language text from the XML file.
     
    (
    i don't understand: 
        my edit_article.asp file is in the directory:     root/zbres/admin/edit_article.asp
        the editor is in:    root/zbres/CuteEditor/CuteEditor_Files
        so
        from my edit file to the CuteEditor_Files i have to mark:    ../CuteEditor/CuteEditor_Files
    )

    What is still wrong?
     
    zbres
  •  01-13-2005, 4:58 AM 3464 in reply to 3443

    Re: can't deal wit it

    so,
    now replace the code
       editor.FilesPath = "CuteEditor/CuteEditor_Files"

    by
       editor.FilesPath = "/CuteEditor/CuteEditor_Files"  (with a Slash at the beginning)
    (works on my server)
    the relative and absolute path doesn't exactly work like asp with the ../  , i mage a lot of tests , and i had to read the code , i spend a lot of time on this and  now if i can help ...

  •  01-13-2005, 6:02 AM 3467 in reply to 3443

    Re: can't deal wit it

    surprisly.

    i change like this:

     
     article = rs("article")

       editor.ID = "Editor1" 'Set the ID of this editor class
       editor.Text = article 'Set the initial HTML value of editor control
       editor.FilesPath = "../CuteEditor/CuteEditor_Files"
       editor.ImageGalleryPath = "/Uploads"
    and its done. !
    i can update an existing article. 
     
    But
    i still have a problem with inserting a new article
    thats my code:

    <%
       Dim editor
       Set editor = New CuteEditor  'Create a new editor class
       editor.ID = "Editor1" 'Set the ID of this editor class
       editor.Text = article 'Set the initial HTML value of editor control
       editor.FilesPath = "../CuteEditor/CuteEditor_Files"
       editor.ImageGalleryPath = "/Uploads"
       editor.MaxImageSize = 50
       editor.AutoConfigure = "enableall"
       editor.DisableItemList = "Save"
       editor.Width = 440
       editor.Height = 200                                                                                                     
       editor.Draw()
    %>       


    <%
    dim articleA
    article=Request.Form("Editor1_HTMLContent")
     
     If Request("addArticle") <> "" Then
      Set con = Server.CreateObject("ADODB.connection")
      con.Open "Provider=Microsoft.Jet.OleDB.4.0; data source=" & Server.MapPath("../mainDB/admin.mdb")
      Set rs = Server.CreateObject("ADODB.recordset")
      rs.Open "articles",con,3,3
      rs.AddNew
       rs("title") = setData(Request("aTitle"))
       rs("article") = article
      rs.Update
      rs.Close
     End If
    %>
    </BODY>
    </HTML>
  •  01-13-2005, 6:53 AM 3469 in reply to 3443

    Re: can't deal wit it

    <%
    dim articleA
    article=Request.Form("Editor1_HTMLContent")
     
     If Request("addArticle") <> "" Then
      Set con = Server.CreateObject("ADODB.connection")
      con.Open "Provider=Microsoft.Jet.OleDB.4.0; data source=" & Server.MapPath("../mainDB/admin.mdb")
      Set rs = Server.CreateObject("ADODB.recordset")
      rs.Open "articles",con,3,3
      rs.AddNew
       rs("title") = setData(Request("aTitle"))
       rs("article") = article
      rs.Update
      rs.Close
     End If
    %>
    </BODY>
    </HTML>
  •  01-13-2005, 7:06 AM 3470 in reply to 3443

    Re: can't deal with it

    still, after correction, -  dosn't work   !?
    === Edited by zbres @ 13 Jan 2005 10:12 AM [GMT -5] ===
    Everything is fine now.
    my problem was a lack of:  onfocus="save(Editor1)"
    in the insert butten of the add article page
    thats a tip for all.
    10x
     
View as RSS news feed in XML