August 24, 2006

[php] Good things to know about global variable in PHP

Filed under: Programming — HanaDaddy @ 11:32 pm

From 4.1.0 (or 4.2.0)

Default register_globals in php.ini is off
This disables automatic forms input name to PHP vars function
(Eg.<input name=simpletext > => in php the input value is available as $simpletext with register_globals on )
Therefore, you need to access below Globals to access them

Also, short_open_tags is off
This disables <? ?> php tag. so you need to use <?php ?>.
(more…)

August 23, 2006

[named] allowing query for only local domains

Filed under: Unix Admin — HanaDaddy @ 10:43 pm

Rule:
1. Block all query
2. Allow query for each local zone
(more…)

[javascript] IE6 & doctype & scrollTop property

Filed under: Programming — HanaDaddy @ 10:41 pm

I just realized that the old javascript that I copied & implemented on this forum does not properly work.

I am talking about the the preview popup window.

The popup window should always appear on the top of the link,but I found that it is shown in a totally different place when the webpage is scrolled down.

So I spent some time on the web and found below resource.

http://www.quirksmode.org/js/doctypes.html

According to him, there are difference accessing javascript body element properties such as clientHeight ,clientWidth , scrollLeft ,scrollTop and etc between IE5 & IE6 with DOCTYPE defined.

The popup window javascript code heavily uses document.body.scrollTop.
In IE5, document.body.scrollTop works fine, but when you use IE6 & DOCTYPE togather, you need to use docuement.documentElement.scrollTop property.

Also, some comparison demo pages
doctype onand doctype off

So I have changed the javascript little bit.

First I defined the IE6&DOCTYPE indicator doctype variable.

//we need to check if IE6 & doctype is on ( is used or not)
//doctype=1 (IE6 & doctype) or regular IE6 IE5
var doctype=0;
if(document.documentElement && document.documentElement.clientHeight )
{ doctype=1; }
else
{ doctype=0; }

Then I use it to get the correct Top & Left position of the popup window.

if (doctype==1)
{ ty=document.documentElement.scrollTop; tx=document.documentElement.scrollLeft;}
else if (doctype==0)
{ ty=document.body.scrollTop; tx=document.body.scrollLeft;}
x=event.x + tx+10;
y=event.y + ty;

And it works perfectly!

By the way, in IE6 & DOCTYPE OFF environment, you need to use document.body.scrollTop property.

[Javascript] Ajax Javascript Library

Filed under: Links to note — HanaDaddy @ 10:35 pm

Ease your headache with these Javascript library.

Aren’t they cool or what!

Prototype HomePage
Here is the well explained how-to-use guide
http://24ways.org/advent/easy-ajax-with-prototype

moo.fx : AJAX library
Some nice effect can be implemented without hassle.

http://script.aculo.us/

http://wiki.script.aculo.us/scriptaculous/show/CombinationEffectsDemo

[Java] Java Compiling & Execution in Shell

Filed under: Programming — HanaDaddy @ 10:33 pm

I just created this DB transfering class from Oracle to Mysql and tried to run it under linux, but had hard time to compile & run it.

But I successfully did it. And the code works fine too.


javac -classpath /var/www/java_libs/mysql-connector-java-3.1.7-bin.jar:/var/www/java_libs/v9_ojdbc14.jar:/var/www/import importdb/Import.java

java -classpath /var/www/java_libs/mysql-connector-java-3.1.7-bin.jar:/var/www/java_libs/v9_ojdbc14.jar:/var/www/import importdb/Import

The main class is Import and it is a part of package ImportDB.

/var/www/java_libs/mysql-connector-java-3.1.7-bin.jar : MySQL lib downloaded from MySQL website

/var/www/java_libs/v9_ojdbc14.jar : Oracle Lib downloaded from Oracle website

Note that the /var/www/import in the classpath. This is where importdb folder is located. It is necessary. Without it, you will get Exception in thread “main” java.lang.NoClassDefFoundError: importdb/Import.

Page 18 of 21« First...«1617181920»...Last »
 

42 queries. 0.396 seconds. Powered by WordPress