3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); //db include_once('db.php'); $user_email = $_SESSION['email']; $resultuid = mysql_query("SELECT `id` FROM `tbluser` WHERE `email` = '$user_email'") or die(mysql_error()); $row_id = mysql_fetch_assoc($resultuid); $user_id = $row_id['id']; // id of the user if(isset($_POST['delete_user']) && !empty($_POST['delete_user'])) { $gid = $_POST['gid']; $query4admin = mysql_query("SELECT * FROM groups WHERE id = '$gid' AND admin = '$user_id' AND active = '1'"); $admin = mysql_num_rows($query4admin); if($admin==1){ $delete_user = mysql_real_escape_string($_POST['delete_user']); mysql_query("UPDATE groupmembers SET flag = '0' WHERE `member`='$delete_user' AND `id`='$gid'") or die("Error occured!"); header('Location: /groups/?id='.$gid.'&msg=The user has been kicked out or deleted from the group!'); } else { echo "<b>You are not admin of this group</b> or this group is a deleted/suspended one!"; } } elseif(isset($_POST['group']) && !empty($$_POST['group'])) { $gid = mysql_real_escape_string($_POST['group']); $query4admin = mysql_query("SELECT * FROM groups WHERE id = '$gid' AND admin = '$user_id' AND active = '1'"); $admin = mysql_num_rows($query4admin); if($admin==1){ mysql_query("UPDATE groups SET active = '0' WHERE `id`='$gid' AND `admin`='$user_id'") or die("Error occured!"); header('Location: /groups/?msg=You group has been deleted!'); } else { echo "<b>You are not admin of this group</b> or this group is already deleted!"; } } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: include_once(): open_basedir restriction in effect. File(db.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/VYlYj on line 4 Warning: include_once(db.php): Failed to open stream: Operation not permitted in /in/VYlYj on line 4 Warning: include_once(): Failed opening 'db.php' for inclusion (include_path='.:') in /in/VYlYj on line 4 Warning: Undefined array key "email" in /in/VYlYj on line 6 Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/VYlYj:8 Stack trace: #0 {main} thrown in /in/VYlYj on line 8
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
43.17 ms | 402 KiB | 8 Q