Buenos días a todos,
Al ejecutar el siguiente código me da una serie de errores que no se como solucionarlos. Són los siguientes:
Muchas gracias por avanzado
Notice: Undefined variable: values in C:\Archivos de programa\EasyPHP-5.3.6.0\www\Agendavic\neuerkontakt.php on line 59
Notice: Undefined offset: 1 in C:\Archivos de programa\EasyPHP-5.3.6.0\www\Agendavic\neuerkontakt.php on line 70
nickname:
Notice: Undefined offset: 2 in C:\Archivos de programa\EasyPHP-5.3.6.0\www\Agendavic\neuerkontakt.php on line 71
Notice: Undefined offset: 3 in C:\Archivos de programa\EasyPHP-5.3.6.0\www\Agendavic\neuerkontakt.php on line 72
El codigo es el siguiente:
<?php
################################################## ################################
# #
# inscriptio: free php-based contact management #
# #
# Copyright (C) 2003 Stephan Otto, [email protected] #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# This file is part of inscriptio. #
# #
# inscriptio is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# inscriptio is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with inscriptio; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
# #
################################################## ################################
include ("config.php");
include ("header.php");
$cID = @$_POST["cid"];
if ($cID == "") $neuereintrag = "neu";
if ($cID <> "") {
$zieldatei = "data/".$cID."_main.dat";
$fp = @fopen("$zieldatei", "rb");
if (!$fp) {
die("$da_fehlendedatei IEC#29#");
}
while(!feof($fp)) {
$data .= fgets($fp, 1024);
}
fclose($fp);
$values = explode($trennzeichen, $data);
$e = (count($values)- 1);
for ($i = 0; $i <= $e; $i++) {
$values[$i] = htmlentities($values[$i]);
if (eregi($leerzeichen, $values[$i])) $values[$i] = "";
$values[$i] = str_replace("~ZW~", "\n", $values[$i]);
}
}
if ($values[21] == "") $values[21] = $nk_adresse;
$zeilenzahl = 6;
if ($cID == "") $zeilenzahl = 7;
echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td>\n";
echo "<div align=\"center\"><form action=\"kontaktschreiben.php\" method=\"post\">\n";
echo "<table width=\"580\" cellspacing=\"0\" cellpadding=\"0\" class=\"gitter\">\n";
echo "<tr><td> </td><td> </td></tr>";
echo "<tr><td width=\"50%\" colspan=\"2\" class=\"zwischenpunkt\">$nk_zurperson</td><td colspan=\"2\" rowspan=\"$zeilenzahl\"></td></tr>\n";
echo "<tr><td class=\"unterpunkt\">$nk_spitzname:</td><td><input type=\"text\" name=\"cspitzname\" size=\"30\" value=\"$values[1]\"></td></tr>\n";
echo "<tr><td class=\"unterpunkt\">$nk_titel:</td><td><input type=\"text\" name=\"ctitel\" size=\"30\" value=\"$values[2]\"></td></tr>\n";
echo "<tr><td class=\"unterpunkt\">$nk_vorname:</td><td><input type=\"text\" name=\"cvorname\" size=\"30\" value=\"$values[3]\"></td></tr>\n";
echo "<tr><td class=\"unterpunkt\">$nk_nachname:</td><td><input type=\"text\" name=\"cnachname\" size=\"30\" value=\"$values[4]\"></td></tr>\n";
echo "<tr><td class=\"unterpunkt\">$nk_geburtstag:</td><td><select name=\"cgeburtstag\" size=\"1\"><option>--</option>\n";
for ($i = 1; $i < 10; $i++) {
if ($values[5] == "0$i"):
echo "\n<option value=\"$i\" selected=\"selected\">0$i</option>";
else:
echo "\n<option value=\"$i\">0$i</option>";
endif;
}
for ($i = 10; $i <= 31; $i++) {
if ($values[5] == "$i"):
echo "\n<option value=\"$i\" selected=\"selected\">$i</option>";
else:
echo "\n<option value=\"$i\">$i</option>";
endif;
}
echo "</select>.";
echo "<select name=\"cgeburtsmonat\" size=\"1\"><option>---------</option>";
for ($i = 0; $i < 12; $i++) {
$w = $i + 1;
if ($values[6] == "$w"):
echo "\n<option value=\"$w\" selected=\"selected\">$nk_geburtsmonat[$i]</option>";
else:
echo "\n<option value=\"$w\">$nk_geburtsmonat[$i]</option>";
endif;
}
echo "</select>.<select name=\"cgeburtsjahr\" size=\"1\"><option>----</option>";
$heute = getdate();
$start = $heute['year'];
$ende = $start - 100;
for ($i = $start; $i > $ende; $i--) {
if ($values[7] == "$i"):
echo "\n<option value=\"$i\" selected=\"selected\">$i</option>";
else:
echo "\n<option value=\"$i\">$i</option>";
endif;
}
echo "</select></td></tr>\n";
// if ($cID == "") echo "<tr><td> </td><td class=\"erkl\"><input type=\"checkbox\" name=\"cdik\" value=\"true\" $cf_datuminkalender>$nk_datuminkalender</td></tr>\n";
echo "<tr><td> </td><td> </td></tr>";
echo "<tr><td colspan=\"2\" class=\"zwischenpunkt\"><input type=\"text\" name=\"cadressname\" size=\"30\" value=\"$values[21]\"></td>\n";
echo "<td colspan=\"2\" class=\"zwischenpunkt\">$nk_komm</td></tr>\n";
echo "<tr><td class=\"unterpunkt\">$nk_strasse:</td><td><input type=\"text\" name=\"cstrasse\" size=\"30\" value=\"$values[8]\"></td>\n";
echo "<td class=\"unterpunkt\">$nk_telefon:</td><td><input type=\"text\" name=\"ctelefon\" size=\"30\" value=\"$values[14]\"></td></tr>\n";
echo "<tr><td class=\"unterpunkt\"> </td><td><input type=\"text\" name=\"cstrasse2\" size=\"30\" value=\"$values[9]\"></td>\n";
echo "<td class=\"unterpunkt\">$nk_handy:</td><td><input type=\"text\" name=\"chandy\" size=\"30\" value=\"$values[15]\"></td></tr>\n";
echo "<tr><td class=\"unterpunkt\">$nk_plz:</td><td><input type=\"text\" name=\"cplz\" size=\"30\" value=\"$values[10]\"></td>\n";
echo "<td class=\"unterpunkt\">$nk_fax:</td><td><input type=\"text\" name=\"cfax\" size=\"30\" value=\"$values[16]\"></td></tr>\n";
echo "<tr><td class=\"unterpunkt\">$nk_ort:</td><td><input type=\"text\" name=\"cort\" size=\"30\" value=\"$values[11]\"></td>\n";
echo "<td class=\"unterpunkt\">$nk_email:</td><td><input type=\"text\" name=\"cemail\" size=\"30\" value=\"$values[17]\"></td></tr>\n";
echo "<tr><td class=\"unterpunkt\">$nk_buland:</td><td><input type=\"text\" name=\"cbuland\" size=\"30\" value=\"$values[12]\"></td>\n";
echo "<td class=\"unterpunkt\">$nk_website:</td><td><input type=\"text\" name=\"cwebsite\" size=\"30\" value=\"$values[18]\"></tr>\n";
echo "<tr><td class=\"unterpunkt\">$nk_land:</td><td><input type=\"text\" name=\"cland\" size=\"30\" value=\"$values[13]\"></td>\n";
echo "<td class=\"unterpunkt\">$nk_imess:</td><td><input type=\"text\" name=\"cimess\" size=\"30\" value=\"$values[19]\"></td></tr>\n";
echo "<tr><td> </td><td> </td>";
echo "<td> </td><td> </td></tr>";
echo "<tr><td colspan=\"4\" class=\"zwischenpunkt\">$nk_bemerkung:</td></tr>\n";
echo "<tr><td colspan=\"4\" align=\"center\"><textarea name=\"cbemerkung\" cols=\"50\" rows=\"5\">$values[20]</textarea></td></tr>\n";
echo "<tr><td colspan=\"4\" align=\"center\"><input type=\"submit\" value=\"$nk_speichern\"><input type=\"hidden\" name=\"cneuereintrag\" value=\"$neuereintrag\"><input type=\"hidden\" name=\"cid\" value=\"$cID\"></td></tr>\n";
echo "</form>";
echo "<tr><td colspan=\"4\"> </td></tr>\n";
echo "</table></div>";
echo "</td></tr></table>";
include ("footer.php");
?>