Parse error: syntax error, unexpected T_VARIABLE in /home/lpxxfain/public_html/membersupload.php on line 29
I really don't know what I did wrong, please help.
<?php
ob_start();
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
$imagesize = $_FILES['imagefile']['size'];
$status = addslashes(strip_tags($_POST['status']));
$category = $_POST['category'];
$imagename = addslashes(strip_tags($_POST['requiredimagename']));
$owner = $userdata['user_name'];
$ownerdir = $owner;
$date = date('F d, Y');
$description = addslashes(strip_tags($_POST['requireddescription']));
$category = addslashes(strip_tags($_POST['category']));
$username = $userdata['user_name'];
$filename = str_replace(' ', '', $_FILES['userfile']['name']);
$tblw = strlen($filename);
$ext = substr($filename, $tblw-3, $tblw);
$exts = array("png", "gif", "jpg");
if ($ext == 'png' OR $ext == 'gif' OR $ext == 'jpg') {
$idq = mysql_query("SELECT `id` FROM `registered_files` ORDER BY `id` DESC LIMIT 1");
$ida = mysql_fetch_assoc($idq);
$id = $ida['id'] + 1;
$uploaddir = '/home/lpxxfain/public_html/members/images/';
$path = '/home/lpxxfain/public_html/members/images/'.$id. '.'.$ext;
$uploadfile = $uploaddir . $id . "." . $ext;
$viewid = str_replace(' ', '', $imagename.$id);
$idpath = 'http://aimmultimedia.com/wm'.$ext.'.php?src='.$id.'&ext='.$ext.'&viewid='$viewid; (Line 29)
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile);
mysql_query("INSERT INTO `registered_files` (`id`,`path`,`owner`,`idpath`,`description`,`category`,`status`,`imagename`,`viewid`,`ext`,`date`) VALUES('$id','$path','$owner','$idpath','$description','$category','$status','$imagename','$viewid','$ext','$date')");
switch ($ext):
case jpg:
header("Location: http://aimmultimedia.com/wmjpg.php?src=$id&ext=$ext&viewid=$viewid");
break;
case gif:
header("Location: http://aimmultimedia.com/wmgif.php?src=$id&ext=$ext&viewid=$viewid");
break;
case png:
header("Location: http://aimmultimedia.com/wmpng.php?src=$id&ext=$ext&viewid=$viewid");
break;
default:
echo "Error! Please contact the administrator!.";
endswitch;
};
ob_end_flush();
?>
<?php
require_once "footer.php";
?>
Thanks in advance. Regards,
AIM Multimedia.com