DST Posted February 23, 2010 Report Share Posted February 23, 2010 Kāds nezin kāpec es varu aisūtīt uz datubāzi failus a kad aisuutu draugam so skriptu uz vina pc nevar aisuutiit vnk nesuutaas. rekur add skripts. <?php define('WWW','www'); if (!defined('WWW')) { header('Location: http://'.$_SERVER['HTTP_HOST'].''); die(); } $host = "localhost"; // db hosts $dbname = "forums"; // foruma datubaze $dbuser = "root"; // foruma db users $dbpass = "PASS"; // juusu foruma datubaazes parole $link = mysql_connect($host, $dbuser, $dbpass) or die("NEsanaaca piekontektities: " . mysql_error()); mysql_select_db($dbname) or die("Datubaaze neekstistee"); echo $r['laiks']; $selekts=mysql_query("SELECT * FROM ibf_sessions WHERE member_id=".$_COOKIE['member_id']); while ($r = mysql_fetch_array($selekts)) { if(isset($_POST['add_news'])) { $laiks=date("H:i d.m.Y"); $aut=$r['member_name']; $title = $_POST['title']; $links = $_POST['links']; $bilde = $_POST['bilde']; $nick = $udata->members_display_name; $userid = $_COOKIE['member_id']; $apraksts = $_POST['apraksts']; mysql_query("INSERT INTO music (nick, userid, date, title, apraksts, links, bilde) VALUES('$nick', '$userid', '$laiks', '$title', '$apraksts', '$links', '$bilde') ")or die(mysql_error()); } } if($_COOKIE['member_id'] > 0) { echo ' <form action="" method="post"> <table> <tr> <td><font size="2px">Nosaukums:</font></td> <td><input type="text" size="30" name="title" style="font-size:12px;"/></td> </tr> <tr> <td><font size="2px">Apraksts:</font></td> <td><textarea type="text" size="30" name="apraksts" style="font-size:12px;"/></textarea></td> </tr> <tr> <td><font size="2px">Pilns links (http://):</font></td> <td><input type="text" size="30" name="links" style="font-size:12px;"/></td> </tr> <tr> <td><font size="2px">Bilde:</font></td> <td><input type="text" size="30" name="bilde" style="font-size:12px;"/></td> </tr> <tr><td> <input type="submit" name="add_news" value="Pievienot!" style="height: 17px;width: 70px;font-size: 9px;border: solid 1px #c0c0c0;background: #292929;color: #FFF;"> <td></tr> </table> </form>'; } else { echo "LOGIN"; } ?> Link to comment Share on other sites More sharing options...
KpC Posted February 24, 2010 Report Share Posted February 24, 2010 Sāksim ar šo: echo $r['laiks']; Ko viņš dara pirms while? Un vēl, nafig caur while ciklu vajag insertot kaut ko? Izņem insertu ārā no while cikla.. Un vai nebūtu ērtāk neizmantot while, bet vienkārši fetchot rezultātu? Link to comment Share on other sites More sharing options...
GMXX Posted February 24, 2010 Report Share Posted February 24, 2010 un ari , vai nebutu ertak izmantojot include config.php un visus db shitus sarakstit tur? Link to comment Share on other sites More sharing options...
DST Posted February 25, 2010 Author Report Share Posted February 25, 2010 Par to config tāds man jau ir tikai šītas bija atsevišķ vails ko suutiju un tpc ieliku sito 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