Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
I need help Parse error: syntax error, unexpected $end in ...
Old 11-25-2007, 02:24 PM I need help Parse error: syntax error, unexpected $end in ...
goheadtry's Avatar
Webmaster Talker

Posts: 730
Name: John
Location: United States of America, California
Trades: 0
I need help I am getting this error
Code:
Parse error:  syntax error, unexpected $end in /home/forbushj/public_html/zzupload.php on line 76
PHP Code:
<?php
if(count($_POST) <1){
//show the form
    
if(isset($_GET['error'])){
        if(
$_GET['error'] == "nofile"){
            
$if_error="Please choose a file to upload.";
        }elseif(
$_GET['error'] == "notvid"){
            
$if_error="The file you selected is not a video.";
        }elseif(
$_GET['error'] == "couldnotupload"){
            
$if_error="Your file could not be uploaded.";
        }elseif(
$_GET['error'] == "noconvert"){
            
$if_error="We're sorry, but your video could not be converted for some reason.";
        }
    }else{
        
$if_error="";
    }
    echo 
"<form name=\"uploadform\" action=\"\" method=\"post\" enctype=\"multipart/form-data\">
    
$if_error
    <!--THE_REST_OF_YOUR_FORM_GOES_HERE-->
    </form>"
;
}else{
//do the processing

function is_video$f ){
$result trim exec ('file -bi ' escapeshellarg $f ) ) ) ;
$TYPE explode("/"$result);
if(
$TYPE[0] == "video"){
return 
TRUE;
}
else{
return 
FALSE;
}

if(
$_FILES['ufile']['name'] == ""){
    
header("location: {$_SERVER['PHP_SELF']}?error=nofile");
    exit();
}

if(!
is_video($_FILES['ufile']['name'])){
    
header("location: {$_SERVER['PHP_SELF']}?error=notvid");
    exit();
}

if(!
move_uploaded_file($_FILES['ufile']['tmp_name'],$_SERVER['DOCUMENT_ROOT']."/uploadvidd/".$_FILES['ufile']['name'])){
    
header("location: {$_SERVER['PHP_SELF']}?error=couldnotupload");
    exit();
}

$ffmpeg '/usr/bin/ffmpeg';//location of ffmpeg binary
$bitrate '32';//bitrate for audio options are 16,32,64
$ext '.flv';//Extension of output video files
$extb '.jpg';//Extension of image
$vidsize '320x240'//video size
$imgsize '150x100';//image size for menu
$force 'flv';//Force video format to
$sstime '00:00:35';//time to take screenshot
$samprate ='22050'// Sample rate choices are as follows 11025, 22050, 44100)
//Converts uploaded video with FFmpeg binary
if(!exec('$ffmpeg -i /home/forbushj/public_html/uploadvidd/'.$vidIN.' -ar $samprate -ab $bitrate -f flv -s $vidsize /home/forbushj/public_html/vidd/'.$vidout.'.$ext.') || !exec('$ffmpeg -i /home/forbushj/public_html/vidd/'.$vidout.''.$ext.' -s $imgsize -an -ss $sstime -an -r 1 -vframes 1 -y -f image2 /home/forbushj/public_html/pic/video/'.$vidout.'.$extb.')){
    
header("location: {$_SERVER['PHP_SELF']}?error=noconvert");
    exit();
}

//write to mysql
$linkID = @mysql_connect("localhost","ffgdfg","$141dfg") or die("Could not connect to MySQL server");
@
mysql_select_db("forbushj_onetest") or die("Could not select database");
 
// Retrieve the posted product information.
$titlev stripslashes($_POST['vidname']);      
$descrv stripslashes($_POST['viddes']);
$srcv stripslashes($_POST['srcof']);
if(
$query=mysql_query("INSERT INTO video(`title`,`descr`,`pic`,`locat`,`src`) VALUES ('" mysql_real_escape_string($titlev) . "','" mysql_real_escape_string($descrv) . "','" mysql_real_escape_string($output) . ".jpg','" mysql_real_escape_string($output) . ".flv','" mysql_real_escape_string($srcv) . "')")){
    echo 
"Successfully uploaded and converted your file.";
}
}
?>
__________________
Free $1 gift card when you signup at
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
 
Register now for full access!
Old 11-25-2007, 02:32 PM Re: I need help Parse error: syntax error, unexpected $end in ...
maxxximus's Avatar
Extreme Talker

Posts: 219
Name: Rob
Location: UK
Trades: 0
Looks like your missing a closing bracket.

Try adding a } at the end of the script so there are 3 } instead of 2.
maxxximus is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to I need help Parse error: syntax error, unexpected $end in ...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12107 seconds with 12 queries