Case 1 - Solving Willer's bug ( Script's - PHP ,HTML) Forms , indenting
Case Study - Solving willer's case
Concepts Involved - Form elements , code indenting ,conditional logic
Level - Basic
Willer wrote that his PHP script was bugging out ....on careful analysis i could observe that the error he was getting was of undefined index ...since the script printed by him on screen was only for PHP coding , i was sure that the error was in the form that was sending the values to the PHP script .....like guessed , i saw that his form element had value nom whereas he was checking for nom_ctr in the the PHP script ...the error became more critical because it formed the condition of a if loop which would now always evaluate to be false because the the condition of the if loop would never hold good .....Once i corrected this , i then proceeded to check whether the code had syntaxical error and you bet it did ....this is where i think proper code indenting play's a major role ...in his code , i could see that the parent if loop and the nested if loop containing yet another subnested if loop were all lost in braces ----this is again terrible because incorrect opening and closing of braces especially with conditional operators can wreak havoc on code and that is what it did in his case ---the compiler would never get a chance to travel to the subnested loop where the database connection and the query stood ....obviously then , the code will never work .
So , i did 2 things , firstly i changed the form element to match the variable being checked in the logic script so that names and indexes remain in unity
Second , i indented his code to observe proper logic flow and i could easily see the 4 places where he went wrong (even 1 place makes the code go wrong , so 4 is icing on the cake)
But once i did that and created a database replicating his same scenario , it was joy to see the code work .
Carry knowledge and understand the concepts .....the day there is peace in the world , i shall be a very happy man ,
Cheers ,
Amlan (flirt by nature , coder by passion)
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Case 1 - Solving Willer's bug ( Script's - PHP ,HTML) Forms , indenting», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.