Trang

Hiển thị các bài đăng có nhãn HTML. Hiển thị tất cả bài đăng
Hiển thị các bài đăng có nhãn HTML. Hiển thị tất cả bài đăng

[eBook] HTML and PHP Tutorials

HTML Web Programming and Designing

HTML (Hyper Text Markup Language) is the web Programming language the most most most useful and useable Web Programming language, Programmer, hacker, developer everyone need to learn HTML. HTML is the Source and Base of all Web Programming languages, If you don't know HTML then you can't learn any Web Programming lang. 

 

PHP + SQL + SQLi Programming

As you know that SQL is a Programming lang. of Database (Structured Query Language) without SQL, we can't login to any website and access our files. SQL is the most useable Pogramming lang. SQL is only use for Database Structuring storing info data. Now PHP (Hypertext Pre-processor or Personal Home Page) PHP is widely used in web applications to connect with Server, Web Applications and SQL DB. PHP is really very useful in Web Programming world, without PHP there could be nothing. Every Hackers need to learn PHP,SQL and SQLI (SQL Injection).

Xem Thêm

 

Các lỗi thường gặp khi viết mã HTML và CSS



Dưới đây là các lỗi thường gặp khi viết mã HTML & CSS mà bạn cần chú ý để có thể validate HTML và CSS

HTML - Sai DOCTYPE
DOCTYPE sẽ nói cho trình duyệt loại mã HTML mà trang web sử dụng, ở HTML 4.01 có 3 loại DOCTYPE chính:

  • HTML 4.01 Strict
  • HTML 4.01 Transitional
  • HTML 4.01 Frameset

Bạn có thể tìm hiểu thêm về DOCTYPE trên w3schools

HTML - Sử dụng id giống nhau
Trên một trang web, class có thể dùng nhiều lần nhưng bạn chỉ được dùng id cho 1 element riêng. Điều này đặc biệt quan trọng khi áp dụng javascript, ajax.

Sử dụng sai:

Code:
<div id="idabc">Information</div> <div id="idabc">Other information</div>
Sử dụng đúng:

Code:
<div id="infomation">Information</div> <div id="otherinfo">Other information</div>
HTML - Đóng thẻ không đúng thứ tự
Việc đóng thẻ đúng thứ tự là rất quan trọng, ví dụ thẻ div chỉ được đóng sau khi tất cả các thẻ trong nó đóng

Sử dụng sai:
Code:
<div><strong>Information</div></strong>
Sử dụng đúng:
Code:
<div><strong>Information</strong></div>

HTML - Viết hoa các tags
Bạn sẽ không validate được mã HTML của mình nếu viết như sau
Code:
<DIV></DIV>

HTML - Sử dụng style ngay trên thẻ (inline style)
Sử dụng style ngay trong thẻ HTML bao giờ cũng nhanh hơn việc đưa chúng vào file CSS riêng, nhưng việc đó làm cho bạn rất vất vả khi thay đổi các thẻ giống nhau và khó gỡ lỗi
Code:
<a href="link.html" style="color: #000; text-decoration: none;">link name</a>
HTML - Sử dụng các kí tự đặc biệt
Hãy chắc chắn rằng bạn sử dụng ký tự đặc biệt đúng cách trong mã HTML vì không phải lúc nào trình duyệt cũng có thể hiểu và xử lý chúng

Sử dụng sai:
Code:
<p> ©, & Stuff</p>
Sử dụng đúng:
Code:
<p>&copy;, &amp; Stuff</p>

HTML - Sử dụng header là ảnh
Khi trong thiết kế có những font không có trong hệ thống, thì bạn cũng không nên dùng như sau:
Code:
<img src="Header.jpg"  alt="Header title" />
Cách sử dụng đúng phải là kết hợp với CSS:
Code:
<h1 class="header">Header Title</h1>
Và style cho header:

