[자바스크립트]입력양식 증가 폼

http://my-cgi.dreamwiz.com/dldydxo/dhtml.html

허접하나마 함 올려봅니다.
자바스크립트를 이용한.. 리플래쉬 되지 않고 입력양식을 증가시키는 폼입니다.
문제는 익스용이라는데 있지요… –^

혹시 브라우져를 가리지 않고 사용할수 있는 방법을 아시는 분은 좀 알려주시기 바랍니다.

dhtml test


onMouseOver=”this.style.color=’red'” onMouseOut=”this.style.color=’navy'”>입력양식 늘이기

  캐릭터 명 이름  
1  

reset
/ 저장

유저,DB,도메인 세팅 쉽게하기

안정호
http://newsone.co.kr

아는 후배가 갑자기 만들어 달라그래서 만들어 봤는데 좀 허접하군요.
bash 내공이 허접해서………..
위 부분 설정을 몇군대 자신에 마쳐서 고치면 될 겁니다.
이미있는 계정인지 확인하는 부분도 그렇고
누구 고수분이 손좀 보면…

무한대 2차도메인 생성 (apache + mysql 이용)

신재국
http://terran.co.kr
http://terran.co.kr/

안녕하세요.
프로그래머 생활이 재밌기를 바라며 한가지 tip 이라 생각되어 이렇게
글을 올립니다.

개인적으로, 한대의 서버에 여러 도메인과
각 도메인에 대한 2차 도메인을 회원들에게 서비스하고 있습니다.

허나, 회원들의 요청이 많아지게되자,
named 에 계속 추가하여 named restart 시켜주는 방법, 회원 관리가
적절치 못하다고 생각하였습니다.

이곳저곳 문서를 찾다가
우연히 apache 에서 세팅이 가능하며,
name 서버에 일일이 추가하지 않아도 되기에
저의 성공사례를 올립니다.

저의 경우 1대의 서버에
XXX.co.kr
YYY.co.kr
ZZZ.co.kr 도메인을 운영하고,
각각의 도메인에 2차도메인을 부여하여 운영하고 있습니다.

회원이 많아짐에 따라 mysql을 이용하여 2차도메인 정보를 저장하고 있습니다.

서버설정은 아래와 같습니다.

1. 아파치 세팅

1-1.
아파치는 mod_rewrite 모듈이 탑재되어 있어야 합니다.
아파치의 모듈들이 설치된 디렉토리에 mod_rewrite.so 가 없는 경우.

apache 를 다시 컴파일 합니다.

env CFLAGS=”-DEAPI”
./configure
–prefix=/etc/httpd
–enable-module=so
–enable-shared=max
–enable-module=rewrite
–enable-shared=rewrite

make
make install

1-2.

httpd.conf 에서 다음을 확인하고 없으면 추가합니다.

LoadModule rewrite_module libexec/mod_rewrite.so
AddModule mod_rewrite.c

1-3.
최 하단에 버

한글/영문/특수문자/숫자 구분






html_graph로 쉽고 멋있는 그래프 그리기

일단은 html_graphs.php3 의 내용입니다.
$html_graphs_included = 1;

