• PHP Help General Help
  • [RESOLVED] Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';

<?php
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";

$username = $userdata['user_name'];

$sql2="SELECT * FROM registered_files WHERE id = '$id'";
$result2=mysql_query($sql2);
$rows2=mysql_fetch_array($result2);

$imagename = $rows2['imagename'];
$imagedescription = $rows2['description'];

opentable('Edit Images');
$owner = $userdata['user_name'];
$sql = "SELECT * FROM `registered_files` WHERE `owner` = '$owner'" ;
$result=mysql_query($sql);
// Define $color=1
$color="1";
echo '<table width="850" border="1" align="center" cellpadding="2" cellspacing="0">';
while($rows=mysql_fetch_array($result)){
$id = $rows['id'];
// If $color==1 table row color = #FFC600
if($color==1){
echo '<tr bgcolor="#eeeeee" onmouseover ="style.backgroundColor=\'#3D59AB\';" onmouseout=\'style.backgroundColor="#eeeeee"\'>
<td>'.$rows['status'].'</td><td>'.$rows['imagename'].'</td><td>'.$rows['date'].'</td><td>'.$rows['description'].'</td>
<td><a href="/memberseditimages.php?editid='.$id.'">Edit</a></td>
</tr>';
// Set $color==2, for switching to other color
$color="2";
}
// When $color not equal 1, use this table row color
else {
echo '<tr bgcolor="#c0c0c0" onmouseover ="style.backgroundColor=\'#3D59AB\';" onmouseout=\'style.backgroundColor="#c0c0c0"\'>
<td>'.$rows['status'].'</td><td>'.$rows['imagename'].'</td><td>'.$rows['date'].'</td><td>'.$rows['description'].'</td>
<td><a href="/memberseditimages.php?editid='.$id.'">Edit</a></td>
</tr>';
// Set $color back to 1
$color="1";
}}
echo '</table>';
$editid = $_GET['editid'];
$sql2="SELECT * FROM registered_files WHERE id = '$editid'";
$result2=mysql_query($sql2);
$rows2=mysql_fetch_array($result2);
$imagename = $rows2['imagename'];
$imagedescription = $rows2['description'];
if(isset($_GET['editid']) && $rows2['owner'] = $username) {
echo '<br /><br /> <center><body><table width="700" border="1" cellpadding="2" cellspacing="0">
  <tr>
    <td width="156">Status:</td>
    <td width="530"><form id="form1" name="form1" method="post" action="editimagesprocess.php?save=1">
    <font color= "green" >Public</font>
        <input name="status" type="radio" value="public" />
        </label>
    or
    <label>
    <font color="red"> Private </font>
     <input name="status" type="radio" value="private" />
     <input name="id" type="hidden" value='.$editid'>
    </label>
    <label>
    <label>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input name="Save1" type="submit" id="Save1" value="Save" />
    </label>
    </form>
    </td>
  </tr>
  <tr>
    <td>Image Name: </td>
    <td><form id="form2" name="form2" method="post" action="editimagesprocess.php?save=2">
      <label>
        <input name="imagename" type="text" id="imagename" value='.$imagename.' size="40" maxlength="50">
             <input name="id" type="hidden" value='.$editid.'>
        </label>
      <label>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <input name="Save2" type="submit" id="Save2" value="Save">
      </label>
    </form>
    </td>
  </tr>
  <tr>
    <td height="77">Image Description: </td>
    <td><form name="imagedescription" method="post" action="editimagesprocess.php?save=3">
      <label>
        <textarea name="imagedescription" cols="50" rows="3" id="imagedescription">'.$imagedescription.'</textarea>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
      <label>
      <input name="imagedescription" type="submit" id="Save3" value="Save">
      </label>
           <input name="id" type="hidden" value='.$editid'>
    </form>
    </td>
  </tr>
</table></center>';


}
require_once "side_right.php";
require_once "footer.php";

?> 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/lpxxfain/public_html/memberseditimages.php on line 75

