KryPt0 Posted March 18, 2006 Report Share Posted March 18, 2006 (edited) Amm... Nū man ir šitāds te errors: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\AppServ\www\zinj\edit.php on line 10 Un šī ir 10 rindiņa: <input name=\"title\" type=\"text\" id=\"title\" style=\"border: 1px solid #000000; background: #f8f8f8; font-size: 10px; font-family:Tahoma\" value=\".$row['title'].\"> šis ir pilns fails: <? include("connection.php"); $tid = $_GET['tid']; $query = "SELECT * FROM news WHERE id='$tid' "; $result = mysql_query($query, $connection) or die ("Could not execute database query."); while($row = mysql_fetch_array($result)) { echo "<div align=\"center\"> <form name=\"editnews\" method=\"post\" action=\"editnews_process.php&tid=$tid\"> Title:<br> <input name=\"title\" type=\"text\" id=\"title\" style=\"border: 1px solid #000000; background: #f8f8f8; font-size: 10px; font-family:Tahoma\" value=\".$row['title'].\"> <br> Author:<br> <input name=\"author\" type=\"text\" id=\"author\" style=\"border: 1px solid #000000; background: #f8f8f8; font-size: 10px; font-family:Tahoma\" value=\".$row['author'].\"> <br> Long Story:<br> <textarea name=\"entry\" rows=\"7\" style=\"border: 1px solid #000000; background: #f8f8f8; font-size: 10px; font-family: Tahoma\">"$row['entry']"</textarea> <br> <input type=\"submit\" name=\"Submit\" value=\"Submit\" style=\"border: 1px solid #000000; background: #f8f8f8; font-size: 10px; font-family:Tahoma\"> <br> </form> </div> "; } ?> Tiek sūtīts uz šejieni no šī faila: <a href="add.php">Pievienot ziņu</a> <br /><br /> <b>Rediģēt ziņu</b><br /> <? include("connection.php"); $query = "SELECT * FROM news"; $result = mysql_query($query, $connection) or die ("Could not execute database query."); while($row = mysql_fetch_array($result)) { $id = $row['id']; $title = $row['title']; $date = $row['date']; $entry = $row['entry']; $author = $row['author']; $category = $row['category']; echo "$title - <a href=edit.php?id=$id>Edit</a><br>"; } ?> Kas tā varētu būt par problēmu? P.S. Parcik nav gari kodi, tad saliku te nevis paste.php.lv Edited March 18, 2006 by KryPt0 Link to comment Share on other sites More sharing options...
john.brown Posted March 18, 2006 Report Share Posted March 18, 2006 Kļūda, visticamāk, ir kādā rindiņā iepriekš. Un droši vien neuzmanība. Pietrūkst ',' vai ';', vai kas tamlīdzīgs. Ja gribi ko konkrētāku, izliec failu iekš http://paste.php.lv. Bet papriekš pameklē pats :) Link to comment Share on other sites More sharing options...
KryPt0 Posted March 18, 2006 Author Report Share Posted March 18, 2006 Starpcitu, jau trīs stundas šito sautēju, bet kļūmi neatrodu o_0 pirmstam ir tikai un vienīgi iekļauts Connection uz MySQL un viss :( Link to comment Share on other sites More sharing options...
john.brown Posted March 18, 2006 Report Share Posted March 18, 2006 (edited) Neraksti tik drausmīgas rindas ar mežonīgu backslashu vairumu. Bez tam tev mainīgo ielikšana rindā klibo. Ja vajag garu htmlu ielikt, dari tā: http://paste.php.lv/3467 Uz ātro, pareizi mainīgo ielikt: echo 'Strings parastās pēdiņās ar '.$mainigo.' ieliktu'; // vai tā echo "Strings dubult pēdiņās ar $mainigo iekšā"; Edited March 18, 2006 by john.brown Link to comment Share on other sites More sharing options...
KryPt0 Posted March 18, 2006 Author Report Share Posted March 18, 2006 Ehh... Tagat itkā aizgāja, bet nerādīja FORM'u... Laikam sākšu pa jaunam un uzmanīgāk... Link to comment Share on other sites More sharing options...
Grey_Wolf Posted March 19, 2006 Report Share Posted March 19, 2006 KryPt0 --> kljuuda ir tiiri sintaksee.. // Tahoma\">" $row['entry'] "</textarea> // sheit! truks . izmanto kaadu no editoriem kas iekraaso kodu.. teiksim notepad++ (notepad2 - sho nesmu lietojis nevaru komenteet) man sho kljuudaino vietu atrast aiznjeema tieshi 10 sekundes ;) Link to comment Share on other sites More sharing options...
Stopp Posted March 19, 2006 Report Share Posted March 19, 2006 (edited) value=\".$row['title'].\"> value=".$row['title']."> kļūda, ko es saskatīju.. edit: btw tev tāda pati kļūda ir arī 2 rindiņas zemāk. Edited March 19, 2006 by Stopp Link to comment Share on other sites More sharing options...
john.brown Posted March 19, 2006 Report Share Posted March 19, 2006 (edited) Tāda veida kļūdu ir daudz :) 2 KryPt0 Formu arī nerādīs. Sūti uz edit tu ar šitādu saiti: <a href=edit.php?id=$id>Edit</a> A iekš edit mēģini no GET izņemt šitādu: $tid = $_GET['tid']; Tev $_GET['id'] vajag :) Edited March 19, 2006 by john.brown Link to comment Share on other sites More sharing options...
Recommended Posts