I am trying to figure out how o combine jQuery code, where I grab a URL value from a field a PHP code that will hit that URL to check if the site exists... I have to use the jQuery in this case. Perhaps i can validate the URL with it too?..
$("#go").click(function() {
var $url = $("#url").val();
<?php
$x = @fopen($url,"r");
if ($x) {
?>
$("#ws").attr("src",url);
$("#start").remove();
<?php
fclose($x);
} else {
?>
alert("bad URL");
<?php
}
?>
});