educratsweb logo


Php code example for login 

 

 

Login.php

Create a login.php file where you take input user name and password as shown the figure.

<?php

include("config.php");

session_start();

if($_SERVER["REQUEST_METHOD"] == "POST")

{

// username and password sent from form

$myusername=addslashes($_POST['adminuser']);

$mypassword=addslashes($_POST['adminpass']);

$sql="SELECT * FROM admin WHERE adminuser='$myusername' and adminpass='$mypassword'";

$result=mysql_query($sql);

$row=mysql_fetch_array($result);

$active=$row['active'];

$count=mysql_num_rows($result);

// If result matched $myusername and $mypassword, table row must be 1 row

if($count==1)

{

session_register("myusername");

$_SESSION['login_adminuser']=$myusername;

header("location: index.php");

}

else

{

$error="Your Login Name or Password is invalid";

}

}

?>

<h2>Login</h2>

<form action="" method="post">

  <label>UserName  : </label>

  <br />

  <input type="text" name="adminuser" id="txtbox"/>

  <br />

  <br />

  <label>Password  : </label>

  <br />

  <input type="password" name="adminpass" class="box" id="txtbox" />

  <br/>

  <br />

  <input type="submit" value=" Submit " id="btn"/>

  <br />

</form>

<div style="font-size:11px; color:#cc0000; margin-top:10px"><?php echo $error; ?></div>

</div>

 

Config.php

 

Create a configuration file through you connect the mysql databse or any other configuration.

<?php

$mysql_hostname = "localhost";

$mysql_user = "your username ";

$mysql_password = "your password";

$mysql_database = "Your database";

$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Opps some thing went wrong");

mysql_select_db($mysql_database, $bd) or die("Opps some thing went wrong");

?>

 

lock.php

 

<?php

include('config.php');

session_start();

$user_check=$_SESSION['login_adminuser'];

//$ses_sql=mysql_query("select empuser from employeelogin where empuser='$user_check' ");

//$row=mysql_fetch_array($ses_sql);

$login_admin_session=$user_check;

if(!isset($login_admin_session))

{

header("Location: login.php");

}

?>

 

index.php

 

after successful login this is your secure page.

<?php

include('lock.php');

?>

<h2>WELCOME in Login Portal</h2> | <a href=’logout.php’>Logo out</a>

 

logout.php

after successful login this is your secure page.

<?php

session_start();

if(session_destroy())

{

header("Location: login.php");

}

?>

 

 

Database Structure

Table name : admin

