Popup message and ajax to jquery form

I create a form with PHP and jQuery, I add this in footer of my website, all I need is to display the form results in a popup in the main of my website not in the footer and make this to work without page refresh (with ajax). I add here my entire code:

<form enctype="multipart/form-data" action="" method="post">
   <input name="url" type="text"/>
    <input type="submit" name="submit" value="Check" class="btn btn-primary"/><br/>
</form>

<?php
if(isset($_REQUEST['submit'])) {
    $url = $_REQUEST['url'];
if(substr( $string_n, 0, 7 ) != "http://" && substr( $string_n, 0, 8 ) != "https://")
$url = "http://".$url;
if(stripos($url,"folder/")>0)
$content = file_get_contents($url);
else
$content = file_get_contents($url."/folder/");
if(preg_match("/Copyright ver. ([0-9.]+)/", $content, $result))
echo "Your year is : ".$result[1];
else
echo "Sorry cannot determine year";
}
?>


Source: javascript

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.