Jquery #

    Jquery

/

JavaScript, / / 23.02.11 / [0]

Ajax #

  Ajax

HTML







Search Results


Type something into the input field


JS
function createObject() {
var request_type;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
request_type = new ActiveXObject("Microsoft.XMLHTTP");
} else {
request_type = new XMLHttpRequest();
}
return request_type;
}

var http = createObject();

function searchNameq() {
searchq = encodeURI(document.getElementById('searchq').value);
document.getElementById('msg').style.display = "block";
document.getElementById('msg').innerHTML = "Searching for " + searchq+"";
// Set te random number to add to URL request
nocache = Math.random();
http.open('get', 'in-search.php?name='+searchq+'&nocache = '+nocache);
http.onreadystatechange =searchNameqReply;
http.send(null);
}
function searchNameqReply() {
if(http.readyState == 4){
var response = http.responseText;
document.getElementById('search-result').innerHTML = response;
}
}

php in-search.php
include('config.php');
$searchq = $_GET['name'];
$getName = mysql_query('SELECT * FROM USER WHERE name LIKE "%'.addslashes($searchq).'%"');
while ($row = mysql_fetch_array($getName))
echo $row['name'] . '
';
?>

PHP, JavaScript / : ajax, , , php / 22.02.11 / [0]

#


, -
: ... ... HTML-:
preg_replace("!(.*?)!si","<_>\\1",$string);

,
if (preg_match('|(.*)|sei', $str, $arr)) $title = $arr[1]; else $title='';


preg_replace("/.*?\./", '', 'photo.jpg');

,
if (!preg_match("|^[\d]+$|", $var))

, , "_" (), :
if (preg_match("/[^(\w)|(\x7F-\xFF)|(\s)]/",$username)) {
echo "invalid username";
exit;
}

e-mail "@" "." "-", . :
if (preg_match("/[^(\w)|(\@)|(\.)|(\-)]/",$usermail)) {
echo "invalid mail";
exit;
}


if(preg_match('/^\d+$/', $var)) echo $var;


$vnut , $vnech .

HTML
$search = array ("']*?>.*?'si",// javascript
"'<[\/\!]*?[^<>]*?>'si", // HTML-
"'([\r\n])[\s]+'", //
"'&(quot|#34);'i", // HTML-
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i",
"'&#(\d+);'e");// php-

$replace = array ("",
"",
"\\1",
"\"",
"&",
"<",
">",
" ",
chr(161),
chr(162),
chr(163),
chr(169),
"chr(\\1)");

$text = preg_replace($search, $replace, $document);

PHP / / 21.02.11 / [0]

Rapha?l JavaScript #

Raphaël   JavaScript

(SVG) .
.

JavaScript, / / 20.02.11 / [0]

ajax, jquery, php mysql #

   ajax, jquery, php  mysql

/

CSS, XHTML, PHP, JavaScript, / : ajax, jquery, php, mysql, todo, list / 19.02.11 / [0]

title JavaScript Jquery #

  title  JavaScript  Jquery

, .
var data = $('h1').html() + '| ';
document.title = data.replace( /([\s\S]+)/, '' ).replace(/<\/title>([\s\S]+)/, '' ); </div> <br> <div class="scriptcode"> <h1> </h1> </div>, <div class="scriptcode"> <title>
"| ". .

JavaScript / : js, jquery, title / 10.02.11 / [11]