Jump to content

Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' help


jnerotrix

Recommended Posts

Here is the error i get:

 

Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /www/rack111.com/p/o/p/popcornpetz/htdocs/index.php on line 21

 

In this code

 

<?php include('header.php'); ?>

<title> View it </title>
<center>

<?php



if (isset($_POST['action'])) {
session_start();
   
$_SESSION['numtimes'] = (isset($_POST['times']) && is_numeric($_POST['times']))?$_POST['times']:10;
$_SESSION['url'] = $_POST['url'];
$_SESSION['reload'] = $_POST['reloadtime'];
$_SESSION['w'] = $_POST['setwidth'];
$_SESSION['h'] = $_POST['setheight'];
$autoplay = "&autoplay=1";

if ($HTTP_POST_VARS["submitted"] == "yes"){
echo "<meta http-equiv='refresh' content=/"$_SESSION['reload'];">";
}
for ($i=0; $i < $_SESSION['numtimes']; $i++) {
echo '<object width="' . $_SESSION['w']; . '" height="' . $_SESSION['h']; . '"><param name="movie" value="http://www.youtube.com/v/' . $_SESSION['url'] . '&hl=en&fs=1"></param><param name="allowFullScreen" value="false"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' . $_SESSION['url'] . '&hl=en&fs=1$autoplay" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="false" width="' . $_SESSION['w'] . '" height="' . $_SESSION['h'] . '"></embed></object>';
}

}

?>

<table border="1">
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<tr>
<td>Video Url:<input type="text" readonly="1" value="http://www.youtube.com/watch?v=" size="30"><input type="Text" name="url"></td>
</tr>
<tr>
<td>(Number)<input type="text" name="times" value="10"> of Times to Display Video in <input type="text" name="reloadtime" value="5">(Seconds)</td>
</tr>
<tr>
<td>Set Width <input type="text" name="setwidth" value="425"> Set Height <input type="text" name="setheight" value="344">
</tr>
<tr>
<td align="center" valign="center"><input type="submit" name="action" value="Submit">
<input type="hidden" name="submitted" value="yes">
</td>
</tr>
</form
</table>

Link to comment
Share on other sites

ok thats fixed but now i have a sessions problem

 

i get this session error

 

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /www/rack111.com/p/o/p/popcornpetz/htdocs/header.php:7) in /www/rack111.com/p/o/p/popcornpetz/htdocs/index.php on line 11

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /www/rack111.com/p/o/p/popcornpetz/htdocs/header.php:7) in /www/rack111.com/p/o/p/popcornpetz/htdocs/index.php on line 11

 

and heres the page code

 

<?php include('header.php'); ?>

<title> View it </title>
<center>

<?php



if (isset($_POST['action'])) {
session_start();
   
$_SESSION['numtimes'] = (isset($_POST['times']) && is_numeric($_POST['times']))?$_POST['times']:10;
$_SESSION['url'] = $_POST['url'];
$_SESSION['reload'] = $_POST['reloadtime'];
$_SESSION['w'] = $_POST['setwidth'];
$_SESSION['h'] = $_POST['setheight'];
$autoplay = "&autoplay=1";

if ($HTTP_POST_VARS["submitted"] == "yes"){
echo "<meta http-equiv='refresh' content='{$_SESSION['reload']}'>";
}
for ($i=0; $i < $_SESSION['numtimes']; $i++) {
echo "<object width='{$_SESSION['w']}' height='{$_SESSION['h']}'><param name='movie' value='http://www.youtube.com/v/{$_SESSION['url']}&hl=en&fs=1'></param><param name='allowFullScreen' value='false'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.youtube.com/v/{$_SESSION['url']}&hl=en&fs=1$autoplay' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='false' width='{$_SESSION['w']}' height='{$_SESSION['h']}'></embed></object>";
}

}

?>

<table border="1">
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<tr>
<td>Video Url:<input type="text" readonly="1" value="http://www.youtube.com/watch?v=" size="30"><input type="Text" name="url"></td>
</tr>
<tr>
<td>(Number)<input type="text" name="times" value="10"> of Times to Display Video in <input type="text" name="reloadtime" value="5">(Seconds)</td>
</tr>
<tr>
<td>Set Width <input type="text" name="setwidth" value="425"> Set Height <input type="text" name="setheight" value="344">
</tr>
<tr>
<td align="center" valign="center"><input type="submit" name="action" value="Submit">
<input type="hidden" name="submitted" value="yes">
</td>
</tr>
</form
</table>




Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.