} else { $count = MySQLi_Query($res_id, "select (max(id)+1) as count from students"); $count_id = MySQLi_Fetch_Assoc($count); if ($count_id["count"]) { $query = "insert into students values (" . $count_id["count"] . ",'{$name}','{$email}',{$age},'{$gender}','{$password}')"; } else { $query = "insert into students values (1,'{$name}','{$email}',{$age},'{$gender}','{$password}')"; } $res = MySQLi_Query($res_id, $query); if ($res) { echo "<tr align='center'> <td colspan='5'> <font color='green'> Registration Successful! </font> You may login now from here:- <a href='login.php'>Login</a></td> </tr>"; } else { echo "<tr align='center'> <td colspan='5'> <font color='red'> Registration Failed! </font> </td> </tr>"; } } MySQLi_Close($res_id); } } ?> </table> <footer align='center'> © All Rights Reserved. </footer> </body> </html>
?> <script type="text/javascript" src="notify.js"></script> <script> $(document).ready(function() { $.notify( "Message Sent!","success"); }); </script> <?php } else { echo "<tr align='center'> <td colspan='5'> <font color='red'> Message Sending Failed! </font> </td> </tr>"; } } else { echo "<tr align='center'> <td colspan='5'> <font color='red'> Sorry, User does not exists! </font> </td> </tr>"; } MySQLi_Close($resid); } } ?> <?php } else { echo "<tr align='center'> <td colspan='5'> <font color='red'> Sorry, You not Logged in! </font> Login again:- <a href='login.php'>Login</a> </td> </tr>"; } ?> </table> <footer align='center'> © All Rights Reserved. </footer> </body> </html>