2012-04-12 13 views
0

私のPHPスクリプトがバックグラウンドで実行されている間、何かを見せて画面をロックしたい。PHPスクリプトでjQuery BlockUIを設定する

URLリストのメタデータを取得しているため、スクリプトの実行に時間がかかることがあるため、テキスト領域に入力されたURLの数に応じて最大5分かかることがあります。

私はBlockUI jQueryコードを使用したいと思いますが、私のPHPスクリプトでどのように設定するか分かりません。ここで

は私のコードです:

<form method="get" action=<?php echo "'".$_SERVER['PHP_SELF']."'";?> > 
<p>URL of Competitor:</p> 
<textarea name="siteurl" rows="10" cols="50"> 
<?php //Check if the form has already been submitted and if this is the case, display  the submitted content. If not, display 'http://'. 
echo (isset($_GET['siteurl']))?htmlspecialchars($_GET['siteurl']):"http://";?> 
</textarea><br> 
<input type="submit" value="Submit"> 
</form> 
<div id="nofloat"></div> 
<table class="metadata" id="metatable_1"> 
<?php 
ini_set("display_errors", 0); 
function parseUrl($url){ 
    //Trim whitespace of the url to ensure proper checking. 
    $url = trim($url); 
    //Check if a protocol is specified at the beginning of the url. If it's not,  prepend 'http://'. 
    if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { 
      $url = "http://" . $url; 
    } 
    //Check if '/' is present at the end of the url. If not, append '/'. 
    if (substr($url, -1)!=="/"){ 
      $url .= "/"; 
    } 
    //Return the processed url. 
    return $url; 
} 
//If the form was submitted 
if(isset($_GET['siteurl'])){ 
    //Put every new line as a new entry in the array 
    $urls = explode("\n",trim($_GET["siteurl"])); 
    //Iterate through urls 
    foreach ($urls as $url) { 
      //Parse the url to add 'http://' at the beginning or '/' at the end if not already there, to avoid errors with the get_meta_tags function 
      $url = parseUrl($url); 
      //Get the meta data for each url 
      $tags = get_meta_tags($url); 
      //Check to see if the description tag was present and adjust output accordingly 
      echo (isset($tags['description']))?"<tr><td>Description($url)</td> <td>".$tags['description']:"<tr><td>Description($url)</td><td>No Meta Description</td> </tr>."; 
    } 
} 
?> 
</table> 
<script type="text/javascript"> 
     var exportTable1=new ExportHTMLTable('metatable_1'); 
    </script> 
<div> 
     <input type="button" onclick="exportTable1.exportToCSV()" value="Export to CSV"/> 
     <input type="button" onclick="exportTable1.exportToXML()"  value="Export to XML"/> 
    </div> 

そしてここでは、jQueryのブロックUIへのリンクです:http://jquery.malsup.com/block/#demos

はまた、私は任意のファイルをインクルードする必要がありますか?

誰かが正しい方向に私を指すことができればそれは素晴らしいことでしょう:)大変

ありがとう!

リッキー

答えて

0

AJAXを使用してそのスクリプトを呼び出すと、一度取得したページに結果を返し、その後、別のファイルにPHPを入れて?

+0

申し訳ありません私は初心者です、私は理解していません – RuFFCuT

関連する問題