1cfd3bbb56
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고, Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
3.8 KiB
3.8 KiB
id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
| id | title | category | status | verification_status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | created_at | updated_at | review_reason | merge_history | tags | raw_sources | applied_in | github_commit | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| php-ajax-live-search | PHP AJAX Live Search | Programming_Language | draft | conceptual |
|
B | 0.87 | 2026-07-04 | 2026-07-04 |
|
|
PHP AJAX Live Search
🎯 한 줄 통찰 (One-line insight)
Live search is framed with three explicit UX benefits over traditional search — results appear WHILE typing, narrow AS you keep typing, and widen again if you delete characters — meaning the entire feature is really just the name-autocomplete pattern (onkeyup + XMLHttpRequest) applied to XML data with a link/title match instead of a name match. [S1]
🧠 핵심 개념 (Core concepts)
- Live search benefits — instant results while typing, narrowing results with more input, broadening results by deleting characters. [S1]
- Same onkeyup pattern — reuses the exact autocomplete architecture from
PHP AJAX PHP. [S1] - XML data source —
links.xml, containing<link>elements each with a<title>and<url>sub-element. [S1] - PHP-side search via DOM +
stristr()— loads the XML withDOMDocument, then loops all<link>elements checking if the query string appears (case-insensitively) in each<title>. [S1] - Response is pre-built HTML links — matches are wrapped in
<a href="...">...</a>tags directly by PHP before being sent back. [S1]
📖 세부 내용 (Details)
- PHP search loop:
$xmlDoc=new DOMDocument(); $xmlDoc->load("links.xml"); $x=$xmlDoc->getElementsByTagName('link'); $q=$_GET["q"]; if (strlen($q)>0) { for($i=0; $i<($x->length); $i++) { $y=$x->item($i)->getElementsByTagName('title'); $z=$x->item($i)->getElementsByTagName('url'); if (stristr($y->item(0)->childNodes->item(0)->nodeValue,$q)) { $hint = "<a href='" . $z->item(0)->childNodes->item(0)->nodeValue . "' target='_blank'>" . $y->item(0)->childNodes->item(0)->nodeValue . "</a>"; } } }. [S1] - Fallback:
if ($hint=="") { $response="no suggestion"; } else { $response=$hint; } echo $response;. [S1]
⚖️ 모순 및 업데이트 (Contradictions & updates)
소스에서 모순되는 정보는 발견되지 않음.
🛠️ 적용 사례 (Applied in summary)
현재 발견된 실제 적용 사례가 없습니다 — W3Schools 페이지 링크를 실시간으로 검색해 클릭 가능한 링크로 반환하는 것이 실전 라이브 서치의 대표 사례다. [S1]
💻 코드 패턴 (Code patterns)
Case-insensitive title search returning pre-built HTML links (PHP/DOM):
if (stristr($y->item(0)->childNodes->item(0)->nodeValue, $q)) {
$hint = "<a href='" . $z->item(0)->childNodes->item(0)->nodeValue .
"' target='_blank'>" . $y->item(0)->childNodes->item(0)->nodeValue . "</a>";
}
✅ 검증 상태 및 신뢰도
- 상태: draft
- 검증 단계: conceptual
- 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
- 신뢰 점수: 0.87
- 중복 검사 결과: 신규 생성 (New discovery)
🔗 지식 그래프 (Knowledge Graph)
- 상위/루트: PHP Tutorial
- 관련 개념: PHP AJAX XML, PHP AJAX Poll
- 참조 맥락: onkeyup 실시간 검색 — 폴(AJAX Poll) 챕터로 이어짐.
📚 출처 (Sources)
- [S1] W3Schools — PHP - AJAX Live Search — https://www.w3schools.com/php/php_ajax_livesearch.asp
📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "PHP - AJAX Live Search" page (Astra wiki-curation, P-Reinforce v3.1 format).