منتديات النخبة
أدوات النخبة :  |  قص الصور  |  تحويل WebP  |  ضغط الصور  |  تغيير الحجم  |  علامة مائية  |  مولد Favicon  |  تحميل مقاطع تيك توك  |  البحث بالمواضيع القديمة
إضافة إهداء drkmoon [ الجنسية : سعودية ] كيف ألومك والخطا ماهو خطاك، الخطا من قلبي اللي دلعك، قلبي اللي كل ما تطلب عطاك وطلعك فوق السحاب ودلعك | شَـــنَــكَــوٍتَ [ الجنسية : كويتي ] شلونكم شخباركم إن شاء الله كلكم تمام | احزان شهرزاد [ الجنسية : إماراتية ] اللهم ارحمها واغفر لها | الــبــيــرق [ الجنسية : سعودي ] اللهم نسألك العفو والعافية | drkmoon [ الجنسية : سعودي ] إخواني الأعزاء، سيتوقف المنتدى غداً السبت لمدة 12 ساعة بسبب تحديثات في السيرفر، ويعاد إن شاء الله فور انتهاء التحديثات، هذا للتنويه

العودة   منتديات النخبة > °o.O ( مـنـتـديــات الـنخـبـة الـعـامـــة ) O.o° > مكتبة النخبة التقنية

مكتبة النخبة التقنية كل ما يخص الإنترنت القديم، والمنتديات، وتطوير المواقع، والاستضافة، والأرشفة والذكاء الاصطناعي

 
 
أدوات الموضوع إبحث في الموضوع تقييم الموضوع انواع عرض الموضوع
  #1  
قديم
admin
من الزمن الجميل
admin admin غير متواجد حالياً
★ ZMZM ★
 
تاريخ التسجيل: Jun 2005
افتراضي مركز تحميل بدون قاعده بيانات وسهل التركيب خفيف ويوجد مثال

السلام عليكم ورحمة الله وبركاتة





أنشئ ملف index.php داخل: up

ونحط الكود كامل داخل ملف index.php

اقتباس:
<?php
$uploadDir = "uploads/";

if (!file_exists($uploadDir)) {
mkdir($uploadDir, 0755, true);
}

$message = "";

if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_FILES['image'])) {
$allowed = array('jpg','jpeg','png','gif');
$fileName = $_FILES['image']['name'];
$tmpName = $_FILES['image']['tmp_name'];
$ext = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));

if (in_array($ext, $allowed)) {
$newName = time() . rand(1000,9999) . "." . $ext;
$target = $uploadDir . $newName;

if (move_uploaded_file($tmpName, $target)) {
$url = "https://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/uploads/" . $newName;

$message = '
<div class="success">
تم رفع الصورة بنجاح
<br><br>
الرابط المباشر:
<input type="text" value="'.$url.'" onclick="this.select();">
<br>
كود المنتدى:
<input type="text" value="[IMG]'.$url.'[/IMG]" onclick="this.select();">
</div>';
}
} else {
$message = '<div class="error">الصيغة غير مسموحة، المسموح JPG / PNG / GIF فقط</div>';
}
}
?>
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="utf-8">
<title>مركز تحميل النخبة</title>

<style>
body{
margin:0;
background:#e7dcc6;
font-family:Tahoma, Arial;
font-size:12px;
color:#4b3621;
}

.wrapper{
width:760px;
margin:25px auto;
background:#f8f1df;
border:1px solid #b49b72;
}

.header{
background:#d8c49b;
border-bottom:1px solid #b49b72;
padding:10px;
text-align:center;
}

.header h1{
margin:0;
font-size:24px;
color:#5b3b17;
}

.header span{
display:block;
margin-top:4px;
color:#7a5a2a;
font-weight:bold;
}

.banner{
text-align:center;
padding:12px;
background:#fff8e8;
border-bottom:1px solid #c7ad7d;
}

.banner img{
max-width:468px;
height:auto;
border:0;
}

.nav{
background:#b89458;
color:#fff;
padding:7px;
text-align:center;
font-weight:bold;
}

.nav a{
color:#fff;
text-decoration:none;
margin:0 10px;
}

.box{
margin:18px;
border:1px solid #b49b72;
background:#fffaf0;
}

.box-title{
background:#d8c49b;
padding:8px;
font-weight:bold;
color:#5b3b17;
border-bottom:1px solid #b49b72;
}

.box-content{
padding:20px;
text-align:center;
}

input[type=file]{
background:#fff;
border:1px solid #b49b72;
padding:6px;
width:330px;
}

input[type=submit]{
background:#8b5e23;
color:#fff;
border:1px solid #5b3b17;
padding:7px 28px;
cursorointer;
font-weight:bold;
}

input[type=text]{
width:90%;
margin-top:6px;
direction:ltr;
text-align:left;
padding:6px;
border:1px solid #b49b72;
}

.success{
margin:18px;
padding:12px;
background:#eef8df;
border:1px solid #7ca35c;
color:#2d5b12;
text-align:center;
}

.error{
margin:18px;
padding:12px;
background:#f8dddd;
border:1px solid #a94442;
color:#8a1f1f;
text-align:center;
}

.footer{
text-align:center;
padding:10px;
background:#d8c49b;
border-top:1px solid #b49b72;
color:#5b3b17;
}
</style>
</head>

<body>

<div class="wrapper">

<div class="header">
<h1>مركز تحميل النخبة</h1>
<span>ZMZM.NET Upload Center</span>
</div>

<div class="banner">
<a href="https://zmzm.net/vb">
<img src="banner.gif" alt="منتديات النخبة">
</a>
</div>

<div class="nav">
<a href="https://zmzm.net">الرئيسية</a>
|
<a href="https://zmzm.net/vb">منتديات النخبة</a>
</div>

<?php echo $message; ?>

<div class="box">
<div class="box-title">رفع صورة جديدة</div>
<div class="box-content">
<form method="post" enctype="multipart/form-data">
<p>اختر الصورة من جهازك</p>
<input type="file" name="image" required>
<br><br>
<input type="submit" value="رفع الصورة">
</form>
</div>
</div>

<div class="footer">
مركز تحميل النخبة - لحفظ صور أرشيف منتديات النخبة
</div>

</div>

</body>
</html>
بعدها:

أنشئ مجلد اسمه uploads داخل مجلد up.
أعطه صلاحية 755 أو 775.


افتح:
https://xxxxx.com/up

مثال لمركز التحميل
https://zmzm.net/up


رفع صور للمنتديات, تحميل الصور للمنتديات, صور vBulletin, مركز تحميل عربي مجاني, رفع الصور المتحركة GIF
رد مع اقتباس
 


تعليمات المشاركة
تستطيع إضافة مواضيع جديدة
تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة

الانتقال السريع

مضى على تأسيس شبكة النخبة
منذ 8 يونيو 2004
سنة
شهر
يوم
تطبيق منتديات النخبة
منتديات النخبة
أضف النخبة إلى شاشة جوالك

ZMZM.NET - منتديات النخبة
ذكريات ومواضيع منتديات النخبة
Powered by vBulletin® Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. TranZ By Almuhajir
يرغب منتديات النخبة في الحصول على إذن منك لتمكين الإشعارات.