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
mali problem

 
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
_butch



Joined: 10 Sep 2003
Posts: 870
Location: Maichno, Krlovc

PostPosted: 28.09.2003 13:18    Post subject: mali problem Add user to your forum ignore list Reply with quote

mali problem -
prikaze mi formu, al ne mogu mjenjati sadrzaj da editiram link..

Code:
// EDIT LINKOVA
case edit:
$query =  "SELECT id, ime FROM links ";
$result = mysql_query($query);
while ($r = mysql_fetch_array($result)) {
$id = $r[id];
$ime = $r[ime];
echo "
 <a href='?a=edit&id=$id'>edit $ime</a>
 <br>
";
}

if (isset ($id)) {
$query = "SELECT * FROM links WHERE id=\"$id\"";
$result = mysql_query($query);
while ($r = mysql_fetch_array($result)) {
$ime = $r[ime];
$url = $r[url];
$button = $r[button];
}

echo "
<form name=\"form1\" method=\"post\" action=\"$PHP_SELF?a=dodaj&ime=$ime\" >
  <table width=\"360\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#FFFFFF\">
    <tr>
      <td width=\"107\">ime</td>
      <td width=\"291\"><input name=\"ime\" type=\"text\" id=\"ime1\" value=\"$ime\"></td>
    </tr>
    <tr>
      <td>url</td>
      <td><input name=\"url\" type=\"text\" id=\"url\" value=\"http://\"></td>
    </tr>
    <tr>
      <td>button</td>
      <td><input name=\"button\" type=\"text\" id=\"button\" value=\"$button\"></td>
    </tr>
    <tr>
      <td><input name=\"submit\" type=\"submit\" id=\"submit\" value=\"submit\"></td>
      <td>&nbsp;</td>
    </tr>
  </table>
</form>
";
if (isset ($submit)) {
$query = "UPDATE links  SET ime=\"$ime1\",  url=\"$url\",  button=\"$button\"  WHERE id=\"$id\"";
mysql_query  ($query);
echo  "<br> link $ime1 tj. bivsi $ime editiran";
}
echo "<br><br><br><a href='?a=edit'>back to edit screen</a>";
}




break;
}
[/code]

_________________
FRENCH GUARD: No chance, English bed-wetting types.
I burst my pimples at you and call your door-opening request a silly thing, you tiny-brained wipers of other people's bottoms!
Flikrac
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
maxy



Joined: 07 Sep 2003
Posts: 894
Location: Zagreb

PostPosted: 28.09.2003 14:44    Post subject: Add user to your forum ignore list Reply with quote

Code:
action=\"$PHP_SELF?a=dodaj&ime=$ime\"


nigdje nemas case dodaj:
sve ti je u editu...a form ti fura na edit Smile
Back to top
View user's profile Send private message
_butch



Joined: 10 Sep 2003
Posts: 870
Location: Maichno, Krlovc

PostPosted: 28.09.2003 19:38    Post subject: Add user to your forum ignore list Reply with quote

maxy wrote:
Code:
action=\"$PHP_SELF?a=dodaj&ime=$ime\"


nigdje nemas case dodaj:
sve ti je u editu...a form ti fura na edit Smile


vidis..
al opet mi ne sljaka..
necu valjda opet trebat pisat.. sh*it

_________________
FRENCH GUARD: No chance, English bed-wetting types.
I burst my pimples at you and call your door-opening request a silly thing, you tiny-brained wipers of other people's bottoms!
Flikrac
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
zytzagoo
mi3.crew


Joined: 25 Aug 2003
Posts: 1842
Location: Zagreb, Hrvatska

PostPosted: 28.09.2003 19:46    Post subject: Add user to your forum ignore list Reply with quote

Ako ti se sav taj komad koda koji si pejstao nalazi unutar edit casea, onda action forme postavi na edit i vidi hoce li se sto dogoditi...

