GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 02-Dec-2006, 04:13
nessler nessler is offline
New Member
 
Join Date: Dec 2006
Posts: 1
nessler is on a distinguished road

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'


Hi all,

I'm using a php script to open videos in a pop up window, but I always get this error.

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /data/members/free/tripod/nl/b/u/b/bubblegun/htdocs/popup2go/popup.php on line 114

here's the php:

PHP Code:

<?php

if ($_GET['url'])
    $url = $_GET['url'];
    
if ($_GET['size']) {
    $size = $_GET['size'];
} else {
    $size = 320;
}

$width = $size;
$height = round(($size/4)*3);

// get file extension
$url_array = split("/", $url);    
$filename = $url_array[sizeof($url_array)-1];
$file_array = explode(".", $filename);
$file_ext = strtolower($file_array[sizeof($file_array)-1]);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<title>Video</title>

<style>
body {
    background-color: #000000;
    text-align: center;
    margin: 0px;
    padding: 0px;
    color:#CCCCCC;
    font-size:12px;
    font-family: Arial, Verdana, Helvetica, sans-serif;
}

a {
    font-size:12px;
    color:#CCCCCC;
    text-decoration:none;
}

a:hover {
    text-decoration: underline;
}

#video {
    height: 100%;
    margin: auto;
    padding: 15px auto;
}

</style>

<script src="quicktime.js" language="JavaScript" type="text/javascript"></script>
<script src="windowsmedia.js" language="JavaScript" type="text/javascript"></script>
<script src="AC_RunActiveContent.js" type="text/javascript"></script>
<script src="AC_ActiveX.js" type="text/javascript"></script>

</head>

<body>
<div id="video">
<?php

$html = "";

// print HTML embed code for each file type
switch ($file_ext) {
    case "mov":
    case "mp4":
    case "qt":
    case "smil":
    case "3gp":
    case "mpg":
    case "mpeg":
    case "m4v":
    case "mp3":
    case "wav":
    case "aiff":
    case "aac":
    case "m4b":
        $height = $height + 16;
        $html = "";
        $html .= "<script language=\"JavaScript\" type=\"text/javascript\">\n";
        $html .= "QT_WriteOBJECT_XHTML(\"$url\",\"$width\",\"$height\",\"\",\"autoplay\",\"true\",\"emb#bgcolor\",\"black\",\"align\",\"middle\");\n";
        $html .= "</script>\n";
        break;
        
    case "wmv":
    case "avi":
        $height = $height + 46;
        $html = "";
        $html .= "<div id=\"EXAMPLE_DIV_ID\">This text will be replaced by the control</div>\n";
        $html .= "<script language=\"JavaScript\" type=\"text/javascript\" defer=\"yes\">\n";
        $html .= "CreateControl(\"EXAMPLE_DIV_ID\",\"clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6\",\"EXAMPLE_OBJECT_ID\",\"$width\",\"$height\",\"$url\",\"-1\");\n";
        $html .= "</script>\n";
        break;
        
    case "swf":
        $url = substr($url, 0, -4); // removes .swf file extension which is required by .js from Macromedia
        $html = "";
        $html .= "<script type=\"text/javascript\">\n";
        $html .= "AC_FL_RunContent(\"codebase\",\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\",\"width\",\"$width\",\"height\",\"$height\",\"src\",\"$url\",\"quality\",\"high\",\"pluginspage\",\"http://www.macromedia.com/go/getflashplayer\",\"movie\",\"$url\"); //end AC code\n";
        $html .= "</script>\n";
        break;
        
    case "flv":
        $height = $height + 20;
        $html = "";
        $html .= "<script type=\"text/javascript\">\n";
        $html .= "AC_FL_RunContent(\"codebase\",\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\",\"data\",\"flvplayer.swf?file=$url\",\"width\",\"$width\",\"height\",\"$height\",\"src\",\"flvplayer?file=$url\",\"quality\",\"high\",\"pluginspage\",\"http://www.macromedia.com/go/getflashplayer\",\"movie\",\"flvplayer?file=$url\"); \/\/end AC code\n";
        $html .= "</script>\n";
        break;
    
       case "rm":
       case "ram":
// Start of rm section added by Lance G of [url]www.krahne.com[/url] on 2/7/06.
// have not tested many different types of real media videos.  Use at your own risk.
           $html =<<<END
<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="$width" height="$height" id="RVOCX">
<param name="src" value="$url">
<param name="autostart" value="true">
<param name="controls" value="imagewindow">
<param name="console" value="video">
<embed src="$url" width="$width" height="$height" type="audio/x-pn-realaudio-plugin" autostart="true" controls="imagewindow" console="video">
</embed>
</object>
END;
// End of section added by Lance G of [url]www.krahne.com[/url] on 2/7/06.
               break;
}

echo $html;
echo "<br/>";
/*
echo "Resize: <a href=\"" . $_SERVER['PHP_SELF'] . "?url=" . $url . "&size=320\">320x340</a> | <a href=\"" . $_SERVER['PHP_SELF'] . "?url=" . $url . "&size=640\">640x480</a></div>";
*/
?>
</div>
</body>
</html>




line 114:

$html .= "<script type=\"text/javascript\">\n";



Any help is very welcome !!
Last edited by admin : 02-Dec-2006 at 04:20. Reason: Please insert your PHP code between [php] & [/php] tags
  #2  
Old 27-Jan-2007, 03:46
dollarbd dollarbd is offline
New Member
 
Join Date: Jan 2007
Posts: 4
dollarbd is on a distinguished road

Re: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'


In line 114 it was ----- $html .= "<script type=\"text/javascript\">\n";
instead of this write
$html .= "<script type=\'text/javascript\'>\n";
If it work properly, pls let me know.
 

Recent GIDBlogToyota - 2008 July Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 04:29.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.