3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php include('session.php'); ?> <?php $connection = mysql_connect("localhost:3306", "gregb_admin", "jokBHYX2016@!@") or die ("Couldn't connect to server."); $db = mysql_select_db('preesclamp', $connection) or die ("Couldn't select database."); $query = "select * from testlogin1 where id = '$id_session'"; $result = mysql_query($query); while ($line1 = mysql_fetch_array($result, MYSQL_ASSOC)) { $line1['age']; $line1['week6weight']; $line1['week6bps']; $line1['week6bpd']; $Age = $line1['age']; $displayweight = $line1['week6weight']; $displaybps = $line1['week6bps']; $displaybpd = $line1['week6bpd']; } $Key=$_POST['id']; $Week7weight=$_POST['weight']; $Week7bp_s=$_POST['bp_s']; $Week7bp_d=$_POST['bp_d']; $data2 = "UPDATE testlogin1 SET week7weight='$Week7weight', week7bps='$Week7bp_s', week7bpd='$Week7bp_d' WHERE id='$Key'"; $query1 = mysql_query($data2) or die("Couldn't execute query. ". mysql_error()); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Week 7 Results</title> </head> <body> <?php $lowerage = 21; $higherage = 35; if ($higherage < $Age) { echo "<img src=red_down.jpg>"; } elseif ($lowerage > $Age) { echo "<img src=red_down.jpg>"; } else { echo "<img src=green_up.jpg>"; } if (array_key_exists('content', $_POST)) { echo "Age:"; echo htmlspecialchars($_POST['content']); } ?> Age: <?php echo $Age?> <br> <strong>Week 7 Results</strong> <br><br> Weight (Week 6): <?php echo $displayweight ?> <br><br> Week 6 Blood Pressure: <?php echo $displaybps ?> / <?php echo $displaybpd ?> <br><br> <?php $weightfactor = $Week7weight - $displayweight; if (array_key_exists('weight', $_POST)) { } if ($weightfactor <= 5) { echo "<img src=green_up.jpg>"; } else { echo "<img src=red_down.jpg>"; } ?> <br><br> Weight (Week 7): <?php echo $Week7weight?> <br> Week 7 Blood Pressure: <?php echo $Week7bp_s?> / <?php echo $Week7bp_d?> <br> <br> <a href="welcome.php" title="Go Back Home">Go Back Home</a> </body> </html>
based on 2INlc
Output for 7.0.0 - 7.2.0
Warning: include(session.php): failed to open stream: No such file or directory in /in/GUMTs on line 2 Warning: include(): Failed opening 'session.php' for inclusion (include_path='.:') in /in/GUMTs on line 2 Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /in/GUMTs:6 Stack trace: #0 {main} thrown in /in/GUMTs on line 6
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Warning: include(session.php): failed to open stream: No such file or directory in /in/GUMTs on line 2 Warning: include(): Failed opening 'session.php' for inclusion (include_path='.:') in /in/GUMTs on line 2 Fatal error: Call to undefined function mysql_connect() in /in/GUMTs on line 6
Process exited with code 255.