/*
#######################################################################
#
# $Id: html_graphs.php3,v 1.3 1998/06/17 23:37:19 pdavis Exp $
#
# $Author: pdavis $
# $Locker: $
#
# $Date: 1998/06/17 23:37:19 $
#
# $Source: J:\programs\PHP/RCS/html_graphs.php3,v $
# $Revision: 1.3 $
# $State: Exp $
#
# $Log: html_graphs.php3,v $
# Revision 1.3 1998/06/17 23:37:19 pdavis
# Added mixed color codes and images to double graph.
#
# Revision 1.2 1998/06/17 21:20:20 pdavis
# Fixed Background problem, added mixed color codes and graphics.
#
# Revision 1.1 1998/06/17 15:52:41 pdavis
# Initial revision
#
#
#######################################################################
#
# *
# * Phil Davis
# *
# * Smyrna, Tennessee 37167 USA
# *
# * pdavis@pobox.com
# * http://www.pobox.com/~pdavis/
# *
#
# (C) Copyright 1998
# Phil Davis
# Printed in the United States of America
#
# This program is free software; you can redistribute it
# and/or modify it under the terms of the GNU General
# Public License version 2 as published by the Free
# Software Foundation.
#
# This program is distributed in the hope that it will
# be useful, but WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# Released under GNU Public License v2.0, available
# at www.fsf.org. The author hereby disclaims all
# warranties relating to this software, express or implied,
# including with no limitation any implied warranties of
# merchantability, quality performance, or fitness for a
# particular purpose. The author and their distributors
# shall not be liable for any special, incidental,
# consequential, indirect or similar damages due to loss
# of data, even if an agent of the author has been found
# to be the source of loss or damage. In no event shall the
# author’s liability for any damages ever exceed the price
# paid for the license to use software, regardless of the
# form of the claim. The person using the software bears all
# risk as to the quality and performance of the software.
#
# Swim at your own risk!
#
# This software program, documentation, accompanying
# written and disk-based notes and specifications, and all
# referenced and related program files, screen display
# renditions, and text files, are the property of the
# author.
#
# The authors have done their best to insure that the
# material found in this document is both useful and
# accurate. However, please be aware that errors may exist,
# the author does not make any guarantee concerning the
# accuracy of the information found here or in the uses
# to which it may be put.
#
#######################################################################
#
# About:
#
# The following PHP3 code provides a nice class interface for
# html graphs. It provides a single, reasonably consistent
# interface for creating HTML based graphs. The idea behind
# this code is that the user of the class sets up four or five
# arrays and pass these to html_graph() which then takes
# care of all the messy HTML layout. I am reasonably happy
# with the outcome of this interface. The HTML that must be
# generated for HTML graphs *is* messy, and the interface is
# very clean and flexible. I think that once you generate
# one graph with it, you’ll never look at creating HTML graphs
# the same. The arrays that must be set up consist of:
#
# * A names array containing column/row identifiers ($names)
# * One or two values arrays containg corresponding
# values to the column/row names ($values & $dvalues)
# * One or two bars array which also corresponds to the names
# array. The values in these arrays are URLS to graphics
# or color codes starting with a # which will be used to
# generate the graph bar. Color codes and graphics may
# be mixed in the same chart, although color codes can’t
# be used on Vertical charts. ($bars & $dbars)
# * The heart of customization… a vals array. If this
# array isn’t created then html_graphs will use all
# default values for the chart. Items that are customizable
# include font styles & colors, backgrounds, graphics,
# labels, cellspacing, cellpadding, borders, anotations
# and scaling factor. ($vals)
#
#######################################################################
# Known Bugs:
# * Currently the $vals[background] tag element doesn’t
# work in Netscape.
#######################################################################
# To Do:
#
# * Would like to make the $vals array to html_graph() completely
# optional. Currently it has to at least be an empty array.
#
#######################################################################
# Contact:
#
# If you have questions, suggestions, bugs, bug fixes, or enhancements
# please send them to pdavis@pobox.com so that they may be wrapped into
# future versions of HTML_Graph.
#######################################################################
# Examples:
# See http://www.pobox.com/~pdavis/programs/
#######################################################################
*/

/*
#######################################################################
#
# Function: html_graph($names, $values, $bars, $vals[, $dvalues, $dbars])
#
# Purpose: Calls routines to initialize defaults, set up table
# print data, and close table.
#
# Arguments:
# $names – Array of element names.
# $values – Array of corresponding values for elements.
# $bars – Array of corresponding graphic image names
# or color codes (begining with a #) for elements.
# Color codes can’t be used on vertical charts.
# $dvalues – Array of corresponding values for elements.
# This set is required only in the double graph.
# $dbars – Array of corresponding graphic image names
# or color codes (begining with a #) for elements.
# This set is required only in the double graph.
#
# $vals – array(“vlabel”=>””,
# “hlabel”=>””,
# “type”=>””,
# “cellpadding”=>””,
# “cellspacing”=>””,
# “border”=>””,
# “width”=>””,
# “background”=>””,
# “vfcolor”=>””,
# “hfcolor”=>””,
# “vbgcolor”=>””,
# “hbgcolor”=>””,
# “vfstyle”=>””,
# “hfstyle”=>””,
# “noshowvals”=>””,
# “scale”=>””,
# “namebgcolor”=>””,
# “valuebgcolor”=>””,
# “namefcolor”=>””,
# “valuefcolor”=>””,
# “namefstyle”=>””,
# “valuefstyle”=>””
# “doublefcolor”=>””)
#
# Where:
#
# vlabel – Vertical Label to apply
# default is NUL
# hlabel – Horizontal Label to apply
# default is NUL
# type – Type of graph
# 0 = horizontal
# 1 = vertical
# 2 = double horizontal
# default is 0
# cellpadding – Padding for the overall table
# default is 0
# cellspacing – Space for the overall table
# default is 0
# border – Border size for the overall table
# default is 0
# width – Width of the overall table
# default is NUL
# background – Background image for the overall table
# If this value exists then no BGCOLOR
# codes will be added to table elements.
# default is NUL
# vfcolor – Vertical label font color
# default is #000000
# hfcolor – Horizontal label font color
# default is #000000
# vbgcolor – Vertical label background color
# Not used if background is set
# default is #FFFFFF
# hbgcolor – Horizontal label background color
# Not used if background is set
# default is #FFFFFF
# vfstyle – Vertical label font style
# default is NUL
# hfstyle – Horizontal label font style
# default is NUL
# noshowvals – Don’t show numeric value at end of graphic
# Boolean value, default is FALSE
# scale – Scale values by some number.
# default is 1.
# namebgcolor – Color code for element name cells
# Not used if background is set
# default is “#000000”
# valuebgcolor – Color code for value cells
# Not used if background is set
# default is “#000000”
# namefcolor – Color code for font of name element
# default is “#FFFFFF”
# valuefcolor – Color code for font of value element
# default is “#000000”
# namefstyle – Style code for font of name element
# default is NUL
# valuefstyle – Style code for font of value element
# default is NUL
# doublefcolor – Color code for font of second element value
# default is “#886666”
#
#######################################################################
*/
function html_graph($names, $values, $bars, $vals, $dvalues=0, $dbars=0)
{
// Set the values that the user didn’t
$vals = hv_graph_defaults($vals);
start_graph($vals, $names);

if ($vals[type] == 0) {
horizontal_graph($names, $values, $bars, $vals);
} elseif ($vals[type] == 1) {
vertical_graph($names, $values, $bars, $vals);
} elseif ($vals[type] == 2) {
double_horizontal_graph($names, $values, $bars, $vals, $dvalues, $dbars);
}
end_graph();
}

