Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it
    Registrato dal
    Jun 2002
    Messaggi
    109

    problemi con un form a categorie

    salve ragazzi
    Ho un problema su un form che ho creato per le categorie e sottocategorie per un amministrazione questo è lo script:
    <?php
    @$actions = $_GET['actions'];
    @$action = $_GET['action'];
    @$cat = $_GET['cat'];
    @$categoria = addslashes(trim($_POST['categoria']));
    @$sotto_categoria = addslashes(trim($_POST['sotto_categoria']));
    @$foot_categoria = addslashes(trim($_POST['foot_categoria']));

    ?>
    <table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
    <form name="categorie" method="post" action="default.php?page=prodotti/ins_categoria"><tr>
    <td colspan="3" class="style_add_azienda">[img]img/ins_cat.png[/img]INSERIMENTO CATEGORIE E SOTTOCATEGORIE </td>
    </tr>
    <tr>
    <td colspan="3"></td>
    </tr>
    <tr>
    <td width="300" height="40" class="style_font">Categoria:</td>
    <td width="258" height="40"><div align="left" ><input name="categoria" type="text" value="<?php echo $categoria; ?>" class="style_form" size="38"></div> </td>
    <td height="40" class="style_pagine"><div align="left">[img]img/add.png[/img] aggiungi sottocategoria</div></td>
    </tr>
    <tr>
    <td width="300" height="40" class="style_font"><?php if ($actions=="add_cat") {echo"Sottocategoria:";} ?></td>
    <td width="258" height="40"><div align="left" ><?php if ($actions=="add_cat") {echo"<input name=\"sotto_categoria\" type=\"text\" value=\"$sotto_categoria\" class=\"style_form\" size=\"38\"> ";} ?></div></td>
    <td height="40" class="style_font"><?php if ($actions=="add_cat") {echo"<div align=\"left\"><a href=\"default.php?page=prodotti/ins_categoria&action=add_foot&actions=add_cat\"><i mg src=\"img/add.png\" width=\"26\" height=\"24\" align=\"absmiddle\" border=\"0\" /></a> aggiungi sottocategoria</div>";}?></td>
    </tr>
    <tr>
    <td height="40" class="style_font"><?php if ($action=="add_foot" AND $actions =="add_cat") {echo"Sottocategoria:";} ?></td>
    <td height="40" class="style_font"><div align="left" ><?php if ($action=="add_foot" AND $actions =="add_cat") {echo"<input name=\"foot_categoria\" value=\"$foot_categoria\" type=\"text\" class=\"style_form\" size=\"38\" > ";} ?></div></td>
    <td height="40" class="style_font"></td>
    </tr>
    <tr>
    <td height="50" colspan="3" class="style_font"><div align="center"><input name="Image" type="Image" src="img/invia.png" /> </div></td>
    </tr>
    </form>
    </table>

    e un form ad albero cioè inserita una categoria si clicca sul un pulsante e scende la sotto categoria e cosi via...il problema che non riesco a fargli ricordare il valore inserito dell'input o del form...chi mi può aiutare per questo problema


    Grazie di cuore

  2. #2
    Utente di HTML.it
    Registrato dal
    Jun 2002
    Messaggi
    109
    ho provato a inserire negli input onclick="document.categorie.submit();" ma si ricarica appena provo ad inserire qualcosa

  3. #3
    Utente di HTML.it
    Registrato dal
    Jun 2002
    Messaggi
    109
    ho trovato la soluzione!! FUNZIONA a chi può servire...ecco lo script:
    <?php
    @$actions = $_GET['actions'];
    @$action = $_GET['action'];
    @$cat = $_GET['cat'];
    @$categoria = addslashes(trim($_POST['categoria']));
    @$sotto_categoria = addslashes(trim($_POST['sotto_categoria']));
    @$foot_categoria = addslashes(trim($_POST['foot_categoria']));

    ?>
    <table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
    <form name="categorie" method="post" action="default.php?page=prodotti/ins_categoria&actions=add_cat<?php if (isset($action) or isset($actions)) {echo "&action=add_foot";} ?>"><tr>
    <td colspan="3" class="style_add_azienda">[img]img/ins_cat.png[/img]INSERIMENTO CATEGORIE E SOTTOCATEGORIE </td>
    </tr>
    <tr>
    <td colspan="3"> </td>
    </tr>
    <tr>
    <td width="300" height="40" class="style_font">Categoria:</td>
    <td width="258" height="40"><div align="left" ><input name="categoria" type="text" value="<?php echo $categoria; ?>" class="style_form" size="38"></div> </td>
    <td height="40" class="style_pagine"><div align="left">[img]img/add.png[/img] aggiungi sottocategoria</div></td>
    </tr>
    <tr>
    <td width="300" height="40" class="style_font"><?php if ($actions=="add_cat") {echo"Sottocategoria:";} ?> </td>
    <td width="258" height="40"><div align="left" ><?php if ($actions=="add_cat") {echo"<input name=\"sotto_categoria\" type=\"text\" value=\"$sotto_categoria\" class=\"style_form\" size=\"38\"> ";} ?> </div></td>
    <td height="40" class="style_font"><?php if ($actions=="add_cat") {echo"<div align=\"left\"><a href=\"default.php?page=prodotti/ins_categoria&action=add_foot&actions=add_cat\" onclick=\"document.categorie.submit(); return false;\"><img src=\"img/add.png\" width=\"26\" height=\"24\" align=\"absmiddle\" border=\"0\" /></a> aggiungi sottocategoria</div>";}?></td>
    </tr>
    <tr>
    <td height="40" class="style_font"><?php if ($action=="add_foot" AND $actions =="add_cat") {echo"Sottocategoria:";} ?> </td>
    <td height="40" class="style_font"><div align="left" ><?php if ($action=="add_foot" AND $actions =="add_cat") {echo"<input name=\"foot_categoria\" value=\"$foot_categoria\" type=\"text\" class=\"style_form\" size=\"38\" > ";} ?> </div></td>
    <td height="40" class="style_font"> </td>
    </tr>
    <tr>
    <td height="50" colspan="3" class="style_font"><div align="center"><input name="Image" type="Image" src="img/invia.png" /> </div></td>
    </tr>
    </form>
    </table>

  4. #4
    Utente di HTML.it
    Registrato dal
    Jun 2002
    Messaggi
    109
    scusate ancora non funziona correttamente....sono stato troppo precipitoso mi fa un errore se invio prima che inserisco la sottocategoria invece di inviare mi fa scendere la sottocategoria....lo metto a punto e poi ripubblico


    scusate tanto

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.