Bali Web Design Bali Web Developer SEO in Bali

Google

August 1, 2008

Yellow background on HTML text field Form

Filed under: html — Tags: , — admin @ 10:05 am

Have you ever found a confusing condition on your browser IE or Firefox that when you open an HTML Form page some text field has yellow background even you dont have this color on your css or html.

This situation also make me confuse because my client said that he saw yellow background on a computer but on another computer he doesn’t see yellow background. He want to know the answer why.

I was already thinking about this confusing thing before, but i didn’t try to find more detail about this problem. But i know this is something to do with the plugin on browser. Something like auto complete form.

So i go to forum and found the reason. According to the forum, it is because we use google toolbar for auto complete capability when we input data on HTML form. So we can set an auto complete form when we fill another html form later.

To disable the toolbar just go to View > Toolbars > Google Toolbar. And then refresh the browser. The textfield background will colouring with its original color.

July 29, 2008

How to post form into a popup window

Filed under: html, javascript — Tags: , — admin @ 10:04 am

When you need to send a variable to a popup window from mainpage, ussually we will put it in url as GET method. But using this problem we will get problem when the variable has long character. We know that GET has limited long.

So we need to use POST method to submit a form. But how we can do it? I have a trick how to do it.

First we create a javascript for handling onsubmit event on html form.

function thePopupWindows(windowsname){
var win = window.open('', windowsname, ''width=580,height=450');
return true;
}

and then set this function on HTML Form :

<form action="popupwin.php" method="post" target="thepopup" onsubmit="return thePopupWindows(this.target);">
<input id="name" name="name" type="text" />
<input type="submit" value="Submit">
</form>

July 10, 2008

Add page break on HTML page

Filed under: html — Tags: — admin @ 10:03 am

Sometimes we want to add a page break on specific part on the page for printing. We can do it with simple css method for adding page break on specific part that you want a page break is occur.

So when you need to add page break on specific place, you just need to add this html code :

<p style=”page-break-before: always”>

on part that you want a page break occur.

for example :

<p>This is page 1</p>
<p style=”page-break-before: always”>
<p>This is page 2</p>

If we print this html, we will have two pages printed.

July 9, 2008

how to search value inside a set or array in mysql

Filed under: mysql, query tips — Tags: , — admin @ 10:01 am

Sometimes we have data in a field on our table like this “1,2,3,4,5,6,7″, and we want to search for example number 2. Beside doing searching inside php, we can do it in sql query. I found one function for retrieving position of a value inside a set : FIND_IN_SET(str,strlist).

So the query will look like this :

SELECT * FROM table_name WHERE FIND_IN_SET(2, field_name) > 2;

This query will return all recordset that have number 2 in field_name set.

Another way to searching a value inside a set, is by manipulating on how we save the set in field. So if we want to save a set of “1, 2, 3, 4, 5, 6, 7″, we will save it as “<1>,<2>,<3>,<4>,<5>,<6>,<7>” in database. And doing query using this method :

SELECT * FROM table_name WHERE field_name LIKE ‘%<2>%’;

but of course the first way is more faster. because first way we search value in array / set, but second way search value in string.

April 16, 2008

INSERT INTO SELECT command on Mysql Database

Filed under: mysql, query optimization — Tags: , — admin @ 10:00 am

Sometimes we need to copied a small pieces of one table to another table. Usually we run SELECT FROM source table first, and then iteratively add into target table, the query is something like this

mysql_query(’SELECT id, name, address FROM member’);

and then using php, we add all results into target table

mysql_query(’INSERT INTO target_table(id, name,date_f) VALUES (’. $id .’, ‘. $name .’, NOW())’);

but using this way we need at least 3 lines code and it is not efficient, there is another way to do that more efficient. Mysql has INSERT INTO SELECT FROM query command, the query will look like below

mysql_query(’INSERT INTO target_table (id, name, date_f)
SELECT source_table.id, source_table.name, NOW()
FROM source_table;’);

if you want to overwrite old value, you can use REPLACE instead INSERT.

April 13, 2008

How to find current URL using php?

Filed under: php, php-tips-basic — Tags: — admin @ 9:56 am

Sometimes we need to find current URL for processing on script. URL is construct by three component :

  1. Domain name : www.domain.com
  2. Script name : index.php
  3. Query string : parameter on url, example component=member&task=edit

Using $_SERVER variable we can get this all information and construct it to get full URL. We need to retrieve value ‘HTTP_HOST’, ‘SCRIPT_NAME’ and ‘QUERY_STRING’ on $_SERVER array. Here is the code :

$url = “http://” . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'] . “?” . $_SERVER['QUERY_STRING'];

this script produce complete current url, if you don’t need host to be included you can just use values from $_SERVER['REQUEST_URI'];

April 10, 2008

Site philosophy, another introduction title than Hello world!

Filed under: web-history — admin @ 7:50 am

As my other new website, i always create an introduction text about the site purposes beside of using this standard text after wordpress installation.

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!

I would like to describe my skill background. I were graduated from Christian Duta Wacana University at Jogjakarta. I took Information technology faculty. Basically i learn about how to program and at the end of study, i learn more about Internet and Multimedia. So i start to join to internet club on my campus named UKDWNet Club and got basic experience about how to build and manage a website. I’m very excited at that time, so i am focusing on web programming.

After graduated i join to outsourcing company from Germany that handle big project for desktop application and web application. And during this time i get more experience about programming using Delphi, .NET and PHP. Now i am a senior PHP programmer in this company. I forgot to mention the company, it is named Probypro Digitals Solution. And i still join to this company until now.

Beside my full time work at Probypro, i also do some freelance project with other IT company in Bali, such as Bengkel Media Group, Barefoot, and other company that even doesn’t have named, ;)

So this site is my first publication of my skill, hope that i can help you to grow your business using IT Solution. Oh ya i would like to say great thanks to Janumedia for encouraging me to publish my skill and post some article related with software development.

In the next days i would like to post some article about programming and internet stuff. Feel free to contact me for support.

Wishes all best for you.

Mario Cahyadi
Owner of Bali Stupa

« Older Posts