Parse error: parse error, unexpected $ in /www/w/wick*****esc/htdocs/parkeriscool/admin/main.php on line 414
[code]
<?php
$admin = 1;
require(“../header.php”);
/*— BEGIN HANDLING THE FORM REQUESTS — */
if ($_POST[‘mkalbum’]){
if (mkalbum($_POST[‘album_name’], $_POST[‘album_desc’])){
$response = $response . “The album was successfully created.n”;
}
else{
$response = $response . ‘There was an error creating the new album, MySQL said: ‘ . mysql_error();
}
}
if($_POST[‘dltalbum’]){
if(dltalbum_pics_server($_POST[‘dltalbum_album’])){
if(dltalbum_pics_db($_POST[‘dltalbum_album’])){
if(dltalbum_db($_POST[‘dltalbum_album’])){
$response = $response . “The album was successfully deleted.n”;
}
else{
$response = $response . “There was an error deleting the album from the `albums` database table. MySQL said: ” . mysql_error() . “n”;
}
}
else{
$response = $response . “There was an error removing the pictures in the album from the `pics` database table. MySQL said: ” . mysql_error() . “n”;
}
}
else{
$response = $response . “There was an error deleting the pictures in the album from the server. They have been moved or already deleted, there may have never been any, or there may have been a more serious error. I’m going to go ahead and try to delete the other parts of the album anyway. MySQL said: ” . mysql_error() . “n”;
if(dltalbum_pics_db($_POST[‘dltalbum_album’])){
if(dltalbum_db($_POST[‘dltalbum_album’])){
$response = $response . “The album was successfully deleted.n”;
}
else{
$response = $response . “There was an error deleting the album from the `albums` database table. MySQL said: ” . mysql_error() . “n”;
}
}
else{
$response = $response . “There was an error removing the pictures in the album from the `pics` database table. MySQL said: ” . mysql_error() . “n”;
}
}
}
if ($_POST[‘upload_pic’]){
if (uploadpic(“../pics/”)){
if(mkthumb($_FILES[‘uploadpic’] [‘name’], “../pics/”)){
if (add_to_album($_FILES[‘uploadpic’] [‘name’], “pics/”, $_POST[‘upoadpic_caption’], $_POST[‘uploadpic_album’])){
if(update($_POST[‘uploadpic_album’])){
$response = $response . “The picture was successsfully added to the album.n”;
}
else{
$response = $response . “There was an error updating the last updated date for the album, however everything else went to plan and your picture will still appear in the album. MySQL said: ” . mysql_error() . “n”;
}
}
else{
$response = $response . “There was an error adding the pic to the album’s databse table. MySQL said: ” . mysql_error() . “n”;
}
}
else{
$response = $response . “There was a problem creating the picture’s thumbnail.n”;
}
}
else{
$response = $response . “There was a problem uploading the picture.n”;
// display a message according do exactly what went wrong
switch ($_FILES[‘uploadpic’] [‘error’]){
case 1:
$response = $response . “The file is bigger than this PHP installation allows.n”;
break;
case 2:
$response = $response . “The file is bigger than this form allows.n”;
break;
case 3:
$response = $response . “Only part of the file was uploaded.n”;
break;
case 4:
$response = $response . “No file was uploaded.n”;
break;
}
}
}
if($_POST[‘pics_admin’]){
$album = $_POST[‘album’];
$result = mysql_query(“SELECT * FROM `pics` WHERE `album` = ‘$album'”);
while($pic = mysql_fetch_array($result)){
if($_POST[‘dlt_’ . $pic[name]]){
if(dltpic_db($pic[name])){
if(dltpic_svr($pic[name])){
$ok += 1;
}
}
}
$num += 1;
}
$response = $response . “$ok of the requested $num pics have been successfully deleted” . “n”;
while($pic = mysql_fetch_array($result)){
if($_POST[‘caption_’ . $pics[name]]){
if(mysql_query(“UPDATE `pics` SET `caption` = ‘” . $_POST[‘caption_’ . $pics[name]] . “‘ WHERE `name` = ‘$pics[name]'”) && mysql_affect_rows()){
$ok += 1;
}
}
$num += 1;
}
$response = $response . “$ok of the requested $num captions have been successfully updated” . “n”;
}
/*— FINISH HANDLING THE FORM REQUESTS — */
?>
<?php echo $response ?>
<?php
//echo(table_contents(“albums”));
//echo(table_contents(“pics”));
?>
CREATE A NEW ALBUM:<br />
<form method=”post” action=”<?php echo $_SERVER[‘PHP_SELF’] ?>”>
<p>
<input type=”hidden” name=”mkalbum” value=”1″ />
name: <input type=”text” name=”album_name” />
<br />
desc: <input type=”text” name=”album_desc” />
<br />
<input type=”submit” value=”Create” />
</p>
</form>
DELETE AN ALBUM:<br />
<form method=”post” action=”<?php echo $_SERVER[‘PHP_SELF’] ?>” onsubmit=”return confirm(‘Are you sure that you want to delete this album and all of the pictures in it?’)”>
<p>
<input type=”hidden” name=”dltalbum” value=”1″ />
<select name=”dltalbum_album”>
<?php
$result = mysql_query(“SELECT `name` FROM `albums`”) or die(‘Error selecting the albums from the database, MySQL said: ‘ . mysql_error());
while ($album = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo(‘<option value=”‘ . $album[name] . ‘”>’ . $album[name] . ‘</option>’);
}
?>
</select>
<input type=”submit” value=”Delete” />
</p>
</form>
<br />
UPLOAD A PICTURE:<br />
<form method=”post” enctype=”multipart/form-data” action=”<?php echo $_SERVER[‘PHP_SELF’] ?>”>
<p>
<input type=”hidden” name=”upload_pic” value=”1″ />
pic: <input type=”file” name=”uploadpic” /><br />
<input type=”hidden” name=”MAX_FILE_SIZE” value=”9999999999999999999999″ />
caption: <input type=”text” name=”upoadpic_caption” />
<input type=”submit” value=”Upload” />
<select name=”uploadpic_album”>
<?php
$result = mysql_query(“SELECT `name` FROM `albums`”) or die(‘Error selecting the albums from the database, MySQL said: ‘ . mysql_error());
while ($album = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo(‘<option value=”‘ . $album[name] . ‘”>’ . $album[name] . ‘</option>’);
}
?>
</select>
</p>
</form>
EDIT THE PICS IN AN ALBUM!
<?php
require(“../footer.php”);
?>
i had to cut out a big block of code there to gt this posted, that error message refers to the very last line, which is odd because all it has is the ending php tag. ive had the footer there like that forever and it has worked fine. WHAT IS WRONG!!??!?!?!?!?!