Code:
h1.Header{     /*     Mã CSS để ẩn text và hiện background     */ }
HTML - Không có thuộc tính alt
Tại sao phải thêm alt vào trong thẻ img khi không hề có khác biệt? Alt sẽ giúp người đọc xem được thông tin về ảnh khi họ không tải được ảnh đó, nó còn giúp các bộ máy tìm kiếm hiểu bức ảnh hơn (SEO)

Sử dụng sai:
Code:
<img src="image.jpg"  />
Sử dụng đúng:

Code:
<img src="image.jpg"  alt="image alt tag" />
CSS - Không sử dụng cách viết tắt
Code:
border-top:1px solid #00f;  border-right:1px solid #00f;  border-bottom:1px solid #00f;  border-left:1px solid #00f;
Khi cả 4 border như nhau, tại sao bạn không dùng:
Code:
border:1px solid #00f;
CSS - Sử dụng đơn vị cho giá trị bằng 0
Bạn không cần phải điền đơn vị cho các giá trị bằng 0 vì 0px, 0pt, 0em đều bằng nhau.

Code:
/* Thay vì */ padding:0px 0px 5px 0px; /* Bạn nên dùng */ padding:0 0 5px 0;
CSS - Sử dụng mã màu
Bạn có thể khai báo dùng màu 'white', 'black', 'red'... nhưng tốt nhất hãy cho trình duyệt biết chính xác màu hiển thị bằng cách sử dụng mã màu. Và với các mã màu lặp lại như #ffffff, #000000 bạn cũng có thể viết tắt thành #fff hoặc #000
Code:
color: #000; color: #e6a; /* Tương đương với màu #ee66aa */
CSS - Sử dụng sai Position
Khi bạn mới bắt đầu học CSS thì position khá khó hiểu. Bạn có thể sử dụng: static, relative, absolute và fixed. Giá trị mặc định của position là static. Bạn có thể xem cách sử dụng chi tiết tại w3school


Tham khảo ntuts

Xem Thêm

 

vBulletin 2.0/2.2.x Cross Site Scripting Vulnerabilities

Source: http://www.securityfocus.com/bid/5997/info

vBulletin does not filter HTML tags from URI parameters, making it prone to cross-site scripting attacks.
As a result, it is possible for a remote attacker to create a malicious link containing script code which will be executed in the browser of a legitimate user, in the context of the website running vBulletin.
This issue may be exploited to steal cookie-based authentication credentials from legitimate users of the website running the vulnerable software.
http://<victim>/usercp.php?s=[Session ID]"><Script>alert(document.cookie);</Script>

Nguồn: http://www.exploit-db.com/exploits/21946/


Xem Thêm

 

vBulletin 2.2.7/2.2.8 HTML Injection Vulnerability

Source: http://www.securityfocus.com/bid/6337/info

Problems with vBulletin could make it possible for an attacker to inject arbitrary HTML in vBulletin forum messages.
vBulletin does not sufficiently filter potentially malicious HTML code from posted messages. As a result, when a user chooses to view a message posting that contains malicious HTML code, the code contained in the message would be executed in the browser of the vulnerable user. This will occur in the context of the site hosting the vBulletin forum software.
Attackers may potentially exploit this issue to manipulate web content or to steal cookie-based authentication credentials. It may be possible to take arbitrary actions as the victim user.
This should only be considered an issue if HTML has been enabled in messages. This option is not enabled by default and the vendor recommends that users do not enable it. If the option has been enabled, HTML will not be filtered at all.
*** This vulnerability has been further investigated. It has been reported by the vendor that this functionality is by disabled by default. Additionally, the risks of enabling this feature are documented in the user manual. Therefore, this is not a valid vulnerability, and will be removed from the SecurityFocus Vulnerability Database.
<b onMouseOver="alert(document.location);">Test!</b>

Nguồn: http://www.exploit-db.com/exploits/22077/


Xem Thêm

 

Copyright © Dương-UG Blog's - Nguyễn Bình Dương