Mam problem następujący:
Mam formularz oto on:
<? include("config.php"); if ($_SERVER[REFERER]==$referer['1']) { include("form.php"); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Dodaj Grę!</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> <style type="text/css"> <!-- .style1 { font-size: 18px; font-family: Verdana, Arial, Helvetica, sans-serif; } .style2 {font-size: 12px} --> </style> </head> <body> <center> <table width="400" border="0" cellspacing="0" cellpadding="0"> <tr> <th height="161" scope="col"><form action="add_game.php" method="post" enctype="multipart/form-data" name="form1"> <p class="style1">Dodaj Grę ;) </p> <p><span class="style2">Tytuł: </span> <input name="tytul" type="text" class="style2" id="tytul"> </p> <p class="style2">Data: <input name="data" type="text" class="style2" id="data"> </p> <p class="style2">Size: <input name="rozmiar" type="text" class="style2" id="rozmiar"> </p> <p class="style2">Catid: <select name="kateg"> <? lacz_db(); $zapytanie="SELECT * FROM kategorie"; } ?> </select> </p> <p> <textarea name="opis" cols="40" rows="5" class="style2" id="opis">Opis</textarea> </p> <p> <textarea name="sterowanie" cols="40" rows="5" class="style2" id="sterowanie">Sterowanie</textarea> </p> <p> <textarea name="kod" cols="40" rows="5" class="style2" id="kod">Kod pliku Flash, Director lub Shockwaveflash</textarea> </p> <p> <input name="file" type="file" class="style2" id="file"> </p> <p><br> <input type="submit" name="Submit" value="Dodaj!"> <input type="reset" name="Submit2" value="Reset"> </p> </form></th> </tr> <tr> <th scope="row"> </th> </tr> <tr> <th scope="row"> </th> </tr> <tr> <th scope="row"> </th> </tr> <tr> <th scope="row"> </th> </tr> </table> </center> </body> </html>
I 2 Plik.
<? include("config.php"); function lID($kID){ lacz_db(); $zapytanie="SELECT * FROM gry WHERE catID='$kID' order by id"; for ($i=0; $i<$ileWierszy; $i++){ if (($i+1)==$ileWierszy) { $lid = $wiersz["id"]; } } return $lid; } lacz_db(); /*$kodzik="<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="700" HEIGHT="500"><PARAM NAME=movie VALUE="".$kod."">" ."<EMBED src="".$kod."" WIDTH="700" HEIGHT="500" ALIGN="center" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>" ."</OBJECT>";*/ $sql = "INSERT INTO gry ( id , tytul , opis , catid , size , data , sterowanie , kod ) " . " VALUES ( '', '$tytul', '$opis', '$kateg', '$rozmiar', '$data', '$sterowanie', '$kod' );"; $dsa = "INSERT INTO plays ( gameID , value ) " . " VALUES ( '', 0 );"; $lID = lID($kateg); if (($file_size<"70000") && ($file_size>"1")){ $image = "../img/gry/".$lID.".gif"; } ?>
I MAM PROBLEM IŻ:
Gdy dodaje grę do bazy to wyświetla mi się iż Rekord do bazy dodany poprawnie lecz.
Niestety jest troszke inaczej niż pisze.
Rekord moze i dodany lecz z zerowa treścią czyli pusto jest.
Jaki jest moze problem z tym ?