Dj_Stay Posted March 12, 2010 Report Share Posted March 12, 2010 (edited) Sveiki es sakara ar Pievienot Video, Speli, Bildi ta, tad isuma pa problemu es piemeram gribu pievienot video mana weba Seit var apskatit es ierakstu to kodu nosaukumu, bet kad spiezu pievienot man iemet tani pasa lapa un nekas nepievienojas Ja kads var piedavat labaku script vai palidzet sani problema, tad rakstat Edited March 12, 2010 by Dj_Stay Link to comment Share on other sites More sharing options...
Dj_Stay Posted March 12, 2010 Author Report Share Posted March 12, 2010 nu tak plzz kads help P.S Sory par doblepost Link to comment Share on other sites More sharing options...
overmind Posted March 13, 2010 Report Share Posted March 13, 2010 'Ļoti' labi var saprast tavu problēmu.. Un jā, ja tu gribi lai kāds atrisina tavu problēmu, vismaz uz to laiku uzliec lai to lapu var apskatīt jebkurš, netikai reģistrēts lietotājs. Ja tā izdarīsi, iespējams būšu tik labs un palīdzēšu. Link to comment Share on other sites More sharing options...
DoubleT Posted March 13, 2010 Report Share Posted March 13, 2010 vai arī ieliec pievienošanas skriptu un DB struktūru. Link to comment Share on other sites More sharing options...
Dj_Stay Posted March 13, 2010 Author Report Share Posted March 13, 2010 (edited) Kr4 es ielikshu to ko Doublet prasa Reku php fails piev_video.php http://paste.php.lv/74a374512e4a87d7560e6b...52aa85?lang=php un rekur vnk bija video.sql http://paste.php.lv/ffacfcd5ee48a4efc3c02b...cae200?lang=php Edited March 13, 2010 by Dj_Stay Link to comment Share on other sites More sharing options...
DoubleT Posted March 13, 2010 Report Share Posted March 13, 2010 (edited) fuj cik nepatīkams kods. mysql_real_escape_string sāc lietot kur tev vispār ir definēti mainīgie? PHP $kods = htmlspecialchars($_POST["kods"]); $autors = htmlspecialchars($_POST["autors"]); $nosauk = htmlspecialchars($_POST["nosauk"]); if ($kods != "" && $autors != "" && $nosauk != "") { ?> <b><?php echo $lthxvidadd; ?></b> <? mysql_query ("INSERT INTO video (video, autors, nosauk) VALUES('$kods', '$autors', '$nosauk') " ) or die( mysql_error()); $sql = mysql_query("SELECT id FROM `video` ORDER BY `id` DESC LIMIT 1"); while( $row = mysql_fetch_array($sql)){ header('Location: ?do=video&id='.$row['id'].''); } } un nafig tev to, kad izfetcho id likt ciklā? karoč kodam vajadzīga smaga optimizācija Edited March 13, 2010 by DoubleT Link to comment Share on other sites More sharing options...
Dj_Stay Posted March 13, 2010 Author Report Share Posted March 13, 2010 (edited) es cita foruma izlasiju to ka sis kods <input type="submit" name="submit" value="Pievienot!" style="height: 17px;width: 70px;font-size: 9px;border: solid 1px #c0c0c0;background: Jamaina uz sito if (($_POST['submit'] == "Pievienot!") && ($_POST['kods'] != "") && ($_POST['autors'] != "") && ($_POST['nosauk'] != "")) { ?> Bet kad es nomainu man vins nejiet Edited March 13, 2010 by Dj_Stay Link to comment Share on other sites More sharing options...
DoubleT Posted March 13, 2010 Report Share Posted March 13, 2010 (edited) tu manis doto vispār izmēģināji? ja nebūtu pašam webi ko kodēt uzrakstītu to skriptu, bet ahh... karoč uz ātro daudz tīrāks skripts ( domu gan jau uztversi ) PHP <form action="piev_video.php?action=pievienot" method="post"> Nosaukums <input type="text" name="title" maxlenght="32" /> Kods <input type="text" name="kods" maxlenght="32" /> Autors <input type="hidden" name="autors" value="<?=$udata->members_display_name?>" /> <? if(isset($_GET["action"]) && $_GET["action"] == "pievienot") { $a = mysql_real_escape_string($_POST["title"]); $b = mysql_real_escape_string($_POST["kods"]); $c = mysql_real_escape_string($_POST["autors"]); if $a != '' && $b != '' && $c != '') { mysql_query("INSERT INTO video (video,autors,nosauk) VALUES ('$b','$c','$a')") or die(mysql_error()); $d = mysql_query("SELECT id FROM video ORDER BY id DESC LIMIT 1"); $row = mysql_fetch_array($d); header('Location: ?do=video&id='.$row["id"].''); } } ?> pilnībā neiztestēju utt. bet nu ideja gan jau, ka skaidra Edited March 13, 2010 by DoubleT Link to comment Share on other sites More sharing options...
X ID Posted March 13, 2010 Report Share Posted March 13, 2010 Lieto mysql_insert_id(), nevis selekto jaunāko id. Link to comment Share on other sites More sharing options...
Dj_Stay Posted March 13, 2010 Author Report Share Posted March 13, 2010 es aizmrsu uzraksit ka sen jau visu sataisiju Kr4 kads nevar iedot man banneru script kurs no lejasuz augshu iet ? Ludzu Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now