colinhanke Posted June 25, 2006 Share Posted June 25, 2006 I could use some help with this script error. When I try to open this page in my browser I get this error:Parse error: parse error, unexpected $end in C:\Program Files\xampp\htdocs\moviesite.php on line 48Here is the script: (//note: line 48 is the very last line which is simply </HTML>)<?phpsession_start();//check to see if user has logged in with a valid passwordif ($_SESSION['authuser']!=1) {echo "Sorry, but you don't have permission to view thispage, you loser!";exit();}?><HTML><HEAD><TITLE>My Movie Site - <?php echo $_REQUEST['favmovie'] ?></TITLE></HEAD><BODY><?php include "header.php"; ?><?php$favmovies = array("Life of Brian","Stripes","Office Space","The Holy Grail","Matrix", "Terminator 2", "Star Wars", "Close Encounters of the Third Kind","Sixteen Candles", "Caddyshack");if (ISSET($_REQUEST['favmovie'])) {echo "Welcome to our site, ";echo $_SESSION['username'];echo "! <br>";echo "My favorite movie is ";echo $_REQUEST['favmovie'];echo "<br>";$movierate=5;echo "My movie rating for this movie is: ";echo $movierate;}else {echo "My top ". $_POST["num"]. " movies are:<br>";if (ISSET($_REQUEST['sorted'])) {sort($favmovies);}//list the movies$numlist = 1;while ($numlist <= $_POST["num"]) {echo $numlist;echo ". ";echo pos($favmovies);next($favmovies);echo "<br>\n";$numlist = $numlist + 1;}?></BODY></HTML>Any help would be much appreciated. Thanks. Link to comment https://forums.phpfreaks.com/topic/12875-script-help/ Share on other sites More sharing options...
.josh Posted June 25, 2006 Share Posted June 25, 2006 <TITLE>My Movie Site - <?php echo $_REQUEST['favmovie'][!--coloro:red--][span style=\"color:red\"][!--/coloro--];[!--colorc--][/span][!--/colorc--] ?></TITLE> Link to comment https://forums.phpfreaks.com/topic/12875-script-help/#findComment-49424 Share on other sites More sharing options...
hitman6003 Posted June 25, 2006 Share Posted June 25, 2006 you are missing the closing curly brace on your while statement:[code]<?php$favmovies = array("Life of Brian","Stripes","Office Space","The Holy Grail","Matrix", "Terminator 2", "Star Wars", "Close Encounters of the Third Kind","Sixteen Candles", "Caddyshack");if (isset($_REQUEST['favmovie'])) { echo "Welcome to our site, "; echo $_SESSION['username']; echo "! <br>"; echo "My favorite movie is "; echo $_REQUEST['favmovie']; echo "<br>"; $movierate=5; echo "My movie rating for this movie is: "; echo $movierate;} else { echo "My top ". $_POST["num"]. " movies are:<br>"; if (isset($_REQUEST['sorted'])) { sort($favmovies); } //list the movies $numlist = 1; while ($numlist <= $_POST["num"]) { echo $numlist; echo ". "; echo pos($favmovies); next($favmovies); echo "<br>\n"; $numlist = $numlist + 1; } //this is the missing curly brace}?></BODY></HTML>[/code] Link to comment https://forums.phpfreaks.com/topic/12875-script-help/#findComment-49431 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.