| Subcribe via RSS

ie bug: form within a form not posting values

August 19th, 2008 | No Comments | Posted in dom, html, javascript by dreamluverz

You might be wondering why you cannot post the values of some fields even it’s inside the form.

Having a form within a form in your html code/dom is a BIG issue when it comes to ie.

Some of the issues you will encouter are listed below:

1. You won’t be able to post the values of those fields and it’s not even on the $_POST coz basically those fields within nested form is not recognize.
2. When calling javascript those fields are undefined.

I read from another source that it has something to do with the DOM in ie. So in order to solve this issue fix your form. Remove the nested form in your html code. :)



Tags: , , ,

ssh command for viewing file ownership

August 19th, 2008 | No Comments | Posted in ssh by dreamluverz

Type

ls -l or ll to see ownership of folders/files

You can also checkout this site for other ssh command http://www.webhostgear.com/35.html



Tags: ,

b2evo fatal error: Allowed memory size

June 9th, 2008 | No Comments | Posted in b2evo, php by dreamluverz

In case you encounter this error upon installing b2evo you can check the solution below.

Error: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 35 bytes) in /var/www/…/_misc/_plugins.class.php on line 2399

Solution: In most cases you have your php.iniĀ  inside the installed folder of b2evo, increase the allowed memory size and it will fix the error.

Tags: ,

javascript reference

May 28th, 2008 | No Comments | Posted in anything under the moonlight, javascript by dreamluverz

Here’s a good site for javascript reference:

http://users.dickinson.edu/~braught/courses/cs131s99/jsRef.html

Tags:

prototype window

May 28th, 2008 | Comments Off | Posted in anything under the moonlight, javascript by dreamluverz

I discovered this thing from a friend and it’s a cool stuff. Haven’t tried it though but really excited to give it a shot.

Overview

This javascript class allows you to add window in a HTML page.

This class is based on Prototype. The code is inspired by the powerful script.aculo.us library. You can even use all script.aculo.us effects to show and hide windows if you include effects.js file , but it’s not mandatory.

It has been tested on Safari, Camino, Firefox and IE6, Opera looks fine.

Features

  • Valid HTML/XHTML generated code
  • Resizable windows
  • Minimize/Maximize
  • Modal dialogs
  • Visual effects
  • Skinnable
  • And more…

How to Use

It's easy to use, just include two javascripts and one css (more if you want different skins).


<script type="text/javascript" src="/javascripts/prototype.js"> </script>

<script type="text/javascript" src="/javascripts/window.js"> </script>
<link href="/stylesheets/themes/default.css" rel="stylesheet" type="text/css"/>
<!--  Add this to have a specific theme-->

<link href="themes/mac_os_x.css" rel="stylesheet" type="text/css"/>

To create a window, you just have to instanciate a Window object with some optional parameters, set innerHTML of the window main content and call show() or showCenter() function. Check out the samples tab with more sample codes

win = new Window({className: “mac_os_x”, title: “Sample”, width:200, height:150, destroyOnClose: true, recenterAuto:false});
win.getContent().update("Hello world !!”);
win.showCenter();


source: http://prototype-window.xilinus.com/index.html

Tags: , ,

why utf8 is important

May 28th, 2008 | 1 Comment | Posted in anything under the moonlight, developer's tools by dreamluverz

Advantages

Here are several advantages of UTF-8:

  • UTF-8 can be read and written quickly just with bit-mask and bit-shift operations.
  • Comparing two char strings in C/C++ with strcmp() gives the same result as wcscmp(), so that legicographic sorting and tree-search order are preserved.
  • Bytes FF and FE never appear in an UTF-8 output, so they can be used to indicate an UTF-16 or UTF-32 text (see BOM).
  • UTF-8 is byte order independent. The bytes order is the same on all systems, so that it doesn’t actually require a BOM.

Disadvantages

UTF-8 has several disadvantages:

  • You cannot determine the number of bytes of the UTF-8 text from the number of UNICODE characters because UTF-8 uses a variable length encoding.
  • It needs 2 bytes for those non-Latin characters that are encoded in just 1 byte with extended ASCII char sets.
  • ISO Latin-1, a subset of UNICODE, is not a subset of UTF-8.
  • The 8-bit chars of UTF-8 are stripped by many mail gateways because Internet messages were originally designed as 7-bit ASCII. The problem led to the creation of UTF-7.
  • UTF-8 uses the values 100xxxxx in more than 50% of its representation, but existing implementation of ISO 2022, 4873, 6429, and 8859 systems mistake these as C1 control codes. The problem led to the creation of UTF-7,5.

source:http://www.codeguru.com/cpp/misc/misc/multi-lingualsupport/article.php/c10451/

Why is it Important?

UTF-8 is an important encoding because of the following reasons:

  • ASCII compatible
  • easily supported
  • compact and efficient for most scripts
  • easily processed, unlike other multibyte encodings

source: http://developers.sun.com/dev/gadc/technicalpublications/articles/utf8.html

Tags: , ,

What is utf8

May 27th, 2008 | No Comments | Posted in anything under the moonlight, mysql, php by dreamluverz

What Is UTF-8 And Why Is It Important?

Unicode is a character set supported across many commonly used software applications and operating systems. For example, many popular web browser, e-mail, and word processing applications support Unicode. Operating systems that support Unicode include Solaris Operating Environment, Linux, Microsoft Windows 2000, and Apple’s Mac OS X. Applications that support Unicode are often capable of displaying multiple languages and scripts within the same document. In a multilingual office or business setting, Unicode’s importance as a universal character set cannot be overlooked.

source: http://developers.sun.com/dev/gadc/technicalpublications/articles/utf8.html

Tags:

INSERT SELECT

May 27th, 2008 | No Comments | Posted in mysql by dreamluverz

I was trying to duplicate a record and the best solution I can find is to do it like this.

INSERT INTO table SELECT * FROM table WHERE {CONDITION}

But this is not a good idea if you have auto increment for your primary key so you can do it like this instead

INSERT INTO table (field1, field2, field3) SELECT field1, field2, field3 FROM table WHERE {CONDITION}

Take a closer look of the statement. At first I was trying to do it like the one shown below and I got an error column count doesn’t match. As you notice I specify the fields on SELECT and not on INSERT INTO.

INSERT INTO table SELECT field1, field2, field3 FROM table

Tags: , ,

CONCAT_WS

May 27th, 2008 | No Comments | Posted in anything under the moonlight, mysql by dreamluverz

CONCAT_WS(separator,str1,str2,…)

CONCAT_WS() stands for Concatenate With Separator and is a special form of CONCAT(). The first argument is the separator for the rest of the arguments. The separator is added between the strings to be concatenated. The separator can be a string, as can the rest of the arguments. If the separator is NULL, the result is NULL.

mysql> SELECT CONCAT_WS(',','First name','Second name','Last Name');
-> 'First name,Second name,Last Name'
mysql> SELECT CONCAT_WS(',','First name',NULL,'Last Name');
-> 'First name,Last Name'

CONCAT_WS() does not skip empty strings. However, it does skip any NULL values after the separator argument.

source: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat-ws

Tags: ,

www redirect

May 22nd, 2008 | No Comments | Posted in htaccess by dreamluverz

If you want to redirect your domain from http://domain.com to www.domain.com you must put this rule at the very top and before all other rules you have on your htaccess file.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain\.com
RewriteRule ^(.*) http://www.mydomain.com/$1 [L,R=301]

Tags: ,