Question. Imas ukljucen register_globals? Ako nemas, onda ti isset($submit) nece raditi, nego moras provjeriti $_POST['submit'], ako forma ide post metodom... Ili $_REQUEST['submit'] ako ti nije bitno otkud dolazi request (post ili get)... Naravno, to je pod uvjetom da imas neku noviju verziju php-a... u starijim imas $HTTP_POST_VARS, $HTTP_GET_VARS itd. Koja je verzija php-a?

_________________
[+]I[+]am[+]my[+]own[+]religion[+]
Back to top
View user's profile Send private message Visit poster's website Twitter profile
_butch



Joined: 10 Sep 2003
Posts: 870
Location: Maichno, Krlovc

PostPosted: 28.09.2003 19:54    Post subject: Add user to your forum ignore list Reply with quote

najnovija - php 4.3.3, register_globals = ON
___
isravio sam ovo sa action forme..
al je problem ovakav-
imam url recimo nesto.php?a=edit i onda mi izvadi linkove iz baze koji su odmah linkovi.. kad se klikne na jedan imas url nesto.php?a=edit&id=1
onda mi trebalo u formu ubaciti podatke koje izvadim iz baze - sve to radi, ali ima trenutno 2 linka u bazi i kada kliknem na 1. onda mi ostaju podaci od onog 2 linka (kojeg nisam ni diro), a kada editiram ovog 2. i ponovno odem da ga editiram (radi kontrole) ostaju mi prvobitni podaci..
___
novi, malo drukciji kod
Code:

// EDIT LINKOVA
case edit:
$query =  "SELECT id, ime FROM links ";
$result = mysql_query($query);
while ($r = mysql_fetch_array($result)) {
$id = $r[id];
$ime = $r[ime];
echo "
 <a href='?a=edit&b=$id'>edit $ime</a>
 <br>
";
}
// jos uvijek edit
switch ($b) {
case $id:
$query = "SELECT ime, url, button FROM links WHERE id='$id'";
$result = mysql_query($query);
while ($r = mysql_fetch_array($result)) {
$ime = $r[ime];
$url = $r[url];
$button = $r[button];
}


echo "
<form name=\"form1\" method=\"post\" action=\"$PHP_SELF?a=edit&b=$id\" >
  <table width=\"360\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#FFFFFF\">
    <tr>
      <td width=\"107\">ime</td>
      <td width=\"291\"><input name=\"ime1\" type=\"text\" id=\"ime1\" value=\"$ime\"></td>
    </tr>
    <tr>
      <td>url</td>
      <td><input name=\"url\" type=\"text\" id=\"url\" value=\"$url\"></td>
    </tr>
    <tr>
      <td>button</td>
      <td><input name=\"button\" type=\"text\" id=\"button\" value=\"$button\"></td>
    </tr>
    <tr>
      <td><input name=\"submit\" type=\"submit\" id=\"submit\" value=\"submit\"></td>
      <td>&nbsp;</td>
    </tr>
  </table>
</form>
";
if (isset ($submit)) {
$query = "UPDATE links  SET ime='$ime1',  url='$url',  button='$button'  WHERE id='$id'";
mysql_query  ($query);
echo  "<br> link $ime1 tj. bivsi $ime editiran";
break;
}
}
echo "<br><br><br><a href='?a=edit'>back to edit screen</a>";

break;

_________________
FRENCH GUARD: No chance, English bed-wetting types.
I burst my pimples at you and call your door-opening request a silly thing, you tiny-brained wipers of other people's bottoms!
Flikrac
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
_butch



Joined: 10 Sep 2003
Posts: 870
Location: Maichno, Krlovc

PostPosted: 28.09.2003 22:33    Post subject: Add user to your forum ignore list Reply with quote

sredio sam..
samo sam promjenio nes kod 2. switcha..
hvala svima kojima sam vrijeme potratio..

_________________
FRENCH GUARD: No chance, English bed-wetting types.
I burst my pimples at you and call your door-opening request a silly thing, you tiny-brained wipers of other people's bottoms!
Flikrac
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
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