الانتقال إلى المحتوى
View in the app

A better way to browse. Learn more.

مجموعة مستخدمي أوراكل العربية

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Need some help in the login form

Featured Replies

بتاريخ:

can any one help me with correcting the code or can any one give me another code for using it in the login form.
this is my problem:-

i had make a login form using in oracle 9i form builder >>>in this form i have three text boxes one for intering user name and the second one for entering the password and the third text box is not visible and it is used for counting the tries.

In addition i have a three buttons , one is for login and the two others are not visible and they are a show main menu button and a exit button. For login button i had put a WHEN-BUTTON-PRESSED trigger in the login button and it must check if the user name and the password match what it is on the login table so it allow the user to see the show main menu button otherwise if the user name or the password are wrong and has been putted wrong for 3 times of trying then it will show the exit button.
and this is a picture of the login form in the design view.
http://www.al7loh.com/uploader/uploads/login.JPG
and this is the code for theWHEN-BUTTON-PRESSED trigger on the login button.
_________

declare
alertNum number;
dummy1 tbl_login.USER_NAME%type;
dummy2 tbl_login.PASSWORD%type;

begin
select tbl_login.USER_NAME into dummy1 from tbl_login where tbl_login.USER_NAME = :LOGIN.USER_NAME ;
select tbl_login.PASSWORD into dummy2 from tbl_login where tbl_login.PASSWORD = :LOGIN.PASSWORD ;
if :LOGIN.TRIES<3 then
if sql% found
then
set_item_property('LOGIN.SHOW_MENU', visible, property_true);
set_item_property('LOGIN.SHOW_MENU', enabled, property_true);

else
message ('Invalid password....try again');
:LOGIN.TRIES := :LOGIN.TRIES+1;
:LOGIN.USER_NAME := null;
:LOGIN.PASSWORD := null;


end if;

else
message ('Exceeded Number of tries..press exit button');
set_item_property('LOGIN.EXIT', visible, property_true);
set_item_property('LOGIN.EXIT', enabled, property_true);
end if;

end;
___________


can any one help me correcting the code of the WHEN-BUTTON-PRESSED trigger on the login form or can any one give me another code for using it in the login form.

i hope to get some help from the experts>>>

بتاريخ:

اخي الكريم
بالبداية يوجد بالكود عندك 3 أخطاء :
1- يوجد فراغ بين sql% found و الصحيح هو : sql%found
2- التعبير : if :LOGIN.TRIES<3 then ليس له معني لسبب أن قيمة :LOGIN.TRIES هي بالبداية null
لذلك لاتقارن قيمة null مع أي شيء لذلك الصحيح هو كتابة if nvl(:LOGIN.TRIES,0)<3 then
3- نفس الأمر بالنسبة لـ :LOGIN.TRIES := :LOGIN.TRIES+1; الصحيح هو كتابة
LOGIN.TRIES := nvl(:LOGIN.TRIES,0)+1;
بالإضافة أنه لديك حقل بجدول اسمه password أفضل تغيير اسمه لـ password1 مثلا أعتقد أنا كلمة محجوزة لكن الغريب أنه
تم قبولها بانشاء الجدول .. !!
المهم جرب صحح هذه الأمور إذا مامشي الحال خبرنا لأبعتلك كود صحيح غير الكود الذي كتبته لتنفيذ هذه العملية .
وخبرنا شو بصير معك على كل الأحوال .

بتاريخ:

First you are inneed for a program unit, preferd stored in the DB, to check on the user_name and the password.
consider the following:-
-the user name should be unique.
-the user will try for 3 times.
so let us create a package which will handel what we need:
CREATE OR REPLACE PACKAGE user_app
IS
FUNCTION allowed (user_name_in IN <user_name>%type
,pass_word_in IN <pass_word%type>) RETURN BOOLEAN;
END user_app;
/
show error;

CREATE OR REPLACE PACKAGE BODY user_app
IS
FUNCTION allowed (user_name_in IN <user_name>%type
,pass_word_in IN <pass_word%type>) RETURN BOOLEAN
IS
retval BOOLEAN := false;
exi INTEGER ;
BEGIN
SELECT 1
INTO exi
FROM <log_in_tab>
WHERE upper(user_name) = upper (user_name_in)
AND upper(pass_word) = upper(pass_word_in);
IF exi = 1
THEN
retval := TRUE;
END IF;
RETURN retval;
EXCEPTION
WHEN no_data_found
THEN
RETURN FALSE;
END allowed;
END user_app;
/
show error;

