제가 허접하게 만들었지만, 샘플 소스 제공해 봅니다. 추천좀 부탁드릴께요~~.
[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에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5902 | 9년 전 | 297 | ||
| 5901 | 9년 전 | 303 | ||
| 5900 | 9년 전 | 304 | ||
| 5899 | 9년 전 | 772 | ||
| 5898 | 9년 전 | 254 | ||
| 5897 | 9년 전 | 275 | ||
| 5896 | 9년 전 | 179 | ||
| 5895 | 9년 전 | 717 | ||
| 5894 | 9년 전 | 336 | ||
| 5893 | 9년 전 | 314 | ||
| 5892 | 9년 전 | 377 | ||
| 5891 | 9년 전 | 380 | ||
| 5890 | 9년 전 | 419 | ||
| 5889 | 9년 전 | 291 | ||
| 5888 | 9년 전 | 186 | ||
| 5887 | 9년 전 | 291 | ||
| 5886 | 9년 전 | 221 | ||
| 5885 | 9년 전 | 234 | ||
| 5884 | 9년 전 | 206 | ||
| 5883 | 9년 전 | 244 | ||
| 5882 | 9년 전 | 259 | ||
| 5881 | 9년 전 | 303 | ||
| 5880 | 9년 전 | 211 | ||
| 5879 | 9년 전 | 236 | ||
| 5878 | 9년 전 | 402 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기