I really don't know where it went wrong. It was working fine, before I added the "hidden field." Please help,

Regards,
AIMMutlmedia.com

     '    <label>
        <font color="red"> Private </font>
         <input name="status" type="radio" value="private" />
         <input name="id" type="hidden" value='.$editid'>  

    Right there

      missing a "." between $editid and '>.....

        Ah! Thank you, didn't think it really mattered. Oh well, we make mistakes, we learn. 🆒

          2 years later

          Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/fauna/domains/faunaurbana.org/public_html/administrator/index.php on line 240

          Can you help me? Thanks, I don't see the error :S

          <?php
          /**
          * @version $Id: index.php 8078 2007-07-19 06:45:54Z robs $
          * @Translator: Joomla Spanish 
          * @Review : shacker | 22/07/07
          * @package Joomla
          * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
          * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
          * Joomla! is free software. This version may have been modified pursuant
          * to the GNU General Public License, and as distributed it includes or
          * is derivative of works licensed under the GNU General Public License or
          * other free or open source software licenses.
          * See COPYRIGHT.php for copyright notices and details.
          */
          
          // Set flag that this is a parent file
          define( '_VALID_MOS', 1 );
          
          if (!file_exists( '../configuration.php' )) {
          	header( 'Location: ../installation/index.php' );
          	exit();
          }
          
          require( '../globals.php' );
          require_once( '../configuration.php' );
          
          // SSL check - $http_host returns <live site url>:<port number if it is 443>
          $http_host = explode(':', $_SERVER['HTTP_HOST'] );
          if( (!empty( $_SERVER['HTTPS'] ) && strtolower( $_SERVER['HTTPS'] ) != 'off' || isset( $http_host[1] ) && $http_host[1] == 443) && substr( $mosConfig_live_site, 0, 8 ) != 'https://' ) {
          	$mosConfig_live_site = 'https://'.substr( $mosConfig_live_site, 7 );
          }
          
          require_once( '../includes/joomla.php' );
          include_once ( $mosConfig_absolute_path . '/language/'. $mosConfig_lang .'.php' );
          
          //Installation sub folder check, removed for work with SVN
          if (file_exists( '../installation/index.php' ) && $_VERSION->SVN == 0) {
          	define( '_INSTALL_CHECK', 1 );
          	include ($mosConfig_absolute_path .'/offline.php');
          	exit();
          }
          
          $option = strtolower( strval( mosGetParam( $_REQUEST, 'option', NULL ) ) );
          
          // mainframe is an API workhorse, lots of 'core' interaction routines
          $mainframe = new mosMainFrame( $database, $option, '..', true );
          
          if (isset( $_POST['submit'] )) {
          	$usrname 	= stripslashes( mosGetParam( $_POST, 'usrname', NULL ) );
          	$pass 		= stripslashes( mosGetParam( $_POST, 'pass', NULL ) );
          
          if($pass == NULL) {
          	echo "<script>alert('Por favor ponga una contraseña'); document.location.href='index.php?mosmsg=Por favor ponga una contraseña'</script>\n";
          	exit();
          }
          
          $query = "SELECT COUNT(*)"
          . "\n FROM #__users"
          . "\n WHERE ("
          // Administrators
          . "\n gid = 24"
          // Super Administrators
          . "\n OR gid = 25"
          . "\n )"
          ;
          $database->setQuery( $query );
          $count = intval( $database->loadResult() );
          if ($count < 1) {
          	mosErrorAlert( _LOGIN_NOADMINS );
          }
          
          $my = null;
          $query = "SELECT u.*, m.*"
          . "\n FROM #__users AS u"
          . "\n LEFT JOIN #__messages_cfg AS m ON u.id = m.user_id AND m.cfg_name = 'auto_purge'"
          . "\n WHERE u.username = " . $database->Quote( $usrname )
          . "\n AND u.block = 0"
          ;
          $database->setQuery( $query );
          $database->loadObject( $my );
          
          /** find the user group (or groups in the future) */
          if (@$my->id) {
          	$grp 			= $acl->getAroGroup( $my->id );
          	$my->gid 		= $grp->group_id;
          	$my->usertype 	= $grp->name;
          
          	// Conversion to new type
          	if ((strpos($my->password, ':') === false) && $my->password == md5($pass)) {
          		// Old password hash storage but authentic ... lets convert it
          		$salt = mosMakePassword(16);
          		$crypt = md5($pass.$salt);
          		$my->password = $crypt.':'.$salt;
          
          		// Now lets store it in the database
          		$query = 'UPDATE #__users ' .
          				'SET password = '.$database->Quote($my->password) .
          				'WHERE id = '.(int)$my->id;
          		$database->setQuery($query);
          		if (!$database->query()) {
          			// This is an error but not sure what to do with it ... we'll still work for now
          		}
          	}
          
          	list($hash, $salt) = explode(':', $my->password);
          	$cryptpass = md5($pass.$salt);
          
          	if ( strcmp( $hash, $cryptpass ) || !$acl->acl_check( 'administration', 'login', 'users', $my->usertype ) ) {
          		mosErrorAlert("Incorrect Username, Password, or Access Level.  Please try again", "document.location.href='index.php'");
          	}
          
          	session_name( md5( $mosConfig_live_site ) );
          	session_start();
          
          	// construct Session ID
          	$logintime	= time();
          	$session_id = md5( $my->id . $my->username . $my->usertype . $logintime );
          
          
          	// add Session ID entry to DB
          	$query = "INSERT INTO #__session"
          	. "\n SET time = " . $database->Quote( $logintime ) . ", session_id = " . $database->Quote( $session_id ) . ", userid = " . (int) $my->id . ", usertype = " . $database->Quote( $my->usertype) . ", username = " . $database->Quote( $my->username )
          	;
          	$database->setQuery( $query );
          	if (!$database->query()) {
          		echo $database->stderr();
          	}
          
          	// check if site designated as a production site
          	// for a demo site allow multiple logins with same user account
          	if ( $_VERSION->SITE == 1 ) {
          		// delete other open admin sessions for same account
          		$query = "DELETE FROM #__session"
          		. "\n WHERE userid = " . (int) $my->id
          		. "\n AND username = " . $database->Quote( $my->username )
          		. "\n AND usertype = " . $database->Quote( $my->usertype )
          		. "\n AND session_id != " . $database->Quote( $session_id )
          		// this ensures that frontend sessions are not purged
          		. "\n AND guest = 1"
          		. "\n AND gid = 0"
          		;
          		$database->setQuery( $query );
          		if (!$database->query()) {
          			echo $database->stderr();
          		}
          	}
          
          	$_SESSION['session_id'] 			= $session_id;
          	$_SESSION['session_user_id'] 		= $my->id;
          	$_SESSION['session_username'] 		= $my->username;
          	$_SESSION['session_usertype'] 		= $my->usertype;
          	$_SESSION['session_gid'] 			= $my->gid;
          	$_SESSION['session_logintime'] 		= $logintime;
          	$_SESSION['session_user_params']	= $my->params;
          	$_SESSION['session_userstate'] 		= array();
          
          	session_write_close();
          
          	$expired = 'index2.php';
          
          	// check if site designated as a production site
          	// for a demo site disallow expired page functionality
          	if ( $_VERSION->SITE == 1 && @$mosConfig_admin_expired === '1' ) {
          		$file 	= $mainframe->getPath( 'com_xml', 'com_users' );
          		$params =& new mosParameters( $my->params, $file, 'component' );
          
          		$now 	= time();
          
          		// expired page functionality handling
          		$expired 		= $params->def( 'expired', '' );
          		$expired_time 	= $params->def( 'expired_time', '' );
          
          		// if now expired link set or expired time is more than half the admin session life set, simply load normal admin homepage
          		$checktime = ( $mosConfig_session_life_admin ? $mosConfig_session_life_admin : 1800 ) / 2;
          		if (!$expired || ( ( $now - $expired_time ) > $checktime ) ) {
          			$expired = 'index2.php';
          		}
          		// link must also be a Joomla link to stop malicious redirection
          		if ( strpos( $expired, 'index2.php?option=com_' ) !== 0 ) {
          			$expired = 'index2.php';
          		}
          
          		// clear any existing expired page data
          		$params->set( 'expired', '' );
          		$params->set( 'expired_time', '' );
          
          		// param handling
          		if (is_array( $params->toArray() )) {
          			$txt = array();
          			foreach ( $params->toArray() as $k=>$v) {
          				$txt[] = "$k=$v";
          			}
          			$saveparams = implode( "\n", $txt );
          		}
          
          		// save cleared expired page info to user data
          		$query = "UPDATE #__users"
          		. "\n SET params = " . $database->Quote( $saveparams )
          		. "\n WHERE id = " . (int) $my->id
          		. "\n AND username = " . $database->Quote( $my->username )
          		. "\n AND usertype = " . $database->Quote( $my->usertype )
          		;
          		$database->setQuery( $query );
          		$database->query();
          	}
          
          	// check if auto_purge value set
          	if ( $my->cfg_name == 'auto_purge' ) {
          		$purge 	= $my->cfg_value;
          	} else {
          	// if no value set, default is 7 days
          		$purge 	= 7;
          	}
          	// calculation of past date
          	$past = date( 'Y-m-d H:i:s', time() - $purge * 60 * 60 * 24 );
          
          	// if purge value is not 0, then allow purging of old messages
          	if ($purge != 0) {
          	// purge old messages at day set in message configuration
          		$query = "DELETE FROM #__messages"
          		. "\n WHERE date_time < " . $database->Quote( $past )
          		. "\n AND user_id_to = " . (int) $my->id
          		;
          		$database->setQuery( $query );
          		if (!$database->query()) {
          			echo $database->stderr();
          		}
          	}
          
          	/** cannot using mosredirect as this stuffs up the cookie in IIS */
          	// redirects page to admin homepage by default or expired page
          	echo "<script>document.location.href='$expired';</script>\n";
          	exit();
          } else {
          	mosErrorAlert("Nombre de usuario o clave incorrecto. Intenta de nuevo", "document.location.href='index.php?mosmsg=Nombre de usuario o clave incorrecto. Intentar de nuevo'");
          }
          } else {
          	initGzip();
          	$path = $mosConfig_absolute_path . '/administrator/templates/' . $mainframe->getTemplate() . '/login.php';
          	require_once($path'/home/fauna/domains/faunaurbana.org/public_html/administrator/templates/joomla_admin/login.php' (include_path='../usr/local/lib/php' );
          	doGzip();
          }
          ?>

            Right at the end:

            require_once($path'/home/fauna/domains/faunaurbana.org/public_html/administrator/templates/joomla_admin/login.php' (include_path='../usr/local/lib/php' );
                doGzip();
            

            there should be a '.' after $path.

              a month later
              <script language=\"javascript\">
              var newWin = null;
              function closeWin(){
                      if (newWin != null){
                              if(!newWin.closed)
                              newWin.close();
                      }
              }
              function popUp(strURL,strType,strHeight,strWidth) {
                      closeWin();
                      var strOptions="";
                      if (strType=="console") strOptions="resizable,height="+strHeight+",width="+strWidth;
                      if (strType=="fixed") strOptions="status,height="+strHeight+",width="+strWidth;
                      if (strType=="elastic") strOptions="toolbar,menubar,scrollbars,resizable,location,height="+strHeight+",width="+strWidth;
                      newWin = window.open(strURL, 'newWin', strOptions);
                      newWin.focus();
              }
              </script>

              Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';'

              why bro?!

                a year later

                I am not sure where the ')' should go, I have tried so many different options and it still isn't working!

                Please help.

                Thanks,

                <?php
                $post_notification_strings = array(
                	'error' => '&#12456;&#12521;&#12540;',
                	'already_subscribed' => '&#12377;&#12391;&#12395;&#30331;&#37682;&#12375;&#12414;&#12375;&#12383;!',
                	'activation_faild' => '&#12450;&#12463;&#12486;&#12451;&#12505;&#12540;&#12471;&#12519;&#12531;&#22833;&#25943;&#12375;&#12414;&#12375;&#12383;&#12290;',
                	'address_not_in_database' => '&#12354;&#12394;&#12383;&#12398;&#12513;&#12540;&#12523;&#12450;&#12489;&#12524;&#12473;&#12399;&#12487;&#12540;&#12479;&#12505;&#12540;&#12473;&#12364;&#35211;&#12388;&#12363;&#12426;&#12414;&#12379;&#12435;&#12391;&#12375;&#12383;&#12290;',
                	'sign_up_again'=>'&#20877;&#30331;&#37682;&#19979;&#12373;&#12356;&#12290;',
                	'deaktivated' => '&#28961;&#21177;&#12395;&#12394;&#12426;&#12414;&#12375;&#12383;&#12290;',
                	'no_longer_activated' => '@@addr &#12399;&#28961;&#21177;&#12395;&#12394;&#12426;&#12414;&#12375;&#12383;&#12290;',
                	'check_email' => '&#27491;&#12375;&#12356;&#12513;&#12540;&#12523;&#12450;&#12489;&#12524;&#12473;&#12434;&#12372;&#35352;&#20837;&#19979;&#12373;&#12356;&#12290;',
                	'wrong_captcha' => '&#12372;&#35352;&#20837;&#12398;&#25991;&#23383;&#12420;&#25968;&#23383;&#12399;&#19978;&#35352;&#12398;&#12452;&#12513;&#12540;&#12472;&#12392;&#36949;&#12356;&#12414;&#12377;&#12290;',
                	'registration_successful' => '&#30331;&#37682;&#25104;&#21151;',
                	'activated' => '&#12450;&#12463;&#12486;&#12451;&#12505;&#12540;&#12471;&#12519;&#12531;&#25104;&#21151;',
                	'all' => '&#20840;&#37096;',
                	'saved' => '&#35373;&#23450;&#20445;&#23384;&#12375;&#12414;&#12375;&#12383;&#12290;',
                	'unsubscribe_mail' => &#12461;&#12515;&#12531;&#12475;&#12523;&#12522;&#12531;&#12463;&#12364;&#12388;&#12356;&#12390;&#12356;&#12427;&#12513;&#12540;&#12523;&#12362;&#36865;&#12426;&#12356;&#12383;&#12375;&#12414;&#12375;&#12383;&#12290;',
                	'welcome' => '@@blogname&#12288;&#12395;&#30331;&#37682;&#12375;&#12414;&#12375;&#12383;&#12290;',
                )
                ?>

                  Missing a single quote on this line:

                  'unsubscribe_mail' => &#12461;&#12515;&#12531;&#12475;&#12523;&#12522;&#12531;&#12463;&#12364;&#12388;&#12356;&#12390;&#12356;&#12427;&#12513;&#12540;&#12523;&#12362;&#36865;&#12426;&#12356;&#12383;&#12375;&#12414;&#12375;&#12383;&#12290;',

                  You need a single quote before the ampersand.

                    4 months later

                    hi im new here, i think or maybe i already signup long time ago don't remember 😕

                    anyway i found this by chance looking in google for

                    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\index.php on line 383

                    i think this post will be kinda long but to make it short, i have a problem with this

                    this is the original code

                    // Loop through the files
                    while (false !== ($file = readdir($dir))) {
                            if (in_array($file, $exclude) == FALSE){
                                    $ext = pathinfo($path.$file);
                                    $ext = $ext['extension'];
                                    $file = str_replace($ext, '', $file);
                                 echo '<ul class="photo"><li><a href="'.$pathtoflv.$file.'flv"><span> </span><img src="'.$path.$file.'jpg" alt="'.$file.'" /></a><span></span></a></li><br></ul>';
                     }
                    }
                    

                    the problem is this

                    <a href="'.$pathtoflv.$file.'flv">

                    why isn't this working

                    // Loop through the files
                    while (false !== ($file = readdir($dir))) {
                            if (in_array($file, $exclude) == FALSE){
                                    $ext = pathinfo($path.$file);
                                    $ext = $ext['extension'];
                                    $file = str_replace($ext, '', $file);
                                 echo '<ul class="photo"><li> <a href="#" onclick="vlc_controls.play(\'.$pathtoflv.$file.'\'flv\')"><span> </span><img src="'.$path.$file.'jpg" alt="'.$file.'" /></a><span></span></a></li><br></ul>';
                    

                    this code, <a href="#" onclick="vlc_controls.play(\'.$pathtoflv.$file.'\'flv\')">

                    should give html output like this

                    <a href="#" onclick="vlc_controls.play('http://code.revolunet.com/VLCjs/rambo.mpg')">rambo trailer</a>

                    i'm following this page http://www.revolunet.com/labo/code/VLCcontrols

                    here is all my project files http://www.megaupload.com/?d=T4YSX4YJ

                    please somebody just 10 mints of your time to check whats wrong with it, inside zip only index.php you need to look and php code is very short. 🙁

                    please have a look into it, somebody

                    thank you

                      // missing single quote-----------------------------------------------v
                      echo '<ul class="photo"><li> <a href="#" onclick="vlc_controls.play(\'' .
                      $pathtoflv . $file . '\'flv\')"><span> </span><img src="' . $path . $file .
                      'jpg" alt="' . $file . '" /></a><span></span></a></li><br></ul>';
                      

                        thanks very much, but now im starting to think there is some bug with php its self :quiet:

                        the html output looks ok

                        <ul class="photo"><li> <a href="#" onclick="vlc_controls.play('./2.'flv')"><span> </span><img src="./2.jpg" alt="2." /></a><span></span></a></li><br></ul><

                        everything seems ok, when i click on thumbnail nothing happens it supposed start streaming :queasy:😕

                          NogDog;10927171 wrote:
                          // missing single quote-----------------------------------------------v
                          echo '<ul class="photo"><li> <a href="#" onclick="vlc_controls.play(\'' .
                          $pathtoflv . $file . '\'flv\')"><span> </span><img src="' . $path . $file .
                          'jpg" alt="' . $file . '" /></a><span></span></a></li><br></ul>';
                          

                          yessss its working but i had to change little thing,

                          // Loop through the files
                          while (false !== ($file = readdir($dir))) {
                          if (in_array($file, $exclude) == FALSE){
                          $ext = pathinfo($path.$file);
                          $ext = $ext['extension'];

                                      $file = str_replace($ext, '', $file);
                             echo '<ul class="photo"><li> <a href="#" onclick="vlc_controls.play(\'' .$pathtoflv . $file [B]. 'flv\[/B]')"><span> </span><img src="' . $path . $file . 'jpg" alt="' . $file . '" /></a><span></span></a></li><br></ul>';

                          this one works on firefiox yahoo 😃

                          <a href="#" onclick="vlc_controls.play(\'' .$pathtoflv . $file . 'flv\')"><

                          it had extra '\'flv\')"> it should've been 'flv\')"> :o

                          now im wondering why on IE8 it doesnt work.

                            2 months later

                            I just had this error pop up and it was such a simple fix...but I found the answer here and wanted to pay my respects. Thanks for posting the fix.

                            Daniel

                              a month later

                              Hello everyone!

                              I'm trying to add a javascript in a php file.

                              <script language="JavaScript" type="text/javascript">
                                //Configure below to change URL path to the snow image
                                var snowsrc="Themes/default/images/snow.gif"
                                // Configure below to change number of snow to render
                                var no = 64;
                                // Configure whether snow should disappear after x seconds (0=never):
                                var hidesnowtime = 0;
                                // Configure how much snow should drop down before fading ("windowheight" or "pageheight")
                                var snowdistance = "pageheight";
                              
                              ///////////Stop Config//////////////////////////////////
                              
                                var ie4up = (document.all) ? 1 : 0;
                                var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
                              
                              function iecompattest(){
                              return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
                              }
                              
                                var dx, xp, yp;    // coordinate and position variables
                                var am, stx, sty;  // amplitude and step variables
                                var i, doc_width = 800, doc_height = 600; 
                              
                                if (ns6up) {
                                  doc_width = self.innerWidth;
                                  doc_height = self.innerHeight;
                                } else if (ie4up) {
                                  doc_width = iecompattest().clientWidth;
                                  doc_height = iecompattest().clientHeight;
                                }
                              
                                dx = new Array();
                                xp = new Array();
                                yp = new Array();
                                am = new Array();
                                stx = new Array();
                                sty = new Array();
                                snowsrc=(snowsrc.indexOf("dynamicdrive.com")!=-1)? "snow.gif" : snowsrc
                                for (i = 0; i < no; ++ i) {  
                              dx[i] = 0; // set coordinate variables xp[i] = Math.random()*(doc_width-50); // set position variables yp[i] = Math.random()*doc_height; am[i] = Math.random()*20; // set amplitude variables stx[i] = 0.02 + Math.random()/10; // set step variables sty[i] = 0.7 + Math.random(); // set step variables if (ie4up||ns6up) { if (i == 0) { document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://dynamicdrive.com\"><img src='"+snowsrc+"' border=\"0\"><\/a><\/div>"); } else { document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"><\/div>"); } } } function snowIE_NS6() { // IE and NS6 main animation function doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10; doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")? iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight; for (i = 0; i < no; ++ i) { // iterate for every dot yp[i] += sty[i]; if (yp[i] > doc_height-50) { xp[i] = Math.random()*(doc_width-am[i]-30); yp[i] = 0; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); } dx[i] += stx[i]; document.getElementById("dot"+i).style.top=yp[i]+"px"; document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px";
                              } snowtimer=setTimeout("snowIE_NS6()", 10); } function hidesnow(){ if (window.snowtimer) clearTimeout(snowtimer) for (i=0; i<no; i++) document.getElementById("dot"+i).style.visibility="hidden" } if (ie4up||ns6up){ snowIE_NS6(); if (hidesnowtime>0) setTimeout("hidesnow()", hidesnowtime*1000) } </script>

                              If I save everything in a separate file snow.js and load it with <script type="text/javascript" src="snow.js"></script> it works, but I would like to add the whole thing inside the php file. If I do that I get this error syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';'

                              What am I missing?

                                Chipicao wrote:

                                I would like to add the whole thing inside the php file

                                Why? One language is server-side only, while one is client-side only. Seems perfectly normal to separate the two.

                                  Nice one Weedpacket. Yes, I am a PHP noob, or to be honest I never read a book or attended any type of class, but that's because I'm lazy. I am however able to understand the logic behind the code and tweak it as I please. I'm certainly not a programmer, I'm just a modder.

                                  The reason why I want to add this javascript together with php is that it doesn't work as it's supposed to when it's separated. So can someone please tell me what do I need to add and where to make it work inside a php file?

                                    Chipicao wrote:

                                    The reason why I want to add this javascript together with php is that it doesn't work as it's supposed to when it's separated.

                                    That doesn't make sense... unless you've got the path in the <script> tag wrong. PHP and JavaScript don't directly work together. All of the PHP code is parsed on the server and the resulting output is sent to the browser. It doesn't matter if the JS is sent as output by the PHP script or if you instead output a <script> tag that links to the .js file on your server.