Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/01/2011, 07:19
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

esto es lo que sigue. Gracias!!

if ($t9)
print "$t9/";
if ($t8)
print "$t8/";
if ($t7)
print "$t7/";
if ($t6)
print "$t6/";
if ($t5)
print "$t5/";
if ($t4)
print "$t4/";
if ($t3)
print "$t3/";
if ($t2)
print "$t2/";
if ($t1)
print "$t1/";

unset($t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8,$t9,$catfath erid_1,$catfatherid_2,$catfatherid_3,$catfatherid_ 4,$catfatherid_5,$catfatherid_6,$catfatherid_7,$ca tfatherid_8,$catfatherid_9,$catname_1,$catname_2,$ catname_3,$catname_4,$catname_5,$catname_6,$catnam e_7,$catname_8,$catname_9);
echo"</option>";}
echo"</select></td>
</tr>
<tr bgcolor=\"$colour_3\">
<td width=\"200\" valign=\"top\"><b>$la_upload_im</b></td>
<td width=\"400\" valign=\"top\"><input name=\"upload_image\" type=\"checkbox\" value=\"yes\">$la_upload_checked</td>
</tr>
<tr bgcolor=\"$colour_3\">
<td width=\"200\" valign=\"top\"><b>$la_image</b></td>
<td width=\"400\" valign=\"top\"><INPUT class=\"file\" NAME=\"userfile\" TYPE=\"file\">$la_cat_types</td>
</tr>
</tr>
<!--<tr bgcolor=\"$colour_3\">
<td width=\"200\" valign=\"top\"><b>$la_per_ship</b></td>
<td width=\"400\" valign=\"top\">
$currency<INPUT class=\"textbox\" TYPE=\"text\" NAME=\"per_ship\"></td>
</tr>
</tr>
<tr bgcolor=\"$colour_3\">
<td width=\"200\" valign=\"top\"><b>$la_per_item</b></td>
<td width=\"400\" valign=\"top\">
$currency<INPUT class=\"textbox\" TYPE=\"text\" NAME=\"item_ship\"></td>
</tr>
</tr>
<tr bgcolor=\"$colour_3\">
<td width=\"200\" valign=\"top\"><b>$la_per_int_item</b></td>
<td width=\"400\" valign=\"top\">
$currency<INPUT class=\"textbox\" TYPE=\"text\" NAME=\"per_int_ship\"></td>
</tr>
</tr>
<tr bgcolor=\"$colour_3\">
<td width=\"200\" valign=\"top\"><b>$la_per_int_item2</b></td>
<td width=\"400\" valign=\"top\">
$currency<INPUT class=\"textbox\" TYPE=\"text\" NAME=\"item_int_ship\"></td>
</tr>-->
<tr bgcolor=\"$colour_3\">
<td width=\"200\" valign=\"top\">&nbsp;</td>
<td width=\"400\" valign=\"top\">
<INPUT class=\"submit\" TYPE=\"submit\" NAME=\"submit\" VALUE=\"$la_add_category\"></td>
</tr>
</table>
</td></tr></table>
</FORM>";
}

// if submit has been clicked
if ($submit){
$userfile_size=$_FILES['userfile']['size'] ;
$userfile_type=$_FILES['userfile']['type'] ;
$userfile_name=$_FILES['userfile']['name'] ;
// $userfile=$_FILES['userfile']['tmp_name'];
$userfile = $HTTP_POST_FILES['userfile']['tmp_name'];

// link back
$goback="<a href=\"javascript:history.back()\">$la_try_again</a>";

// if category was not chosen
if (empty($cat_name))
{
echo "<p align=\"center\">$la_cat_name_empt</p><p>$goback</p>";
exit;
}

// if image was not chosen to be uploaded
if($upload_image!=="yes"){

$userfile_name = "catnophoto.gif";
$userfile_name = addslashes($userfile_name);

$sql_insert = "insert into ".$prefix."store_category (category, category_en, cat_image, price, cat_father_id, per_ship, item_ship, per_int_ship, item_int_ship, description) values ('$cat_name','$cat_name_en','$userfile_name', '$price', '$cat_father_id', '$per_ship', '$item_ship', '$per_int_ship', '$item_int_ship', '$description')";

$result = mysql_query($sql_insert);

// result text
echo "<div align='center'>$la_new_cat $category $la_created!<p><p><img src='../images/$userfile_name'><p><a href=\"add_product.php\">$la_add_prod</a> | <a href=\"add_category.php\">$la_add_cat_title</a></p><p><a href=\"categories.php\">$la_back_cat_admin</a></p></div>";
}

// if upload image was clicked
if($upload_image=="yes"){
// Upload
$path = "$site_dir/images/";
$max_size = 200000;

if (is_uploaded_file($userfile)) {

if ($userfile_size>$max_size) { echo "$la_too_big<br>\n"; exit; }

if (($userfile_type=="image/gif") || ($userfile_type=="image/pjpeg") || ($userfile_type=="image/x-png") || ($userfile_type=="image/png") || ($userfile_type=="image/jpeg")) {

if (file_exists($path . $userfile_name)) { echo "<p align=\"center\">$la_used_already</p><br>\n";$escape=1; }

if($escape!=1){
$res = move_uploaded_file($userfile, $path . $userfile_name);}
if($escape=1){$res="continue";}

// Resultant output
if (!$res) {
echo "<p align=\"center\">$la_upload_failed<br><br><a href=\"javascript:history.back()\">$la_try_again</a></p>\n"; exit; }
} else { echo "<p align=\"center\">$la_wrong_type<br><br><a href=\"javascript:history.back()\">$la_try_again</a></p>\n"; exit; }


$sql_insert = "insert into ".$prefix."store_category (category, category_en, cat_father_id, price, cat_image, per_ship, item_ship, per_int_ship, item_int_ship, description) values ('$cat_name','$cat_name_en', '$cat_father_id', '$price', '$userfile_name', '$per_ship', '$item_ship', '$per_int_ship', '$item_int_ship', '$description')";

$result = mysql_query($sql_insert);

echo "<div align='center'>$la_new_cat $category $la_created!<p><p><img src='../images/$userfile_name'><p><a href=\"add_product.php\">$la_add_prod</a> | <a href=\"add_category.php\">$la_add_cat_title</a></p><p><a href=\"categories.php\">$la_back_cat_admn</a></p></div>";}
}}
include ("footer.inc.php");
} // end if session is registered
?>