XSS (Cross Site Scripting)

XSS (Cross Site Scripting) Cheat Sheet Esp: for filter evasion

ขอเก็บไว้ก่อน ถ้าว่างจะมาอ่านทำความเข้าใจ

http://ha.ckers.org/xss.html

Posted in เกี่ยวกับนักพัฒนาเว็บ | Tagged , | Leave a comment

query สำหรับดึง source code ใน oracle

เนื่องจากบทความที่แล้ว เป็น query สำหรับดู DEPENDENCY ของ object

สำหรับ query ที่ใช้สำหรับดึง code ในส่วนของ source code ที่เป็น view คือ

SELECT text
FROM all_views
WHERE view_name= ?

สำหรับ ที่เอาไว้ดึง function + procedure คือ

SELECT text
FROM all_source
WHERE name= ? and type = ?
order by line

TIP: เราสามารถเขียน program สำหรับดึงข้อมูลต่างๆ มาสร้างเป็น script ไว้สำหรับทำเป็น database deploy ได้ครับ กรณีที่มัน dependency กันลองต่อยอดดูนะครับ

Posted in Oracle | Tagged , , , | Leave a comment

วิธีดู DEPENDENCY ของ object ใน oracle

วิธีดู DEPENDENCY ของ object ใน oracle เช่น เอาไว้ดูว่า procedure นี้ dependency กับ procedure หรือ function ไหนบ้าง

SELECT lvl
     , u.object_id
     , u.object_type
     , LPAD (' ', lvl) || object_name obj
   FROM ( SELECT LEVEL lvl, object_id
            FROM SYS.public_dependency s
         START WITH s.object_id =
                      ( SELECT object_id
                          FROM user_objects
                         WHERE object_name = UPPER ('&OBJECT_NAME')
                           AND object_type = UPPER ('&OBJECT_TYPE'))
         CONNECT BY s.object_id = PRIOR referenced_object_id
         GROUP BY LEVEL, object_id) tree
      , user_objects u
  WHERE tree.object_id = u.object_id
ORDER BY lvl

ที่มา : http://stackoverflow.com/questions/297465/how-do-you-programatically-identify-a-stored-procedures-dependencies

Posted in Oracle | Tagged , | Leave a comment

ปัญหา select ทับเมนู หรือ calendar บน IE6

ปัญหา

สำหรับหลายๆคนที่ทำเว็บน่าจะเจอปัญหาเกี่ยวกับ tag select ของ html บน IE 6 ชอบทับ เมนู หรือ calendar ที่เป็น div ไม่ว่าจะ set z-index ให้มากๆ ก็ยังโดน select ทับอยู่ดี

ปล. ไม่ได้ลงรูปให้ดูนะครับ น่าจะทราบกันอยู่แล้ว (เมื่อไหร่จะเลิกใช้ IE6 กันสักทีก็ไม่รู้)

วิธีแก้ปัญหา

  • เขียน code ให้ hide และ show select เมื่อใช้งานเมนู หรือ calendar วิธีนี้อาจจะทำให้ user ที่ใช้ งงว่าทำไม dropdown หลายไป แต่เป็นวิธีที่ง่ายสุด
  • อีกวิธีคือสร้าง iframe ให้ขนาดความกว้าง+ความยาวเท่ากับเมนู หรือ calendar สำหรับคนที่ใช้ jquery อยู่แล้ว จะโชคดีมีคนเขียน plugin ที่ชื่อ BGIFRAME มาให้ใช้อยู่แล้ว

สำหรับคนที่ใช้ JSCal2 เป็น javascript calendar http://www.dynarch.com/projects/calendar/ แล้วเกิดปัญหากับ ie6 และใช้ prototype javascript

สามารถ download ตัวอย่างได้ที่นี่ครับ jscal2-fix-ie6

ปล. หวังว่าคงมีประโยชน์ไม่มากก็น้อย ผมกว่าจะแก้ได้ก็ใช้เวลานานเหมือนกัน

Posted in Javascript | Tagged , , , , , , | Leave a comment

php error เกี่ยวกับ strtotime

ปัญหาที่เจอ

A PHP Error was encountered
Severity: Warning
Message: strtotime() [function.strtotime]: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Bangkok’ for ‘ICT/7.0/no DST’ instead

A PHP Error was encountered
Severity: Warning
Message: strtotime() [function.strtotime]: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Bangkok’ for ‘ICT/7.0/no DST’ instead

วิธีแก้

if( ! ini_get(‘date.timezone’) )

{

date_default_timezone_set(‘Asia/Bangkok’);

}

Posted in PHP | Tagged , | Leave a comment

How to Redirect non-www to www for Codeigniter

RewriteEngine On                           

#This bit rewrites your host name to include www
RewriteCond %{HTTP_HOST} !^www\.doopromotion\.com [NC]
RewriteRule ^(.*)$ http://www.doopromotion.com/$1 [R=301,NC,L]

#This bit does the codeigniter magic
RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME} !-d  
RewriteRule ^(.*)$ /index.php/$1 [L]

สำหรับคนที่ develop บน codeigniter จะได้ไม่มี content duplicate ลองดูนะครับ
Posted in เกี่ยวกับนักพัฒนาเว็บ | Tagged , , , , , , | Leave a comment

วิธี ping sitemap เพื่อเรียก bot

เขียนแบบสั้นๆง่ายๆนะครับ

เปลี่ยน http://doopromotion.com/sitemap.xml เป็น domain และ sitemap ของเว็บของคุณ และนำไปวางใน browser + enter

  1. http://www.google.com/webmasters/sitemaps/ping?sitemap=http://doopromotion.com/sitemap.xml
  2. http://api.search.yahoo.com/SiteExplorerService/V1/updateNotification?appid=MicrosysProgramSER&url=http://doopromotion.com/sitemap.xml
  3. http://submissions.ask.com/ping?sitemap=http://doopromotion.com/sitemap.xml
  4. http://api.moreover.com/ping?u=http://doopromotion.com/sitemap.xml
  5. http://webmaster.live.com/ping.aspx?siteMap=http://doopromotion.com/sitemap.xml

DooPromotion » Cheap Deals, Best Deals, On Sale

Posted in เกี่ยวกับนักพัฒนาเว็บ | Tagged , , , , , , , | Leave a comment

PageRank DooPro.com

จะพยายามมาอัพเดทเรื่อยๆนะครับ ขอเริ่มนับใหม่ตั้งแต่ 2010

Posted in เกี่ยวกับเว็บดูโปร | Tagged , , , | Leave a comment

Computer & IT learning center (e-book)

Computer & IT learning center (e-book)
http://www.flazx.com/

สำหรับคน it
ไม่ต้องอธิบายไรมากครับ ลองเข้าดูรับรองคุณจะติดใจ

Posted in เกี่ยวกับนักพัฒนาเว็บ | Tagged , , | Leave a comment

commnd unix find and find+grep ไว้หาคำ

find . -exec grep “word” ‘{}’ \; -print

find . -name “word” -print

Posted in เกี่ยวกับนักพัฒนาเว็บ | Tagged , , | Leave a comment