Forums
New posts
Search forums
News
Security News
Technology News
Giveaways
Giveaways, Promotions and Contests
Discounts & Deals
Reviews
Users Reviews
Video Reviews
Support
Windows Malware Removal Help & Support
Inactive Support Threads
Mac Malware Removal Help & Support
Mobile Malware Removal Help & Support
Blog
Log in
Register
What's new
Search
Search titles only
By:
Search titles only
By:
Reply to thread
Menu
Install the app
Install
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Guides
Programming Guides & Questions
Verifying user name / password in website with simple python code
Message
<blockquote data-quote="DDE_Server" data-source="post: 875662" data-attributes="member: 65727"><p>hi guys <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite124" alt=":love:" title="Love :love:" loading="lazy" data-shortname=":love:" /><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite124" alt=":love:" title="Love :love:" loading="lazy" data-shortname=":love:" /> ,</p><p>i am beginner in programming but while learning statement/loops/lists in python i coded simple code to check user name/password against stored one as you could see below:</p><p>although it still very very simple but i am feeling happy to accomplish something while (not loop) i am learning:</p><p></p><p>[CODE=python]User_names_database = ['user_name']</p><p>password_database = ['0123456']</p><p>"""prompt user to enter his/her username"""</p><p>entered_user_name = input("Please enter the user name:")</p><p>entered_user_name.title()</p><p>entered_password = input("please enter your password:")</p><p></p><p>"""Check if the entered user name/password existing in the user data base of the website"""</p><p>if entered_user_name == 'user_name' and entered_password == '0123456':</p><p> print('login Successful,you will be shortly redirected to your account page')</p><p>else:</p><p> print('login fail,please try again\nif you cannot remember you should choose forget password below')</p><p> while True:</p><p> entered_user_name = input("Please enter the user name:")</p><p> entered_user_name.title()</p><p> entered_password = input("please enter your password:")</p><p> if entered_user_name == ' user_name' and entered_password == '0123456':</p><p> print('login Successful,you will be shortly redirected to your account page')</p><p>[/CODE]</p><p></p><p>really i know i this is very basic but i am feeling happy </p><p>i think this may be linking with back end database of course with some code scalability to be more dynamic </p><p>so Guys what is your opinion ?? i am happy to know your feedback</p><p><strong>Note:this code is written in python language</strong></p></blockquote><p></p>
[QUOTE="DDE_Server, post: 875662, member: 65727"] hi guys :love::love: , i am beginner in programming but while learning statement/loops/lists in python i coded simple code to check user name/password against stored one as you could see below: although it still very very simple but i am feeling happy to accomplish something while (not loop) i am learning: [CODE=python]User_names_database = ['user_name'] password_database = ['0123456'] """prompt user to enter his/her username""" entered_user_name = input("Please enter the user name:") entered_user_name.title() entered_password = input("please enter your password:") """Check if the entered user name/password existing in the user data base of the website""" if entered_user_name == 'user_name' and entered_password == '0123456': print('login Successful,you will be shortly redirected to your account page') else: print('login fail,please try again\nif you cannot remember you should choose forget password below') while True: entered_user_name = input("Please enter the user name:") entered_user_name.title() entered_password = input("please enter your password:") if entered_user_name == ' user_name' and entered_password == '0123456': print('login Successful,you will be shortly redirected to your account page') [/CODE] really i know i this is very basic but i am feeling happy i think this may be linking with back end database of course with some code scalability to be more dynamic so Guys what is your opinion ?? i am happy to know your feedback [B]Note:this code is written in python language[/B] [/QUOTE]
Insert quotes…
Verification
Post reply
Top