제가 허접하게 만들었지만, 샘플 소스 제공해 봅니다. 추천좀 부탁드릴께요~~.
[Client Javascript Source]
// form과 div의 obj를 넘겨주면, ajax를 실행해서 그 결과 html을 div에 넣어줍니다.
function request_post(form, obj)
{
var formdata=$(form).serialize();
{
var formdata=$(form).serialize();
//alert("formdata="+formdata);
$.ajax({
type: "POST",
url: "post_server.php",
data: formdata,
dataType: "html",
success: function(data){
$(obj).html(data);
},
$.ajax({
type: "POST",
url: "post_server.php",
data: formdata,
dataType: "html",
success: function(data){
$(obj).html(data);
},
});
}
}
// main_cmd,와 sub_cmd, 그리고 value를 인자로 실행시켜서 그 결과를 div와 같은 obj에 삽입
function request_get(main_cmd, sub_cmd, value, obj)
{
//alert("cmd : " + cmd + ", value : " + value);
$.ajax({
url: "get_server.php",
data: {'main_cmd': main_cmd, 'sub_cmd': sub_cmd, 'value': value},
dataType: "html",
{
//alert("cmd : " + cmd + ", value : " + value);
$.ajax({
url: "get_server.php",
data: {'main_cmd': main_cmd, 'sub_cmd': sub_cmd, 'value': value},
dataType: "html",
success: function(data){
$(obj).html(data);
}
$(obj).html(data);
}
});
}
}
[Server : PHP 코드]
function ajax_error($code)
{
global $connect;
if($connect) my_close($connect);
header("HTTP/1.0 $code Error");
exit;
}
{
global $connect;
if($connect) my_close($connect);
header("HTTP/1.0 $code Error");
exit;
}
// 예로.. id 체크하는 것
$m_checkid = $_POST['id'];
if( $m_checkid )
{
$query_string = "select user_id from user_table where user_id = '".$m_checkid."'";
{
$query_string = "select user_id from user_table where user_id = '".$m_checkid."'";
$return_string = "<font color='green'>사용가능</font>";
$result = my_query_error($query_string);
while($row_data = mysql_fetch_array($result))
{
$return_string = "<font color='red'>중복</font>";
}
echo $return_string;
}
$result = my_query_error($query_string);
while($row_data = mysql_fetch_array($result))
{
$return_string = "<font color='red'>중복</font>";
}
echo $return_string;
}
내용은 별로 없지만, 추천좀 해 주세요..
프로젝트 의뢰해야 하는데 활동점수가 부족해서 의뢰를 정상적으로 못하고 있습니다. 추천좀 꾹~~
댓글 6개
13년 전
일단 츄쳔해써욤
13년 전
감사합니다.
매직크레용
13년 전
추천합니다..
13년 전
추천합니다.
아이디어맨
13년 전
감사합니다.
드래그홈2
13년 전
굳
게시판 목록
팁게시판
디자인과 관련된 유용한 정보를 공유하세요.
질문은 상단의 QA에서 해주시기 바랍니다.
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6027 | 9년 전 | 305 | ||
| 6026 | 9년 전 | 263 | ||
| 6025 | 9년 전 | 233 | ||
| 6024 | 9년 전 | 397 | ||
| 6023 | 9년 전 | 272 | ||
| 6022 | 9년 전 | 280 | ||
| 6021 | 9년 전 | 269 | ||
| 6020 | 9년 전 | 245 | ||
| 6019 | 9년 전 | 216 | ||
| 6018 | 9년 전 | 199 | ||
| 6017 | 9년 전 | 235 | ||
| 6016 | 9년 전 | 222 | ||
| 6015 | 9년 전 | 191 | ||
| 6014 | 9년 전 | 156 | ||
| 6013 | 9년 전 | 250 | ||
| 6012 | 9년 전 | 196 | ||
| 6011 | 9년 전 | 218 | ||
| 6010 | 9년 전 | 208 | ||
| 6009 | 9년 전 | 289 | ||
| 6008 | 9년 전 | 182 | ||
| 6007 | 9년 전 | 194 | ||
| 6006 | 9년 전 | 249 | ||
| 6005 | 9년 전 | 207 | ||
| 6004 | 9년 전 | 291 | ||
| 6003 | 9년 전 | 258 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기