colinhanke
-
Posts
4 -
Joined
-
Last visited
Never
Posts posted by colinhanke
-
-
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 48
Here is the script: (//note: line 48 is the very last line which is simply </HTML>)
<?php
session_start();
//check to see if user has logged in with a valid password
if ($_SESSION['authuser']!=1) {
echo "Sorry, but you don't have permission to view this
page, 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. -
[!--quoteo(post=387499:date=Jun 24 2006, 11:44 AM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ Jun 24 2006, 11:44 AM) [snapback]387499[/snapback][/div][div class=\'quotemain\'][!--quotec--]
those look like the funny quotes. try using " or '
[/quote]
You........... Are a genius. lol. Thanks a lot. -
I'm just starting out php so this may just be a simple fix of something dumb. I am following a workbook and it told me to create a file called moviesite.php and enter this code:
<HTML>
<HEAD>
<TITLE>My Movie Site</TITLE>
</HEAD>
<BODY>
<?php
define (“FAVMOVIE”, “The Life of Brian”);
echo “My favorite movie is “;
echo FAVMOVIE;
?>
</BODY>
</HTML>
It didn't work when I typed it in manually, so I copied and pasted it straight from the manual but when I try to open it up in my browser I get this response "Parse error: parse error, unexpected T_STRING in C:\Program Files\xampp\htdocs\moviesite.php on line 7". Any suggestions would be much appreciated.
New Table Problem
in MySQL Help
Posted
"#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.'36-40','41-45','46-50','51-55','56-60','61-65','66-70','71-75','76-80','81-85'' at line 1"
Here is the code that phpmyadmin used to query mysql:
CREATE TABLE `mktsurvey` (
`UI` VARCHAR( 20 ) NOT NULL ,
`Zip` CHAR( 10 ) NOT NULL ,
`Age` ENUM( '18-24', '25-30', '31-35'. '36-40', '41-45', '46-50', '51-55', '56-60', '61-65', '66-70', '71-75', '76-80', '81-85', '86-90', '91-95', '96-100', ) NOT NULL ,
`Children` ENUM( 'Yes', 'No' ) NOT NULL ,
`Online_hrs` ENUM( '0-1', '2-5', '6-10', '11-15', '+15' ) NOT NULL ,
`site_cool` ENUM( 'Yes', 'No' ) NOT NULL ,
`site_features` VARCHAR( 255 ) NOT NULL ,
`buy_child_online` ENUM( 'Yes', 'No' ) NOT NULL ,
`times_buy_chile_online` ENUM( '0-1', '2-5', '6-10', '11-15', '+15' ) NOT NULL ,
`myspace` ENUM( 'Yes', 'No' ) NOT NULL ,
`online_local_resources` ENUM( 'Never', 'A Little', 'Often', 'All the Time' ) NOT NULL ,
`partic_online_network` ENUM( 'Yes', 'No' ) NOT NULL ,
`partic_online_network_why` VARCHAR( 255 ) NOT NULL ,
`prize_want` VARCHAR( 255 ) NOT NULL ,
`stay_update` ENUM( 'Yes', 'No' ) NOT NULL ,
`lm_partic` ENUM( 'Yes', 'No' ) NOT NULL ,
`email` VARCHAR( 255 ) NOT NULL ,
`ip` VARCHAR( 20 ) NOT NULL ,
PRIMARY KEY ( `UI` )
) ENGINE = MYISAM
any comments or quesitions would be greatly appreciated. Thanks.