묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
아래 소스에서 변수를 넘겨 받으면 폼이 안뜨야 되는데, 계속 뜹니다.
값이 다른데,
a_userid는 varchar(20)인데,
username은 모르겠어요....
또 어떻게 값을 넘기는 지...
<?
// a-DB 접속
$connect=dbconn();
$member=member_info();
$username=$user_id;
if($connect) mysql_close($connect);
?>
<?
if(!$username) {
print_form();
exit;
};
$my_icon = "default.gif";
if(!$message && ($faceshow == $my_icon)) {
print_form_nameset();
exit;
};
$time = date("H:i d/m");
$timeis = time();
$holdtime = $timeis - 900 ;
$message_array = file("messages.htm");
$history_array = file("archive.htm");
$show_who = file("users.txt");
for ($talley = 1; $talley < 40; $talley++) {
$old_messages .= $message_array[$talley];
}
for ($talley = 1; $talley < 200; $talley++) {
$old_history .= $history_array[$talley];
}
foreach ($show_who as $user_on) {
$displayed = explode(",",$user_on);
if( $displayed[0] < $holdtime ){
break;
}
if( $displayed[1] == "$usernamen" ){
break;
}
$updated .= $user_on;
}
$updated .= "$timeis,$usernamen";
$online = stripslashes($updated);
$open_file = fopen("users.txt", w);
fputs($open_file, $online);
fclose($open_file);
$username = htmlspecialchars($username);
$message = htmlspecialchars($message);
$new_message = "<font color="$myfont"> $time <img src="$faceshow"> $username [-] $message<p>n </font>";
$header = "<html><head>".
"<embed src="sound.wav" width=2 height=0 autostart=true loop=false> <noembed> <bgsound src="sound.wav" loop=none> </noembed>n";
"<meta http-equiv="pragma" content="no-cache">".
"<meta http-equiv="refresh" CONTENT="15">".
"<meta name="robots" content="noindex"></head>".
"<body bgcolor="#ffffff" text="#000000"><p>".
$open_file = fopen("messages.htm", "w");
fputs($open_file, $header);
fputs($open_file, stripslashes($new_message));
fputs($open_file, $old_messages);
fputs($open_file, $footer);
fclose($open_file);
$open_file = fopen("archive.htm", "w");
fputs($open_file, $header);
fputs($open_file, stripslashes($new_message));
fputs($open_file, $old_history);
fputs($open_file, $footer);
fclose($open_file);
print_form_nameset();
function print_form()
{
global $username;
global $self_post;
echo <<<FORM1
</head>
<body bgcolor="#ffffff" text="#000000">
<BODY BACKGROUND="burlap.gif">
<p>
<font size="-1">
function print_form()
{
global $username;
global $self_post;
echo <<<FORM1
</head>
<body bgcolor="#ffffff" text="#000000">
<BODY BACKGROUND="aaaa.gif">
<p>
<font size="-1">
<form name="chat" method="post" action="$self_post" >
Chat Handle : <input type="text" name="username" size="30" value="$username">
<input type="submit" value="test"><br>
</form>
</font>
FORM1;
}
?>
[도움바람] 변수를 받지 못합니다. ㅋ - 소스첨부
2004.11.17 19:31
아래 소스에서 변수를 넘겨 받으면 폼이 안뜨야 되는데, 계속 뜹니다.
값이 다른데,
a_userid는 varchar(20)인데,
username은 모르겠어요....
또 어떻게 값을 넘기는 지...
<?
// a-DB 접속
$connect=dbconn();
$member=member_info();
$username=$user_id;
if($connect) mysql_close($connect);
?>
<?
if(!$username) {
print_form();
exit;
};
$my_icon = "default.gif";
if(!$message && ($faceshow == $my_icon)) {
print_form_nameset();
exit;
};
$time = date("H:i d/m");
$timeis = time();
$holdtime = $timeis - 900 ;
$message_array = file("messages.htm");
$history_array = file("archive.htm");
$show_who = file("users.txt");
for ($talley = 1; $talley < 40; $talley++) {
$old_messages .= $message_array[$talley];
}
for ($talley = 1; $talley < 200; $talley++) {
$old_history .= $history_array[$talley];
}
foreach ($show_who as $user_on) {
$displayed = explode(",",$user_on);
if( $displayed[0] < $holdtime ){
break;
}
if( $displayed[1] == "$usernamen" ){
break;
}
$updated .= $user_on;
}
$updated .= "$timeis,$usernamen";
$online = stripslashes($updated);
$open_file = fopen("users.txt", w);
fputs($open_file, $online);
fclose($open_file);
$username = htmlspecialchars($username);
$message = htmlspecialchars($message);
$new_message = "<font color="$myfont"> $time <img src="$faceshow"> $username [-] $message<p>n </font>";
$header = "<html><head>".
"<embed src="sound.wav" width=2 height=0 autostart=true loop=false> <noembed> <bgsound src="sound.wav" loop=none> </noembed>n";
"<meta http-equiv="pragma" content="no-cache">".
"<meta http-equiv="refresh" CONTENT="15">".
"<meta name="robots" content="noindex"></head>".
"<body bgcolor="#ffffff" text="#000000"><p>".
$open_file = fopen("messages.htm", "w");
fputs($open_file, $header);
fputs($open_file, stripslashes($new_message));
fputs($open_file, $old_messages);
fputs($open_file, $footer);
fclose($open_file);
$open_file = fopen("archive.htm", "w");
fputs($open_file, $header);
fputs($open_file, stripslashes($new_message));
fputs($open_file, $old_history);
fputs($open_file, $footer);
fclose($open_file);
print_form_nameset();
function print_form()
{
global $username;
global $self_post;
echo <<<FORM1
</head>
<body bgcolor="#ffffff" text="#000000">
<BODY BACKGROUND="burlap.gif">
<p>
<font size="-1">
function print_form()
{
global $username;
global $self_post;
echo <<<FORM1
</head>
<body bgcolor="#ffffff" text="#000000">
<BODY BACKGROUND="aaaa.gif">
<p>
<font size="-1">
<form name="chat" method="post" action="$self_post" >
Chat Handle : <input type="text" name="username" size="30" value="$username">
<input type="submit" value="test"><br>
</form>
</font>
FORM1;
}
?>