Results 1 to 3 of 3

Thread: Form field: Covert char ' dan " sebelum transfer masuk lam SQL server

  1. #1
    Join Date
    Sep 2001
    Posts
    3
    Rep Power
    0

    Form field: Covert char ' dan " sebelum transfer masuk lam SQL server

    err...salamz..
    -Buat bro/sis yang tahu:
    Q: Aku ada satu form yang content bagi setiap fieldsnya akan disimpan lam SQL server (guna ASP). Cthnya, form feedback dari user. Tapi bila user isi form tu dengan char ' atau " page akan generate error(database error). Aku ada terfikir cara nok settlenya ialah dengan convert char tu kpd. variable/char lain sebelum simpan..tapi script aku x jadi..So..kekalau ada yang sudi share solution???


  2. #2
    Join Date
    Jul 2001
    Location
    KL, Malaysia
    Posts
    277
    Rep Power
    226
    Use replace to replace ' with '', and " with ""
    that is single-quote with 2 single-quotes, and double-quotes with 2 double-quotes.

    The syntax for replace in ASP is:
    replace(thestring, oldvalue, newvalue)

    So, you shoud do something like:
    replace(Request.form("feedback"), "'", "''")

    Hope this helps.

  3. #3
    Join Date
    Sep 2001
    Posts
    3
    Rep Power
    0

    Thanks

    Thanks bro...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Free - "One Step To eBay Riches"+"Money From Home" + Rights
    By tukshad in forum Other Webmaster-related Services and Promotion
    Replies: 0
    Last Post: 25-11-2005, 10:21 PM
  2. What job are there in IT field?
    By heeheelim in forum Job Vacancies
    Replies: 1
    Last Post: 20-09-2005, 02:51 AM
  3. "apple" or "mac" domain name
    By lcf in forum Domain Names
    Replies: 5
    Last Post: 06-09-2005, 10:18 PM
  4. Replies: 10
    Last Post: 12-06-2003, 09:16 AM
  5. Replies: 3
    Last Post: 24-05-2002, 06:42 PM

Posting Permissions

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

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112