اذهب إلى المحتوى

Omar Ammora

الأعضاء
  • المساهمات

    15
  • تاريخ الانضمام

  • تاريخ آخر زيارة

أجوبة بواسطة Omar Ammora

  1. عندما اقوم ببناء التطبيق في اندرويد ستوديو تظهر هذه الرسالة :

    Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
        is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
        Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:29:5-300:19 to override.
     

    ما الحل ؟؟؟؟

  2. بتاريخ 19 ساعات قال Ahmed Charafeddine Meftah:

    إن كنت تريد أن يتم التحقق من صحة الإيميل عبر رابط يتم ارساله الى الإيميل المسجل، كل ما عليك فعله هو : 

    - اضافة حقلين hash و active (الملف المرفق 1)

    active = 0 معناه لم يتم تأكيد الحساب active = 1 تم تأكيد الحساب

    - عند التسجيل يتم توليد كود مميز (hash)  يتم تخزينه في القاعدة الى جانب active = 0

    
    // توليد هاش عشوائي
    $hash = md5( rand(0,999999) );

    - تسجيل العضو :

    
    mysql_query("INSERT INTO users (username, password, email, hash) VALUES(
    '". mysql_escape_string($name) ."', 
    '". mysql_escape_string(md5($password)) ."', 
    '". mysql_escape_string($email) ."', 
    '". mysql_escape_string($hash) ."') ") or die(mysql_error());

    ارسال معلومات التسجيل الى الايميل + رابط التفعيل : 

    
    $to      = $email; 
    $subject = 'Signup | Verification'; 
    $message = '
     
    Thanks for signing up!
    Your account has been created, you can login with the following credentials after you have activated your account by pressing the url below.
     
    ------------------------
    Username: '.$name.'
    Password: '.$password.'
    ------------------------
     
    Please click this link to activate your account:
    http://www.yourwebsite.com/verify.php?email='.$email.'&hash='.$hash.'
     
    ';
                         
    $headers = 'From:noreply@yourwebsite.com' . "\r\n"; 
    mail($to, $subject, $message, $headers);

    - وهكذا عند الضغط على رابط التأكيد : 

    
    mysql_connect("localhost", "tutorial", "password") or die(mysql_error());
    mysql_select_db("registrations") or die(mysql_error());
                 
    if(isset($_GET['email']) && !empty($_GET['email']) AND isset($_GET['hash']) && !empty($_GET['hash'])){
        // Verify data
        $email = mysql_escape_string($_GET['email']);
        $hash = mysql_escape_string($_GET['hash']); 
                     
        $search = mysql_query("SELECT email, hash, active FROM users WHERE email='".$email."' AND hash='".$hash."' AND active='0'") or die(mysql_error()); 
        $match  = mysql_num_rows($search);
                     
        if($match > 0){
            mysql_query("UPDATE users SET active='1' WHERE email='".$email."' AND hash='".$hash."' AND active='0'") or die(mysql_error());
            echo 'تم تفعيل حسابك بنجاح';
        }else{
            echo 'خطأ : لم يتم تفعيل حسابك';
        }
                     
    }else{
        echo 'خطأ ...';
    }

     

    db.jpg

    عذرا اخي هل اضع كود توليد هاش عشوائي ضمن كود تسجيل عضو او انشأ صفحة واضعه فيها وشكراا....

    عذرا اخي هل اضع كود توليد هاش عشوائي ضمن كود تسجيل عضو او انشأ صفحة واضعه فيها وشكراا....

  3. بتاريخ 1 ساعة قال Ahmed Charafeddine Meftah:

    إن كنت تريد أن يتم التحقق من صحة الإيميل عبر رابط يتم ارساله الى الإيميل المسجل، كل ما عليك فعله هو : 

    - اضافة حقلين hash و active (الملف المرفق 1)

    active = 0 معناه لم يتم تأكيد الحساب active = 1 تم تأكيد الحساب

    - عند التسجيل يتم توليد كود مميز (hash)  يتم تخزينه في القاعدة الى جانب active = 0

    
    // توليد هاش عشوائي
    $hash = md5( rand(0,999999) );

    - تسجيل العضو :

    
    mysql_query("INSERT INTO users (username, password, email, hash) VALUES(
    '". mysql_escape_string($name) ."', 
    '". mysql_escape_string(md5($password)) ."', 
    '". mysql_escape_string($email) ."', 
    '". mysql_escape_string($hash) ."') ") or die(mysql_error());

    ارسال معلومات التسجيل الى الايميل + رابط التفعيل : 

    
    $to      = $email; 
    $subject = 'Signup | Verification'; 
    $message = '
     
    Thanks for signing up!
    Your account has been created, you can login with the following credentials after you have activated your account by pressing the url below.
     
    ------------------------
    Username: '.$name.'
    Password: '.$password.'
    ------------------------
     
    Please click this link to activate your account:
    http://www.yourwebsite.com/verify.php?email='.$email.'&hash='.$hash.'
     
    ';
                         
    $headers = 'From:noreply@yourwebsite.com' . "\r\n"; 
    mail($to, $subject, $message, $headers);

    - وهكذا عند الضغط على رابط التأكيد : 

    
    mysql_connect("localhost", "tutorial", "password") or die(mysql_error());
    mysql_select_db("registrations") or die(mysql_error());
                 
    if(isset($_GET['email']) && !empty($_GET['email']) AND isset($_GET['hash']) && !empty($_GET['hash'])){
        // Verify data
        $email = mysql_escape_string($_GET['email']);
        $hash = mysql_escape_string($_GET['hash']); 
                     
        $search = mysql_query("SELECT email, hash, active FROM users WHERE email='".$email."' AND hash='".$hash."' AND active='0'") or die(mysql_error()); 
        $match  = mysql_num_rows($search);
                     
        if($match > 0){
            mysql_query("UPDATE users SET active='1' WHERE email='".$email."' AND hash='".$hash."' AND active='0'") or die(mysql_error());
            echo 'تم تفعيل حسابك بنجاح';
        }else{
            echo 'خطأ : لم يتم تفعيل حسابك';
        }
                     
    }else{
        echo 'خطأ ...';
    }

     

    db.jpg

    شكرا جزيلا سأجرب الطريقة 

     

×
×
  • أضف...