#######################################################################
# Function: start_graph($vals, $names)
# Purpose: Prints out the table header and graph labels.
#######################################################################
function start_graph($vals, $names)
{
echo ““;
print “

print ” cellpadding=$vals[cellpadding]”;
print ” cellspacing=$vals[cellspacing]”;
print ” border=$vals[border]”;

if ($vals[width] != 0) { print ” width=$vals[width]”; }
if ($vals[background]) { print ” background=$vals[background]”; }
print “>
“;

if (($vals[vlabel]) || ($vals[hlabel])) {
if (($vals[type] == 0) || ($vals[type] == 2 )) { // horizontal chart
$rowspan = sizeof($names) + 1;
$colspan = 3;
} elseif ($vals[type] == 1) { // vertical chart
$rowspan = 3;
$colspan = sizeof($names) + 1;
}

print “

“;

print “

“;
}
}

#######################################################################
# Function: end_graph()
# Purpose: Prints out the table footer.
#######################################################################
function end_graph()
{
print “

// If a background was choosen don’t print cell BGCOLOR
if (!$vals[background]) { print “bgcolor=$vals[hbgcolor]”; }
print ” colspan=$colspan>”;
print ““;
print “$vals[hlabel]“;
print “
// If a background was choosen don’t print cell BGCOLOR
if (!$vals[background]) { print “bgcolor=$vals[vbgcolor]”; }
print ” ROWSPAN=$rowspan>”;
print ““;
print “$vals[vlabel]“;
print “

“;
}

#######################################################################
# Function: hv_graph_defaults($vals)
# Purpose: Sets the default values for the $vals array
#######################################################################
function hv_graph_defaults($vals)
{
if (!$vals[vfcolor]) { $vals[vfcolor]=”#000000″; }
if (!$vals[hfcolor]) { $vals[hfcolor]=”#000000″; }
if (!$vals[vbgcolor]) { $vals[vbgcolor]=”#FFFFFF”; }
if (!$vals[hbgcolor]) { $vals[hbgcolor]=”#FFFFFF”; }
if (!$vals[cellpadding]) { $vals[cellpadding]=0; }
if (!$vals[cellspacing]) { $vals[cellspacing]=0; }
if (!$vals[border]) { $vals[border]=0; }
if (!$vals[scale]) { $vals[scale]=1; }
if (!$vals[namebgcolor]) { $vals[namebgcolor]=”#FFFFFF”; }
if (!$vals[valuebgcolor]) { $vals[valuebgcolor]=”#FFFFFF”; }
if (!$vals[namefcolor]) { $vals[namefcolor]=”#000000″; }
if (!$vals[valuefcolor]) { $vals[valuefcolor]=”#000000″; }
if (!$vals[doublefcolor]) { $vals[doublefcolor]=”#886666″; }
return ($vals);
}

#######################################################################
# Function: horizontal_graph($names, $values, $bars, $vals)
# Purpose: Prints out the actual data for the horizontal chart.
#######################################################################
function horizontal_graph($names, $values, $bars, $vals)
{
for ($i = 0; $i < sizeof($values); $i++) {
echo(“ // If a background was choosen don’t print cell BGCOLOR
if (! $vals[background]) { print ‘ BGCOLOR=”‘ . $vals[namebgcolor] . ‘”‘; }
echo(“>

$names[$i]

// If a background was choosen don’t print cell BGCOLOR
if (! $vals[background]) { print ‘ BGCOLOR=”‘ . $vals[valuebgcolor] . ‘”‘; }
echo(“>”);
// Decide if the value in bar is a color code or image.
if (ereg(“^#”, $bars[$i])) {
$width = $values[$i] * $vals[scale];
echo(“

BGCOLOR=$bars[$i] WIDTH=$width >

&nbsp

“);
} else {
print ‘ print ‘ HEIGHT=10 WIDTH=”‘ . $values[$i] * $vals[scale] . ‘”>’;
}
if (! $vals[noshowvals]) {
print ‘ print ‘ STYLE=”‘ . $vals[valuefstyle] . ‘”>(‘;
print $values[$i] . “)
“;
}
echo(“
“);
}
}

#######################################################################
# Function: vertical_graph($names, $values, $bars, $vals)
# Purpose: Prints out the actual data for the vertical chart.
#######################################################################
function vertical_graph($names, $values, $bars, $vals)
{
print “

“;

for ($i = 0; $i < sizeof($values); $i++) {
print “

// If a background was choosen don’t print cell BGCOLOR
if (!$vals[background]) { print ” BGCOLOR=$vals[valuebgcolor]”; }
print “>”;

if (!$vals[noshowvals]) {
print “ print ” style=”$vals[valuefstyle]”>($values[$i])
“;
}
$height = $values[$i] * $vals[scale];
echo(“
“); //gif그래프에서 이동하기
}
print “ “;

for ($i = 0; $i < sizeof($values); $i++) {
echo(“

// If a background was choosen don’t print cell BGCOLOR
if (!$vals[background]) { print ” BGCOLOR=$vals[namebgcolor]”; }
echo(“>$names[$i]

“);
}
}

#######################################################################
# Function: double_horizontal_graph($names, $values, $bars,
# $vals, $dvalues, $dbars)
# Purpose: Prints out the actual data for the double horizontal chart.
#######################################################################
function double_horizontal_graph($names,$values,$bars,$vals,$dvalues,$dbars)
{
for( $i=0;$i echo(“ // If a background was choosen don’t print cell BGCOLOR
if (! $vals[background]) { print ‘ BGCOLOR=”‘ . $vals[namebgcolor] . ‘”‘; }
echo(“>$names[$i]
“);
// If a background was choosen don’t print cell BGCOLOR
if (! $vals[background]) { print ‘ BGCOLOR=’ . $vals[valuebgcolor]; }
$width = $dvalues[$i] * $vals[scale];
echo(“>



// Set background to a color if it starts with # or
// an image otherwise.
if (ereg(“^#”, $dbars[$i])) { print ‘BGCOLOR=”‘ . $dbars[$i] . ‘”>’; }
else { print ‘BACKGROUND=”‘ . $dbars[$i] . ‘”>’; }
echo(““);
// Decide if the value in bar is a color code or image.
if (ereg(“^#”, $bars[$i])) {
$width = $values[$i] * $vals[scale];
echo(“

&nbsp

“);
} else {
print ‘ print ‘ HEIGHT=10 WIDTH=”‘ . $values[$i] * $vals[scale] . ‘”>’;
}

if (! $vals[noshowvals]) {
print ‘ print ‘ STYLE=”‘ . $vals[valuefstyle] . ‘”>(‘;
print $values[$i] . “)
“;
}
?>


if (! $vals[noshowvals])
{
print ‘ print ‘ STYLE=”‘ . $vals[valuefstyle] . ‘”>(‘;
print $dvalues[$i] . “)
“;
}
?>


} // endfor

} // end double_horizontal_graph

?>

graph.php3에서 위의 파일을 include해서 아래에서 설정만 하면
그래프가 나와서 세로 막대,가로 막대 ㅎㅎㅎㅎㅎㅎ
if (!$html_graphs_included) {
include(“html_graphs.php3”);
}

$names = array(“SDS”, “LG-EDS”, “DITCO”, “BIT”, “H&C”, “Other”,”AAA”,”BBB”,”CCC”,”DDD”,”EEE”,”FFF”,”GGG”,”WWW”,”ZZZ”);
$values = array(1250,1100,1000,870,650,300,500,400,100,100,100,200,300,400,400);
$largest = 1300;

$bars = array();

for ($i = 0; $i < sizeof($values); $i++) {
$bars[$i] = “bar.gif”;
}

$graph_vals = array(
“hlabel”=>”은행”,
“vlabel”=>”조회”,
“type”=>1, // vertical graph
“vfcolor”=>”#FFFFFF”,
“hfcolor”=>”#FFFFFF”,
“vbgcolor”=>”#000000”, //조회 배경 색깔
“hbgcolor”=>”#000000”, //은행 배경 색깔
“width”=>650,
“cellspacing”=>”1”,
“scale”=>150/$largest,
“valuebgcolor”=>”#F0E0DE”,
“namefcolor”=>”#FFFFFF”,
“namebgcolor”=>”#000000”); //x축 배경 색깔

html_graph($names, $values, $bars, $graph_vals);
?>