0

I am a newbie php programmer. I m working on a mass cms detector app. app is working good, bt i want to make it faster. heres my app code :

<form method='post' ><center>
    <textarea cols='50' rows='10' name='sites' style="border: 1px dotted #FF0000; " size="32" >
http://www.google.com/
http://wordpress.org/
http://joomla.org/
    </textarea><br><br>
    <input type='submit' name='tepi' value='Check Sites' ><br>

<?php

    if($_POST['tepi']){
    $lol = explode("\r\n",$_POST['sites']);

    foreach ($lol as $lolz){

    $lolz = trim($lolz);

    $joomla = @file_get_contents("$lolz/components/com_content/metadata.xml");

    if($joomla){
     echo "<font color='red' fance='Tahoma' size='4'><a href='$lolz'><font color='red' fance='Tahoma' size='4'>$lolz</font></a> --> is Joomla ! </font><br>";
    }

    $word = @file_get_contents("$lolz/wp-includes/js/quicktags.js");
    if($word){
     echo "<font color='blue' fance='Tahoma' size='4'><a href='$lolz'><font color='blue' fance='Tahoma' size='4'>$lolz</font></a> --> is Wordpress ! </font><br>";
    }

    $vb = @file_get_contents("$lolz/clientscript/vbulletin_ajax_imagereg.js");
    if($vb){

     echo "<font color='black' fance='Tahoma' size='4'><a href='$lolz'><font color='black' fance='Tahoma' size='4'>$lolz</font></a> --> is vbulletin  ! </font><br>";
    }
    }
    }
?>

so this script is scanning 1 by 1. I want something else. i want to post a multiple thread at a time. there will be a option set thread so that i can scan 10-15 site at a time. how can i do that ?

  • PHP is single threaded, there are plugins that can give you process control that add functionality to allow you to emulate threads to a very limited degree. – scragar Jun 10 '14 at 12:31
  • @scragar you need to nuance your comment. You *can* run multiple PHP scripts simultaneously on different threads. – nl-x Jun 10 '14 at 12:32
  • check this out: http://stackoverflow.com/questions/12394027/curl-multi-threading-with-php –  Jun 10 '14 at 12:32
  • 1
    PHP is historically single-threaded (and frankly, given the quality of your average PHP programmer, it's a damn good thing it is). If you really want to try it, i seem to remember a pthreads extension in PECL. But there be dragons. – cHao Jun 10 '14 at 12:33
  • @cHao: that's cruel... pointing someone who clearly still has a lot to learn to pthreads. That's like giving a bottle of scotch to a baby. – Elias Van Ootegem Jun 10 '14 at 12:38
  • @EliasVanOotegem: Drunk babies are hilarious. :) – cHao Jun 10 '14 at 12:39

0 Answers0