3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 5.3.0 - 5.4.16
Parse error: syntax error, unexpected '}' in /in/Ko5cu on line 111
Process exited with code 255.