Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: incomplete data

  1. #1
    Regular Coder
    Join Date
    Feb 2004
    Location
    Malaysia
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts

    incomplete data

    hi all,
    i have a text area which u knw..u can write lots of stuff there but when it's inserted into the db, i only have one word which is the first word....what happen to the long sentence(s) which i have typed in?

    cheers
    Warm Regards,
    Mivec

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    does it have anything to do with the fieldlength defined in the database??
    I am the luckiest man in the world

  • #3
    Regular Coder Freon22's Avatar
    Join Date
    May 2005
    Location
    USA
    Posts
    287
    Thanks
    3
    Thanked 5 Times in 5 Posts
    I think it would help if you posted some code .

  • #4
    Regular Coder
    Join Date
    Feb 2004
    Location
    Malaysia
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi guys...ok...will post the code here:

    this is the initial page where user types in their stuff(eventUpload.asp):

    Code:
    <form method="post" action="eventConfirm.asp"  name="evUpload">
    <table width="100%" border="0">
      <tr>
        <td align="center" class="white" valign="top" width="13%"><hr><br>
            <u><font color="#FFFF00">MENU</font></u> <br>
            <br>
            <a href="eventView.asp">View Event</a><br>
            <br>
            <a href="#">Upload Event</a><br>
            <br>Delete Events<br><br>Edit Events<br><br><hr></td>
        <td width="87%"><table width="92%" border="0" align="center" class="forumline" cellspacing="1" cellpadding="4">
        <tr>
                <td height="30" colspan="2" align="center" class="rowbg">Events Upload</td>
      </tr>
      <tr>
          <td width="30%" height="22" class="row1">Event Title :</td>
        <td width="60%" class="row2">
            <input type="text" name="txtEvName" size="80">
            <font color="#FF0000"><b>**</b></font> </td>
      </tr>
      <tr>
          <td width="30%" class="row1">Event Venue :</td>
       <td width="60%" class="row2"><input type="text" name="txtEvLocation" size="80">
            <font color="#FF0000"><strong>**</strong></font></td>
      </tr>
      <tr>
          <td width="30%" class="row1">Event Speaker :</td>
          <td width="60%" class="row2"><input type="text" name="txtEvHandler" size="40">
            <font color="#FF0000"><strong>**</strong></font></td>
      </tr>
      <tr>
          <td width="30%" class="row1">Event Date : </td>  
          <td width="60%" class="row2">
            <input type="text" name="txtEvDate" size="40">
            <strong><font color="#FF0000">**</font></strong></td>
      </tr>
      <tr>
          <td width="30%" class="row1">Event Sysnopsis :</td>
          <td width="60%" class="row2"><textarea name="txtaSysnopsis" cols="78" rows="4"></textarea></td>
      </tr>
      <tr>
          <td width="30%" class="row1">Event SignUp : </td>
          <td width="60%" class=row2 align=left><input type="text" name="txtSign" size="80"></td>
      </tr>
      <tr>
          <td width="30%" class="row1">Event Weblink : </td>
          <td width="60%" class=row2 align=left><input type="text" name="txtWeblink" size="80"></td>
      </tr>
      <!--<tr>
          <td width="30%" class="row1">Event Image : </td>
          <td width="60%" class=row2 align=left><input name="urlFile" type="file" size="50"> </td>
      </tr>-->
      <tr>
          <td width="30%" class="row1">Event Content Color : </td>
          <td width="60%" class="row2" align="left"><input id="pick1123677243field" size="9" onChange="relateColor('pick1123677243', this.value);" title="color" name="txtCol">
    	  <a href="javascript:pickColor('pick1123677243');" id="pick1123677243"
    style="border: 1px solid #000000; font-family:Verdana; font-size:10px;
    text-decoration: none;">&nbsp;&nbsp;&nbsp;</a>
    <script language="javascript">relateColor('pick1123677243', getObj('pick1123677243field').value);</script>
                  (Click the small box for border color)</td>
      </tr>  
    <!--<tr><td colspan="2">&nbsp;</td></tr> -->
    <tr><td colspan="2" align="center" class="row4">
    	    <input type="submit" name="btnSend" value="Send">&nbsp;
            <input type="reset" name="btnReset" value="Reset"> </td>
    </tr> 
    </table></td>
      </tr>
    </table>
      </form>
    this is the 2nd page where the values are stored in the hidden input tags(eventConfirm.asp):

    Code:
    <form method="post" action="eventDone.asp"  name="uploadOK">
    	    <input type="submit" name="btnSend" value="Send">
    		<input type="hidden" name="txtEvName" value=<%=request.form("txtEvName")%>>
            <input type="hidden" name="txtEvLocation" value=<%=request.form("txtEvLocation")%>>
            <input type="hidden" name="txtEvHandler" value=<%=request.form("txtEvHandler")%>>
            <input type="hidden" name="txtEvDate" value=<%=request.form("txtEvDate")%>>
            <input type="hidden" name="txtaSysnopsis" value=<%=request.form("txtaSysnopsis")%>>
    		<input type="hidden" name="txtSign" value=<%=request.form("txtSign")%>>
            <input type="hidden" name="txtWeblink" value=<%=request.form("txtWeblink")%>>
            <input type="hidden" name="txtCol" value=<%=request.form("txtCol")%>>
    </form>
    this is where the data's are inserted to the db(eventDone.asp)
    Code:
    <%@ LANGUAGE="VBSCRIPT" %>
    <% OPTION EXPLICIT 
       Response.expires = 0 %>
    <!-- #include file = "adovbs.inc" -->
    <!-- including the function definition file -->
    <!-- #include file = "FuncDef.asp" -->
    <!-- This file is to update the database after the confirmation -->
    
    <!-- This page confirms that the user's account has been created -->
    <!-- This coding inserts the user's details into the database -->
    
    <%
    Dim SQLTxt
    Dim ran
    Dim intRan
    
    Randomize()
    
    ran = 987654321 * Rnd()
    intRan = Int(ran)
    
    SQLTxt = "SELECT * from tEvents WHERE evTitle = '" & request.form("txtEvName") & "';"
    
    OpenMyDB dbfile, SQLTxt
    
    DBRecordset.addnew
    DBRecordset("evID") = intRan
    DBRecordset("evTitle") = request.form("txtEvName")
    DBRecordset("evVenue") = request.form("txtEvLocation")
    DBRecordset("evSpeaker") = request.form("txtEvHandler")
    DBRecordset("evDate") = request.form("txtEvDate")
    DBRecordset("evSynopsis") = request.form("txtaSysnopsis")
    DBRecordset("evSignUp") = request.form("txtSign")
    DBRecordset("evWebLink") = request.form("txtWeblink")
    DBRecordset("evBorderColor") = request.form("txtCol")
    DBRecordset.Update
    
    CloseMyDB
    %>
    the problem is this for everyone of them, whenever a space is encountered...the rest of the characters does not go in...only what is BEFORE the space..here is a snapshot of the record of the db.i'll attach it..so, whats the problem??going nuts here...

    i will attach the database snapshot here also.see attachment
    Attached Thumbnails Attached Thumbnails incomplete data-problem.jpg   incomplete data-dbfields.jpg  
    Last edited by mivec; 08-18-2005 at 10:49 AM.
    Warm Regards,
    Mivec

  • #5
    Regular Coder
    Join Date
    Feb 2004
    Location
    Malaysia
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts

    need urgent help....

    anyone?? i myself is also shocked by what went in...only just one word of a WHOLE sentence....that means it only inserts anything BEFORE meeting the space(which is only one word for this case).help.....anyone....pls....

    Warm Regards,
    Mivec

  • #6
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,065
    Thanks
    4
    Thanked 8 Times in 8 Posts
    i am betting that there was an apostrophe aka single quote used in the string. You need to use the replace function below to allow the full string to be inserted.

    replace lone apostrophe with two apostrophes
    Replace(yourString, "'", "''")

    or replace with ascii character code like below just remove the spaces
    in & # 39;
    Code:
    Replace(yourString, "'", "& # 39;")
    or you can add this function to prevent sql interjection attacks
    Code:
    Private Function preventInjection(ByRef theString)
        theString = Replace(theString, "'", "''") 'removes lone apostrophe's '
        theString = Replace(theString, ";", "")  'removes semicolon
        theString = Replace(theString, "--", "") 'removes double dash sql comment
        preventInjection = theString
    End Function
    Last edited by miranda; 08-19-2005 at 02:54 AM.

  • #7
    Regular Coder Freon22's Avatar
    Join Date
    May 2005
    Location
    USA
    Posts
    287
    Thanks
    3
    Thanked 5 Times in 5 Posts
    Have you tryed to do a Response.Write(request.form("txtaSysnopsis")) on page two to see if you have your full textarea at that point? I see that you are putting your textarea into a hidden form. I did some looking around and I don't see anything wrong with do that.

    Code:
    <input type="hidden" name="txtaSysnopsis" value=<%=request.form("txtaSysnopsis")%>>
    But I am slow I think miranda has hit it.

  • #8
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    Quote Originally Posted by Freon22
    I did some looking around and I don't see anything wrong with do that.

    Code:
    <input type="hidden" name="txtaSysnopsis" value=<%=request.form("txtaSysnopsis")%>>
    There is something wrong with it.
    Code:
    <input type="hidden" name="txtaSysnopsis" value="<%=Server.HTMLEncode(request.form("txtaSysnopsis"))%>">
    The value should be enclosed in quotes and must be HTML encoded.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •