html yoki php ya`ni birinchi sahifada form quyasiz
<form method="post" name="myform" action="action.php">
<input type="text" name="mytext" />
<input type="submit" value="submit" class="form-button" >
</form>
bu esa php sahifangiz ( unutmang yuqorida biz action.php deb nomlaganmiz)
$mytext = $_POST['mytext']; /// formda yozilgan tekst action php da bo'lib o'tadi!
echo $mytext;
Keyin o'rtada if tegidan ham foydalandim, ya`ni shart quydim
if (strlen($mytext) == "8") {
$secondtext = $mytext;
echo '8 ta harfdan iborat bulsa $secondtext';
else {
die( 'agar shart xato bulsa sahifa uladi yani qolgan kodlarni emas aynan shuni kursatadi');
}