CREATE TABLE `admin` (

  `adminuser` varchar(20) NOT NULL default '',

  `adminpass` varchar(20) NOT NULL default '',

  PRIMARY KEY  (`adminuser`),

  UNIQUE KEY `adminpass` (`adminpass`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;

 

 

This is a sample login page. You can modify or use it for your project.

educratsweb.com

Posted by: educratsweb.com

I am owner of this website and bharatpages.in . I Love blogging and Enjoy to listening old song. ....
Enjoy this Author Blog/Website visit http://twitter.com/bharatpages

if you have any information regarding Job, Study Material or any other information related to career. you can Post your article on our website. Click here to Register & Share your contents.
For Advertisment or any query email us at educratsweb@gmail.com

RELATED POST
1. Department of Science & Technology is having three binational Centres
Presently the Department of Science & Technology, Govt. of India is having three binationalCentres namely Indo-French Centre for Promotional of Advanced Research (IFCPAR)established with France in 1987, Indo-US Science & Technology Forum (IUSSTF) established in2000 with USA and Indo-German Science & Technology Centre (IGSTC) established in 2010under inter-governmental agreements. During last three years, the following new programmes have been launched by these binationalCentres:
2. 11 Digital Education Tools For Teachers And Students
The Most Popular Digital Education Tools For Teachers And Learners Hundreds of digital education tools have been created with the purpose of giving autonomy to the student, improving the administration of academic processes, encouraging collaboration, and facilitating communication
3. Private Sector Participation in Space Sector
Government has created Indian National Space, Promotion &Authorization Centre (INSPACe), under Department of Space to encourage, promote and hand hold the private sector for their participation in Space Sector. Private players will also be able to use ISRO infrastructure through INSPACe.The decision of Government was conveyed to the Members of the scientific community elaborately, and scientific community welcomed the Government decision. The role of New Space India Limited (NSIL) in the po
4. Rajya Sabha passes Indian Institutes of Information Technology Laws (Amendment) Bill, 2020 today
Rajya Sabha passed Indian Institutes of Information Technology Laws (Amendment) Bill, 2020 in New Delhi today. The Indian Institutes of Information Technology Act of 2014 and Indian Institutes of Information Technology (Public-Private Partnership) Act, 2017 are the unique initiatives of the Government of India to impart knowledge in the field of Information Technology to provide solutions to the challenges faced by the country.The Indian Institutes of Information Technology Laws (Amendment) Bill, 2020 wa
5. Get Ready to Learn RPA Blue Prism
We are living in the midst of a digital era. Technology can enable us to  automate  business processes using Artificial Intelligence (AI) and software rather than people, wherever possible. A technology for this purpose is Robotic Process Automation (RPA). RPA can have a transformative impact on organizations by lowering costs, increasing reliability, and executing quickly. It can also let IT
6. Tips when hiring a software development company
In an increasingly competitive market, the software and app development company is beginning to be in high demand. New technologies are the future. Society lives surrounded by all kinds of smart devices. As a result of this need, every day more people want to have their own app and/or software. When you have the development of an app or software in mind, you must take a series of steps so that this project ends up being a reality. The first is to think about subcontracting a co
7. Government is implementing several schemes to encourage students/youth of the country towards the field of science and technology: Dr. Harsh Vardhan
It has been a part of Government’s Science and Technology (S&T) policy toencourage the students/youth of the country towards the field of science and technology. The first three key elements of Science, Technology, and Innovation (STI) Policy of 2013 Are: Promoting the spread of scientific temper amongst all sections of society. Enhancing skill for applications of science among the young from all social strata. Making careers in scienc
8. Workshop to mark 20 years of Himalayan Chandra Telescope to highlight the science it produced
In the cold, dry desert of Ladakh, 4500 meters above the mean sea level, for two decades, the 2-m diameter optical-infrared Himalayan Chandra Telescope (HCT) at the Indian Astronomical Observatory (IAO) has been scanning the night sky in search of stellar explosions, comets, asteroids, and exo-planets. The telescope remotely operated using a dedicated satellite communication link from the Centre for Research & Education in Science & Technology (CREST), Indian I
9. 321 Free Tools for Teachers - Free Educational Technology
Jacob Lund/Shutterstock.com Free Educational Technology for Teachers Do you support Free Technology for Teachers? If Yes, I highly encourage you to share this Free Educational Technology Reso
10. National GIS-Enabled Land Bank System
Government has integrated Industrial Information System (IIS) portal with the GIS System of six States in first phase to provide updates on land availability and plot level information to investors anywhere in the world on real time basis and help them make informed decisions.   For the development of National Land Bank, Government intends to solicit the details of industrial land with plot level information, connectivity thereto, basic facilities, other facilities available and
11. From Touchless Soap & Water Dispenser, Mechanical Ventilator to Pioneering E-classroom Software or Low-cost Rapid Diagnostic Device and Innovating Air Providing Virus Destroying Mask, Covid 19 has forced Scientists to Seek for Fastest Innovations to Survive, Opine Researchers
Miss Digantika Bose studies in Class XII at Memari V M Institution Unit II, Burdwan. But in her tender age she is very much influenced by the principle of Thomas Alva Edison that ‘To invent, you need a good imagination and a pile of junk’. And as the proverb goes, Necessity is the mother of invention, Digantika has felt the utter helpless- ness of common people in the wake of Covid 19 pandemic to survive and has come up with Air Providing and Virus Destroying Mask which has received the accla
12. Indian Astronomers discover one of the farthest Star galaxies in the universe.
As a landmark achievement in Space missions, Indian Astronomers have discovered one of the farthest Star galaxies in the universe.
13. Tata Motors Limited to supply 150 Nexon XZ+ electric compact SUVs & Hyundai Motor India Ltd. to supply 100 units of its Kona electric Premium SUVs
Energy Efficiency Services Limited (EESL), a Super Energy Service Company (ESCO) under the administrative control of Ministry of Power, Government of India, will procure 250 electric vehicles from Tata Motors and Hyundai Motor India. The companies were selected through an international competitive bidding process, which was aimed at increased participation. Tata Motors Limited and Hyundai Motor I
14. Science, Technology and Innovation Policy, 2020
Science, Technology and Innovation Policy, 2020 Science, Technology and Innovation Policy, 2020 Introduction As India and the world reorient in the wake of the COVID-19 crisis, a landmark policy initiative has been flagged by the Government of India. The Science, Technology and Innovation Poli
15. Vaishwik Bharatiya Vaigyanik Summit
Vaishwik Bharatiya Vaigyanik Summit Over the years, India has been able to develop a strong educations system, research institutes, industrial base to utilise the potential of its scientists and academicians. The vast talent pool of India and its resources has been instrumental in driving the development of country. To reach newer heights, Vai
16. Study showing stars of varied ages can co-exist in open clusters, provides clue to stellar evolution in the Milky Way Galaxy
Study showing stars of varied ages can co-exist in open clusters, provides clue to stellar evolution in the Milky Way Galaxy Stars in our Galaxy are formed from the molecular clouds present in the Galaxy. It is believed that the majority of stars in our Galaxy are formed in the star clusters making them important clues to understand the star formation mechanism. Open star clusters are a system of stars bound by gravity in which stars are born from the same molecular clouds. All the stars in a
17. IACS Kolkata INSPIRE faculty’s work on Black Holes and Gravitational Waves to help understanding fundamentals of our nature
IACS Kolkata INSPIRE faculty’s work on Black Holes and Gravitational Waves to help understanding fundamentals of our nature Dr. Sumanta Chakraborty from School of Physical Sciences and School of Mathematical and Computational Sciences at the Indian Association for the Cultivation of Science (IACS) Kolkata, a recipient of the INSPIRE faculty award instituted by the Department of Science & Technology, Govt of India has provided new ways to look into the thermodynamic properties of bla
18. Detection of fluorine in hot Extreme Helium Stars solves their evolution mystery
Detection of fluorine in hot Extreme Helium Stars solves their evolution mystery An extreme helium star or EHe is a low-mass supergiant that is almost devoid of hydrogen, the most common chemical element of the universe. There are 21 of them detected so far in our galaxy. T
19. NCSTC, DST in association with Vigyan Prasar organized watching of Solar Eclipse live with solar filter spectacles in the campus
NCSTC, DST in association with Vigyan Prasar organized watching of Solar Eclipse live with solar filter spectacles in the campus The National Council for Science & Technology Communication (NCSTC), Department of Science & Technology (DST) in association with Vigyan Prasar organized watching of Solar Eclipse live with solar filter spectacles on 21 June Sunday in the campus of the department. Children, women, scientists, and other officials and staff members enjoyed watching the spectac
20. स्वदेशी Microprocessor Challenge - Innovate Solutions for #आत्मनिर्भर भारत
स्वदेशी Microprocessor Challenge - Innovate Solutions for #आत्मनिर्भर भारत Background of स्वदेशी Microprocessor Challenge Under #AatmaNibharBharat Abhiyan, there is a growing need for Swadeshi Compute Hardware, that shall be part of every Smart Device deployed in different
21. IMD Weather Services VIA UMANG Mobile App
The UMANG mobile app (Unified Mobile Application for New-age Governance)  is a Government of India all-in-one single, unified, secure, multi-channel, multi-platform, multi-lingual, multi-service mobile app, powered by a robust back-end platform providing access to high impact services of various organizations (Central and State).  Prime Minister of India launched the UMANG App in 2
22. Chinese hackers attempt over 40,000 cyber-attacks in 5 days on India: Maha Police
Chinese hackers attempt over 40,000 cyber-attacks in 5 days on India: Maha Police @DGPMaharashtra Maharashtra Police has said that Chinese hackers have attempted over 40,000 cyber-attacks on India's Information Technology infrastructure and banking sector during the past five days. Special Inspector General of Police (Cyber Wing) Yasha
23. 7 services hosted on http://mausam.imd.gov.in web site of IMD have been onboarded to UMANG Application
7 services hosted on http://mausam.imd.gov.in web site of IMD have been onboarded to UMANG Application   The Unified Mobile Application for New-age Governance (UMANG) has been inaugurated by Dr. M .Rajeevan, Secretary, Ministry of Earth Sciences in the presence of Dr. M Mohapatra DG , IMD and Shri Abhishek Singh , President and CEO of NeGD on today the 22 May,2020 UMANG is a
24. DST-SERB supports study for identification of structure-based potential antivirals against COVID 19
The Science and Engineering Research Board (SERB) underDepartment of Science & Technology (DST) has recently supported a proposed study by Prof. Pravindra Kumar from IIT- Roorkee for identification of structure-based potential antivirals against SARS-CoV2.    The study to be funded under Intensification of Research in High Priority areas (IRHPA) will search for small molecule inhibitors targeting some of the most important viral replication enzymes. These enzymes are vir
25. IT Minister Launches National AI Portal of India- www.ai.gov.in
IT Minister Launches National AI Portal of India-  www.ai.gov.in On the occasion of the first anniversary of the second tenure of the government, the Union Minister for Electronics and IT, Law and Justice and Communications Ravi Shankar Prasad launched India’s national Artificial Intelligence Portal called www.ai.gov.in This portal has been jointly developed by the Ministry of Electronics an
26 Scientist Vacancy Recruitment in SAMEER 2020 #Scientist & Research 15 Days Remaining for Apply
Scientist Vacancy Recruitment in SAMEER 2020 Society for Applied Microwave Electronics Engineering & Research (SAMEER) is a Research & Development under the Ministry of Electronics and Information Technology (MeitY), Government of India. Online application on prescribe ...
27 Recruitment of Assistant Professors Engineering College Vacancy by Bihar PSC 2020 #Bihar 0 Days Remaining for Apply
Recruitment of Assistant Professors Engineering College Vacancy by Bihar PSC 2020 Bihar Public Service Commission (BPSC)  invites Online Applications from Indian Citizens for the recruitment 2020 of following Faculty Sarkari Naukri vacancy posts of  Assistant Professors in various subjects/disciplines for State Engineering Colleges in the state of Bihar for Science and Technology Department of Government of Bihar.  Bihar PSC Assistant Professor of Eng ...
28 बिहार तकनीकी सेवा आयोग | आयुष चिकित्सा पदाधिकारी की नियुक्ति हेतु विज्ञापान #Bihar 24 Days Remaining for Apply
बिहार तकनीकी सेवा आयोग | आयुष चिकित्सा पदाधिकारी की नियुक्ति हेतु विज्ञापान बिहा ...
29 ICMR Scientist-B vacancy Recruitment 2020 #Scientist & Research 2 Days Remaining for Apply
Indian Council of Medical Research (ICMR) under Department of Health Research, Ministry of Health & Family Welfare, Government of India will conduct a computer-based examination on 01/11/2020 for recruitment of various Scientist-B (Medical/Non-Medical) vacancy posts and hence invites online application on prescribed format from Indian nationals for filling up these Government Job Vacancy posts of Scientist-B in various disciplines. (Advertisement No. ICMR/SC-B/2020) ICMR Scientist-B Recruitmen ...
30 UPSC Government Jobs Vacancy Recruitment 10/2020 #UPSC 1 Days Remaining for Apply
Union Public Service Commission (UPSC), Dholpur House, New Delhi invites Online application on prescribed recruitment form by 01/10/2020 for following Sarkari Naukri Government Jobs vacancy posts especially Specialist (Faculty (Assistant Professor) and Assistant Director (Statistics - Census Operations etc. in various Central Government Departments/Organisations in the prescribed online format (Advt. No. 10/2020). UPSC Government Jobs Advt. No. 10/2020 Vacancies ...
31 IFSCA Assistant Manager officer Recruitment 2020 #Sarkari Naukri 0 Days Remaining for Apply
International Financial Services Centres Authority (IFSCA), a statutory unified regulatory body under the Department of Economic Affairs, Ministry of Finance, Government of India is conducting a one-time special recruitment drive for the recruitment of Sarkari Naukri Vacancy posts of Assistant Managers (Officer Grade 'A') from amongst candidates appeared in the Interview of Civil Services Examination - 2019 (Main and Interview) conducted by the Union Public Service Commission (UPSC). (Advertiseme ...
32 State Bank of India (SBI) has advertised vacancies for recruitment of Specialist Cadre Officers on a regular basis for its various requirements and activities #Bank 8 Days Remaining for Apply
 State Bank of India (SBI) has advertised vacancies for recruitment of Specialist Cadre Officers on a regular basis for its various requirements and activities Central Recruitment & Promotion Department (CRPD) of State Bank of India (SBI) invites online recruitment application forms from Indian citizens for appointment of f ...
33 Sardar Vallabhbhai Patel University of Agriculture & Technology (SVPUAT), Meerut (Uttar Pradesh) requires Faculty for its various academic Institutes and colleges under Faculty vacancy recruitment 2020. #Faculty & Teaching 14 Days Remaining for Apply
Sardar Vallabhbhai Patel University of Agriculture & Technology (SVPUAT), Meerut (Uttar Pradesh) requires Faculty for its various academic Institutes and colleges under Faculty vacancy recruitment 2020. IIT Kharagpur invites application on prescribed format from Indian Nationals possessing excellent academic background a ...
34 Indian Institute of Technology (IIT) Kharagpur (West Bengal) requires Faculty for its various academic units under Faculty vacancy recruitment 2020. #Faculty & Teaching 7 Days Remaining for Apply
Faculty Vacancy Recruitment in IIT Kharagpur 2020 Indian Institute of Technology (IIT) Kharagpur (West Bengal) requires Faculty for its various academic units under Faculty vacancy recruitment 2020. IIT Kharagpur invites online application from Indian Nationals, NRI and OCI possessing excellent academic background, commitment to top quality teaching and proven credentials for carrying out outstanding research and development for various teaching Departments/Centres/ ...
35 Recruitment of Engineering Professionals in Rites Limited 2020 #Engineering 13 Days Remaining for Apply
Recruitment of Engineering Professionals in Rites Limited 2020 Rites Limited invites online application for the recruitment of the following Govt. Naukri job vacancy of dynamic and hardworking Engineering Professionals in various Engineering disciplines and at various levels (Advt. No. 06-13/2020) on a regular/contract basis in rites Limited. SarkariNaukriBlog dot com ...
36 Recruitment of Engineering Professionals in Rites Limited 2020 #Engineering 13 Days Remaining for Apply
Recruitment of Engineering Professionals in Rites Limited 2020 Rites Limited invites online application for the recruitment of the following Govt. Naukri job vacancy of dynamic and hardworking Engineering Professionals in various Engineering disciplines and at various levels (Advt. No. 06-13/2020) on a regular/contract basis in rites Limited. ...
37 Research Officer Recruitment in IOCL R&D Centre Faridabad #Jobs 23 Days Remaining for Apply
 Research Officer Recruitment in IOCL R&D Centre Faridabad IOCL-Research Officer Recruitment 2020 Indian Oil Corporation Limited (IOCL), has its Research and Development (R&D) Centre at Faridabad near Delhi. Indian Oil R&D Centre Faridabad is looking for energetic and dedicated PhDs for recruitment as Research Officer/Research Manager in the R&D Centre in various research areas. IOC R&D centre invites online application on prescribed format ...
38 Recruitment of Junior Engineer (Civil) in Public Health Engineering Department, Govt of Bihar #Bihar 15 Days Remaining for Apply
Recruitment of Junior Engineer (Civil) in Public Health Engineering Department, Govt of BiharRecruitment of Junior Engineer (Civil) in Public Health Engineering Department, Govt of Bihar Total Post - 288 ...
39 Online application of Various Post in Public Health Engineering Department, Govt of Bihar #Bihar 5 Days Remaining for Apply
Online application of Various Post in Public Health Engineering Department, Govt of BiharOnline application of  Various Post in Public Health Engineering Department, Govt of Bihar Application invited from the eligible candidate for the following three posts. 1. State Project Manager ...
40 Simulatala Awasiya Vidyalaya Class 6 Admissions 2021: Registration process begins on Sept 25, check schedule here #Admission 5 Days Remaining for Apply
Simultala Awasiya Vidyalaya Admission 2021-22: – Hello friends, If you were wating for Simultala School Admission 2021 then there is ggod news for you all. SAV Admission online form has been delcared and we have shared all the details related to it. You can fill the onlie form from the official website and the step by step information we are shareing below. Bihar School Examination Board, Patna hsa released notce for Simultala Residential School (SAV) Entrance Exam. Online app ...
41 Sarkari Naukri Vacancy Recruitment by Himachal Pradesh SSC Advt. No. 36-3/2020 #Himachal Pradesh 3 Days Remaining for Apply
 Sarkari Naukri Vacancy Recruitment by Himachal Pradesh SSC Advt. No. 36-3/2020 Himachal Pradesh Staff Selection Commission (HP SSC), Hamirpur (HP) invites online applications on the prescribed format for the following various Sarkari Naukri vacancy posts in various departments/ organisations in Himachal Pradesh Government by HPSSC (Advertisement No. 36-3/2020) by eligible candidates. Government Jobs by Himachal Pradesh HP SSC     ...
42 Sarkari Naukri Vacancy Recruitment by Himachal Pradesh SSC Advt. No. 36-3/2020 #Himachal Pradesh 3 Days Remaining for Apply
 Sarkari Naukri Vacancy Recruitment by Himachal Pradesh SSC Advt. No. 36-3/2020 Himachal Pradesh Staff Selection Commission (HP SSC), Hamirpur (HP) invites online applications on the prescribed format for the following various Sarkari Naukri vacancy posts in various departments/ organisations in Himachal Pradesh Government by HPSSC (Advertisement No. 36-3/2020) by eligible candidates. ...
We would love to hear your thoughts, concerns or problems with anything so we can improve our website educratsweb.com ! visit https://forms.gle/jDz4fFqXuvSfQmUC9 and submit your valuable feedback.
Save this page as PDF | Recommend to your Friends

http://educratsweb(dot)com http://www.educratsweb.com/content.php?id=58 http://educratsweb.com educratsweb.com educratsweb