I'm currently developing a form for web scraping activities, how can i initiate the submit button function using isSet?
here's my code:
<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" />
when the user clicks on submit, a javascript function will initiate.
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';
}
here's my isset function that is problematic.
if (isset($_POST['submit'])) { $webcrawl = new WebCrawlerBM($_POST['target_url']);
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>";
}
The situation is that when i click, nothing happens.