검색어에 이런 것이 될경우 어떻게 처리해야하나요? 정보
검색어에 이런 것이 될경우 어떻게 처리해야하나요?관련링크
첨부파일
본문
검색어 테이블 디비를 보니까...내역이 아래와같더라구요..
g4_popular 디비 테이블의 내역을 보니까 거의 모든 아이피가 날짜로 검색워드가 써져있더라구요..
불특정 다수의 검색하는 사람들이 작정하고 날짜로만 합심해서 검색하는건지 원...악심을 품고 시켜서 하라고 해도 힘들정도 겠더라구요..
현재 상태와 디비 내역은 첨부 이미지와같습니다..디비 내역에 간간히 제대로된 검색어가 존재하는것을 보면 날짜검색어는 왜 그런지 모르겠습니다..
검색어 db 테이블을 보면 아래와같습니다..
원인은 무엇이고 어떻게 해결할 수 있는지 도와주실분은 안계신가요..
인기검색어를 매번 삭제할 수도 없는 노릇이고...ㅠㅠ
http://ipconfig.co.kr 로 아이피 검색해보면 미국,브라질, 필란드 , 중국, 한국 뭐 난리도 아니던데요;
bbs/search.php 도 함께 첨부합니다..
#
# 'g4_popular' structure
#
CREATE TABLE g4_popular (
pp_id int(11) not null auto_increment primary key,
pp_word varchar(50) not null ,
pp_date date not null default '0000-00-00' ,
pp_ip varchar(50) not null ,
KEY index1 (pp_date,pp_word,pp_ip)
) TYPE=MyISAM;
#
# 'g4_popular' data
#
INSERT INTO g4_popular VALUES ( '148', '2009-10-14', '2009-10-21', '65.55.230.249');
INSERT INTO g4_popular VALUES ( '149', '2009-10-07', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '150', '2009-09-18', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '151', '2009-08-04', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '152', '2009-09-10', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '153', '2009-09-04', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '154', '2009-09-11', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '155', '2009-08-02', '2009-10-21', '61.247.221.33');
INSERT INTO g4_popular VALUES ( '156', '2009-10-17', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '157', '레프트4데드', '2009-10-21', '125.191.33.131');
INSERT INTO g4_popular VALUES ( '158', '2009-10-13', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '159', '2009-08-09', '2009-10-21', '124.49.190.132');
INSERT INTO g4_popular VALUES ( '160', '2009-09-13', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '161', 'L4D', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '162', '2009-09-17', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '163', '2009-09-06', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '164', '2009-09-13', '2009-10-21', '59.15.254.163');
INSERT INTO g4_popular VALUES ( '165', '2009-09-03', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '166', '2009-10-01', '2009-10-21', '65.55.211.174');
INSERT INTO g4_popular VALUES ( '167', '2009-09-01', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '168', '2009-07-09', '2009-10-21', '121.187.6.43');
INSERT INTO g4_popular VALUES ( '169', '2009-09-09', '2009-10-21', '65.55.211.186');
INSERT INTO g4_popular VALUES ( '170', '2009-09-07', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '171', '2009-10-05', '2009-10-21', '67.218.116.132');
INSERT INTO g4_popular VALUES ( '172', '2009-10-04', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '173', '2009-09-09', '2009-10-21', '67.218.116.132');
INSERT INTO g4_popular VALUES ( '174', '2009-08-28', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '175', '2009-08-03', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '176', '2009-08-22', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '177', '2009-09-18', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '178', '2009-08-30', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '179', '2009-08-24', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '180', '아키텍쳐', '2009-10-21', '121.161.159.159');
INSERT INTO g4_popular VALUES ( '181', '2009-08-02', '2009-10-21', '61.247.221.34');
INSERT INTO g4_popular VALUES ( '182', 'tank', '2009-10-21', '147.46.35.107');
INSERT INTO g4_popular VALUES ( '183', '2009-10-21', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '184', '2009-08-26', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '185', '2009-07-09', '2009-10-21', '218.54.94.16');
INSERT INTO g4_popular VALUES ( '186', '2009-09-12', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '187', '야한싸이트', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '188', '2009-10-09', '2009-10-21', '66.249.67.173');
INSERT INTO g4_popular VALUES ( '189', '2009-09-20', '2009-10-21', '67.218.116.132');
INSERT INTO g4_popular VALUES ( '190', '레포데', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '191', '재건축', '2009-10-21', '124.137.207.66');
INSERT INTO g4_popular VALUES ( '192', '안전진단', '2009-10-21', '124.137.207.66');
INSERT INTO g4_popular VALUES ( '193', '과업수행계획서', '2009-10-21', '124.137.207.66');
INSERT INTO g4_popular VALUES ( '194', '2009-10-02', '2009-10-21', '65.55.230.248');
INSERT INTO g4_popular VALUES ( '195', '2009-10-11', '2009-10-21', '66.249.67.173');
INSERT INTO g4_popular VALUES ( '196', '2009-10-01', '2009-10-21', '65.55.230.248');
INSERT INTO g4_popular VALUES ( '197', '일위대가', '2009-10-21', '121.138.50.43');
INSERT INTO g4_popular VALUES ( '198', '레프트4', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '199', '2009-10-04', '2009-10-21', '65.55.230.248');
INSERT INTO g4_popular VALUES ( '200', '군일위대가', '2009-10-21', '121.138.50.43');
INSERT INTO g4_popular VALUES ( '201', 'Dead', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '202', '2009-07-30', '2009-10-21', '221.139.38.175');
INSERT INTO g4_popular VALUES ( '203', '2009-10-05', '2009-10-21', '65.55.211.183');
INSERT INTO g4_popular VALUES ( '204', '2009-09-25', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '205', '2009-10-06', '2009-10-21', '65.55.211.186');
INSERT INTO g4_popular VALUES ( '206', '2009-09-09', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '207', '2009-08-23', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '208', '2009-06-27', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '209', '2009-10-18', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '210', '2009-10-06', '2009-10-21', '66.249.67.173');
INSERT INTO g4_popular VALUES ( '211', '2009-10-12', '2009-10-21', '66.249.67.173');
INSERT INTO g4_popular VALUES ( '212', '철골', '2009-10-21', '211.107.71.145');
INSERT INTO g4_popular VALUES ( '213', '철골업체', '2009-10-21', '211.107.71.145');
INSERT INTO g4_popular VALUES ( '214', '2009-09-26', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '215', '2009-10-01', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '216', '2009-09-20', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '217', '2009-08-01', '2009-10-21', '112.144.234.250');
INSERT INTO g4_popular VALUES ( '218', '2009-09-13', '2009-10-21', '112.144.234.250');
INSERT INTO g4_popular VALUES ( '219', '2009-10-17', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '220', '2009-10-17', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '221', '2009-04-23', '2009-10-21', '67.218.116.132');
INSERT INTO g4_popular VALUES ( '222', '2009-09-29', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '223', '2009-06-07', '2009-10-21', '114.111.36.30');
INSERT INTO g4_popular VALUES ( '224', '2009-09-30', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '225', '2009-10-01', '2009-10-21', '65.55.211.185');
INSERT INTO g4_popular VALUES ( '226', '2009-09-21', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '227', '야한싸이트', '2009-10-21', '218.55.249.66');
INSERT INTO g4_popular VALUES ( '228', '2009-10-02', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '229', '2009-09-22', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '230', '레프트', '2009-10-21', '122.34.221.181');
INSERT INTO g4_popular VALUES ( '231', '2009-09-17', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '232', '2009-10-05', '2009-10-21', '66.249.67.173');
INSERT INTO g4_popular VALUES ( '233', '2009-10-20', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '234', '4', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '235', '2009-10-08', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '236', '레프트', '2009-10-21', '115.88.141.156');
INSERT INTO g4_popular VALUES ( '237', '2009-10-05', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '238', '2009-09-21', '2009-10-21', '67.218.116.132');
INSERT INTO g4_popular VALUES ( '239', '2009-08-03', '2009-10-21', '121.175.67.18');
INSERT INTO g4_popular VALUES ( '240', '19', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '241', '레프트4데드', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '242', '2009-10-03', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '243', '2009-10-21', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '244', '2009-10-01', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '245', '2009-09-22', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '246', '2009-09-17', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '247', '2009-10-01', '2009-10-21', '65.55.211.175');
INSERT INTO g4_popular VALUES ( '248', '2009-10-11', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '249', '2009-10-03', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '250', '2009-08-03', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '251', '2009-08-22', '2009-10-21', '122.32.143.9');
INSERT INTO g4_popular VALUES ( '252', '2009-09-14', '2009-10-21', '67.218.116.132');
INSERT INTO g4_popular VALUES ( '253', '2009-10-05', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '254', '2009-09-14', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '255', '2009-09-19', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '256', '2009-08-27', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '257', 'SDA', '2009-10-21', '121.158.187.57');
INSERT INTO g4_popular VALUES ( '258', '2009-10-18', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '259', 'rhddbrl', '2009-10-21', '211.44.190.215');
INSERT INTO g4_popular VALUES ( '260', '2009-09-26', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '261', '2009-09-18', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '262', '2009-07-26', '2009-10-21', '211.230.124.169');
INSERT INTO g4_popular VALUES ( '263', '2009-05-01', '2009-10-21', '65.55.110.208');
INSERT INTO g4_popular VALUES ( '264', '2009-05-28', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '265', '2009-09-10', '2009-10-21', '119.205.138.61');
INSERT INTO g4_popular VALUES ( '266', '레프트4', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '267', '2009-10-15', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '268', '레프트4데드', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '269', '2009-07-15', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '270', '2009-10-09', '2009-10-21', '67.218.116.132');
INSERT INTO g4_popular VALUES ( '271', '2009-10-05', '2009-10-21', '65.55.211.180');
INSERT INTO g4_popular VALUES ( '272', '19', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '273', '레프트', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '274', '2009-07-09', '2009-10-21', '119.198.74.63');
INSERT INTO g4_popular VALUES ( '275', '2009-09-07', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '276', '레프트4데드', '2009-10-21', '59.24.217.111');
INSERT INTO g4_popular VALUES ( '277', '2009-09-20', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '278', '2009-09-21', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '279', '2009-10-05', '2009-10-21', '65.55.211.187');
INSERT INTO g4_popular VALUES ( '280', '레프트4덷', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '281', 'nanen12', '2009-10-21', '59.2.137.67');
INSERT INTO g4_popular VALUES ( '282', '2009-10-08', '2009-10-21', '65.55.211.173');
INSERT INTO g4_popular VALUES ( '283', '남구', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '284', '플러그', '2009-10-21', '222.101.83.24');
INSERT INTO g4_popular VALUES ( '285', '플러그인', '2009-10-21', '222.101.83.24');
INSERT INTO g4_popular VALUES ( '286', '2009-09-10', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '287', '2009-10-07', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '288', '2009-10-01', '2009-10-21', '65.55.211.187');
INSERT INTO g4_popular VALUES ( '289', '야한싸이트', '2009-10-21', '66.249.67.173');
INSERT INTO g4_popular VALUES ( '290', '2009-10-02', '2009-10-21', '67.218.116.132');
INSERT INTO g4_popular VALUES ( '291', '2009-10-02', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '292', '2009-09-13', '2009-10-21', '67.218.116.132');
INSERT INTO g4_popular VALUES ( '293', '2009-10-21', '2009-10-21', '66.249.67.173');
INSERT INTO g4_popular VALUES ( '294', 'cold', '2009-10-21', '121.174.102.32');
INSERT INTO g4_popular VALUES ( '295', 'fear', '2009-10-21', '121.174.102.32');
INSERT INTO g4_popular VALUES ( '296', '글러그인설정', '2009-10-21', '222.101.83.24');
INSERT INTO g4_popular VALUES ( '297', 'L4D', '2009-10-21', '116.42.151.33');
INSERT INTO g4_popular VALUES ( '298', '레프트4데드', '2009-10-21', '116.42.151.33');
INSERT INTO g4_popular VALUES ( '299', '레프트4데드맵다운', '2009-10-21', '116.42.151.33');
INSERT INTO g4_popular VALUES ( '300', '레프트4데드맵', '2009-10-21', '116.42.151.33');
INSERT INTO g4_popular VALUES ( '301', '2009-09-08', '2009-10-21', '67.218.116.166');
INSERT INTO g4_popular VALUES ( '302', '2009-10-08', '2009-10-21', '67.218.116.132');
INSERT INTO g4_popular VALUES ( '303', '2009-10-06', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '304', '2009-07-11', '2009-10-21', '121.190.25.38');
INSERT INTO g4_popular VALUES ( '305', '2009-09-10', '2009-10-21', '67.218.116.132');
INSERT INTO g4_popular VALUES ( '306', '2009-07-26', '2009-10-21', '118.42.102.12');
INSERT INTO g4_popular VALUES ( '307', '2009-10-08', '2009-10-21', '66.249.67.43');
INSERT INTO g4_popular VALUES ( '308', '2009-08-21', '2009-10-21', '219.255.24.174');
INSERT INTO g4_popular VALUES ( '309', '2009-06-01', '2009-10-21', '66.249.67.70');
INSERT INTO g4_popular VALUES ( '310', '새벽의저주', '2009-10-21', '121.176.48.187');
INSERT INTO g4_popular VALUES ( '311', '2009-09-12', '2009-10-21', '67.218.116.132');
INSERT INTO g4_popular VALUES ( '312', '2009-09-14', '2009-10-21', '65.55.211.187');
INSERT INTO g4_popular VALUES ( '313', '2009-10-20', '2009-10-21', '66.249.67.173');
INSERT INTO g4_popular VALUES ( '314', '레프트4데드', '2009-10-21', '110.15.15.175');
INSERT INTO g4_popular VALUES ( '315', '2009-08-02', '2009-10-21', '121.145.17.111');
# End of g4_popular Dump
댓글 전체
117번째줄
set pp_word = '$stx',
로 수정해보세요.
감사합니다.

if(!preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/", $search_str)) {
$sql = " insert into $g4[popular_table]
set pp_word = '$search_str',
pp_date = '$g4[time_ymd]',
pp_ip = '$_SERVER[REMOTE_ADDR]' ";
sql_query($sql, FALSE);
}
날짜형식이 아닌 경우에만 삽입하도록 해보면 어떨까요?
Parse error: syntax error, unexpected $end in /volume1/web/bbs/search.php on line 256
감사합니다.
// 인기검색어
$block = "/^[0000-9999]{1,}-[00-12]{1,}-[00-31]{1,}$/";
if (preg_match($block, $stx)) { }
else {
$sql = " insert into $g4[popular_table]
set pp_word = '$search_str',
pp_date = '$g4[time_ymd]',
pp_ip = '$_SERVER[REMOTE_ADDR]' ";
sql_query($sql, FALSE);
}
}
$str .= ")";
추가적으로, if ($stx) 바로 아래에 경고창 띄우기.
$block = "/^[0000-9999]{1,}-[00-12]{1,}-[00-31]{1,}$/";
if (preg_match($block, $stx)) {
alert("0000-00-00 형식은 검색할수 없습니다.");
}
else { }
감사합니다.
한발 늦었다.. 캬캬;
http://lifeinside.dyndns.org/bbs/search.php
이렇게 검색페이지로 넘어가면 여기서도 또 똑같은 문제가 발생하더라구요..
이런경우에는 어떻게 해야하나요???
날짜 한계 범위에서 검색해 보세요.
대체 왜 이런것을 검색할까요???
$block = "/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/";
디비에서 0000-00-00 식으로 들어오는 아이피들을 검색해보니까
네이버등 검색포탈에서 검색해서 들어오거나 링크 타고 들어오면 무조건 0000-00-00 으로 검색어를 남기는것같습니다..
아래링크는 실제 검색해서 사이트로 들어온 링크입니다.
http://search.naver.com/search.naver?sm=tab_hty&where=nexearch&query=left+4+dead+%BC%B3%C4%A1+%B0%E6%B7%CE&x=0&y=0
이 질문이 길어지니.. 포인트를 더 드려야할것같습니다. 질문을 다시 올리겠습니다.