Jumat, 16 Agustus 2013

PHP Indonesia - Facebook: Tanya.. Saya punya code HTML yang kalau diklik man...

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
Online retail made easy.

With everything you need to start selling online today, Shopify is perfect for beginners & experts alike, providing a complete solution to create your online store.
From our sponsors
Tanya.. Saya punya code HTML yang kalau diklik man...
Aug 16th 2013, 15:41, by Fi Nofriani

Fi Nofriani 3:41pm Aug 16
Tanya..
Saya punya code HTML yang kalau diklik manggil fungsi JS begini:
function positif(obj) {
var url = obj.parentNode.valueOf('href');
var nama = obj.parentNode.innerText;
alert(url);
jq("#page_hasil .examples #quote p").load("retrain/pos.php?url=" + url + "&nama=" + nama);
//var pos = <?php echo base_url() ?>.'retrain/pos.php';
//$("#quote p").load(pos + "?url=" + url + "&nama=" + nama);
}

isi pos.php:
<?php

session_start();
header("Cache-Control: no-cache");

$url = $_GET["url"];
$nama = $_GET["nama"]; //ambil langsung
$nama2 = str_replace(str_split('\\/:*?"<>|()'), '', $nama);

$file = '../cat/statistika/' . $nama2 . '.txt';
if (isset($_SESSION['username'])) {
if (!file_exists($file)) {
include_once '../classifier_retrain/classifier.php';
include_once '../classifier_retrain/trainer.php';

$current = file_get_contents($url);
$current2 = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $current);
$current3 = preg_replace('#<style(.*?)>(.*?)</style>#is', '', $current2);

$current4 = strip_tags($current3);

$tr = new trainer();
$arr = array('statistika', 'nonstatistika');
$tr->makeCategory($arr);
$cl = new classifier();
$text = $current2;

$result = $cl->classifyText($text);
if ($result == 'statistika') {
file_put_contents($file, $current4);
echo "Rated positive, Thanks for your response!";
} else {
echo "Rating failed";
}
} else {
echo "The file already exist.";
}
} else {
echo "You must <a href='http://localhost/mpsn/pengguna'>login</a> to rate.";
}
?>

Sebenarnya script-nya bisa kerja, tapi saya ingin ada tanda "Loading..." selagi script-nya sedang di-run.
Itu kan taro echo "loading"; flush();
Naronya di sebelah mana ya?
Makasih..

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar