3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); //Load latest update //error_reporting(0); // include db here include('db.php'); include_once 'includes/functions.php'; include_once 'includes/tolink.php'; include_once 'includes/time_stamp.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); $uid = $row_id['id']; // id of the user $Wall = new Wall_Updates(); if(isSet($_POST['update'])) { $update=$_POST['update']; $privacy=$_POST['privacy']; if($privacy=='0'){ $privacy=$privacy; } elseif( $privacy=='2' ) {$privacy=$privacy;} else { $privacy='1';} if(isSet($_FILES['photo'])) { $photo = $_FILES['photo']; $photoname = stripslashes($photo['name']); $photopath = "uploads/photos/".$uid."_" . basename($photoname); $ext = pathinfo($photo['tmp_name'], PATHINFO_EXTENSION); $ext = strtolower($ext); if (move_uploaded_file($photo['tmp_name'], $photopath)) { // Move succeed. list($width,$height)=getimagesize($photopath); if($width > 400 || $height > 300) { $photo = "<img src=\"".$photopath."\" width=\"400\" height=\"300\" />"; } else { $photo = "<img src=\"".$photopath."\" />"; } $data=$Wall->Insert_Photo($uid,$update,$photo,$privacy); } else { // Move failed. Possible duplicate? header("Location: wall.php?msg=Invalid image name!"); } } elseif(isSet($_FILES['file'])) { $file = $_FILES['file']; $filename = stripslashes($file['name']); $filepath = "uploads/docs/".$uid."_" . basename($filename); $ext = pathinfo($file['tmp_name'], PATHINFO_EXTENSION); $ext = strtolower($ext); if (move_uploaded_file($file['tmp_name'], $filepath)) { // Move succeed. $filepath="http://nitofa.com/$filepath"; $data=$Wall->Insert_Doc($uid,$update,$filepath,$privacy); } else { // Move failed. Possible duplicate? header("Location: wall.php?msg=Not valid file name!"); } } else { $data=$Wall->Insert_Update($uid,$update,$privacy); } if($data) { $msg_id=$data['msg_id']; $message=tolink(htmlentities($data['message'])); $time=$data['created']; $uid=$data['uid_fk']; $resultname = mysql_query("SELECT * FROM `tbluser` WHERE `id` = '$uid'") or die(mysql_error()); $row_name = mysql_fetch_assoc($resultname); $fullname = $row_name['fname'].' '.$row_name['lname']; // full name of user $face=$Wall->Avatar($uid); //$commentsarray=$Wall->Comments($msg_id); ?> <?php if(!$_GET['mode']=='ajax') { header("Location: wall.php?msg=Posted successfully!"); } ?> <div class="stimg"> <img src="<?php echo $face;?>" class='big_face'/> </div> <div class="sttext"> <a class="stdelete" href="#" id="<?php echo $msg_id;?>" title='Delete update'>X</a> <b><a href="<?php echo 'http://nitofa.com/browse-user.php?fid='.$uid;?>"><?php echo $fullname;?></a></b> <?php echo $message;?> <div class="sttime"><?php time_stamp($time);?> | <a href='#' class='commentopen' id='<?php echo $msg_id;?>' title='Comment'>Comment </a> | <?php include('likeunlike.php'); ?></div> <div id="stexpandbox"> <div id="stexpand"></div> </div> <div class="commentcontainer" id="commentload<?php echo $msg_id;?>"> <?php // include('load_comments.php') ?> </div> <div class="commentupdate" style='display:none' id='commentbox<?php echo $msg_id;?>'> <div class="stcommentimg"> <img src="<?php echo $face;?>" class='small_face'/> </div> <div class="stcommenttext" > <form method="post" action=""> <textarea name="comment" class="comment" maxlength="200" id="ctextarea<?php echo $msg_id;?>"></textarea> <br /> <input type="submit" value=" Comment " id="<?php echo $msg_id;?>" class="comment_button"/> </form> </div> </div> </div> </div> <?php } } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: include(): open_basedir restriction in effect. File(db.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/XAq4U on line 8 Warning: include(db.php): Failed to open stream: Operation not permitted in /in/XAq4U on line 8 Warning: include(): Failed opening 'db.php' for inclusion (include_path='.:') in /in/XAq4U on line 8 Warning: include_once(): open_basedir restriction in effect. File(includes/functions.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/XAq4U on line 9 Warning: include_once(includes/functions.php): Failed to open stream: Operation not permitted in /in/XAq4U on line 9 Warning: include_once(): Failed opening 'includes/functions.php' for inclusion (include_path='.:') in /in/XAq4U on line 9 Warning: include_once(): open_basedir restriction in effect. File(includes/tolink.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/XAq4U on line 10 Warning: include_once(includes/tolink.php): Failed to open stream: Operation not permitted in /in/XAq4U on line 10 Warning: include_once(): Failed opening 'includes/tolink.php' for inclusion (include_path='.:') in /in/XAq4U on line 10 Warning: include_once(): open_basedir restriction in effect. File(includes/time_stamp.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/XAq4U on line 11 Warning: include_once(includes/time_stamp.php): Failed to open stream: Operation not permitted in /in/XAq4U on line 11 Warning: include_once(): Failed opening 'includes/time_stamp.php' for inclusion (include_path='.:') in /in/XAq4U on line 11 Warning: Undefined array key "email" in /in/XAq4U on line 13 Fatal error: Uncaught Error: Call to undefined function mysql_query() in /in/XAq4U:15 Stack trace: #0 {main} thrown in /in/XAq4U on line 15
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:
48.75 ms | 403 KiB | 8 Q