Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $msg = '';
- $title = '';
- $size = '';
- $definition = '
- اسم اللعبة :
- التصنيف :
- حجم اللعبة :
- تاريخ الاصدار :';
- $direct = '';
- $torrent = '';
- $description = '';
- $instal = '';
- $gameplay = '';
- if (isset($_POST['add_game'])) {
- $title = strip_tags($_POST['title']);
- $size = strip_tags($_POST['size']);
- $game_cate = @implode(', ', @$_POST['game_cate']);
- $definition = strip_tags($_POST['definition']);
- $direct = $_POST['direct'];
- $torrent = $_POST['torrent'];
- $description = strip_tags($_POST['description']);
- $instal = strip_tags($_POST['instal']);
- $gameplay = $_POST['gameplay'];
- $game_date = date("d/m/Y");
- if (empty($title)) {
- $msg = '<div class="alert alert-danger col-md-11" role="alert">أدخل اسم اللعبة</div>';
- }elseif (empty($size)) {
- $msg = '<div class="alert alert-danger col-md-11" role="alert">أدخل حجم اللعبة</div>';
- }elseif (empty($game_cate)) {
- $msg = '<div class="alert alert-danger col-md-11" role="alert">اختر تصنيف اللعبة</div>';
- }else {
- $image = $_FILES['image'];
- $image_name = $image['name'];
- $image_tmp = $image['tmp_name'];
- $image_size = $image['size'];
- $image_error = $image['error'];
- if ($image_name != '') {
- $image_exe = explode('.', $image_name);
- $image_exe = strtolower(end($image_exe));
- $allowd = array('png','jpg','jpeg','gif');
- if (in_array($image_exe , $allowd)) {
- if ($image_error === 0){
- if ($image_size <= 1000000) {
- $new_name = mt_rand(1265873 , 9858412) . '.' . $image_exe ;
- $image_dir = '../images/games/' . $new_name ;
- $image_db = '../images/games/' . $new_name ;
- if (move_uploaded_file($image_tmp, $image_dir)){
- // -------------- This The Code -----------------
- $files = reArrayFiles($_FILES['images']);
- foreach ($files as $file) {
- $images_name = $file['name'];
- $images_tmp = $file['tmp_name'];
- $images_size = $file['size'];
- $images_error = $file['error'];
- if ($images_name != '') {
- $images_exe = strtolower(end(explode('.', $images_name)));
- $allowd = array('png','jpg','jpeg','gif');
- if (in_array($images_exe , $allowd)) {
- if ($images_error === 0){
- if ($images_size <= 1000000) {
- $newName = mt_rand(1265873 , 9858412) . '.' . $images_exe ;
- $images_dir = '../images/games/' . $newName ;
- $images_db = '../images/games/' . $newName ;
- if (move_uploaded_file($images_tmp, $images_dir)){
- $msg = '<div class="alert alert-success col-md-11" role="alert">لم يتم رفع الصور</div>';
- }else {
- $msg = '<div class="alert alert-danger col-md-11" role="alert">لم يتم رفع الصور</div>';
- }
- }else {
- $msg = '<div class="alert alert-danger col-md-11" role="alert">حجم الصور كبير جدا</div>';
- }
- }else {
- $msg = '<div class="alert alert-danger col-md-11" role="alert">حدث خطأ أثناء رفع الصور</div>';
- }
- }else {
- $msg = '<div class="alert alert-danger col-md-11" role="alert">الرجاء اختيار صور صحيحة</div>';
- }
- }else {
- $msg = '<div class="alert alert-danger col-md-11" role="alert">لم تقم برفع الصور</div>';
- }
- }
- // -------------- End The Code -----------------
- }else {
- $msg = '<div class="alert alert-danger col-md-11" role="alert">لم يتم رفع الصورة الرئيسية</div>';
- }
- }else {
- $msg = '<div class="alert alert-danger col-md-11" role="alert">حجم الصورة الرئيسية كبير جدا</div>';
- }
- }else {
- $msg = '<div class="alert alert-danger col-md-11" role="alert">حدث خطأ أثناء رفع الصورة الرئيسية</div>';
- }
- }else {
- $msg = '<div class="alert alert-danger col-md-11" role="alert">الرجاء اختيار صورة صحيحة</div>';
- }
- }else {
- $msg = '<div class="alert alert-danger col-md-11" role="alert">لم تقم برفع الصورة الرئيسية</div>';
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement