حالت آفلاین — محتوا از حافظهٔ کش نمایش داده می‌شود

فرم ثبت نام

تمرین آسان 6385 visibility link download flag trending_up پربازدید

فرمی طراحی کنید که اطلاعات زیر را با استفاده از بهترین عناصر از کاربر دریافت کند و به صفحه register/ به روش post ارسال کند

نام
نام خانوادگی
جنسیت
سن
شهر
رنگ مورد علاقه
تاریخ تولد
شماره موبایل
آدرس
👨‍💻 4 ساعت قبل کاربر ناشناس این تمرین رو مشاهده کرد
👨‍💻 2 ساعت قبل User 10835 این تمرین رو مشاهده کرد

reply 21

visibility
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>form</title>
</head>
<style>
    .form{
        width: 100%;
        max-width: 600px;
        font-size: 20px;
        background-color: aqua;
        color: black;
        border: 2px solid black;
        border-radius: 20px;
        box-shadow: 0 0 5px black;
        padding: 10px;
        margin: 5px;
    }

    .form  input{
        border-radius: 10px;
        font-size: 20px;
    }

    #btn{
        border-radius:10px ;
        background-color: black;
        color: aqua;
    }

</style>
<body>
    <form action="/regester " method="post" class="form">
        <label for="fname">fname</label>
        <input type="text" id="fname" placeholder="name">
        <br>

        <label for="lname">lname</label>
        <input type="text" id="lname" placeholder="lname">
        <br>

        <label for="woman">woman</label>
        <input type="checkbox" id="woman" >
        <br>

        <label for="man">man</label>
        <input type="checkbox" id="man" >
        <br>

        <label for="age">age</label>
        <input type="number" id="age" placeholder="age">
        <br>

        <label for="city">city</label>
        <input type="text" id="city" placeholder="city">
        <br>

        <label for="color">color</label>
        <input type="text" id="color" placeholder="color">
        <br>

        <label for="birthday">birthday date</label>
        <input type="date" id="birthday" placeholder="birthday">
        <br>

        <label for="p-number">p-number</label>
        <input type="tel" id="p-number" placeholder="p-number">
        <br>

        <label for="addres">addres</label>
        <input type="text" id="addres" placeholder="addres">
        <br>

        <button id="btn">forward</button>
    </form>
    
</body>
</html>
nem=input("your nem")
nam khanavadegi=input("your nam khnavadegi")
jensit=input("your jensit")
san=input("your san")
shehar=input("your shehar")
favorite color=input("your favorite color")
Date of birth=input("your Date of birth")
mobile number=input("your mobile number")
address=input("your address")
print(ok)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            font-size: 15px;
        }
        .signup{
            width: 30%;
            border: solid;
            border-radius: 10px;
            background-color: rgb(126, 126, 126);
            justify-self: center;
            padding: 5px;
        }
        body{
            background-color: black;
        }
        label{
            display: block;
            margin-left:35px;
            color: blue;
            text-shadow: 1px 1px 0px #f00202;
            margin-bottom: 5px;
        }
        input{
        flex-grow: 1;
        display: block;
        justify-self: center;
        width: 70%;
        border-radius: 4px;
        background-color: black;
        }
        select+option{
            justify-self: center;
            display: block;
            margin-left: 40px ;
        }
        .color10{
           margin-left: 60px;
           background-color: black;
           color: rgb(201, 201, 201);
           border-radius: 4px;
            
        }
        .jens5{
            margin-left: 60px;
            background-color: black;
            color: rgb(201, 201, 201);
            border-radius: 4px;
        }
        .time{
            color: rgb(168, 168, 168);
        }
    </style>
</head>
<body>
    <form action="9">
        <div class="signup">
            <div class="name">
                <label for="name">نام</label>
                <input type="text" name="" class="name" placeholder="نام">
            </div>
            <div class="family">
                <label for="family">نام خانوادگی</label>
                <input type="text" name="" class="family" placeholder="نام خانوادگی">
            </div>
            <div class="jens">
                <label for="jens">جنسیت</label>
                <select name="" class="jens5">
                    <option value="" class="jens1">مرد</option>
                    <option value="" class="jens2">زن</option>
                </select>
            </div>
            <div class="age">
                <label for="age">سن</label>
                <input type="number" name="" class="age" placeholder="سن">
            </div>
            <div class="city">
                <label for="city">شهر</label>
                <input type="text" name="" class="city" placeholder="شهر">
            </div>
            <div class="color">
                <label for="color">رنگ مورد علاقه</label>
                <select class="color10">
                    <option value="" class="color1">سبز</option>
                    <option value="" class="color2">قرمز</option>
                    <option value="" class="color3">آبی</option>
                    <option value="" class="color4">سفید</option>
                    <option value="" class="color5">سیاه</option>
                    <option value="" class="color6">زرد</option>
                    <option value="" class="color7">سبز</option>
                </select>
            </div>
            <div class="time">
                <label for="time">تاریخ تولد</label>
                <input type="date" name="" class="time" placeholder="تاریخ تولد">
            </div>
            <div class="phone">
                <label for="phone">شماره تلفن</label>
                <input type="text" name="" class="phone" placeholder="شماره تلفن">
            </div>
            <div class="home">
                <label for="home">آدرس منزل</label>
                <input type="text" name="" class="home" placeholder="آدرس منزل" style="width:90%; height: 30%;">
            </div>
            <div></div>
        </div>
    </form>
</body>
</html>
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>فرم ثبت نام</title>
</head>
<body>
    <form action="/register">
        <label for="fname">نام</label>
        <input type="text" name="fname" id="fname">
        <label for="lname">نام خانوادگی</label>
        <input type="text" name="lname" id="lname">
        <br>
        <label for="sex">جنسیت</label>
        <label for="mr">آقا</label>
        <input type="radio" value="0" name="sex" id="mr">
        <label for="mrs">خانم</label>
        <input type="radio" value="0" name="sex" id="mrs">
        <label for="age">سن</label>
        <input type="number" name="age" id="age">
        <label for="city">نام شهر</label>
        <input type="text" name="city" id="city">
        <br>
        <label for="fcolor">رنگ موردعلاقه</label>
        <input type="text" name="fcolor" id="fcolor">
        <label for="birthday">تاریخ تولد</label>
        <input type="date" name="birthday" id="birthday">
        <br>
        <label for="mobile">موبایل</label>
        <input type="number" name="mobile" id="mobile" maxlength="11">
        <br>
        <label for="address">آدرس</label>
        <textarea name="address" id="address"></textarea>
        <br>
        <input type="submit" value="ثبت نام">
    </form>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>forms</title>
</head>
<body>
  <form action="/register">
      <label for="fname">Fname : </label><br>
        <input type="text" id="fname" name="fname"><br>

      <label for="lname">Lname : </label><br>
        <input type="text" id="lname" name="lname"><br>

      <label for="gender">gender : </label><br>
        <label for="man">man</label>
          <input type="radio" value="man" name="gender" id="man">
        <label for="woman">woman</label>
          <input type="radio" value="woman" name="gender" id="woman"><br>

      <label for="age">age</label>
        <input type="number" name="age" id="age" min="1" max="99"><br>

      <label for="city">city: </label><br>
        <input type="text" id="city" name="city"><br>

      <label for="fcolor">favorite color : </label><br>
        <input type="color" id="fcolor" name="fcolor"><br>

      <label for="time">birthday : </label><br>
        <input type="date" id="time" name="time"><br>

      <label for="tell">Phone number : </label><br>
        <input type="tell" id="tell" name="tell" pattern="09[0-9]{2}[0-9]{3}[0-9]{4}"><br>

      <label for="adress">Adress : </label><br>
        <input type="text" id="adress" name="adress"><br>

      <label for="sumbit">sumbit</label>
        <input type="submit">

  </form>
</body>
</html>
<!DOCTYPE html>
<html lang="fa">
	<head>
		<meta charset="utf-8" />
		<title>sign up form</title>
		<style>
			fieldset{
				width: 400px;
				background-color: lightblue;
				border-radius: 10px;
				margin-left: 25%;
				margin-right: 25%;
			}
		</style>
	</head>

	<body>
	<form action=" register/" method="post">
	<fieldset>
		<legend><h4 style="background-color: #ffffff;border-radius: 5px">sign up form:</h4></legend>
		<lable for="fname">first name:</lable><br>
		<input type="text" id="fname" name="fname" placeholder="shahrooz"
		style="border-radius: 5px;" ><br>

		<lable for="lname">last name:</lable><br>
		<input type="text" id="lname" name="lname" placeholder="chegini"
		style="border-radius: 5px;"><br>

		<lable for="gender">gender:</lable><br>
		<lable for="gender">male:</lable>
		<input type="radio" id="gender" name="gender">
		<lable for="gender">female:</lable>
		<input type="radio" id="gender" name="gender"><br>

		<lable for="age">age:</lable><br>
		<input type="text" id="age" name="age" placeholder="18"
		style="border-radius: 5px;"><br>

		<lable for="city">city:</lable><br>
		<input type="text" id="city" name="City" placeholder="Tehran"
		style="border-radius: 5px;"><br>

		<lable for="color">favourite:</lable><br>
		<input type="text" id="color" name="favourite" placeholder="Red"
		style="border-radius: 5px;"><br>

  		<label for="birthday">Birthday:</label><br>
  		<input type="date" id="birthday" name="birthday"
		style="border-radius: 2px;"><br>

		<label for="phone">phone number:</label><br>
		<input type="tel" id="phone" name="phone" placeholder="09120000000"
		style="border-radius: 5px;"><br>

		<label for="address">address:</label><br>
		<input type="text" id="address" name="address" placeholder="adress"
		style="border-radius: 5px;width: 60%;"><br>
		
		<input type="submit">
	</fieldset>
	</form>
	</body>
