Ver Mensaje Individual
  #3 (permalink)  
Antiguo 22/01/2011, 07:18
peregrina
 
Fecha de Ingreso: enero-2011
Ubicación: Ing. Maschwitz
Mensajes: 8
Antigüedad: 13 años, 3 meses
Puntos: 0
Respuesta: Undefined variable: submit

Es muy largo, lo mando en 2 partes. Acá va la primera.

[HIGHLIGHT="PHP"]
session_start();

// if session is not registered go to login
if (!session_is_registered("admin"))
{
header("Location: login.php");
}

// if seiion is registered
if(session_is_registered("admin")){
include ("config.php");
include( "settings.inc.php");
include_once ("header.inc.php");
echo "<h2>$la_add_cat_title</h2>";

error_reporting(E_ALL);

// if submit has not been clicked
if (!$submit){
echo "<FORM ENCTYPE=\"multipart/form-data\" ACTION=\"add_category.php\" METHOD=\"POST\">
<table align=center width=\"600\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr><td bgcolor=\"$colour_2\">
<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"2\" cellspacing=\"1\">
<tr bgcolor=\"$colour_3\">
<td width=\"200\" valign=\"top\"><b>$la_cat_name</b></td>
<td width=\"400\" valign=\"top\"><input class=\"textbox\" type=\"textbox\" name=\"cat_name\"></td>
</tr>
<tr bgcolor=\"$colour_3\">
<td width=\"200\" valign=\"top\"><b>$la_cat_name en ingles</b></td>
<td width=\"400\" valign=\"top\"><input class=\"textbox\" type=\"textbox\" name=\"cat_name_en\"></td>
</tr>
<tr bgcolor=\"$colour_3\">
<td width=\"200\" valign=\"top\"><b>Precio</b></td>
<td width=\"400\" valign=\"top\"><input class=\"textbox\" type=\"textbox\" name=\"price\"></td>
</tr>
<tr bgcolor=\"$colour_3\">
<td width=\"200\" valign=\"top\"><b>Descripcion</b></td>
<td width=\"400\" valign=\"top\"><textarea name=\"description\" cols=\"40\" rows=\"8\"></textarea></td>
</tr>
<tr bgcolor=\"$colour_3\">
<td width=\"200\" valign=\"top\"><b>$la_cat_below</b></td>
<td width=\"400\" valign=\"top\">";

// Drop down menu to build full category!
print "<select name=\"cat_father_id\"><option value=\"0\">$la_top_lev</option>";
$select = mysql_query("select * from ".$prefix."store_category");
while ($row = mysql_fetch_array($select))
{
$cat_id_dd = $row["cat_id"];

echo"<option value=\"$cat_id_dd\">";
$cat_full_name = $row["cat_full_name"];
$category = $row["category"];
$catfatherid_1 = $row["cat_father_id"];

$t1 = $category;

if ($catfatherid_1 <> 0)
{
$sql_lowercat = "select * from ".$prefix."store_category where cat_id = $catfatherid_1";
$result1 = mysql_query ($sql_lowercat);
$row1 = mysql_fetch_array($result1);
$catfatherid_2 = $row1["cat_father_id"];
$catname_2 = $row1["category"];
$t2 = $catname_2;
$catid2 = $catid_2;
}

if ($catfatherid_2 <> 0)
{
$sql_lowercat = "select * from ".$prefix."store_category where cat_id = $catfatherid_2";
$result1 = mysql_query ($sql_lowercat);
$row1 = mysql_fetch_array($result1);
$catfatherid_3 = $row1["cat_father_id"];
$catname_3 = $row1["category"];
$t3 = $catname_3;
$catid3 = $catid_3;
}

if ($catfatherid_3 <> 0)
{
$sql_lowercat = "select * from ".$prefix."store_category where cat_id = $catfatherid_3";
$result1 = mysql_query ($sql_lowercat);
$row1 = mysql_fetch_array($result1);
$catfatherid_4 = $row1["cat_father_id"];
$catname_4 = $row1["category"];
$t4 = $catname_4;
$catid4 = $catid_4;
}

if ($catfatherid_4 <> 0)
{
$sql_lowercat = "select * from ".$prefix."store_category where cat_id = $catfatherid_4";
$result1 = mysql_query ($sql_lowercat);
$row1 = mysql_fetch_array($result1);
$catfatherid_5 = $row1["cat_father_id"];
$catname_5 = $row1["category"];
$t5 = $catname_5;
$catid5 = $catid_5;
}

if ($catfatherid_5 <> 0)
{
$sql_lowercat = "select * from ".$prefix."store_category where cat_id = $catfatherid_5";
$result1 = mysql_query ($sql_lowercat);
$row1 = mysql_fetch_array($result1);
$catfatherid_6 = $row1["cat_father_id"];
$catname_6 = $row1["category"];
$t6 = $catname_6;
$catid6 = $catid_6;
}

if ($catfatherid_6 <> 0)
{
$sql_lowercat = "select * from ".$prefix."store_category where cat_id = $catfatherid_6";
$result1 = mysql_query ($sql_lowercat);
$row1 = mysql_fetch_array($result1);
$catfatherid_7 = $row1["cat_father_id"];
$catname_7 = $row1["category"];
$t7 = $catname_7;
$catid7 = $catid_7;
}

if ($catfatherid_7 <> 0)
{
$sql_lowercat = "select * from ".$prefix."store_category where cat_id = $catfatherid_7";
$result1 = mysql_query ($sql_lowercat);
$row1 = mysql_fetch_array($result1);
$catfatherid_8 = $row1["cat_father_id"];
$catname_8 = $row1["category"];
$t8 = $catname_8;
$catid8 = $catid_8;
}

if ($catfatherid_8 <> 0)
{
$sql_lowercat = "select * from ".$prefix."store_category where cat_id = $catfatherid_8";
$result1 = mysql_query ($sql_lowercat);
$row1 = mysql_fetch_array($result1);
$catfatherid_9 = $row1["cat_father_id"];
$catname_9 = $row1["category"];
$t9 = $catname_9;

}
HIGHLIGHT]