Can someone help me with finding bug in this piece of PHP code?
Hi, can you someone help me find a bug in this code? : [code] $file = fopen('profile/'.$identita.".php","x"); fwrite($file , " <html><head></head> <body> <h1>Profil uzivatele <?php echo $_SESSION['u_name']; ?></h1> <?php $sql = \"SELECT * FROM videos WHERE id = '$identita' \"; $result = mysqli_query($conn , $sql); $pocet = mysqli_num_rows($result); if ($pocet > 0){ echo \"Uzivatel nahral \"; echo $pocet; echo \" videi.\"; echo \"<hr><hr>\"; while ($row = mysqli_fetch_assoc($result)){ echo \" <p>NAZEV: \".$row['nazev'].\"</p> <p>ODKAZ: \".$row['odkaz'].\"</p> <p>ZHLEDNUTI: \".$row['views'].\"</p> <video width='400' height = '400' id = \".$row['cislo'].\" onended = \"intro\".$row['cislo'].\"()\" controlsList='nodownload' controls> <source src='testing.mp4' type=\"video/mp4\"> </video> <script type='text/javascript' > var cislo = 0; function intro\".$row['cislo'].\"() { var vidd\".$row['cislo'].\" = document.getElementById(\"\".$row['cislo'].\"z"); cislo = cislo + 1; var dalsi\".$row['cislo'].\" = '\".$row['cesta'].\"'; vidd\".$row['cislo'].\".src = dalsi\".$row['cislo'].\"; vidd\".$row['cislo'].\".play(); if (cislo == 2){ url: 'ajax.php', //This is the current doc type: \"POST\", data: ({video:\".$row['cislo'].\"}), success: function(data){ console.log(data); } }); } } </script> <hr>\"; } } ?> "); fclose($file); [end of the code] It just shows server error 500, so I guess, theres a bug somewhere in it