RyanGate

Active member
  • Nov 22, 2014
    608
    208
    43
    මචන්ලා, මට PHP වලින් login form එකක් හදන හැටි සරල code ටිකක් දාපන්කො..

    උඹලා පාවිච්චි කරන්නෙobject-oriented, procedural, PDO ?
     

    CorD SaC

    Well-known member
  • Feb 4, 2015
    15,724
    28,085
    113
    PHP:
    <html>
    <head>
    	<title>Registration Form</title>
    	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    </head>
    <body>
    
        <?php if (isset($_POST['form_submitted'])): ?> 
    
            <h2>Thank You <?php echo $_POST['firstname']; ?> </h2>
    
            <p>You have been registered as
                <?php echo $_POST['firstname'] . ' ' . $_POST['lastname']; ?>
            </p>
    
            <p>Go <a href="/registration_form.php">back</a> to the form</p>
    
            <?php else: ?>
    
                <h2>Registration Form</h2>
    
                <form action="registration_form.php" method="POST">
    
                     First name:
                    <input type="text" name="firstname">
                    
                    <br> Last name:
                    <input type="text" name="lastname">
                    
    			<input type="hidden" name="form_submitted" value="1" />
    
                    <input type="submit" value="Submit">
    
                </form>
    
          <?php endif; ? > 
    </body> 
    </html>


    ඇයි youtube එකේ එහෙම tutorials බලන්නෙ නෑ??? :dull::dull::dull::dull: කොච්චර resources තියේද net එකේ :)
     
    Last edited:

    RyanGate

    Active member
  • Nov 22, 2014
    608
    208
    43
    Thanks මචං.. internet එකේ හැම තැනම තියෙනවා.. ඒත් අවුල්

    PHP:
    <html>
    <head>
    	<title>Registration Form</title>
    	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    </head>
    <body>
    
        <?php if (isset($_POST['form_submitted'])): ?> 
    
            <h2>Thank You <?php echo $_POST['firstname']; ?> </h2>
    
            <p>You have been registered as
                <?php echo $_POST['firstname'] . ' ' . $_POST['lastname']; ?>
            </p>
    
            <p>Go <a href="/registration_form.php">back</a> to the form</p>
    
            <?php else: ?>
    
                <h2>Registration Form</h2>
    
                <form action="registration_form.php" method="POST">
    
                     First name:
                    <input type="text" name="firstname">
                    
                    <br> Last name:
                    <input type="text" name="lastname">
                    
    			<input type="hidden" name="form_submitted" value="1" />
    
                    <input type="submit" value="Submit">
    
                </form>
    
          <?php endif; ? > 
    </body> 
    </html>


    ඇයි youtube එකේ එහෙම tutorials බලන්නෙ නෑ??? :dull::dull::dull::dull: කොච්චර resources තියේද net එකේ :)
     

    CorD SaC

    Well-known member
  • Feb 4, 2015
    15,724
    28,085
    113
    Thanks මචං.. internet එකේ හැම තැනම තියෙනවා.. ඒත් අවුල්

    කරන් යද්දි අවුලක් ආවොත් අහන්ඩ මචන් :)
     

    RyanGate

    Active member
  • Nov 22, 2014
    608
    208
    43
    මම ටිකක් කැම්මැලියි, ඕන උනේ අඩුම code lines ටිකකින් ලියන්න.. මේක හරි ගියා
    කරන් යද්දි අවුලක් ආවොත් අහන්ඩ මචන් :)


    Code:
    <?php
    
        $conn = mysqli_connect("localhost", "root", "", "test");
    
        $name = $_POST['username'];
        $pass = $_POST['password'];
    
        $s = "select * from users where username = '$name'";
    
        $result =mysqli_query ($conn, $s);
        $num = mysqli_num_rows($result);
    
        if ($num==1) {
            echo "Username already taken";
        }
    
        
    ?>
     
    Last edited:

    RyanGate

    Active member
  • Nov 22, 2014
    608
    208
    43
    මේ දවස් ටිකේ කට්ටක් කාල php login project එකක් කලා. මම හොදට css දන්න නිසා වැඩේ ලස්සනට ගියා. පදන්න කෙනෙක් මට කියා දීපන්කො Payment Getway එකක් ආදන්නෙ කොහමද කියල? ලංකාවෙ බැංකු, Dialog ez cash වගේ?

    login-page-php-login-script-with-sessions.jpg
     

    akilaperera2014

    Well-known member
  • Jan 26, 2015
    1,169
    406
    83
    Kadawatha
    මේ දවස් ටිකේ කට්ටක් කාල php login project එකක් කලා. මම හොදට css දන්න නිසා වැඩේ ලස්සනට ගියා. පදන්න කෙනෙක් මට කියා දීපන්කො Payment Getway එකක් ආදන්නෙ කොහමද කියල? ලංකාවෙ බැංකු, Dialog ez cash වගේ?

    login-page-php-login-script-with-sessions.jpg


    Responsive da machan ?? :shocked:
     

    Vitaski119

    Active member
  • Aug 29, 2017
    311
    142
    43
    ‌අතන
    මේ දවස් ටිකේ කට්ටක් කාල php login project එකක් කලා. මම හොදට css දන්න නිසා වැඩේ ලස්සනට ගියා. පදන්න කෙනෙක් මට කියා දීපන්කො Payment Getway එකක් ආදන්නෙ කොහමද කියල? ලංකාවෙ බැංකු, Dialog ez cash වගේ?

    login-page-php-login-script-with-sessions.jpg


    Try to PayHere machan https://www.payhere.lk/