PHP CODE EXAMPLE FOR LOGIN  #EDUCRATSWEB

  • Home
  • Jobs
  • Q&A
  • Register
  • Login

  • 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. I Love blogging and Enjoy to listening old song. ....
    Enjoy this Author Blog/Website visit http://twitter.com/educratsweb

    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. ISMO: India Science Month Online | January 2021 | At your home
    India Science Fest is India’s largest public celebration of science and technology.We strongly feel that India needs to step up its S&T and innovation agenda, in order to keep up its economic progress and social development. The gap between science and society needs to be bridged immediately. ISF endeavors to serve as platform for deeper engagement between scientists, researchers, professionals, entrepreneurs and students. We wish to have the public involved in the latest in science and get all
    2. Mphasis Announces Quantum Computing Framework and Consulting Services
    Mphasis Announces Quantum Computing Framework and Consulting Services   ~ Mphasis offers Quantum-b
    3. Unicode <=> Kruti dev Converter
    कितना भी बड़ा Text टेक्स्ट हो एक साथ संबंधित बॉक्स में पेस्ट कर दें। यह कृतिदेव को यूनिकोड व यूनिकोड को कृतिदेव में बदलेगा। जब आप कन्वर्ट का कार्य पूरा कर चुके हों तो बाॉक्य में जाकर कंट्रोल ए या सले
    4. Instamojo digitises more than 2 lakh small businesses post the pandemic
    Instamojo digitises more than 2 lakh small businesses post the pandemicInstamojo digitises more than 2 lakh small businesses post the pandemic
    5. TallyPrime to simplify e-invoicing compliance through connected solution
    TallyPrime to simplify e-invoicing compliance through connected solution TallyPrime to simplify e-invoicing compliance through connected solution   ·         Tally Solutions enables end-to-end connected experience for e-invoicing through it
    6. India International Science Festival-2020 will showcase 41 events highlighting multi-dimensional aspects of science, technology and innovation in India
    Several curtain raiser events are being organized for generating awareness about the 6thIndia International Science Festival (IISF-2020) to be held virtually this year. At such an event at CSIR – Indian Institute of Toxicology Research, Lucknow,  Dr Shekhar C Mande, Secretary, Department of Scientific and Industrial Research (DSIR), Director General, Council of Scientific and Industrial Research and Chairman, Steering Committee, IISF – 2020, in his key note address, said that t
    7. React JS & Java Full Stack Developer among the top 5 digital skills in demand this year: Quess Report
    React JS & Java Full Stack Developer among the top 5 digital skills in demand this year: Quess Report   React JS developer is the most sort after job role in Mar-Oct 2020 with an uptick of 184% in openings; Bengaluru witnessed t
    8. IT minister announces launch of Grand Challenge for strengthening the COVID Vaccine Intelligence Network (CoWIN) system
    Ministry of Health and Family Welfare (MoHFW) along with Ministry of Electronics and Information Technology (MeitY) has announced the launching of “CoWIN”, a Grand Challenge for strengthening the COVID Vaccine Intelligence Network (CoWIN) system, a digitalised platform to be us
    9. 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
    10. 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
    11. 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
    12. Prime Minister Narendra Modi to inaugurate the summit Responsible AI for Social Empowerment 2020 on October 5
    Ministry of Electronics and Information Technology (MeitY) and NITI Aayog are organizing a Global Virtual Summit on Artificial Intelligence (AI), RAISE 2020- ‘Responsible AI for Social Empowerment 2020,’ from October 5-9, 2020. The Summit will be inaugurated by Prime Minister Shri Narendra Modi in the august presence ofMinister of Electronics & IT, Communications and Law &Justice, Shri Ravi Shankar Prasad, eminent global AI expert Professor R
    13. CSIR-CMERI comes up with High Flow Rate Water Purification Technology for Fluoride and Iron Removal
    NEED OF THE TECHNOLOGY: The contamination of fluoride and iron in drinking water is increasing day by day. Iron is the most abundant trace element in human body, responsible for accomplishment of vital biological functions such as gastrointestinal processes and the regulation of body temperature. But when iron level in water is beyond 0.3 ppm (as per WHO guideline), it shows several adverse effects including liver disease, irregular heart rhythm and neuronal disorder etc.
    14. 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
    15. 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
    16. ERP Software is key for companies´ digital transformation
    The traditional focus of ERP software is to help automate business processes, especially those that are considered critical to ensure the basic operation of the company. On the other hand, digital transformation has a broader and more disruptive focus, in which companies seek new ways of doing things to satisfy and delight their customers. ERP software is the first stage of transformation, but it requires additional work. The mastery of ERP software in
    17. 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
    18. The top Python developers in the United States
    Python is a Swiss Army Knife for programmers. It is a veteran programming language present in many applications and operating systems. We can find it running on servers, in iOS, Android, Linux, Windows or Mac applications. This is because it has a moderate learning curve and because its philosophy emphasizes offering a readable code syntax. It is a versatile multiplatform and multiparadigm programming language that stands out for its readable and clean code. On
    19. Professional Uruguayan Software Company
    A software factory offers the technical knowledge, agile development and implementation methodologies that allow a rapid acquisition of the tool, in order to solve and support the automation of administrative or information processes, as well as the reporting that is defined. In addition, they look for cutting-edge technologies that achieve user-friendly and efficient tool performance. Modern businesses must adapt to the changing needs of their customers. In this new business p
    20. 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.
    21. Successful Flight Test of SMART
    Supersonic Missile Assisted Release of Torpedo (SMART) has been successfully flight tested today 5th Oct 2020 at 1145 hrs from Wheeler Island off the coast of Odisha. All the mission objectives including missile flight upto the range and altitude, separation of the nose cone, release of Torpedo and deployment of Velocity Reduction Mechanism (VRM) have been met perfectly. The tracking stations (Radars, Electro Optical Systems) along the coast and the telemetry stations including down range ships
    22. 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:
    23. 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
    24. 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
    25. National Super Computing Mission (NSM) is boosting high power computing in the country
    India is fast expanding its supercomputer facilities and developing the capacity to manufacture its own supercomputers in the country. The National Super Computing Mission (NSM) is rapidly boosting high power computing in the country through its various phases to meet the increasing computational demands of academia, researchers, MSMEs, and startups in areas like oil exploration, flood prediction as also genomics, and drug discovery. With the infrastructure planned in NSM Phase-I alre
    26 CIMAP Scientist Technical Officer Vacancy Recruitment 2020 #Jobs 15 Days Remaining for Apply
    CIMAP Scientist Technical Officer Vacancy Recruitment 2020 CSIR-Central Institute of Medicinal and Aromatic Plants (CSIR-CIMAP), invites online applications in the prescribed format from Indian citizens for the recruitment of Government Job vacancy posts of Scientists and Technical Officer from enthusiastic young and dynamic Indian Nationals involved in Product Development/Technology Innovation/Applied Technology/Translation Research having excellent academic record/proven ...
    27 Manager Job Vacancy Recruitment in NPS Trust 2021 #Jobs 8 Days Remaining for Apply
    National Pension System Trust (NPS Trust) invites online applications in the prescribed format from eligible Indian citizens for recruitment to fill up the following Sarkari Naukri vacancy posts of Officer Grade B (Manager) and Officer Grade A (Assistant Manager) across different streams on direct recruitment basis. (Advertisement No. 2/2020-21) NPS Trust Manager Jobs Recruitment 2021 Vacancies ...
    28 Recruitment of Personal Staff Vacancy in High Court Madras #Tamil Nadu 13 Days Remaining for Apply
    Applications in the prescribed format through online mode are invited for filling up the following Personal Staff Sarkari Naukri vacancy posts of Personal Assistant to the Honourable Judges (ii) Personal Assistant to the Registrars and (iii) Personal Clerk to the Deputy Registrars in the Madras High Court Service in High Court of Madras at Chennai (Tamil Nadu) (Advertisement no. 159/2020) Madras High Court Personal Staff Vacancy Recruitment 2020-21 Madras High Court Personal Staff&n ...
    29 IBPS IT Jobs Vacancy Recruitment 2021 #Bank 18 Days Remaining for Apply
     Institute of Banking Personnel Selection (IBPS), an autonomous body, has been authorised by the IBA, invites online applications in the prescribed format from eligible candidates for selection of personnel to the following Information Technology (IT) Sarkari Naukri Vacancy posts in IBPS. IBPS IT Jobs Recruitment 2021 Vacancies     Analyst Programmer - Windows: 01 vacancies     Analyst Programmer - Frontend: 02 vacancies   ...
    30 Recruitment of Faculty & non-Teaching Vacancy in IIT Tirupati 2021 #Jobs 8 Days Remaining for Apply
    Indian Institute of Technology (IIT) Tirupati (Andhra Pradesh) invites online applications in the prescribed format from candidates with an established record of independent high-quality research and commitment to teaching for regular Faculty Sarkari Naukri Vacancy positions of Professor, Associate Professors, and Assistant Professor and regular non-teaching staff vacancies. (Advertisement No. IITT/FAC – RMT-01/2020 & IITTP/Staff RMT-01/2020) Government Jobs Vacancy Recruitment IIT Tirup ...
    31 दिखाओ अपनी प्रतिभा पूरे देश को हिन्दुस्तान ओलिंपियाड के साथ #Scholorship 18 Days Remaining for Apply
    दिखाओ अपनी प्रतिभा पूरे देश को हिन्दुस्तान ओलिंपियाड के साथHindustan Olympiad Identified as one of the world’s biggest Olympiads with a legacy of ...
    32 Recruitment of Assistant Professor Faculty Vacancy in NIT Jalandhar 2021 #Punjab 20 Days Remaining for Apply
    Dr. B. R. Ambedkar National Institute of Technology (NIT), Jalandhar (Punjab) invites online applications in the prescribed format for the recruitment of the following 29 Teaching Faculty Sarkari Naukri vacancy posts of Assistant Professors in various disciplines/subject/departments of NIT Jalandhar. (Advt. No. 05/2020) NIT Jalandhar  Assistant Professor  Recruitment 2021 Vacancies     Assistant Professor: 29 vacancies (UR-14, EWS-02, OBC-07, SC-04, ...
    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
    Add FREE Listing to Bharatpages Business Directory
    Read this site in Bengali English Gujarati Hindi Kannada Punjabi Tamil Telugu Urdu or Any other Language Google's cache Page
    January 21 - Historical Events - On This Day
    Sushant Singh Rajput - (21 January 1986 - 14 June 2020) was an Indian film and television actor, dancer, television personality,an entrepreneur and a philanthropist. Rajput started his career with television serials. His debut show was Star Plus romantic drama Kis Desh Mein Hai Meraa Dil (2008), followed by an award-winning performance in Zee TV popular soap opera Pavitra Rishta   IMAGES, GIF, ANIMATED GIF, WALLPAPER, STICKER FOR WHATSAPP & FACEBOOK
    Sushant Singh Rajput - (21 January 1986 - 14 June 2020) was an Indian film and television actor, dancer, television personality,an entrepreneur and a philanthropist. Rajput started his career with television serials. His debut show was Star Plus romantic drama Kis Desh Mein Hai Meraa Dil (2008), followed by an award-winning performance in Zee TV popular soap opera Pavitra Rishta
    #21January

    PolicyX: Compare Insurance Quotes  IMAGES, GIF, ANIMATED GIF, WALLPAPER, STICKER FOR WHATSAPP & FACEBOOK PolicyX: Compare Insurance Quotes

    Recent Posts

    Great Republic Day Sale | 20th - 23rd Jan  IMAGES, GIF, ANIMATED GIF, WALLPAPER, STICKER FOR WHATSAPP & FACEBOOK Great Republic Day Sale | 20th - 23rd Jan

    Jobs & Career Engineering Faculty & Teaching Defense & Police UPSC Scholorship Railway IT & Computer SSC Clerk & Steno UGC NET
    Contents News Education General Awareness Government Schemes Admit Card Study Material Exam Result Scholorship DATA Syllabus Contact us
    Explore more Archives Web Archive Register / Login Rss feed Posts Free Online Practice Set Useful Links / Sitemap Photo / Video Search Pincode Best Deal Greetings Recent Jobs Guest Contributor educratsweb Latest Jobs Notification sarkariniyukti.blogspot.com Bharatpages - BUSINESS DIRECTORY IN INDIA - FREE ONLINE BUSINESS LISTING
    Our Blog Bhakti Sangam chitragupta ji maharaj shri shirdi sai baba sansthan

    Great Republic Day Sale | 20th - 23rd Jan
    Great Republic Day Sale | 20th - 23rd Jan

    Guest Post | Submit   Job information   Contents   Link   Youtube Video   Photo   Practice Set   Affiliated Link   Register with us Register login Login
    educratsweb logo
    educratsweb provide the educational contents, Job, Online Practice set for students.
    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 email us at educratsweb@gmail.com
    Search | http://educratsweb.com/content.php?id=667