system
December 6, 2010, 2:55pm
1
How to convert the code below to Ajax or jQuery?
Ajax or jQuery as the existence of links be investigated. => reciprocal link checker Ajax or jQuery validation.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.zigweb.ir');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec($ch);
curl_close($ch);
$string = str_replace('/', '\\/', $ural);
$link = "/$string/si";
if(preg_match($link, $contents)) {
echo "yes";
} else
echo "no";
}
You can’t really CONVERT it to jQuery or Ajax, but you can use it along with jQuery and Ajax.
system
December 6, 2010, 3:20pm
3
Please explain further.
How is this?
You can use that in conjunction with jQuery’s ajax functions.
http://api.jquery.com/jQuery.ajax/
system
December 6, 2010, 4:09pm
5
But I saw that is ajax and PHP together to use.
How is this?
You know when you visit a web page (perhaps a php web page) and you see the results in your web browser?
Well AJAX visits similar web pages and receives the result as data. There’s no magic to it.