3v4l.org

run code in 300+ PHP versions simultaneously
<?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>
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Warning: include(): open_basedir restriction in effect. File(session.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/GUMTs on line 2 Warning: include(session.php): Failed to open stream: Operation not permitted 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 8.0.13
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 7.3.32 - 7.3.33, 7.4.33
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 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.32
Warning: include(): open_basedir restriction in effect. File(session.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/GUMTs on line 2 Warning: include(session.php): failed to open stream: Operation not permitted 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.6.0 - 5.6.38
Warning: include(): open_basedir restriction in effect. File(session.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/GUMTs on line 2 Warning: include(session.php): failed to open stream: Operation not permitted 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.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38
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.

preferences:
245.36 ms | 402 KiB | 370 Q