如何启动“提交”按钮功能

时间:2015-03-28 09:43:38

标签: php html submit

我目前正在开发一个用于网络抓取活动的表单,如何使用isSet启动提交按钮功能?

这是我的代码:

<form id="startWeb" name="startWeb" method="post" action="webcrawlBM_process.php">
<input type="button" id="startCrawl" action="submit" value="Mula Mengikis" class="gradient-background" onClick="submitForm();" style="width: 230px" />

当用户点击提交时,将启动一个javascript函数。

function submitForm(action)
{
    document.getElementById('startWeb').action = action;
    document.getElementById('startWeb').submit();
    alert('Data anda telah disimpan!  Anda akan dihalakan kembali ke halaman utama.');
    window.location = 'index.php';
}

这里我的isset功能有问题。

if(isset($ _ POST [&#39; submit&#39;])){     $ webcrawl = new WebCrawlerBM($ _ POST [&#39; target_url&#39;]);

if ($webcrawl->WebCrawlerBM($_POST['target_url'])) {
if ($webcrawl->submitForm()) {
    $webcrawl->set_webpage($url);
    $webcrawl->set_makefile($text); 
    $webcrawl->set_writefile($filename);
    $webcrawl->set_striphtmltags($text);

    echo "Your action had been completed successfully.  <br>";
} 

情况是,当我点击时,没有任何反应。

0 个答案:

没有答案