Where is bug, wampserver said bug in the 11th line | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Where is bug, wampserver said bug in the 11th line

<html> <head><title>PHP bilan qilingan forma</title></head> <?php $ism = $yosh = $email = $jins = ""; $ism_ = $yosh_ = $email_ = $jins_ = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST['ism'])){ $ism_ = "Ismni kirtish majburiy"; } else{ $ism = test_input($_POST['ism']); if (!preg_match("/^[a-z A-Z 0-9]*$/", $ism)){ $ism_ = "Login xato kiritilgan"; } } if (empty($_POST['email'])) { $email_ = "Emailni kiritish majburiy"; } else { $email = test_input($_POST['email']); if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $email_ = "Email bizning tarafda bunday bo'lmaydi"; } } if (empty($_POST['yosh'])) { $yosh_ = "Yoshni kirtish majburiy"; } else { $yosh = test_input($_POST['yosh']); if (!preg_match("/^[0-9]*$/", $yosh)) { $yosh_ = "Yoshingizni raqam orqali kiriting iltimos"; } } /* funksiya */ function test_input($data){ $data = htmlspecialchars($data); $data = trim($data); $data = stripcslashes($data); return $data; } } ?> <body> <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>" method="post"> <input type="text" name="ism" placeholder="Ismingiz"><span><?php echo $ism_; ?></span> <input type="email" name="email" placeholder=blah@blah><span><?php echo $email_; ?></span> <input type="number" name="yosh" placeholder="18"><span><?php echo $yosh_; ?></span> <h5>Jinsingiz:</h5> <input type="radio" value="Erkak" name="jins" <?php if(isset($jins) && $jins == "Erkak") echo "Tekshirilgan";?>> <input type="radio" value="Ayol" name="jins" <?php if(isset($jins) && $jins == "Ayol") echo "Tekshirilgan";?>> <input type="submit" value="OK"> </form> <!-- It is output of form --> <?php echo $ism; echo "<br/>";

19th Jun 2017, 8:15 AM
Nodirbek
1 Answer
0
Bug or an error? Please show us the error instead of dumping your whole codes here and show us only the line error mentions.
20th Jun 2017, 4:01 AM
Mohammed Shamshid
Mohammed Shamshid - avatar