Hi, im trying to do this the most automate as possible... i want this scripts to make the input as the user ask, for example "3" then, each input must have a different name, i've tried with the "for" control structure but can't get to the point. then the fields are created in a db... anyone?
<? require("conexion.php"); $query=mysql_query("Select * from empresas_dpto order by id desc"); $form = "<input type=\"text\" name=\"duh\"> | "; if ($tipo=="crear") { // si la cantidad de campos requeridos es mayor a 40 entonces da error // if ($crear_empresas > 40) { ?> <table width="100%" border="0" cellspacing="1" cellpadding="1" align="center"> <tr> <td> <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="3" color="#FF0000"><b>La Empresa no puede tener más de 60 Departamentos Haga click <a href="javascript:history.back()">aqui</a> para volver</b></font></div> </td> </tr> </table> <? } ?> <table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td> <div align="center"><font size="3" color="#FF0000" face="Verdana, Arial, Helvetica, sans-serif"><b>Recuerde que los campos no pueden contener espacios a la hora de crear los departamentos </b> </font></div> </td> </tr> </table><br> <? echo str_repeat($form, $crear_empresas); } else { ?> <form name="x" method="post" action="aempresas.php?tipo=crear"> <input type="text" name="crear_empresas" value=""> <input type="submit" name="Submit" value="Elaborar Planillas"> </form> <? } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php