Gegen Bilderklau - Das Original (https://www.gegen-bilderklau.net/index.php)
- Design, Website, Copyright (https://www.gegen-bilderklau.net/board.php?boardid=80)
--- Homepagehilfe (https://www.gegen-bilderklau.net/board.php?boardid=27)
---- Homepagehilfe - Archiv (https://www.gegen-bilderklau.net/board.php?boardid=139)
----- [PHP & MySQL] PHP-Problem (https://www.gegen-bilderklau.net/thread.php?threadid=147595)


Geschrieben von Nanni am 30.12.2008 um 22:28:

  PHP-Problem

Und zwar vom virtuellen Shop.
Er ist mit Laaser Shop System aufgebaut und ich habe den Produkten das Feld Copyright hinzugefügt, da ich Bilder von anderen Seiten veröffentlichen will. Nach endlos langem Herumspielen wird nun das Copyirhgt angezeigt - aber komischerweise ohne HTML.
Sowohl lima-city.de unterstützt HTML, als man auch per PHPmy Admin HTML-Zeilen eintragen lassen kann, soviel weiß ich. Also kann ja nur was mit dem Code sein....
So schauts aus: http://pony-mall.lima-city.de/Shop/unzip_laaser_shop_system/shop/details.php?id=94&kategorie=10&main_kat=3&start=0&nr=

CODE: [Bei Zeile 130 wird die Zeile mit dem Copyright definiert großes Grinsen ]

php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:

<? 

// Laaser Shop System
// Copyright: Juergen Laaser, 2002-2007
// Bearbeitet von Nanni (M. Anderl)

// Includes

include ("config.php");
include ("templates.php");


// Variablen Deklaration

if(!isset($_GET['search']))     $_GET['search'] = "";
if(!isset($_GET['id']))         $_GET['id'] = "";

$get_vars['search']        = htmlentities($_GET['search']);
$get_vars['id']            = htmlentities($_GET['id']);


// Programm-Code

$conn_id = mysql_connect($HOST,$ID,$PW);
mysql_select_db($DB,$conn_id);

$result = mysql_query("select * from ".$PREFIX."_Artikel where id = '{$get_vars['id']}'"); 

while ($row = mysql_fetch_object($result))
    {
    
        $artikelnummer = $row->artikelnummer;
        $name             = $row->name;
        $beschreibung  = $row->beschreibung;
        $bild           = $row->bild;
        $copyright       = $row->copyright;
        $preis           = $row->preis;
        $variante1       = $row->variante1;
        $variante2       = $row->variante2;
        
        $preis           = number_format($preis,2,",",".");
        $beschreibung = nl2br($beschreibung);
        
    }
?>

<HTML>
<HEAD>
<TITLE><? echo $TITLE1 ?></TITLE>
<meta http-equiv="Content-Type" CONTENT="text/html; charset=iso-8859-1">

<STYLE type=text/css>
<? echo $STYLE1 ?> 
<? echo $STYLE2 ?> 
</STYLE>

</HEAD>
<body bgcolor="<? echo $BGCOLOR ?>" text="<? echo $TEXT ?>" link="<? echo $LINK ?>" vlink="<? echo $VLINK ?>" alink="<? echo $ALINK ?>">

<? if ($shop == "enable") { ?>
<? if ($header == "ok") { ?>

<table width="<? echo $table_width ?>" border="0" cellspacing="0" cellpadding="0" align="<? echo $table_align ?>">
  <tr> 
    <td width="20" height="10">&nbsp;</td>
    <td height="10"> <b> </b> </td>
  </tr>
  <tr>
    <td width="20">&nbsp;</td>
    <td> 
      <? 
      if ($header_img == "ok") echo "<img src='images/logo.gif' alt='LOGO'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"; 
      if ($header_text != "")  echo "<b><font size='$FONTSIZE_HEADER' color='$FONTCOLOR_HEADER'>$header_text</font></b>";
      ?>
    </td>
  </tr>
  <tr>
    <td width="20" height="10">&nbsp;</td>
    <td height="10">&nbsp;</td>
  </tr>
</table>

<? } ?>

<table width="<? echo $table_width ?>" border="0" cellpadding="1" cellspacing="0" align="<? echo $table_align ?>">
  <tr> 
    <td height="30" width="20">&nbsp;</td>
    <td height="40" colspan="2"> <b><font size="<? echo $FONTSIZE_TITLE2 ?>" color="<? echo $FONTCOLOR_TITLE2 ?>"> 
      <? echo $TITLE2 ?>
      </font></b></td>
  </tr>
  <tr> 
    <td height="50" width="20">&nbsp;</td>
    <td height="50" colspan="2"><a href="index.php?nr=<? echo $get_vars['nr'] ?>"><img src="images/uebersicht.gif" alt="&Uuml;bersicht" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="suche.php?nr=<? echo $get_vars['nr'] ?>"><img src="images/suchen.gif" border="0" alt="Suchen"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="agbs.php?nr=<? echo $get_vars['nr'] ?>"><img src="images/agbs.gif" alt="Allgemeine Gesch&auml;ftsbedingungen" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="warenkorb.php?nr=<? echo $get_vars['nr'] ?>"><img src="images/warenkorb.gif" alt="Warenkorb" border="0"></a> 
    </td>
  </tr>
  <tr> 
    <td height="25" width="20">&nbsp;</td>
    <td height="25" bgcolor="<? echo $TABLE_COLOR1 ?>" colspan="2"><b><font size="<? echo $FONTSIZE_TITLE3 ?>" color="<? echo $FONTCOLOR_TITLE3 ?>">&nbsp;Produkt: 
      <? echo $name ?>
      </font></b></td>
  </tr>
  <tr> 
    <td height="20" width="20">&nbsp;</td>
    <td bgcolor="<? echo $TABLE_COLOR2 ?>" height="20" colspan="2"> 
      <form name="form1" method="post" action="warenkorb_insert.php?id=<? echo $get_vars['id'] ?>&kategorie=<? echo $get_vars['kategorie'] ?>&main_kat=<? echo $get_vars['main_kat'] ?>&search=<? echo $get_vars['search'] ?>&start=<? echo $get_vars['start'] ?>&typ_d=details&nr=<? echo $get_vars['nr'] ?>">
        <table width="98%" border="0" cellpadding="0" cellspacing="0" align="center">
          <? if ($get_vars['action']) {?>
          <tr valign="bottom"> 
            <td height="40" colspan="2"> 
              <div align="center"><b> 
                <? 
                if ($get_vars['action'] == "error")  echo "<font size='$FONTSIZE_NORMAL' color='$ERROR_COLOR'>Fehler: Sie haben keine Menge eingegeben!</font>";
                if ($get_vars['action'] == "erfolg") echo "<font size='$FONTSIZE_NORMAL' color='$ERFOLG_COLOR'>Erfolg: Die Ware wurde in den Warenkorb gelegt!</font>";
                ?>
                </b></div>
            </td>
          </tr>
          <? 
          } 
          if ($bild != "") 
          { 
          ?>
          <tr> 
            <td colspan="2"> <br>
              <img src="images/artikel/<? echo $get_vars['id'] ?>.jpg" border="0">
            </td>
          </tr>
          <tr> 
            <td colspan="2"> <font size="<? echo $FONTSIZE_NORMAL ?>"><b>Copyright:</b> <? echo "$copyright" ?>
              </font> </td>
          </tr>
          <tr> 
            <td colspan="2">&nbsp;</td>
          </tr>
          <? } else {?>
          <tr> 
            <td height="25" colspan="2">&nbsp;</td>
          </tr>
          <? } ?>
          <tr> 
            <td colspan="2"> <font size="<? echo $FONTSIZE_NORMAL ?>"><b>Beschreibung:</b><br>
              <? echo $beschreibung ?>
              </font> </td>
          </tr>
          <? if ($variante1 OR $variante2) { ?>
          <tr> 
            <td height="30" colspan="2">&nbsp;</td>
          </tr>
          <tr> 
            <td height="10" colspan="2"><font size="<? echo $FONTSIZE_NORMAL ?>"><b> 
              <? 
            if ($variante1) 
                {
                    $variante1_array = explode("|",$variante1);
                    $anzahl_elemente = substr_count($variante1,"|");
                    $anzahl_elemente = $anzahl_elemente + 1;
                    
                    echo "$variante_name1:&nbsp;";
                    echo "<select name='variante1'>"; 
                    for ($i=0; $i< $anzahl_elemente; $i++)
                        {
        
                           echo "<option value='$variante1_array[$i]'>$variante1_array[$i]</option>";
                           
                        }
                                
                    echo "</select>&nbsp;&nbsp;&nbsp;";
                    
                }
            if ($variante2) 
                {    
                    
                    $variante2_array = explode("|",$variante2);
                    $anzahl_elemente = substr_count($variante2,"|");
                    $anzahl_elemente = $anzahl_elemente + 1;
                    
                    echo "$variante_name2:&nbsp;";
                    echo "<select name='variante2'>"; 
                    for ($i=0; $i< $anzahl_elemente; $i++)
                        {
        
                           echo "<option value='$variante2_array[$i]'>$variante2_array[$i]</option>";
                           
                        }
                                
                    echo "</select>&nbsp;&nbsp;&nbsp;";
                
                }
            ?>
              </b></font></td>
          </tr>
          <? } ?>
          <tr> 
            <td height="10" colspan="2">&nbsp;</td>
          </tr>
          <tr> 
            <td height="10" width="46%"><font size="<? echo $FONTSIZE_NORMAL ?>"><b>Einzelpreis:</b> 
              <? echo "$preis $waehrung" ?>
              </font></td>
            <td height="10" width="54%"> 
              <div align="right"> <font size="<? echo $FONTSIZE_NORMAL ?>"><b>Menge:&nbsp; 
                <input type="text" name="menge" size="3" maxlength="3" value="1">
                &nbsp; 
                <input type=image src="images/kaufen.gif" border ="0" alt="bestellen" name="image">
                &nbsp;&nbsp;&nbsp; </b></font> </div>
            </td>
          </tr>
          <tr> 
            <td height="20" colspan="3">&nbsp;</td>
          </tr>
          <tr>
            <td height="20" colspan="3"><font size="<? echo $FONTSIZE_NORMAL ?>">Alle 
              Preise inklusive Mehrwertsteuer und zuz&uuml;glich Versandkosten.</font></td>
          </tr>
          <tr>
            <td height="20" colspan="3">&nbsp;</td>
          </tr>
        </table>
      </form>
    </td>
  </tr>
  <tr> 
    <td height="20" width="20">&nbsp;</td>
    <td height="20" bgcolor="<? echo $TABLE_COLOR1 ?>" width="100"><b><font size="<? echo $FONTSIZE_NORMAL ?>"> 
      <? 
    if ($get_vars['search']) echo "<a class='zurueck' href='suche_details.php?search={$get_vars['search']}&start={$get_vars['start']}&nr={$get_vars['nr']}'>&nbsp;zur&uuml;ck</a> ";
    if ($get_vars['kategorie']) echo "<a class='zurueck' href='show.php?kategorie={$get_vars['kategorie']}&main_kat={$get_vars['main_kat']}&start={$get_vars['start']}&nr={$get_vars['nr']}'>&nbsp;zur&uuml;ck</a>";
    ?>
      </font></b> </td>
    <td height="20" bgcolor="<? echo $TABLE_COLOR1 ?>"> 
      <div align="right"><font size="1"><a class="zurueck" href="http://www.laaser.net" target="_blank"><i><b>... 
        powered by Laaser ShopSystem</b></i></a><i><b>&nbsp;</b></i></font></div>
    </td>
  </tr>
  <tr> 
    <td height="20" width="20">&nbsp;</td>
    <td height="20" colspan="2"> 
      <div align="center"><font size="<? echo $FOOTER_SIZE ?>" color="<? echo $FOOTER_COLOR ?>"><br>
        <? echo "$FOOTER <br> <a href='$HOMEPAGE' target='_blank'>$HOMEPAGE</a> &nbsp; <a href='mailto:$EMAIL'>$EMAIL</a>"; ?>
        </font></div>
    </td>
  </tr>
</table>

<?
}
else 
{
?>

<table width="<? echo $table_width ?>" border="0" cellspacing="0" cellpadding="0" align="<? echo $table_align ?>">
  <tr> 
    <td width="20">&nbsp;</td>
    <td><b> 
      <? echo $shopmeldung ?>
      </b></td>
  </tr>
</table>

<? 
} 
mysql_close($conn_id);
?>

</BODY>
</HTML>



Geschrieben von Nanni am 30.12.2008 um 23:45:

 

<A href=.....></A> - der Teil.
Oder meinst du das: copyright varchar(255) latin1_swedish_ci Ja NULL?
Ich hab die Einstellungen genau von den anderen Zeilen übernommen.



Geschrieben von Nanni am 31.12.2008 um 00:15:

 

ähm.. ich hatte es vermutet. Drinnen steht:
&lt;A href=http://www.pferdebox-naila.de target=_blank&gt;Pferdebox Naila&lt;/A&gt;

Macht das jetzt nen Unterschied?



Geschrieben von Nanni am 31.12.2008 um 00:29:

 

okay ^^
php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
<? 

// Laaser Shop System
// Copyright: Juergen Laaser, 2002-2007
// Bearbeitet von Nanni (M. Anderl)

// Includes

include ("../config.php");


// Variablen Deklaration

if (!isset($_POST['artikelnummer']))$_POST['artikelnummer'] = "";
if (!isset($_POST['name']))            $_POST['name'] = "";
if (!isset($_POST['beschreibung']))    $_POST['beschreibung'] = "";
if (!isset($_POST['preis']))        $_POST['preis'] = "";
if (!isset($_POST['copyright']))    $_POST['copyright'] = "";
if (!isset($_POST['variante1']))    $_POST['variante1'] = "";
if (!isset($_POST['variante2']))    $_POST['variante2'] = "";
if (!isset($_POST['status']))        $_POST['status'] = "";
if (!isset($_POST['nkategorie']))    $_POST['nkategorie'] = "";

$post_vars['artikelnummer']            = htmlentities($_POST['artikelnummer'],ENT_QUOTES,'utf-8');
$post_vars['name']                    = htmlentities($_POST['name'],ENT_QUOTES,'utf-8');
$post_vars['beschreibung']            = htmlentities($_POST['beschreibung'],ENT_QUOTES,'utf-8');
$post_vars['preis']                    = htmlentities($_POST['preis'],ENT_QUOTES,'utf-8');
$post_vars['copyright']                    = htmlentities($_POST['copyright'],ENT_QUOTES,'utf-8');
$post_vars['variante1']                = htmlentities($_POST['variante1'],ENT_QUOTES,'utf-8');
$post_vars['variante2']                = htmlentities($_POST['variante2'],ENT_QUOTES,'utf-8');
$post_vars['status']                = htmlentities($_POST['status'],ENT_QUOTES,'utf-8');
$post_vars['nkategorie']            = htmlentities($_POST['nkategorie'],ENT_QUOTES,'utf-8');


// Programm-Code

if (!$post_vars['artikelnummer']): $action = "error";
elseif (!$post_vars['name']): $action = "error";
elseif (!$post_vars['beschreibung']): $action = "error";
elseif (!$post_vars['preis']): $action = "error";
else: $action = "erfolg";
endif;

if ($action == "erfolg") 
    {
    
        if (is_uploaded_file($HTTP_POST_FILES['bild']['tmp_name'])) $bild1 = "ok";

        if (!isset($bild1)) $bild1 = "";
    
        $conn_id = mysql_connect($HOST,$ID,$PW);
        mysql_select_db($DB,$conn_id);
        
        mysql_query("insert into ".$PREFIX."_Artikel (kategorie,artikelnummer,name,beschreibung,preis,bild,copyright,variante1,variante2,status) VALUES ('{$post_vars['nkategorie']}','{$post_vars['artikelnummer']}','{$post_vars['name']}','{$post_vars['beschreibung']}','{$post_vars['preis']}','$bild1','{$post_vars['copyright']}','{$post_vars['variante1']}','{$post_vars['variante2']}','{$post_vars['status']}')"); 
    
        if ($bild1 == "ok") 
            {
    
                $result = mysql_query("select id from ".$PREFIX."_Artikel where name = '{$post_vars['name']}'"); 
                while ($row = mysql_fetch_object($result))
                    {
                    
                    $id     = $row->id;
                    
                    }
                $fotoname = "$id.jpg";

                if ($FTP == "1") 
                    {
                
                        $conn_ftp = ftp_connect($HOST1); 
                        @ftp_login($conn_ftp,$ID1,$PW1);
                        @ftp_chdir($conn_ftp,$PFAD1); 
                        $mode = FTP_BINARY;
                
                        $file = fopen($HTTP_POST_FILES['bild']['tmp_name'],"r");
                        @ftp_fput($conn_ftp,$fotoname,$file,$mode);
                        fclose($file);
                        ftp_quit($conn_ftp);
                    }
                else
                    {

                        move_uploaded_file(($HTTP_POST_FILES['bild']['tmp_name']),"../images/artikel/$fotoname");
                        chmod ("../images/artikel/$fotoname", 0777);
                    }
            
                mysql_close($conn_id);
            
            }
        
    header("Location: pro_index.php?action=$action");
    }

else header("Location: pro_neu.php?artikelnummer={$post_vars['artikelnummer']}&name={$post_vars['name']}&beschreibung={$post_vars['beschreibung']}&preis={$post_vars['preis']}&variante1={$post_vars['variante1']}&variante2={$post_vars['variante2']}&action=$action");

?>



Geschrieben von Nanni am 31.12.2008 um 00:45:

 

ouuwww super fröhlich es klappt fröhlich

Danke viiiielmals!



Geschrieben von Nanni am 03.01.2009 um 20:57:

 

O.o und jetzt beim Bearbeiten... wieder Copyright - Änderung wird nicht übernommen. Ob vorher was drinnen stand oder nicht ist egal, sobald man das Feld verändert wird nichts (mehr) eingetragen...

pro_edit.php
php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
<? 

// Laaser Shop System
// Copyright: Juergen Laaser, 2002-2007
// Bearbeitet von Nanni (M. Anderl)


// Includes

include ("../config.php"); 
include ("../templates.php");


// Variablen Deklaration


if (!isset($_GET['id']))        $_GET['id'] = "";
if (!isset($_GET['bild']))        $_GET['bild'] = "";
if (!isset($_GET['copyright']))        $_GET['copyright'] = "";
if (!isset($_GET['kategorie']))    $_GET['kategorie'] = "";
if (!isset($_GET['name_k']))    $_GET['name_k'] = "";
if (!isset($_GET['main_name']))    $_GET['main_name'] = "";
if (!isset($_GET['sort']))        $_GET['sort'] = "";
if (!isset($_GET['start']))        $_GET['start'] = "";
if (!isset($_GET['action']))    $_GET['action'] = "";

$get_vars                        = array();
$get_vars['id']                    = htmlentities($_GET['id']);
$get_vars['bild']                = htmlentities($_GET['bild']);
$get_vars['copyright']                = $_GET['copyright'];
$get_vars['kategorie']            = htmlentities($_GET['kategorie'],ENT_QUOTES,'utf-8');
$get_vars['name_k']                = htmlentities($_GET['name_k'],ENT_QUOTES,'utf-8');
$get_vars['main_name']            = htmlentities($_GET['main_name'],ENT_QUOTES,'utf-8');
$get_vars['sort']                = htmlentities($_GET['sort']);
$get_vars['start']                = htmlentities($_GET['start']);
$get_vars['action']                = htmlentities($_GET['action']);


// Programm-Code

$conn_id = mysql_connect($HOST,$ID,$PW);
mysql_select_db($DB,$conn_id);

$result = mysql_query("select * from ".$PREFIX."_Artikel where id = '{$get_vars['id']}'"); 

while ($row = mysql_fetch_object($result))
    {
        $id               = $row->id;
        $artikelnummer = $row->artikelnummer;
        $name           = $row->name;
        $beschreibung  = $row->beschreibung;
        $preis         = $row->preis;
        $bild             = $row->bild;
        $copyright       = $row->copyright;
        $kategorie       = $row->kategorie;
        $variante1       = $row->variante1;
        $variante2       = $row->variante2;
        $status           = $row->status;
    
    }
?>

<html>
<head>
<title>Shop - Administration</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#E8E8E8" text="#000000" link="#006600" vlink="#006600" alink="#006600">

<form name="form1" action="pro_edit_save.php" enctype="multipart/form-data" method="post">
  <table width="700" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td width="22" height="50"> </td>
      <td height="50" colspan="2"><b><font size="4">Shop - Administration - Produkte 
        - Unterkategorie: 
        <? 
        if ($get_vars['main_name']) echo "{$get_vars['main_name']}  / ";
        echo $get_vars['name_k'];
        ?>
        </font></b></td>
    </tr>
    <? if ($get_vars['action'] == "erfolg") { ?>
    <tr> 
      <td width="22" height="50">&nbsp;</td>
      <td height="50" colspan="2"><b><font color="#006600">Erfolg: Die &Auml;nderungen 
        wurden &uuml;bernommen!</font></b></td>
    </tr>
    <?
    }
    if ($get_vars['action'] == "error") 
    { 
    ?>
    <tr> 
      <td width="22" height="50">&nbsp;</td>
      <td height="50" colspan="2"><b><font color="#CC0000">Fehler: Sie haben Angaben 
        vergessen! (Bild ist optional)</font></b></td>
    </tr>
    <?
    }
    ?>
    <tr> 
      <td width="22" height="10">&nbsp;</td>
      <td height="10" valign="top" colspan="2">&nbsp;</td>
    </tr>
    <tr> 
      <td width="22" height="30">&nbsp;</td>
      <td height="30" colspan="2"><b>Produkt &auml;ndern:</b></td>
    </tr>
    <tr valign="top"> 
      <td width="22" height="28">&nbsp;</td>
      <td height="28" width="150">Art.nr.</td>
      <td height="28"> 
        <input type="text" name="neu_artikelnummer" size="10" maxlength="10" value="<? echo $artikelnummer ?>">
      </td>
    </tr>
    <tr valign="top"> 
      <td width="22" height="28"> </td>
      <td height="28" width="150">Name:</td>
      <td height="28"> 
        <input type="text" name="neu_name" size="30" maxlength="100" value="<? echo $name ?>">
      </td>
    </tr>
    <tr valign="top"> 
      <td width="22" height="74"></td>
      <td height="74" width="150">Beschreibung:</td>
      <td height="74"> 
        <textarea name="neu_beschreibung" cols="40" rows="4"><? echo $beschreibung ?></textarea>
      </td>
    </tr>
    <tr valign="top"> 
      <td width="22" height="28"></td>
      <td height="28" width="150">neue Unterkategorie:</td>
      <td height="28"> 
        <select name="neu_kategorie">
          <?
        $result = mysql_query("select name , main_kat from ".$PREFIX."_Untergruppen where id = '$kategorie'");
        while ($row = mysql_fetch_object($result))
            {
            
                $name2    = $row->name;
                $main_kat = $row->main_kat;
                
                $result1 = mysql_query("select name from ".$PREFIX."_Hauptgruppen where id = '$main_kat'");
                while ($row1 = mysql_fetch_object($result1))
                    {
                    
                        $name3   = $row1->name;
                    
                    }
            }
            
        if ($name3) echo "<option value='$kategorie'>$name3 / $name2</option>";
        else echo "<option value='$kategorie'>$name2</option>";
        
        $result = mysql_query("select * from ".$PREFIX."_Untergruppen order by name");
        while ($row = mysql_fetch_object($result))
            {
            
                $name      = $row->name;
                $id1       = $row->id;
                $main_kat1 = $row->main_kat;
                
                $name4 = "";
                
                $result1 = mysql_query("select * from ".$PREFIX."_Hauptgruppen where id = '$main_kat1'");
                while ($row1 = mysql_fetch_object($result1))
                    {
                    
                        $name4   = $row1->name;
                        
                    }

                if ($name2 != $name) 
                    {
            
                        if ($name4) echo "<option value='$id1'>$name4 / $name</option>";
                        else echo "<option value='$id1'>$name</option>";
                        
                    }
            }
    
        mysql_close($conn_id);

        ?>
        </select>
      </td>
    </tr>
    <tr valign="top"> 
      <td width="22" height="28"></td>
      <td height="28" width="150">Preis:</td>
      <td height="28"> 
        <input type="text" name="neu_preis" size="6" maxlength="10" value="<? echo $preis ?>">
        <? echo $waehrung ?>
        (z.B.: 10.95)</td>
    </tr>
    <tr valign="top"> 
      <td width="22" height="28"></td>
      <td height="28" width="150">Bild:</td>
      <td height="28"> 
        <? if ($bild == "ok" ) echo "Bild vorhanden" ?>
        <input type="file" name="neu_bild" size="30">
        <input type="hidden" name="bild" value="<? echo $bild ?>">
        <input type="hidden" name="kategorie" value="<? echo $get_vars['kategorie'] ?>">
        <input type="hidden" name="id" value="<? echo $get_vars['id'] ?>">
        <input type="hidden" name="name_k" value="<? echo $get_vars['name_k'] ?>">
        <input type="hidden" name="main_name" value="<? echo $get_vars['main_name'] ?>">
        <input type="hidden" name="start" value="<? echo $get_vars['start'] ?>">
        <input type="hidden" name="sort" value="<? echo $get_vars['sort'] ?>">
      </td>
    </tr>
    <tr valign="top"> 
      <td width="22" height="28"></td>
      <td height="28" width="150">Copyright:</td>
      <td height="28"> 
        <input type="text" name="neu_copyright" size="30" maxlength="255" value="<? echo $copyright ?>">
        (Links mit HTML definiert!)</td>
    </tr>
    <tr valign="top">
      <td width="22" height="28"></td>
      <td height="28" width="150">Variante 1:</td>
      <td height="28">
        <input type="text" name="neu_variante1" size="30" maxlength="255" value="<? echo $variante1 ?>">
        (z.B.: S|M|L|XL) </td>
    </tr>
    <tr valign="top">
      <td width="22" height="28"></td>
      <td height="28" width="150">Variante 2:</td>
      <td height="28">
        <input type="text" name="neu_variante2" size="30" maxlength="255" value="<? echo $variante2 ?>">
        (z.B.: wei&szlig;|blau|gr&uuml;n) </td>
    </tr>
    <tr valign="top"> 
      <td width="22" height="28"></td>
      <td height="28" width="150">Status:</td>
      <td height="28"> 
        <select name="neu_status">
        <?php
        if ($status == "1") echo "<option value='1' selected>Gr&uuml;n</option>";
        else echo "<option value='1'>Gr&uuml;n</option>";
        if ($status == "2") echo "<option value='2' selected>Gelb</option>";
        else echo "<option value='2'>Gelb</option>";
        if ($status == "3") echo "<option value='3' selected>Rot</option>";
        else echo "<option value='3'>Rot</option>";
        ?>
        </select>
      </td>
    </tr>
    <tr> 
      <td width="22" height="25">&nbsp;</td>
      <td height="25" width="150">&nbsp;</td>
      <td height="25"> 
        <input type="image" src="speichern.gif">
      </td>
    </tr>
    <tr> 
      <td width="22" height="25">&nbsp;</td>
      <td height="25" colspan="2">&nbsp;</td>
    </tr>
    <tr> 
      <td width="22" height="29">&nbsp;</td>
      <td height="29" colspan="2"><a href="hilfe.php#produkte">Online-Hilfe</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="index.php">Hauptmen&uuml;</a>&nbsp;&nbsp;&nbsp;<a href="pro_show.php?kategorie=<? echo $get_vars['kategorie'] ?>&name_k=<? echo $get_vars['name_k'] ?>&main_name=<? echo $get_vars['main_name'] ?>&start=<? echo $get_vars['start'] ?>&sort=<? echo $get_vars['sort'] ?>">zur&uuml;ck</a></td>
    </tr>
  </table>
</form>
</body>
</html>


pro_edit_save.php
php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
<? 

// Laaser Shop System
// Copyright: Juergen Laaser, 2002-2007
// Bearbeitet von Nanni (M. Anderl)


// Includes

include ("../config.php");


// Variablen Deklaration

if (!isset($_POST['kategorie']))            $_POST['kategorie'] = "";
if (!isset($_POST['name_k']))                $_POST['name_k'] = "";
if (!isset($_POST['main_name']))            $_POST['main_name'] = "";
if (!isset($_POST['sort']))                    $_POST['sort'] = "";
if (!isset($_POST['start']))                $_POST['start'] = "";
if (!isset($_POST['neu_kategorie']))        $_POST['neu_kategorie'] = "";
if (!isset($_POST['neu_artikelnummer']))    $_POST['neu_artikelnummer'] = "";
if (!isset($_POST['neu_name']))                $_POST['neu_name'] = "";
if (!isset($_POST['neu_beschreibung']))        $_POST['neu_beschreibung'] = "";
if (!isset($_POST['neu_preis']))            $_POST['neu_preis'] = "";
if (!isset($_POST['neu_variante1']))        $_POST['neu_variante1'] = "";
if (!isset($_POST['neu_variante2']))        $_POST['neu_variante2'] = "";
if (!isset($_POST['neu_status']))            $_POST['neu_status'] = "";
if (!isset($_POST['bild']))                $_POST['bild'] = "";
if (!isset($_POST['copyright']))            $_POST['copyright'] = "";
if (!isset($_POST['id']))                $_POST['id'] = "";

$post_vars                            = array();
$post_vars['neu_kategorie']            = htmlentities($_POST['neu_kategorie'],ENT_QUOTES,'utf-8');
$post_vars['neu_artikelnummer']        = htmlentities($_POST['neu_artikelnummer'],ENT_QUOTES,'utf-8');
$post_vars['neu_name']                = htmlentities($_POST['neu_name'],ENT_QUOTES,'utf-8');
$post_vars['neu_beschreibung']        = htmlentities($_POST['neu_beschreibung'],ENT_QUOTES,'utf-8');
$post_vars['neu_preis']                = htmlentities($_POST['neu_preis'],ENT_QUOTES,'utf-8');
$post_vars['neu_variante1']            = htmlentities($_POST['neu_variante1'],ENT_QUOTES,'utf-8');
$post_vars['neu_variante2']            = htmlentities($_POST['neu_variante2'],ENT_QUOTES,'utf-8');
$post_vars['neu_status']            = htmlentities($_POST['neu_status'],ENT_QUOTES,'utf-8');
$post_vars['bild']                    = htmlentities($_POST['bild'],ENT_QUOTES,'utf-8');
$post_vars['copyright']                    = $_POST['copyright'];
$post_vars['id']                    = htmlentities($_POST['id'],ENT_QUOTES,'utf-8');
$post_vars['kategorie']                = htmlentities($_POST['kategorie'],ENT_QUOTES,'utf-8');
$post_vars['name_k']                = htmlentities($_POST['name_k'],ENT_QUOTES,'utf-8');
$post_vars['main_name']                = htmlentities($_POST['main_name'],ENT_QUOTES,'utf-8');
$post_vars['sort']                    = htmlentities($_POST['sort'],ENT_QUOTES,'utf-8');
$post_vars['start']                    = htmlentities($_POST['start'],ENT_QUOTES,'utf-8');



// Programm-Code

if (!$post_vars['neu_artikelnummer']): $action = "error";
elseif (!$post_vars['neu_name']): $action = "error";
elseif (!$post_vars['neu_beschreibung']): $action = "error";
elseif (!$post_vars['neu_preis']): $action = "error";
elseif (!$post_vars['neu_copyright']): $action = "error";
else: $action = "erfolg";
endif;

$conn_id = mysql_connect($HOST,$ID,$PW);
mysql_select_db($DB,$conn_id);

if ($action == "erfolg") {

    if ($post_vars['bild'] == "ok" AND !is_uploaded_file($HTTP_POST_FILES['neu_bild']['tmp_name'])) 
        {

            mysql_query("update ".$PREFIX."_Artikel set kategorie ='{$post_vars['neu_kategorie']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set artikelnummer ='{$post_vars['neu_artikelnummer']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set name ='{$post_vars['neu_name']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set beschreibung ='{$post_vars['neu_beschreibung']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set preis ='{$post_vars['neu_preis']}' where id = '{$post_vars['id']}'");
                        mysql_query("update ".$PREFIX."_Artikel set copyright ='{$post_vars['neu_copyright']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set variante1 ='{$post_vars['neu_variante1']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set variante2 ='{$post_vars['neu_variante2']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set status ='{$post_vars['neu_status']}' where id = '{$post_vars['id']}'");
        
        }


    if ($post_vars['bild'] != "ok" AND !is_uploaded_file($HTTP_POST_FILES['neu_bild']['tmp_name'])) 
        {
    
            mysql_query("update ".$PREFIX."_Artikel set kategorie ='{$post_vars['neu_kategorie']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set artikelnummer ='{$post_vars['neu_artikelnummer']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set name ='{$post_vars['neu_name']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set beschreibung ='{$post_vars['neu_beschreibung']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set preis ='{$post_vars['neu_preis']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set copyright ='{$post_vars['neu_copyright']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set variante1 ='{$post_vars['neu_variante1']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set variante2 ='{$post_vars['neu_variante2']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set status ='{$post_vars['neu_status']}' where id = '{$post_vars['id']}'");
        
        }


    if ($post_vars['bild'] == "ok" AND is_uploaded_file($HTTP_POST_FILES['neu_bild']['tmp_name'])) 
        {

            mysql_query("update ".$PREFIX."_Artikel set kategorie ='{$post_vars['neu_kategorie']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set artikelnummer ='{$post_vars['neu_artikelnummer']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set name ='{$post_vars['neu_name']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set beschreibung ='{$post_vars['neu_beschreibung']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set preis ='{$post_vars['neu_preis']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set copyright ='{$post_vars['neu_copyright']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set variante1 ='{$post_vars['neu_variante1']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set variante2 ='{$post_vars['neu_variante2']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set status ='{$post_vars['neu_status']}' where id = '{$post_vars['id']}'");

            $fotoname = "{$post_vars['id']}.jpg";        

            if ($FTP == "1")

                {
    
                    $conn_ftp = ftp_connect($HOST1); 
                    ftp_login($conn_ftp,$ID1,$PW1);
                    ftp_chdir($conn_ftp,$PFAD1);
                            
                    @ftp_delete($conn_ftp,$fotoname);
        
                    $mode = FTP_BINARY;
                    
                    $file = fopen($HTTP_POST_FILES['neu_bild']['tmp_name'],"r");
                        @ftp_fput($conn_ftp,$fotoname,$file,$mode);
                    fclose($file);
                }

            else

                {
                    unlink("../images/artikel/$fotoname");
                    move_uploaded_file(($HTTP_POST_FILES['neu_bild']['tmp_name']),"../images/artikel/$fotoname");
                    chmod ("../images/artikel/$fotoname", 0777);

                }

    
        }
    
    if ($post_vars['bild']!= "ok" AND is_uploaded_file($HTTP_POST_FILES['neu_bild']['tmp_name'])) 
        {

            $bild = "ok";
            mysql_query("update ".$PREFIX."_Artikel set kategorie ='{$post_vars['neu_kategorie']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set artikelnummer ='{$post_vars['neu_artikelnummer']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set name ='{$post_vars['neu_name']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set beschreibung ='{$post_vars['neu_beschreibung']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set preis ='{$post_vars['neu_preis']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set copyright ='{$post_vars['neu_copyright']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set variante1 ='{$post_vars['neu_variante1']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set variante2 ='{$post_vars['neu_variante2']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set bild ='$bild' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set status ='{$post_vars['neu_status']}' where id = '{$post_vars['id']}'");
        
        
            $fotoname = "{$post_vars['id']}.jpg";

            if ($FTP == "1")

                {
                    $conn_ftp = ftp_connect($HOST1); 
                    @ftp_login($conn_ftp,$ID1,$PW1);
                    @ftp_chdir($conn_ftp,$PFAD1); 
                    $mode = FTP_BINARY;
            
                    $file = fopen($HTTP_POST_FILES['neu_bild']['tmp_name'],"r");
                    @ftp_fput($conn_ftp,$fotoname,$file,$mode);
                    fclose($file);

                }

            else

                {
    
                    move_uploaded_file(($HTTP_POST_FILES['neu_bild']['tmp_name']),"../images/artikel/$fotoname");
                    chmod ("../images/artikel/$fotoname", 0777);

                }

    
        }

mysql_close($conn_id);

header("Location: pro_show.php?kategorie={$post_vars['kategorie']}&id={$post_vars['id']}&action=$action&name_k={$post_vars['name_k']}&main_name={$post_vars['main_name']}&start={$post_vars['start']}&sort={$post_vars['sort']}");
}

else header("Location: pro_edit.php?kategorie={$post_vars['kategorie']}&id={$post_vars['id']}&action=$action&name_k={$post_vars['name_k']}&main_name={$post_vars['main_name']}&start={$post_vars['start']}&sort={$post_vars['sort']}");

?>



Geschrieben von Nanni am 03.01.2009 um 22:03:

 

nein, gar nichts wird eingetragen



Geschrieben von Nanni am 04.01.2009 um 12:49:

 

nichts - es kommt immer die Meldung 'Erfolg: Die Änderungen wurden übernommen!'

Und ja, die anderen Felder kann ich bearbeiten und es wird ganz normal übernommen.



Geschrieben von Nanni am 15.02.2009 um 22:19:

 

so hab mal wieder dran gearbeitet -> geht immer noch nicht.



Geschrieben von Nanni am 03.03.2009 um 14:08:

 

=(

Hat niemand eine Idee was ich noch versuchen könnte? Bitte...

LG Nanni



Geschrieben von victor am 05.03.2009 um 22:11:

 

Wenn du wieder dran gearbeitet hast, wie ist denn dann die aktuelle Version? ^^



Geschrieben von Nanni am 06.03.2009 um 20:46:

 

du meinst wieder den ganzen Code?
Sonst hat sich nichts getan. Es tragt übernimmt die Änderung einfach nicht.

php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
<? 

// Laaser Shop System
// Copyright: Juergen Laaser, 2002-2007
// Bearbeitet von Nanni (M. Anderl)


// Includes

include ("../config.php"); 
include ("../templates.php");


// Variablen Deklaration


if (!isset($_GET['id']))        $_GET['id'] = "";
if (!isset($_GET['bild']))        $_GET['bild'] = "";
if (!isset($_GET['copyright']))        $_GET['copyright'] = "";
if (!isset($_GET['kategorie']))    $_GET['kategorie'] = "";
if (!isset($_GET['name_k']))    $_GET['name_k'] = "";
if (!isset($_GET['main_name']))    $_GET['main_name'] = "";
if (!isset($_GET['sort']))        $_GET['sort'] = "";
if (!isset($_GET['start']))        $_GET['start'] = "";
if (!isset($_GET['action']))    $_GET['action'] = "";

$get_vars                        = array();
$get_vars['id']                    = htmlentities($_GET['id']);
$get_vars['bild']                = htmlentities($_GET['bild']);
$get_vars['copyright']                = $_GET['copyright'];
$get_vars['kategorie']            = htmlentities($_GET['kategorie'],ENT_QUOTES,'utf-8');
$get_vars['name_k']                = htmlentities($_GET['name_k'],ENT_QUOTES,'utf-8');
$get_vars['main_name']            = htmlentities($_GET['main_name'],ENT_QUOTES,'utf-8');
$get_vars['sort']                = htmlentities($_GET['sort']);
$get_vars['start']                = htmlentities($_GET['start']);
$get_vars['action']                = htmlentities($_GET['action']);


// Programm-Code

$conn_id = mysql_connect($HOST,$ID,$PW);
mysql_select_db($DB,$conn_id);

$result = mysql_query("select * from ".$PREFIX."_Artikel where id = '{$get_vars['id']}'"); 

while ($row = mysql_fetch_object($result))
    {
        $id               = $row->id;
        $artikelnummer = $row->artikelnummer;
        $name           = $row->name;
        $beschreibung  = $row->beschreibung;
        $preis         = $row->preis;
        $bild             = $row->bild;
        $copyright       = $row->copyright;
        $kategorie       = $row->kategorie;
        $variante1       = $row->variante1;
        $variante2       = $row->variante2;
        $status           = $row->status;
    
    }
?>

<html>
<head>
<title>Shop - Administration</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#E8E8E8" text="#000000" link="#006600" vlink="#006600" alink="#006600">

<form name="form1" action="pro_edit_save.php" enctype="multipart/form-data" method="post">
  <table width="700" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td width="22" height="50"> </td>
      <td height="50" colspan="2"><b><font size="4">Shop - Administration - Produkte 
        - Unterkategorie: 
        <? 
        if ($get_vars['main_name']) echo "{$get_vars['main_name']}  / ";
        echo $get_vars['name_k'];
        ?>
        </font></b></td>
    </tr>
    <? if ($get_vars['action'] == "erfolg") { ?>
    <tr> 
      <td width="22" height="50">&nbsp;</td>
      <td height="50" colspan="2"><b><font color="#006600">Erfolg: Die &Auml;nderungen 
        wurden &uuml;bernommen!</font></b></td>
    </tr>
    <?
    }
    if ($get_vars['action'] == "error") 
    { 
    ?>
    <tr> 
      <td width="22" height="50">&nbsp;</td>
      <td height="50" colspan="2"><b><font color="#CC0000">Fehler: Sie haben Angaben 
        vergessen! (Bild ist optional)</font></b></td>
    </tr>
    <?
    }
    ?>
    <tr> 
      <td width="22" height="10">&nbsp;</td>
      <td height="10" valign="top" colspan="2">&nbsp;</td>
    </tr>
    <tr> 
      <td width="22" height="30">&nbsp;</td>
      <td height="30" colspan="2"><b>Produkt &auml;ndern:</b></td>
    </tr>
    <tr valign="top"> 
      <td width="22" height="28">&nbsp;</td>
      <td height="28" width="150">Art.nr.</td>
      <td height="28"> 
        <input type="text" name="neu_artikelnummer" size="10" maxlength="10" value="<? echo $artikelnummer ?>">
      </td>
    </tr>
    <tr valign="top"> 
      <td width="22" height="28"> </td>
      <td height="28" width="150">Name:</td>
      <td height="28"> 
        <input type="text" name="neu_name" size="30" maxlength="100" value="<? echo $name ?>">
      </td>
    </tr>
    <tr valign="top"> 
      <td width="22" height="74"></td>
      <td height="74" width="150">Beschreibung:</td>
      <td height="74"> 
        <textarea name="neu_beschreibung" cols="40" rows="4"><? echo $beschreibung ?></textarea>
      </td>
    </tr>
    <tr valign="top"> 
      <td width="22" height="28"></td>
      <td height="28" width="150">neue Unterkategorie:</td>
      <td height="28"> 
        <select name="neu_kategorie">
          <?
        $result = mysql_query("select name , main_kat from ".$PREFIX."_Untergruppen where id = '$kategorie'");
        while ($row = mysql_fetch_object($result))
            {
            
                $name2    = $row->name;
                $main_kat = $row->main_kat;
                
                $result1 = mysql_query("select name from ".$PREFIX."_Hauptgruppen where id = '$main_kat'");
                while ($row1 = mysql_fetch_object($result1))
                    {
                    
                        $name3   = $row1->name;
                    
                    }
            }
            
        if ($name3) echo "<option value='$kategorie'>$name3 / $name2</option>";
        else echo "<option value='$kategorie'>$name2</option>";
        
        $result = mysql_query("select * from ".$PREFIX."_Untergruppen order by name");
        while ($row = mysql_fetch_object($result))
            {
            
                $name      = $row->name;
                $id1       = $row->id;
                $main_kat1 = $row->main_kat;
                
                $name4 = "";
                
                $result1 = mysql_query("select * from ".$PREFIX."_Hauptgruppen where id = '$main_kat1'");
                while ($row1 = mysql_fetch_object($result1))
                    {
                    
                        $name4   = $row1->name;
                        
                    }

                if ($name2 != $name) 
                    {
            
                        if ($name4) echo "<option value='$id1'>$name4 / $name</option>";
                        else echo "<option value='$id1'>$name</option>";
                        
                    }
            }
    
        echo mysql_error(); 
                mysql_close($conn_id);

        ?>
        </select>
      </td>
    </tr>
    <tr valign="top"> 
      <td width="22" height="28"></td>
      <td height="28" width="150">Preis:</td>
      <td height="28"> 
        <input type="text" name="neu_preis" size="6" maxlength="10" value="<? echo $preis ?>">
        <? echo $waehrung ?>
        (z.B.: 10.95)</td>
    </tr>
    <tr valign="top"> 
      <td width="22" height="28"></td>
      <td height="28" width="150">Bild:</td>
      <td height="28"> 
        <? if ($bild == "ok" ) echo "Bild vorhanden" ?>
        <input type="file" name="neu_bild" size="30">
        <input type="hidden" name="bild" value="<? echo $bild ?>">
        <input type="hidden" name="kategorie" value="<? echo $get_vars['kategorie'] ?>">
        <input type="hidden" name="id" value="<? echo $get_vars['id'] ?>">
        <input type="hidden" name="name_k" value="<? echo $get_vars['name_k'] ?>">
        <input type="hidden" name="main_name" value="<? echo $get_vars['main_name'] ?>">
        <input type="hidden" name="start" value="<? echo $get_vars['start'] ?>">
        <input type="hidden" name="sort" value="<? echo $get_vars['sort'] ?>">
      </td>
    </tr>
    <tr valign="top"> 
      <td width="22" height="28"></td>
      <td height="28" width="150">Copyright:</td>
      <td height="28"> 
        <input type="text" name="neu_copyright" size="30" maxlength="255" value="<? echo $copyright ?>">
        (Links mit HTML definiert!)</td>
    </tr>
    <tr valign="top">
      <td width="22" height="28"></td>
      <td height="28" width="150">Variante 1:</td>
      <td height="28">
        <input type="text" name="neu_variante1" size="30" maxlength="255" value="<? echo $variante1 ?>">
        (z.B.: S|M|L|XL) </td>
    </tr>
    <tr valign="top">
      <td width="22" height="28"></td>
      <td height="28" width="150">Variante 2:</td>
      <td height="28">
        <input type="text" name="neu_variante2" size="30" maxlength="255" value="<? echo $variante2 ?>">
        (z.B.: wei&szlig;|blau|gr&uuml;n) </td>
    </tr>
    <tr valign="top"> 
      <td width="22" height="28"></td>
      <td height="28" width="150">Status:</td>
      <td height="28"> 
        <select name="neu_status">
        <?php
        if ($status == "1") echo "<option value='1' selected>Gr&uuml;n</option>";
        else echo "<option value='1'>Gr&uuml;n</option>";
        if ($status == "2") echo "<option value='2' selected>Gelb</option>";
        else echo "<option value='2'>Gelb</option>";
        if ($status == "3") echo "<option value='3' selected>Rot</option>";
        else echo "<option value='3'>Rot</option>";
        ?>
        </select>
      </td>
    </tr>
    <tr> 
      <td width="22" height="25">&nbsp;</td>
      <td height="25" width="150">&nbsp;</td>
      <td height="25"> 
        <input type="image" src="speichern.gif">
      </td>
    </tr>
    <tr> 
      <td width="22" height="25">&nbsp;</td>
      <td height="25" colspan="2">&nbsp;</td>
    </tr>
    <tr> 
      <td width="22" height="29">&nbsp;</td>
      <td height="29" colspan="2"><a href="hilfe.php#produkte">Online-Hilfe</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="index.php">Hauptmen&uuml;</a>&nbsp;&nbsp;&nbsp;<a href="pro_show.php?kategorie=<? echo $get_vars['kategorie'] ?>&name_k=<? echo $get_vars['name_k'] ?>&main_name=<? echo $get_vars['main_name'] ?>&start=<? echo $get_vars['start'] ?>&sort=<? echo $get_vars['sort'] ?>">zur&uuml;ck</a></td>
    </tr>
  </table>
</form>
</body>
</html>


Und:
php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
<? 

// Laaser Shop System
// Copyright: Juergen Laaser, 2002-2007
// Bearbeitet von Nanni (M. Anderl)


// Includes

include ("../config.php");


// Variablen Deklaration

if (!isset($_POST['kategorie']))            $_POST['kategorie'] = "";
if (!isset($_POST['name_k']))                $_POST['name_k'] = "";
if (!isset($_POST['main_name']))            $_POST['main_name'] = "";
if (!isset($_POST['sort']))                    $_POST['sort'] = "";
if (!isset($_POST['start']))                $_POST['start'] = "";
if (!isset($_POST['neu_kategorie']))        $_POST['neu_kategorie'] = "";
if (!isset($_POST['neu_artikelnummer']))    $_POST['neu_artikelnummer'] = "";
if (!isset($_POST['neu_name']))                $_POST['neu_name'] = "";
if (!isset($_POST['neu_beschreibung']))        $_POST['neu_beschreibung'] = "";
if (!isset($_POST['neu_preis']))            $_POST['neu_preis'] = "";
if (!isset($_POST['neu_variante1']))        $_POST['neu_variante1'] = "";
if (!isset($_POST['neu_variante2']))        $_POST['neu_variante2'] = "";
if (!isset($_POST['neu_status']))            $_POST['neu_status'] = "";
if (!isset($_POST['bild']))                    $_POST['bild'] = "";
if (!isset($_POST['copyright']))                    $_POST['copyright'] = "";
if (!isset($_POST['id']))                    $_POST['id'] = "";

$post_vars                            = array();
$post_vars['neu_kategorie']            = htmlentities($_POST['neu_kategorie'],ENT_QUOTES,'utf-8');
$post_vars['neu_artikelnummer']        = htmlentities($_POST['neu_artikelnummer'],ENT_QUOTES,'utf-8');
$post_vars['neu_name']                = htmlentities($_POST['neu_name'],ENT_QUOTES,'utf-8');
$post_vars['neu_beschreibung']        = htmlentities($_POST['neu_beschreibung'],ENT_QUOTES,'utf-8');
$post_vars['neu_preis']                = htmlentities($_POST['neu_preis'],ENT_QUOTES,'utf-8');
$post_vars['neu_variante1']            = htmlentities($_POST['neu_variante1'],ENT_QUOTES,'utf-8');
$post_vars['neu_variante2']            = htmlentities($_POST['neu_variante2'],ENT_QUOTES,'utf-8');
$post_vars['neu_status']            = htmlentities($_POST['neu_status'],ENT_QUOTES,'utf-8');
$post_vars['bild']                    = htmlentities($_POST['bild'],ENT_QUOTES,'utf-8');

$post_vars['neu_copyright']                    = $_POST['copyright'];
$post_vars['id']                    = htmlentities($_POST['id'],ENT_QUOTES,'utf-8');
$post_vars['kategorie']                = htmlentities($_POST['kategorie'],ENT_QUOTES,'utf-8');
$post_vars['name_k']                = htmlentities($_POST['name_k'],ENT_QUOTES,'utf-8');
$post_vars['main_name']                = htmlentities($_POST['main_name'],ENT_QUOTES,'utf-8');
$post_vars['sort']                    = htmlentities($_POST['sort'],ENT_QUOTES,'utf-8');
$post_vars['start']                    = htmlentities($_POST['start'],ENT_QUOTES,'utf-8');



// Programm-Code

if (!$post_vars['neu_artikelnummer']): $action = "error";
elseif (!$post_vars['neu_name']): $action = "error";
elseif (!$post_vars['neu_beschreibung']): $action = "error";
elseif (!$post_vars['neu_preis']): $action = "error";
else: $action = "erfolg";
endif;

$conn_id = mysql_connect($HOST,$ID,$PW);
mysql_select_db($DB,$conn_id);

if ($action == "erfolg") {

    if ($post_vars['bild'] == "ok" AND !is_uploaded_file($HTTP_POST_FILES['neu_bild']['tmp_name'])) 
        {

            mysql_query("update ".$PREFIX."_Artikel set kategorie ='{$post_vars['neu_kategorie']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set artikelnummer ='{$post_vars['neu_artikelnummer']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set name ='{$post_vars['neu_name']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set beschreibung ='{$post_vars['neu_beschreibung']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set preis ='{$post_vars['neu_preis']}' where id = '{$post_vars['id']}'");
                        mysql_query("update ".$PREFIX."_Artikel set copyright ='{$post_vars['neu_copyright']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set variante1 ='{$post_vars['neu_variante1']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set variante2 ='{$post_vars['neu_variante2']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set status ='{$post_vars['neu_status']}' where id = '{$post_vars['id']}'");
        
        }


    if ($post_vars['bild'] != "ok" AND !is_uploaded_file($HTTP_POST_FILES['neu_bild']['tmp_name'])) 
        {
    
            mysql_query("update ".$PREFIX."_Artikel set kategorie ='{$post_vars['neu_kategorie']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set artikelnummer ='{$post_vars['neu_artikelnummer']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set name ='{$post_vars['neu_name']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set beschreibung ='{$post_vars['neu_beschreibung']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set preis ='{$post_vars['neu_preis']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set copyright ='{$post_vars['neu_copyright']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set variante1 ='{$post_vars['neu_variante1']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set variante2 ='{$post_vars['neu_variante2']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set status ='{$post_vars['neu_status']}' where id = '{$post_vars['id']}'");
        
        }


    if ($post_vars['bild'] == "ok" AND is_uploaded_file($HTTP_POST_FILES['neu_bild']['tmp_name'])) 
        {

            mysql_query("update ".$PREFIX."_Artikel set kategorie ='{$post_vars['neu_kategorie']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set artikelnummer ='{$post_vars['neu_artikelnummer']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set name ='{$post_vars['neu_name']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set beschreibung ='{$post_vars['neu_beschreibung']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set preis ='{$post_vars['neu_preis']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set copyright ='{$post_vars['neu_copyright']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set variante1 ='{$post_vars['neu_variante1']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set variante2 ='{$post_vars['neu_variante2']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set status ='{$post_vars['neu_status']}' where id = '{$post_vars['id']}'");

            $fotoname = "{$post_vars['id']}.jpg";        

            if ($FTP == "1")

                {
    
                    $conn_ftp = ftp_connect($HOST1); 
                    ftp_login($conn_ftp,$ID1,$PW1);
                    ftp_chdir($conn_ftp,$PFAD1);
                            
                    @ftp_delete($conn_ftp,$fotoname);
        
                    $mode = FTP_BINARY;
                    
                    $file = fopen($HTTP_POST_FILES['neu_bild']['tmp_name'],"r");
                        @ftp_fput($conn_ftp,$fotoname,$file,$mode);
                    fclose($file);
                }

            else

                {
                    unlink("../images/artikel/$fotoname");
                    move_uploaded_file(($HTTP_POST_FILES['neu_bild']['tmp_name']),"../images/artikel/$fotoname");
                    chmod ("../images/artikel/$fotoname", 0777);

                }

    
        }
    
    if ($post_vars['bild']!= "ok" AND is_uploaded_file($HTTP_POST_FILES['neu_bild']['tmp_name'])) 
        {

            $bild = "ok";
            mysql_query("update ".$PREFIX."_Artikel set kategorie ='{$post_vars['neu_kategorie']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set artikelnummer ='{$post_vars['neu_artikelnummer']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set name ='{$post_vars['neu_name']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set beschreibung ='{$post_vars['neu_beschreibung']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set preis ='{$post_vars['neu_preis']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set copyright ='{$post_vars['neu_copyright']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set variante1 ='{$post_vars['neu_variante1']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set variante2 ='{$post_vars['neu_variante2']}' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set bild ='$bild' where id = '{$post_vars['id']}'");
            mysql_query("update ".$PREFIX."_Artikel set status ='{$post_vars['neu_status']}' where id = '{$post_vars['id']}'");
        
        
            $fotoname = "{$post_vars['id']}.jpg";

            if ($FTP == "1")

                {
                    $conn_ftp = ftp_connect($HOST1); 
                    @ftp_login($conn_ftp,$ID1,$PW1);
                    @ftp_chdir($conn_ftp,$PFAD1); 
                    $mode = FTP_BINARY;
            
                    $file = fopen($HTTP_POST_FILES['neu_bild']['tmp_name'],"r");
                    @ftp_fput($conn_ftp,$fotoname,$file,$mode);
                    fclose($file);

                }

            else

                {
    
                    move_uploaded_file(($HTTP_POST_FILES['neu_bild']['tmp_name']),"../images/artikel/$fotoname");
                    chmod ("../images/artikel/$fotoname", 0777);

                }

    
        }

mysql_close($conn_id);

header("Location: pro_show.php?kategorie={$post_vars['kategorie']}&id={$post_vars['id']}&action=$action&name_k={$post_vars['name_k']}&main_name={$post_vars['main_name']}&start={$post_vars['start']}&sort={$post_vars['sort']}");
}

else header("Location: pro_edit.php?kategorie={$post_vars['kategorie']}&id={$post_vars['id']}&action=$action&name_k={$post_vars['name_k']}&main_name={$post_vars['main_name']}&start={$post_vars['start']}&sort={$post_vars['sort']}");

?>



Geschrieben von victor am 07.03.2009 um 01:08:

 

pro_edit_save.php, Zeile 43:
code:
1:
$post_vars['neu_copyright']                    = $_POST['copyright'];

Dein Feld in der pro_edit.php heißt neu_copyright, deshalb ist $POST['copyright'] nicht definiert. Augenzwinkern



Geschrieben von Nanni am 07.03.2009 um 20:44:

 

Also müsste die Zeile lauten:
php:
1:
$post_vars['neu_copyright']                    = $_POST['neu_copyright'];


Oder muss ich $POST['copyright'] noch definieren (und wenn ja, wo)?



Geschrieben von victor am 09.03.2009 um 18:42:

 

Mit der Änderung müsste es gehen.

Mal ganz allgemein: Du musst in PHP Variablen nicht deklarieren. Du müsstest die Daten eigentlich nichtmal kopieren - du kannst durchaus auch direkt auf $_POST['irgendwas'] zugreifen. Aber um schnell das Problem zu lösen sollte es deine geänderte Zeile tun. ^^ Wenn nicht, suchen wir weiter nach den restlichen Fehlern. xD


Forensoftware: Burning Board, entwickelt von WoltLab GmbH