Autor Zpráva
Legolas1
Profil *
Nazdarek. Potreboval by som poradit s jednym scriptom. Totiz, neviem prist na chybu..Vstupny formular funguje no po odoslani sa vystupna stranka zobrazila (po odoslani formulara s fotkou), ale nezobrazilo mi v nej fotky. Nadpis, popis, alt obrazka ano... ale samotne foto nie...(CHMOD je nastaveny na 777)
Tu je script s ktorym mam problem:

<?php
if ($ok) {
$subor = "a_" . date("Ymd_Gis") . ".html";
$fp = fopen($subor, "w")
or die("nie je mozne vytvorit subor!");

fwrite($fp, "<h1 align=center>$album</h1> ");
fwrite($fp, "<p align=center><i>$popis</i></p> <p> ");
fwrite($fp, "<p><p align=center> ");
for ($i = 1; $i <= 5; $i++) {
$fotka = "fotka" . $i;
$fotka_name = $fotka . "_name";
$fotka_type = $fotka . "_type";
$fotka_size = $fotka . "_size";
$popis = "popis" . $i;
if ($$fotka_type=="image/jpeg" ||
$$fotka_type=="image/pjpeg" ||
$$fotka_type=="image/gif" ||
$$fotka_type=="image/x-png") {
copy($$fotka, "./photos/{$$fotka_name}");
fwrite($fp, "<table align=left><tr><td align=center>");
fwrite($fp, "<a href="./photos/{$$fotka_name}"
target="foto">");
fwrite($fp, "<img src="./photos/{$$fotka_name}"
alt="Fotografia" border=0 width=300></a>
</td></tr> ");
fwrite($fp, "<tr><td align=center><i>{$$popis}</i> ");
fwrite($fp, "</table>");
}
if ($i==3) fwrite($fp, "<br clear=left> ");
}
fwrite($fp, "</p> ");
fclose($fp);
Header("Location: $subor");
}
else {
?>

<form action="<?php echo $PHP_SELF ?>" method="post"
enctype="multipart/form-data">
<table>
<tr><td><b>Album:</b></td><td><input type="text" size="25" name="album"></td></tr>
<tr><td><b>Popis:</b></td><td><input type="text" size="25" name="popis"></td></tr>
</table>
<table border=1>
<tr><th>Fotky</th><th>Subor</th><th>Popis</th></tr>
<tr><td>1</td><td><input type="file" name="fotka1"></td>
<td><input type="text" name="popis1" size="50"></td></tr>
<tr><td>2</td><td><input type="file" name="fotka2"></td>
<td><input type="text" name="popis2" size="50"></td></tr>
<tr><td>3</td><td><input type="file" name="fotka3"></td>
<td><input type="text" name="popis3" size="50"></td></tr>
<tr><td>4</td><td><input type="file" name="fotka4"></td>
<td><input type="text" name="popis4" size="50"></td></tr>
<tr><td>5</td><td><input type="file" name="fotka5"></td>
<td><input type="text" name="popis5" size="50"></td></tr>
</table>
<input type="submit" name="ok" value="Vlozit">
</form>
<?php } ?>


Vie mi niekto pomoct, poradit?
nightfish
Profil
$$fotka_type
tohle je tam úmyslně? (se dvěma dolary?)

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm: