Bigquery.com

Bigquery แนะนำ การเขียนเว็บไซต์ ด้วยการใช้ภาษา php html css webmaster tips & tools BigQuery.com พร้อมที่จะถ่ายทอดประสบการณ์ การทำเว็บไซต์แบบง่าย.. เพื่อเป็นพื้นฐานในการเขียนเว็บไซต์ และเพิ่มลูกเล่นให้กับเว็บไซต์ อีกทั้งเป็นทางเลือกในการสร้างเว็บไซต์ด้วยเครื่องมือต่างๆ

Sunday, September 28, 2008

Encode email เพื่อป้องกันโปรแกรมดูดอีเมลล์ ด้วย php

ปัจจุบันข้อมูลมีมูลค่ามหาศาล ผู้ที่มีข้อมูลมากกว่าย่อมเป็นต่อในการทำธุรกิจหรือ ทำการตลาด ดังนั้นจึงมีโปรแกรมต่าง ๆ ที่ไว้คอยดูดอีเมลล์จากเว็บไซต์ ตามเว็บบอร์ด หรือจากการโพสต่าง ๆ ในเว็บไซต์ เพื่อนำไปใช้ในเชิงธุรกิจ หรือแม้กระทั้งเอาอีเมลล์ของเราไปขาย ซึ่งจะกลายเป็น spam mail เข้ามาในเมลล์ของเราเป็นจำนวนมาก สร้างความรำคาญให้กับเจ้าของอีเมลล์ อีกหนึ่งวิธีการป้องกันคือ การเข้ารหัสอีเมลล์นั้นเสีย

เริ่มกันเลยดีกว่า ผมจะเขียนให้อยู่ในรูปแบบของฟังก์ชั่น php นะครับ เพื่อจะได้นำไปใช้ได้ง่าย ๆ
====================================
function mailEncode($mailText){
$email = '';
for($i=0; $i $email .= '&#'.ord(substr($mailText,$i,1));
}
return $email;
}

echo mailEncode("bigquery@gmail.com");
?>
====================================

เมื่อ view source ดูจะได้ bigquery@gmail.com

การ encode อีเมลล์อาจป้องกันได้ในระดับหนึ่งเท่านั้น

Saturday, September 27, 2008

SQL INSERT .. SELECT คำสั่งการ copy data จาก table สู่ table

คำสั่ง SQL อีกหนึ่งคำสั่งที่อาจจะไม่ได้ใช้กันบ่อยนัก แต่เชื่อได้ว่ามีประโยชน์แน่นอนคือคำสั่ง INSERT INTO ... SELECT เป็นคำสั่ง SQL ที่ใช้ในการแทรก หรือ INSERT ข้อมูล โดยการนำข้อมูลหรือ records จากอีกหนึ่งตารางมา INSERT ลงในอีกหนึ่งตาราง

รูปแบบของคำสั่งคือ
INSERT INTO "table1" ("column1", "column2")
SELECT "column3", "column4"
FROM "table2"

ตัวอย่างเช่น
หากต้องการ นำข้อมูลในตาราง Orders ที่เป็นการซื้อขายในปี 2007 มาเก็บไว้อีกหนึ่งตาราง สามารถสร้าง query ได้ดังนี้
INSERT INTO Orders2007(order_id, date_purchased, amount)
SELECT order_id, date_purchased, amount
FROM Orders
WHERE Year(date_purchased) = 2007;

เท่านี้ก็จะได้ข้อมูลการซื้อขายในปี 2007 มาไว้ในตาราง Orders2007
คำสั่ง SQL นี้เปรียบเสมือนการคัดลอก (Copy) บางระเบียนที่ต้องการมาไว้อีกตารางนั้นเอง

Monday, February 11, 2008

Flash content displays on top of all DHTML layers

Issue
A Flash movie in a layer on a DHTML page containing several layers may display above all the layers, regardless of the stacking order ("z-index") of those layers.

Reason
By default, browsers place embedded plug-in content, such as a Flash movie or Java applet, on the topmost layer. In older browsers, attempts to place a DHTML layer on top of a Flash layer would fail. Newer browsers add the ability to layer Flash content with DHTML content and in some cases the ability to use transparent backgrounds in the Flash content (see below).

Solution
Use the WMODE parameter to allow layering of Flash content with DHTML layers. The WMODE parameter can be 'window' (default), 'opaque', or 'transparent'. Using a WMODE value of 'opaque' or 'transparent' will prevent a Flash movie from playing in the topmost layer and allow you to adjust the layering of the movie within other layers of the HTML document.
For details on creating a Flash movie with a transparent background and more information on using the WMODE parameter refer to How to make a Flash movie with a transparent background (TechNote 14201).

Note: The WMODE parameter is supported only on some browser/Flash Player version combinations. If the WMODE parameter is not supported, the Flash movie will always display on top. Refer to TechNote 14201 for details.

Tuesday, January 22, 2008

RegularExpressionValidator decimal

User Control RegularExpressionValidator with number and decimal regex
Try this regex -
\d{1,}\.?\d{0,}

put to e.g. ValidationExpression="\d{1,}\.?\d{0,}"
==========================================

<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtWeight"

ErrorMessage="Format(X.XX)" ValidationExpression="\d{1,}\.?\d{0,}"></asp:RegularExpressionValidator>

==========================================

Monday, January 21, 2008

Error in my_thread_global_end(): 1 threads didn't exit

Copy libmysql.dll for http://www.php.net/releases/ select Version 5.2.1 ...Select Windows binary Download and Extract copy libmysql.dll to PHP folder

PHP Warning: PHP Startup: Unable to load dynamic library 'C:\PHP\ext\php_mysqli.dll' - Access is denied

Hi. I've spent the last 6 hours researching this on the Internet and can't find a solution so I'm hoping someone might be able to help.

Anytime I use new mysqli() or mysqli_connect() I receive this error on my browser:

---------------
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\PHP\ext\php_mysql.dll' - Access is denied. in Unknown on line 0 PHP Warning: PHP Startup:
Unable to load dynamic library 'C:\PHP\ext\php_mysqli.dll' - Access is denied. in Unknown on line 0
---------------

I have PHP 5.1.4 installed on WIN along with MySQL 5.0.22 running on IIS 5.1 (XP Pro). I have correctly updated the php.ini file with these modifications:

extension_dir = C:\PHP\ext
extension=php_mysql.dll (without semi-colon)
extension=php_mysqli.dll (without semi-colon)

I have placed the updated libmysql.dll file that I have downloaded from http://dev.mysql.com/downloads/connector/php/ in the C:\PHP, C:\WINDOWS and C:\WINDOWS\system 32, have restarted everytime and still cannot correct this error.

Does anyone have more information to assist me? If you need any more information from me to help diagnose, I will be glad to provide.

source: http://forums.mysql.com/read.php?11,102233,102233

Rotate text with CSS


if you wish to rotate text, and if your 'text' is not Chinese/Japanese/Korean ideograph character, then you can simply use a CSS style, e.g. (below example I didn't test because I use Linux)
code:


This text should be rotated vertically


details:http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/writingmode.asp

This is an IE feature, mozilla/opera does not support it (and does not plan to). That's why my above example is not tested. This happens to be the *only* feature that I prefer IE over firefox/mozilla.

source : http://www.ozoneasylum.com/11093