</html>
<!DOCTYPE html>
<html lang="fa">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>فرم ثبت نام</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            padding: 20px;
        }
        form {
            background: #fff;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        input, select, textarea {
            width: 100%;
            padding: 10px;
            margin: 10px 0;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
        button {
            background-color: #5cb85c;
            color: white;
            padding: 10px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        button:hover {
            background-color: #4cae4c;
        }
    </style>
</head>
<body>

<h2>فرم ثبت نام</h2>
<form action="/register/" method="POST">
    <label for="first_name">نام:</label>
    <input type="text" id="first_name" name="first_name" required>

    <label for="last_name">نام خانوادگی:</label>
    <input type="text" id="last_name" name="last_name" required>

    <label for="gender">جنسیت:</label>
    <select id="gender" name="gender" required>
        <option value="مرد">مرد</option>
        <option value="زن">زن</option>
        <option value="دیگر">دیگر</option>
    </select>

    <label for="age">سن:</label>
    <input type="number" id="age" name="age" min="1" required>

    <label for="city">شهر:</label>
    <input type="text" id="city" name="city" required>

    <label for="favorite_color">رنگ مورد علاقه:</label>
    <input type="text" id="favorite_color" name="favorite_color" required>

    <label for="birth_date">تاریخ تولد:</label>
    <input type="date" id="birth_date" name="birth_date" required>

    <label for="phone">شماره موبایل:</label>
    <input type="tel" id="phone" name="phone" pattern="[0-9]{10}" required placeholder="10 رقم بدون صفر اول">

    <label for="address">آدرس:</label>
    <textarea id="address" name="address" rows="4" required></textarea>

    <button type="submit">ثبت نام</button>
</form>

</body>
</html>

یک سری موارد رو به دلخواه اضافه کردم.

<!DOCTYPE html>
<html>
<head>
    <title>FORM</title>
    <link rel="stylesheet" href="project.css" type="text/css">
</head>
<body>
    <form method="post">
        <table dir="rtl" style="width: 100%;">
            <thead>
            <tr>
                <th colspan="2">فرم ازمایشی</th>

            </tr>
        </thead>
        <tbody>
            <tr>
                <td><label>نام :</label></td>
                <td><input type="text" class="sd" name="name"></td>
            </tr>
            <tr>
                <td><lable>نام خانوادگی :</lable></td>
                <td><input type="text" class="sd" name="last_name"></td>
            </tr>

           <tr>
                <td> <label>کد ملی:</label></td>
                <td><input type="text" class="sd" name="code"></td>
            </tr>
            <tr>
                <td><lable>ایمیل:</lable></td>
                <td><input type="email" class="sd" required name="email"></td>
            </tr>
            <tr>
                <td><label>رمز عبور ایمیل :</label></td>
                <td><input type="password" class="sd" required name="pass"></td>

            </tr>
            <tr>
                <td><label>ادرس:</label></td>
                <td > <input type="text" class="sd" required name="address"></td>
            </tr>
            <tr>
                <td><lable>شماره تلفن:</lable></td>
                <td><input type="number" class="sd" required name="phone"> </td>
            </tr>

            <tr>
                <td><lable>سن:</lable></td>
                <td><input class="sd" type="number" name="age"></td>
            </tr>
            <tr>
                <td><label>جنسیت :</label></td>
                <td><input type="radio" name="gender">خانم
                    <input type="radio" name="gender">اقا
                    <input type="radio" name="gender">سایر
                </td>
            </tr>
            <tr>
                <td><label>رنگ مورد علاقه:</label></td>
                <td><input type="text" class="sd" name="color"></td>
            </tr>
            <tr>
                <td><lable>زبان انگلیسی بلدی:</lable></td>
                <td><input type="radio" name="en">بله
                    <input type="radio" name="en">خیر
                    <input type="radio" name="en">زیاد نه
                </td>
            </tr>
            <tr >
                <td></td>
                <td ><button type="submit" name="button">ثبت اطلاعات</button>
                </td>
            </tr>           
        </tbody>
        </table>
    </form>

</body>
</html>

<!--محتوای سی اس اس -->
@charset 'utf-8';
*{
    padding: 0px;
    margin: 0xp;
    font-style: italic;
    box-sizin
   g: border-box;
}

form {
    width: 400px;
    border: 2px solid rgb(0, 0, 0);
    margin: 100px auto;
    direction: rtl;
    border-radius: 30px;
    padding: 0px 5px; 
    font-size: large;
    background:linear-gradient(rgb(187, 164, 48) 20%,rgb(192, 150, 12) 20%,rgb(209, 176, 11),rgb(143, 133, 4));
}

table thead tr th {
    width: 100% ;
    padding: 10px 0px;
    background-color: black;
    color: white;
    border-radius:30px ;
}
input[type="radio"]{
    margin-left: 5px;
}

input[type="text"],input[type="email"],input[type="password"],input[type="number"]{
    width: 100%;
    padding: 4px;
    border-radius: 5px;
    border: 1px solid black;
    font-size: medium;
}

.sd:focus{
    box-shadow:  0px 0px 0px 4px  rgba(2, 0, 0, 0.2);
}

button {
    padding: 5px 10px;
    border-radius: 30px;
    border:1px solid rgb(149, 239, 166);
    background-color: rgb(149, 239, 166); ;
    color: black;
    font-size: larger;
    width: 50%;
}

button:hover{
    padding: 5px 10px;
    border-radius: 30px;
    border:1px solid rgb(5, 171, 36);
    color: black;
    background-color:rgb(5, 171, 36) ;
    font-size: larger;
    width: 50%;
}

<!DOCTYPE html>
<html lang="en">
<head>
    <style>
        body{
            text-align: center;
        }
        input{
            width: 70%;
            margin-top: 3%;
            margin-bottom: 3%;
            border-radius: 10px;
            padding: 1%;
        }
        form{
            border-radius: 20px;
            margin-top: 8%;
            width: 30%;
            margin-left: 35%;
            box-shadow: 12px 20px  10px  10px  rgba(60, 37, 37, 0.44);
            background: #fff1c3;
        }
        .sub{
            background-color: greenyellow;
            border: 5px double green;
            border-radius: 20px;
            width: 30%;
        }
    </style>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="">
    <title>1</title>
</head>
<body>

    <form action="#">
        <label for="">نام</label>  <input id="" type="text" name=""><br>
        <label for="">نام خانوادگی</label>  <input id="" type="text" name=""><br>
        <label for="">جنسیت</label>  
        <select id=""  name="" id="jen"><br>
            <option value="0" >زن</option>
            <option value="1" >مرد</option>
        </select><br>
        <label for="">سن</label>  <input id="" type="number" name=""><br>
        <label for="">شهر</label>  <input id="" type="text"><br>
        <label for="">رنگ مورد علاقه</label>  <input id="" type="color"><br>
        <label for="">تاریخ تولد</label>  <input id="" type="date"><br>
        <label for="">شماره موبایل</label>  <input id="" type="number"><br>
        <label for="">آدرس</label>  <input id="" type="text"><br>
        <input type="submit" name="" id="" class="sub" value="تایید">
    </form>
</body>
</html>
name = input("nam khodra vared konid: ")
namekhanevadegi = input("nam khanevadegi khod ra vared konid: ")
jensiat = input("jensiat khodra vared konid: ")
sen = int(input("sen khod ra vared konid: "))
shomaretelephone = int(input("shomare telephone khod ra vared konid: "))
shahr = input("nam shahr khodra vared konid: ")
rangmoredalage = input("rang mored alage khodra vared konid: ")
addrese = input("addrese khod ra vared konid: ")
tarikhtavalod = input("tarikh tavalod khod ra vared konid: ")
print(name)
print(namekhanevadegi)
print(jensiat)
print(sen)
print(shomaretelephone)
print(shahr)
print(rangmoredalage)
print(addrese)
print(tarikhtavalod)
<< صفحه قبل 1 2 3 صفحه بعد >>

ارسال جواب

جوابت را با Markdown بنویس و ثبت کن

×
بستن