Now we are redy to use our function :
to insure the log in information is correct in the trigger we will write:-
IF user_app.allowed(:user_name,:pass_word)
THEN
-- DO ANY THING
ELSIF NOT user_app.allowed(:user_name,:pass_word)
THEN
:GLOBAL.tries := :GLOBAL.tries + 1;
IF :GLOBAL.tries = 3
THEN
-- DO ANY THING
END IF;
END IF;

BY THE WAY YOU MUST IN THE PRE FORM TRIGGER DECLARE THE GLOBAL VARIABLE LIKE THIS:
:GLOBAL.tries:= 1;

i hop it work.
with best wishes.

بتاريخ:
  • كاتب الموضوع
اخي الكريم
بالبداية يوجد بالكود عندك 3 أخطاء :

54207[/snapback]



still the code does not work
please help me fixing it
بتاريخ:
  • كاتب الموضوع

أرجو المساعدة من الاخوة باسرع وقت ممكن
the code does not do these steps

___________________
else
message ('Invalid password....try again');
:LOGIN.TRIES := :LOGIN.TRIES+1;
:LOGIN.USER_NAME := null;
:LOGIN.PASSWORD := null;


end if;

else
message ('Exceeded Number of tries..press exit button');
set_item_property('LOGIN.EXIT', visible, property_true);
set_item_property('LOGIN.EXIT', enabled, property_true);
end if;

end;
_____________
can u tell me ur is the problem with my code
please!!!

بتاريخ:
  • كاتب الموضوع
أرجو المساعدة من الاخوة باسرع وقت ممكن
the code does not do these steps

___________________
else
message ('Invalid password....try again');
:LOGIN.TRIES := :LOGIN.TRIES+1;
:LOGIN.USER_NAME := null;
:LOGIN.PASSWORD := null;


end if;

else
message ('Exceeded Number of tries..press exit button');
set_item_property('LOGIN.EXIT', visible, property_true);
set_item_property('LOGIN.EXIT', enabled, property_true);
end if;

end;
_____________
can u tell me ur is the problem with my code
please!!!

54350[/snapback]



????????
ارجو المساعدة لو سمحتم يا خبراء الاوراكل ................؟!؟!!؟؟!؟!
بتاريخ:
  • كاتب الموضوع

وين الجماعة ....؟؟؟؟
وين مستخدمي أوراكل العرب....؟؟؟ أرجوووووكم ساعدوني بالكود......!!!!؟!؟!؟!؟!

بتاريخ:
  • كاتب الموضوع

وين الجماعة ....؟؟؟؟
وين مستخدمي أوراكل العرب....؟؟؟ أرجوووووكم ساعدوني بالكود......!!!!؟!؟!؟!؟!
الظاهر لا حياة لمن تنادي...

  • بعد 3 سنة...
بتاريخ:

declare
alertNum number;
dummy1 tbl_login.USER_NAME%type;
dummy2 tbl_login.PASSWORD%type;

begin
select tbl_login.USER_NAME into dummy1 from tbl_login where tbl_login.USER_NAME = :LOGIN.USER_NAME ;
select tbl_login.PASSWORD into dummy2 from tbl_login where tbl_login.PASSWORD = :LOGIN.PASSWORD ;
if :LOGIN.TRIES<3 then
if sql%found
then
set_item_property('LOGIN.SHOW_MENU', visible, property_true);
set_item_property('LOGIN.SHOW_MENU', enabled, property_true);

elsif
message ('Invalid password....try again');
:LOGIN.TRIES := :LOGIN.TRIES+1;
:LOGIN.USER_NAME := null;
:LOGIN.PASSWORD := null;

elsif
message ('Exceeded Number of tries..press exit button');
set_item_property('LOGIN.EXIT', visible, property_true);
set_item_property('LOGIN.EXIT', enabled, property_true);
end if;

end;
-----------------------
الخطا فى اف واند اف جرب وقولى

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية

Account

Navigation

البحث

إعداد إشعارات المتصفح الفورية

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.