3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<!--HTML5 + Bootstrap--> <!doctype html> <html lang="en"> <form action=Secur.php method=GET> <head> <meta charset="utf-8"/> <!--Bootstrap LINKS--> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/bootstrap.css" rel="stylesheet" media="screen"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <link href="css/clean-blog.css" rel="stylesheet"> <!--Fonts--> <link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Bree+Serif' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Quicksand' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Yantramanav:400,100' rel='stylesheet' type='text/css'> <!--Javascript--> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/tooltip.js"></script> <!--CSS--><style> body{ position: relative; /* required */ background: url("") no-repeat fixed center; opacity: 0.9; filter: alpha(opacity=10); } label {font-family: 'Pacifico', cursive; serif; font-size: 35;} button {font-family: 'Quicksand', serif; font-size: 40px;} textarea {font-family: 'Quicksand', cursive; serif; font-size: 30px;} h1 {font-family: 'Pacifico', cursive; serif; font-size: 50px;} h2 { margin: 0; color: #fff; padding-top: 60px; font-size: 50px; font-family: 'Quicksand', serif; font-size: 27px; } print {font-family: 'Quicksand', serif; font-size: 27px;} h5 {font-family: 'Quicksand', cursive; serif; font-size: 24px; color: white;} p {font-family: 'Quicksand', sans-serif; text-indent: font-size: 17PX; text-align: justify;} a {font-family: 'Pacifico', cursive; serif; font-size: 30px; color: white;} li > a {font-family: 'Quicksand', sans-serif; font-size: 20px;} .nav-tabs > li, .nav-pills > li { float:none; display:inline-block; *display:inline; /* ie7 fix */ zoom:1; /* hasLayout ie7 trigger */ } .nav-tabs, .nav-pills{ text-align:center; } .dropdown-menu { left: 50%; right: auto; transform: translate(-50%, 0); } .dropdown-menu { left: 50%; right: auto; transform: translate(-50%, 0); } @media only screen and (min-width: 768px) { .navbar-custom { background: transparent; border-bottom: 1px solid transparent; } .navbar-custom .navbar-brand { color: black; padding: 20px; } .navbar-custom .navbar-brand:hover, .navbar-custom .navbar-brand:focus { color: rgba(000); } .footer{ position: fixed; text-align: center; bottom: 0px; width: 100%; } textarea{ width: 600px; height: 250px; } </style> <!--END CSS--> </head> <body> <nav class="navbar navbar-default navbar-custom navbar-fixed-top"> <div class="container-fluid"> <div class="navbar-header page-scroll"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="Secur.php">Data Security</a> </div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <li> <a href="#" data-toggle="modal" data-target="#myModal"> <span class="glyphicon glyphicon-send" data-toggle="tooltip" data-placement="bottom" data-original-title="REGISTER"></span></a> </li> <li> <a href="Secur.php" data-toggle="tooltip" data-placement="bottom" data-original-title="Home"> <span class="glyphicon glyphicon-home"></span></a> </li> </ul> </div> </div> </nav> <!-- MODAL --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title" id="myModalLabel">Register</h4> </div> <div class="modal-body"> <form class="form-horizontal"> <fieldset> <div class="form-group"> <label for="studentno" control-label"></label> <div class="col-lg-8 col-lg-offset-2"> <input type="text" class="form-control" id="studentno" name='studentno' min="11" max="11" maxlength="11" placeholder="Student Number"required> </div> </div> <div class="form-group"> <label for="studentname" control-label"></label> <div class="col-lg-8 col-lg-offset-2"> <input type="text" class="form-control" id="studentname" name='studentname' placeholder="Username" required> </div> </div> <div class="form-group"> <label for="email" control-label"></label> <div class="col-lg-8 col-lg-offset-2"> <input type="email" class="form-control" id="email" name='email'placeholder="Email Address" required> </div> </div> <div class="form-group"> <label for="password"control-label"></label> <div class="col-lg-8 col-lg-offset-2"> <input type="password" class="form-control" id="password" name='password' min="6" max="10" maxlength="10" placeholder="Password" required> </div> </div> </div> <?php mysql_connect("localhost",'root')or die("No connection"); mysql_select_db("dbdatasecur")or die("No database"); $query = "SELECT * FROM `useraccounts`"; $result = mysql_query($query); while(mysql_fetch_array($result)); ?> <div class="modal-footer"> <div id="myButtons"> <button type="button" class="btn btn-danger" data-dismiss="modal"><span class="glyphicon glyphicon-minus"></span> Close</button> <button type=reset name='clear' value="Clear" class="btn btn-warning"><span class="glyphicon glyphicon-remove"></span> Clear</button> <button type=submit name='save' value="Save" class="btn btn-success"><span class="glyphicon glyphicon-plus"></span> Save?</button><br><br> </div> </div> <?php mysql_connect("localhost",'root')or die("No connection"); mysql_select_db("dbdatasecur")or die("No database"); if(isset($_GET["save"])){ $a=$_GET["studentno"]; $b=$_GET["studentname"]; $c=$_GET["email"]; $d=$_GET["password"]; $check="SELECT * FROM useraccounts where studentno='$a'"; $result=mysql_query($check); $count=mysql_num_rows($result); if($count==0){ $insert="INSERT INTO useraccounts VALUES('$a','$b','$c',md5('$d'))"; mysql_query($insert); echo '<script language="javascript">'; echo 'alert("Registered Successfully!")'; echo '</script>'; }else echo '<script language="javascript">'; echo 'alert("Already Registered.")'; echo '</script>'; } ?> </div> </div> </div> </html>
based on sdbeH
Output for 7.0.0 - 7.2.0
<!--HTML5 + Bootstrap--> <!doctype html> <html lang="en"> <form action=Secur.php method=GET> <head> <meta charset="utf-8"/> <!--Bootstrap LINKS--> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/bootstrap.css" rel="stylesheet" media="screen"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <link href="css/clean-blog.css" rel="stylesheet"> <!--Fonts--> <link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Bree+Serif' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Quicksand' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Yantramanav:400,100' rel='stylesheet' type='text/css'> <!--Javascript--> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/tooltip.js"></script> <!--CSS--><style> body{ position: relative; /* required */ background: url("") no-repeat fixed center; opacity: 0.9; filter: alpha(opacity=10); } label {font-family: 'Pacifico', cursive; serif; font-size: 35;} button {font-family: 'Quicksand', serif; font-size: 40px;} textarea {font-family: 'Quicksand', cursive; serif; font-size: 30px;} h1 {font-family: 'Pacifico', cursive; serif; font-size: 50px;} h2 { margin: 0; color: #fff; padding-top: 60px; font-size: 50px; font-family: 'Quicksand', serif; font-size: 27px; } print {font-family: 'Quicksand', serif; font-size: 27px;} h5 {font-family: 'Quicksand', cursive; serif; font-size: 24px; color: white;} p {font-family: 'Quicksand', sans-serif; text-indent: font-size: 17PX; text-align: justify;} a {font-family: 'Pacifico', cursive; serif; font-size: 30px; color: white;} li > a {font-family: 'Quicksand', sans-serif; font-size: 20px;} .nav-tabs > li, .nav-pills > li { float:none; display:inline-block; *display:inline; /* ie7 fix */ zoom:1; /* hasLayout ie7 trigger */ } .nav-tabs, .nav-pills{ text-align:center; } .dropdown-menu { left: 50%; right: auto; transform: translate(-50%, 0); } .dropdown-menu { left: 50%; right: auto; transform: translate(-50%, 0); } @media only screen and (min-width: 768px) { .navbar-custom { background: transparent; border-bottom: 1px solid transparent; } .navbar-custom .navbar-brand { color: black; padding: 20px; } .navbar-custom .navbar-brand:hover, .navbar-custom .navbar-brand:focus { color: rgba(000); } .footer{ position: fixed; text-align: center; bottom: 0px; width: 100%; } textarea{ width: 600px; height: 250px; } </style> <!--END CSS--> </head> <body> <nav class="navbar navbar-default navbar-custom navbar-fixed-top"> <div class="container-fluid"> <div class="navbar-header page-scroll"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="Secur.php">Data Security</a> </div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <li> <a href="#" data-toggle="modal" data-target="#myModal"> <span class="glyphicon glyphicon-send" data-toggle="tooltip" data-placement="bottom" data-original-title="REGISTER"></span></a> </li> <li> <a href="Secur.php" data-toggle="tooltip" data-placement="bottom" data-original-title="Home"> <span class="glyphicon glyphicon-home"></span></a> </li> </ul> </div> </div> </nav> <!-- MODAL --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title" id="myModalLabel">Register</h4> </div> <div class="modal-body"> <form class="form-horizontal"> <fieldset> <div class="form-group"> <label for="studentno" control-label"></label> <div class="col-lg-8 col-lg-offset-2"> <input type="text" class="form-control" id="studentno" name='studentno' min="11" max="11" maxlength="11" placeholder="Student Number"required> </div> </div> <div class="form-group"> <label for="studentname" control-label"></label> <div class="col-lg-8 col-lg-offset-2"> <input type="text" class="form-control" id="studentname" name='studentname' placeholder="Username" required> </div> </div> <div class="form-group"> <label for="email" control-label"></label> <div class="col-lg-8 col-lg-offset-2"> <input type="email" class="form-control" id="email" name='email'placeholder="Email Address" required> </div> </div> <div class="form-group"> <label for="password"control-label"></label> <div class="col-lg-8 col-lg-offset-2"> <input type="password" class="form-control" id="password" name='password' min="6" max="10" maxlength="10" placeholder="Password" required> </div> </div> </div> Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/JX03i:164 Stack trace: #0 {main} thrown in /in/JX03i on line 164
Process exited with code 255.
Output for 5.3.18 - 5.6.28
<!--HTML5 + Bootstrap--> <!doctype html> <html lang="en"> <form action=Secur.php method=GET> <head> <meta charset="utf-8"/> <!--Bootstrap LINKS--> <link href="css/bootstrap.min.css" rel="stylesheet"> <link href="css/bootstrap.css" rel="stylesheet" media="screen"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <link href="css/clean-blog.css" rel="stylesheet"> <!--Fonts--> <link href='http://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Bree+Serif' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Quicksand' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Yantramanav:400,100' rel='stylesheet' type='text/css'> <!--Javascript--> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/tooltip.js"></script> <!--CSS--><style> body{ position: relative; /* required */ background: url("") no-repeat fixed center; opacity: 0.9; filter: alpha(opacity=10); } label {font-family: 'Pacifico', cursive; serif; font-size: 35;} button {font-family: 'Quicksand', serif; font-size: 40px;} textarea {font-family: 'Quicksand', cursive; serif; font-size: 30px;} h1 {font-family: 'Pacifico', cursive; serif; font-size: 50px;} h2 { margin: 0; color: #fff; padding-top: 60px; font-size: 50px; font-family: 'Quicksand', serif; font-size: 27px; } print {font-family: 'Quicksand', serif; font-size: 27px;} h5 {font-family: 'Quicksand', cursive; serif; font-size: 24px; color: white;} p {font-family: 'Quicksand', sans-serif; text-indent: font-size: 17PX; text-align: justify;} a {font-family: 'Pacifico', cursive; serif; font-size: 30px; color: white;} li > a {font-family: 'Quicksand', sans-serif; font-size: 20px;} .nav-tabs > li, .nav-pills > li { float:none; display:inline-block; *display:inline; /* ie7 fix */ zoom:1; /* hasLayout ie7 trigger */ } .nav-tabs, .nav-pills{ text-align:center; } .dropdown-menu { left: 50%; right: auto; transform: translate(-50%, 0); } .dropdown-menu { left: 50%; right: auto; transform: translate(-50%, 0); } @media only screen and (min-width: 768px) { .navbar-custom { background: transparent; border-bottom: 1px solid transparent; } .navbar-custom .navbar-brand { color: black; padding: 20px; } .navbar-custom .navbar-brand:hover, .navbar-custom .navbar-brand:focus { color: rgba(000); } .footer{ position: fixed; text-align: center; bottom: 0px; width: 100%; } textarea{ width: 600px; height: 250px; } </style> <!--END CSS--> </head> <body> <nav class="navbar navbar-default navbar-custom navbar-fixed-top"> <div class="container-fluid"> <div class="navbar-header page-scroll"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="Secur.php">Data Security</a> </div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <li> <a href="#" data-toggle="modal" data-target="#myModal"> <span class="glyphicon glyphicon-send" data-toggle="tooltip" data-placement="bottom" data-original-title="REGISTER"></span></a> </li> <li> <a href="Secur.php" data-toggle="tooltip" data-placement="bottom" data-original-title="Home"> <span class="glyphicon glyphicon-home"></span></a> </li> </ul> </div> </div> </nav> <!-- MODAL --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title" id="myModalLabel">Register</h4> </div> <div class="modal-body"> <form class="form-horizontal"> <fieldset> <div class="form-group"> <label for="studentno" control-label"></label> <div class="col-lg-8 col-lg-offset-2"> <input type="text" class="form-control" id="studentno" name='studentno' min="11" max="11" maxlength="11" placeholder="Student Number"required> </div> </div> <div class="form-group"> <label for="studentname" control-label"></label> <div class="col-lg-8 col-lg-offset-2"> <input type="text" class="form-control" id="studentname" name='studentname' placeholder="Username" required> </div> </div> <div class="form-group"> <label for="email" control-label"></label> <div class="col-lg-8 col-lg-offset-2"> <input type="email" class="form-control" id="email" name='email'placeholder="Email Address" required> </div> </div> <div class="form-group"> <label for="password"control-label"></label> <div class="col-lg-8 col-lg-offset-2"> <input type="password" class="form-control" id="password" name='password' min="6" max="10" maxlength="10" placeholder="Password" required> </div> </div> </div> Fatal error: Call to undefined function mysql_connect() in /in/JX03i on line 164
Process exited with code 255.