ওয়ার্ডপ্রেস ইন্সটল/ আনজিপ স্ক্রিপ্ট পিএইচপিতে

অনেক সময় সার্ভারে ফাইল আনজিপ করা নিয়ে নানা সমস্যা হয় , বিশেষত ফ্রি হোস্টে। তাই এই কোড/স্ক্রিপ্ট টা লিখলাম।

এটা যা পাচ্ছেনঃ

  • ১.ফাইল আপলোডের ব্যবস্থা।
  • ২.ফাইল আনজিপ করার ব্যবস্থা।
  • ৩.সরাসরি ওয়ার্ডপ্রেস ইন্সটল/ আনজিপ করার ব্যবস্থা।

http://dl.dropbox.com/u/70329289/wordpress/untitled.PNG

সোর্স কোডঃ


<html>
<head>
<title>Unzip Script By Saiful</title>
</head>
<body>
<center><h1>PHP Unzip & WordPress Installer Script</h1>
<h2>Please <a href="?del=1">Delete</a> This File After Use</h2></center>
<form type="GET" action="">
<table>
<tr><td>Zip Fize Name:</td><td><input type="text" name="filename"></td></tr><br>
<tr><td>Extract Path:</td><td><input type="text" name="path" value="<?php $ext=dirname(__FILE__); echo $ext. "\\";?>"></td></tr><br>
<tr><td></td><td><input type="submit" name="submit" value="Unzip File"></td></tr>
</table>
</form>
<hr>
<form method="POST" action="" enctype="multipart/form-data">
<input type="file" name="image">
<input type="Submit" name="up" value="Upload"></form>
<?php
//wordpress v info

$file = fopen("http://dl.dropbox.com/u/70329289/wordpress/v.txt", "r");
$msg = array();
while (!feof($file)) {
$msg[] = fgets($file);
}
fclose($file);

?>
<?php
//file Upload Script
if(isset($_POST['up'])){
$filedir = "";
$maxfile = '2000000';
$userfile_name = $_FILES['image']['name'];
$userfile_tmp = $_FILES['image']['tmp_name'];
if (isset($_FILES['image']['name'])) {
$abod = $filedir.$userfile_name;
@move_uploaded_file($userfile_tmp, $abod);
echo"<center><b>Done ==> <a href=\"$userfile_name\" target=\"_blink\">$userfile_name</a></b>";

}} ?>
<hr>
<a href="?act=1">Download & Extract WordPress</a> (<?php echo $msg['0']; echo "Last Update On: "; echo $msg['1'];?>)
<hr>
Files In This Folder<br>
6 down vote

<?php
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator('.')) as $filename)
{
echo "$filename<br>";
}
?>

<hr>
<center>??? ??????????? ?? ?????? ???????? ??? ??? ??? ????? '[email protected]' ???? ???? ??????</center><br>

<?php
//unzip
if(isset($_GET['submit'])){
$file_dir=$_GET['path'];
$zip_file=$_GET['filename'];
$zip = new ZipArchive;
$res = $zip->open("$zip_file");
if ($res === TRUE) {
$zip->extractTo("$file_dir");
$zip->close();
echo 'Done!';
} else {
echo 'Ops!';
}
}
?>

<?php
if(isset($_GET['act'])){
//download WordPress Form Server
$url="http://dl.dropbox.com/u/70329289/wordpress/wordpress.zip";
$file="wordpress.zip";
if(file_put_contents("$file", file_get_contents("$url"))){echo "Wordpress Downloded<br>";}
else {echo "Failed"; }
//unzip file
$ext=dirname(__FILE__);
$zip = new ZipArchive;
$res = $zip->open('wordpress.zip');
if ($res === TRUE) {
$zip->extractTo("$ext/");
$zip->close();
echo 'Extract Done!';
} else {
echo 'Ops!';
}
}
?>
<?php
if(isset($_GET['del'])){
$currentFile = basename($_SERVER['PHP_SELF']);
if(unlink("$currentFile")){echo "<br>DELETED"; }
else { echo " Delete Manually";}
}
?>
<br><center>Php Code By Saiful Islam</font>
</body>
</html>

ডাউনলোড

Level 0

আমি সাইফুল ইসলাম। বিশ্বের সর্ববৃহৎ বিজ্ঞান ও প্রযুক্তির সৌশল নেটওয়ার্ক - টেকটিউনস এ আমি 11 বছর 6 মাস যাবৎ যুক্ত আছি। টেকটিউনস আমি এ পর্যন্ত 12 টি টিউন ও 71 টি টিউমেন্ট করেছি। টেকটিউনসে আমার 0 ফলোয়ার আছে এবং আমি টেকটিউনসে 0 টিউনারকে ফলো করি।


টিউনস


আরও টিউনস


টিউনারের আরও টিউনস


টিউমেন্টস

Level 0

আমার ফোরামে আপনার স্ক্রীপ্ট কাজ করবে কি?
http://www.kazirhut.com

    Level 0

    @kazirhut:
    কাজ করার কথা , যেকোন সারভারে এটা কাজ করার কথা।

      Level 0

      আপনার টাতো ফোরাম , আপনি আনজিপ এর ব্যবহার করতে পারবেন আর ফাইল আপলোড করতে পারবেন ।

Kajer script.Jotil hoica.Ei matro test korlam.Thanks for share…Acha bro,upnar kache ke server thake server a file transfer korar kono script acha?thakle please share korun. [email protected]

Level 0

আপনাকে যেটা দিয়েছি সেটা হল ফাইল ডাউনলোড এর স্ক্রিপ্ট/ ফাংশন , এটার সাথে আপনি ফর্ম ব্যবহার করতে পারেন। আর আমি সময় পেলে করে দিব।

Level 0
<form method="POST" action="">
File URL:<input type="text" name="url"><br>
File Name:<input type="text" name="name"><br>
<input type="Submit" name="dlo" value="Download">
</form>
<?php
if(isset($_POST['dlo'])){
$url=$_POST['url'];
$file=$_POST['name'];
if(file_put_contents(“$file”, file_get_contents(“$url”))){echo “File Downloded”;}
else {echo “Failed”; }
}
?>