Kod
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-2">
<title>fred_fn's test gallery system v2.0 beta</title>
</head>
<body>
<?php
print '<a href="gal.html">Wygenerowana galeria</a>';
print "<fieldset>";
print "<table>";
print "<tr><td>";
print '<p>Wybierz plik(i), które chcesz dodac do galerii i kliknij "Generuj"</p>';
print '<form name="form1" enctype="multipart/form-data" method="post" action="add.php">';
print '<p><input type="file" size="32" name="my_field" value="" />';
print '<input type="hidden" name="action" value="wyslij" />
';
print 'Kategoria: <select name="kategoria">';
mysql_connect("localhost", "root", "krasnal") or die ("MySQL padł -- 1");
mysql_select_db ("zuchy_db") or die ("MySQL padł -- 2");
$wynik = mysql_query ("SELECT * FROM gal_kat ORDER BY nr DESC");
while ($wynik && $rekord = mysql_fetch_assoc ($wynik)){
print "<option value='".$rekord['kategoria']."'>".$rekord['kategoria']."</option>";
}
print "<table>";
print "<tr>";
print '<td valign=middle><input type="submit" name="Submit" value="Generuj" /></td>';
print '<td><div style="position: relative; z-index: 1"><img src="clock.png" alt="90 stopni w prawo" /></div><div style="position: relative; top: -30px; left: 15px; z-index: 2"><input type="radio" name="rorate" value="prawo" /></div></td>';
print '<td><div style="position: relative; z-index: 1"><img src="no.png" alt="bez obrotu" /></div><div style="position: relative; top: -30px; left: 15px; z-index: 2"><input type="radio" name="rorate" value="zero" /></div></td>';
print '<td><div style="position: relative; z-index: 1"><img src="cclock.png" alt="90 stopni w lewo" /></div><div style="position: relative; top: -30px; left: 15px; z-index: 2"><input type="radio" name="rorate" value="lewo" /></div></td>';
print "</tr>";
print "</table>";
print "</p>";
print "</form>";
print "</td><td>";
include('class.upload.php'); //operacje na foto
if (!array_key_exists('action', $_POST) || $_POST['action'] == 'wyslij'){
$handle = new Upload($_FILES['my_field']);
if ($handle->uploaded) {
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = 500;
$handle->jpeg_quality = 100;
$handle->file_name_body_add = '_1';
if (!array_key_exists('rorate', $_POST) || $_POST['rorate'] == 'prawo'){
$handle->image_rotate = 90;
}
elseif (!array_key_exists('rorate', $_POST) || $_POST['rorate'] == 'lewo'){
$handle->image_rotate = 270;
}
elseif (!array_key_exists('rorate', $_POST) || $_POST['rorate'] == 'zero'){
$handle->image_rotate = 0;
}
$handle->Process('./gal/');
$normal = $handle->file_dst_pathname;
$normal_link = $handle->file_dst_name_body;
if ($handle->processed){
echo '<img src="'. $normal .'" />
';
}
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = 100;
$handle->jpeg_quality = 100;
$handle->file_name_body_add = '_2';
if (!array_key_exists('rorate', $_POST) || $_POST['rorate'] == 'prawo'){
$handle->image_rotate = 90;
}
elseif (!array_key_exists('rorate', $_POST) || $_POST['rorate'] == 'lewo'){
$handle->image_rotate = 270;
}
elseif (!array_key_exists('rorate', $_POST) || $_POST['rorate'] == 'zero'){
$handle->image_rotate = 0;
}
$handle->Process('./gal/');
$miniat = $handle->file_dst_pathname;
if ($handle->processed){
echo '<img src="'. $miniat .'" />';
}
$wynikas = mysql_query ("INSERT INTO galeria (nazwa_d, nazwa_m, kategoria) VALUES ('".$normal."', '".$miniat."', '".$_POST['kategoria']."');");
}
print "</td></tr>";
print "</table>";
print "</fieldset>";
print "</body>"
?>
</html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-2">
<title>fred_fn's test gallery system v2.0 beta</title>
</head>
<body>
<?php
print '<a href="gal.html">Wygenerowana galeria</a>';
print "<fieldset>";
print "<table>";
print "<tr><td>";
print '<p>Wybierz plik(i), które chcesz dodac do galerii i kliknij "Generuj"</p>';
print '<form name="form1" enctype="multipart/form-data" method="post" action="add.php">';
print '<p><input type="file" size="32" name="my_field" value="" />';
print '<input type="hidden" name="action" value="wyslij" />
';
print 'Kategoria: <select name="kategoria">';
mysql_connect("localhost", "root", "krasnal") or die ("MySQL padł -- 1");
mysql_select_db ("zuchy_db") or die ("MySQL padł -- 2");
$wynik = mysql_query ("SELECT * FROM gal_kat ORDER BY nr DESC");
while ($wynik && $rekord = mysql_fetch_assoc ($wynik)){
print "<option value='".$rekord['kategoria']."'>".$rekord['kategoria']."</option>";
}
print "<table>";
print "<tr>";
print '<td valign=middle><input type="submit" name="Submit" value="Generuj" /></td>';
print '<td><div style="position: relative; z-index: 1"><img src="clock.png" alt="90 stopni w prawo" /></div><div style="position: relative; top: -30px; left: 15px; z-index: 2"><input type="radio" name="rorate" value="prawo" /></div></td>';
print '<td><div style="position: relative; z-index: 1"><img src="no.png" alt="bez obrotu" /></div><div style="position: relative; top: -30px; left: 15px; z-index: 2"><input type="radio" name="rorate" value="zero" /></div></td>';
print '<td><div style="position: relative; z-index: 1"><img src="cclock.png" alt="90 stopni w lewo" /></div><div style="position: relative; top: -30px; left: 15px; z-index: 2"><input type="radio" name="rorate" value="lewo" /></div></td>';
print "</tr>";
print "</table>";
print "</p>";
print "</form>";
print "</td><td>";
include('class.upload.php'); //operacje na foto
if (!array_key_exists('action', $_POST) || $_POST['action'] == 'wyslij'){
$handle = new Upload($_FILES['my_field']);
if ($handle->uploaded) {
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = 500;
$handle->jpeg_quality = 100;
$handle->file_name_body_add = '_1';
if (!array_key_exists('rorate', $_POST) || $_POST['rorate'] == 'prawo'){
$handle->image_rotate = 90;
}
elseif (!array_key_exists('rorate', $_POST) || $_POST['rorate'] == 'lewo'){
$handle->image_rotate = 270;
}
elseif (!array_key_exists('rorate', $_POST) || $_POST['rorate'] == 'zero'){
$handle->image_rotate = 0;
}
$handle->Process('./gal/');
$normal = $handle->file_dst_pathname;
$normal_link = $handle->file_dst_name_body;
if ($handle->processed){
echo '<img src="'. $normal .'" />
';
}
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_x = 100;
$handle->jpeg_quality = 100;
$handle->file_name_body_add = '_2';
if (!array_key_exists('rorate', $_POST) || $_POST['rorate'] == 'prawo'){
$handle->image_rotate = 90;
}
elseif (!array_key_exists('rorate', $_POST) || $_POST['rorate'] == 'lewo'){
$handle->image_rotate = 270;
}
elseif (!array_key_exists('rorate', $_POST) || $_POST['rorate'] == 'zero'){
$handle->image_rotate = 0;
}
$handle->Process('./gal/');
$miniat = $handle->file_dst_pathname;
if ($handle->processed){
echo '<img src="'. $miniat .'" />';
}
$wynikas = mysql_query ("INSERT INTO galeria (nazwa_d, nazwa_m, kategoria) VALUES ('".$normal."', '".$miniat."', '".$_POST['kategoria']."');");
}
print "</td></tr>";
print "</table>";
print "</fieldset>";
print "</body>"
?>
</html>
Błąd (parse) pojawia się w ostatniej linii - </html>. Jeśli ją usunę, to też się pojawia. Jeśli wsadzę </html> w print, błąd przechodzi do lini z print "</html>".
Więc jak poprawić ten program, żeby działał? Jeżeli to pomoże - pracuję na KrasnalServ 2.7 na Win XP