Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
zasto ne ispisuje u textarea? (news skripta)

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 25.03.2005 23:38    Post subject: zasto ne ispisuje u textarea? (news skripta) Add user to your forum ignore list Reply with quote

ovako izgleda kod s kojim mijenjam postojeci unos.
Code:
<?
include("config.php");
if($submit) {
         $naslov = mysql_real_escape_string($_POST['naslov']);
         $uvod = mysql_real_escape_string($_POST['uvod']);
         $tekst = mysql_real_escape_string($_POST['tekst']);
         if((!$naslov) || (!$uvod)) {
            echo "Obavezno je upisati naslov i kratki uvod!";
           exit();
         } // if((!$naslov)
         $result = mysql_query("UPDATE news SET naslov='$naslov', uvod='$uvod', tekst='$tekst' WHERE id='$id' ",$connect);
         echo "<p>Vijest je uspješno promijenjena!<br/><a href=\"index.html\">Povratak na administraciju</a></p>";
} // if($submit)
else {
   if($id){
        $result = mysql_query("SELECT * FROM news WHERE id='$id' ",$connect);
        while($myrow = mysql_fetch_array($result)) {
         ?>
         <h2>Promijeni vijest</h2>
         <form method="post" action="<? echo $PHP_SELF ?>">
         <input type="hidden" name="newsid" value="<? echo $myrow['id']?>">
         <p>
          Naslov:<br/>
         <input name="naslov" size="50" maxlength="255" value="<? echo $myrow['naslov']; ?>">
          <br/>
          Kratki uvod: <br/>
         <textarea name="uvod" rows="5" cols="50" value="<? echo $myrow['uvod']; ?>"></textarea>
          <br/>
          Sadržaj vijesti: <br/>
         <textarea name="tekst" rows="10" cols="50" value="<? $myrow['tekst']; ?>"></textarea>
          <br/>
          <input type="submit" name="submit" value="Promijeni vijest">
          </form>
         </p>
         <?
      } // while
    } // if($id)
   else {
      $result = mysql_query("SELECT * FROM news ORDER BY id DESC",$connect);
      while($myrow = mysql_fetch_assoc($result)) {
         echo "<h2>";
         print($myrow['naslov']);
         echo "</h2><p>";
         print($myrow['uvod']);
         echo "</p><p class=\"datum\">dodano: ";
         echo $myrow['datumvrijeme'];
         echo "</p><p><a href=\"promijeni.php?id=$myrow[id]\">Promijeni...</a>";
      } // while
   } // else
} // else
?>

dakle ovaj donji dio gdje prikazuje sve vijesti i biras koju ces brisati, radi. ali kad odaberem vijest, prikaze se samo postojeci naslov, ali ne i uvod i tekst Confused

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 25.03.2005 23:44    Post subject: Add user to your forum ignore list Reply with quote

evo promijenila sam ovaj while i svejedno ne radi
Code:
while($myrow = mysql_fetch_array($result)) {
         $naslov = $myrow['naslov'];
         $uvod = $myrow['uvod'];
         $tekst = $myrow['tekst'];
         ?>
         <h2>Promijeni vijest</h2>
         <form method="post" action="<? echo $PHP_SELF ?>">
         <input type="hidden" name="newsid" value="<? echo $myrow['id']?>">
         <p>
          Naslov:<br/>
         <input name="naslov" size="50" maxlength="255" value="<? echo $naslov; ?>">
          <br/>
          Kratki uvod: <br/>
         <textarea name="uvod" rows="5" cols="50" value="<? echo $uvod; ?>"></textarea>
          <br/>
          Sadržaj vijesti: <br/>
         <textarea name="tekst" rows="10" cols="50" value="<? $tekst; ?>"></textarea>
          <br/>
          <input type="submit" name="submit" value="Promijeni vijest">
          </form>
         </p>
         <?
      } // while

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
emptyhead
mi3.crew


Joined: 03 Sep 2003
Posts: 889
Location: Daleko od Novog Zelanda

PostPosted: 26.03.2005 00:00    Post subject: Add user to your forum ignore list Reply with quote

Quote:
<textarea name="uvod" rows="5" cols="50" value="<? echo $uvod; ?>"></textarea>

Code:
<textarea> OVDJE IDE TEXT </textarea>


Ako se dobro sjecam Smile.
Back to top
View user's profile Send private message Visit poster's website
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 26.03.2005 00:11    Post subject: Add user to your forum ignore list Reply with quote

Brick wall d'oh! hvala

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 26.03.2005 00:17    Post subject: Add user to your forum ignore list Reply with quote

sad mi pak ne radi update Confused sa podacima se nista ne mijenja

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 26.03.2005 02:36    Post subject: Add user to your forum ignore list Reply with quote

jea skuzila sto ne valja, sad sve radi Smile

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group