Ver Mensaje Individual
  #5 (permalink)  
Antiguo 24/09/2010, 03:42
albertpg
 
Fecha de Ingreso: enero-2005
Mensajes: 170
Antigüedad: 19 años, 3 meses
Puntos: 0
Respuesta: Error en Is_Numeric()

Ok. Aqui está el código entero!

Código PHP:
Ver original
  1. <?php
  2. include("../include/cons.php");
  3. include("../include/incfunctions.php");
  4. include("../include/inctexteadmin.php");
  5.  
  6. if(!isset($_SESSION["codi"])){
  7.     header("location:index.php");
  8. }else{
  9.  
  10.     $seccio = $_POST["seccio"];
  11.     if (strlen(trim($seccio)) == 0){
  12.         $seccio = 0;
  13.     }elseif (!is_numeric($seccio)){
  14.         $seccio = 0;
  15.     }
  16.  
  17.     $link = mysql_connect($server,$dbuser,$dbpass) or die ("Impossible connectar amb el servidor");
  18.     $query = sprintf("SELECT * FROM seccio WHERE id_seccio = '".seccio."'");
  19.     echo $query;
  20.     $result = mysql_db_query($database,$query,$link) or die (mysql_error());
  21.     $array=mysql_fetch_array($result);
  22.    
  23.     $_SESSION["idioma"]=$array["idioma"];
  24.    
  25.    
  26.     if ($array == 0) {
  27.         ?>
  28.             <script language="JavaScript" type="text/JavaScript">
  29.             <!--
  30.  
  31.             alert('<?=texte($_SESSION["idioma"],"error")?>');
  32.             top.location = "index.php";
  33.  
  34.             -->
  35.             </script>
  36.         <?php
  37.     }else{
  38.         $titol = $array[$_SESSION["idioma"]."_nom"];   
  39.         $_SESSION["titol"] = $titol;
  40.     }
  41.        
  42. ?>
  43.  
  44. <html>
  45. <head>
  46. <title><?php  echo texte($_SESSION("idioma"),"txttitle")?></title>
  47. <!--
  48.     '************************************************************
  49.     '***         ANUNZIA SOLUCIONS TECNOLÒGIQUES, S.L.        ***
  50.     '***                                                      ***
  51.     '*** /e. [email protected]          /w. www.anunzia.com ***
  52.     '************************************************************
  53. -->
  54. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  55. <script type="text/javascript" language="Javascript1.2" src="../../include/<%=session("idioma")%>_valida.js"></script>
  56. <link rel="stylesheet" type="text/css" href="../include/estil.css">
  57. <script language="JavaScript" type="text/JavaScript">
  58. <!--
  59.  
  60. function envia(formu,opcio)
  61. {
  62.     formu.action = opcio;
  63.     formu.seccio.value = <?php echo seccio?>;
  64.     formu.submit();
  65. }
  66.  
  67. -->
  68. </script>
  69. </head>
  70. <body text="#000000" link="#000000" vlink="#000000" alink="#4E9494" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" background="../gifs/fons.jpg">
  71. <center><br>
  72. <table width="95%" cellspacing="0" cellpadding="3" border="0">
  73.     <tr bgcolor="#000000">
  74.         <td align="center"><font color="#ffffff"><%=ucase(session("titol"))%></font></td>
  75.     </tr>
  76.     <tr>
  77.         <td align="center"><br><br></td>
  78.     </tr>
  79.     <tr>
  80.         <td align="center"><font color="#000000"><%=texte(session("idioma"),"titsearch")%>&nbsp;"<%=session("titol")%>":</td>
  81.     </tr>
  82. </table><br><br>
  83. <?php
  84.        
  85.     if ($_SESSION["idioma"] = "cs") {
  86.         $idioma = "E";
  87.     }else{
  88.         $idioma = "C";
  89.     }
  90. ?>
  91. <form name="<?php echo idioma?>form" method="post" action="">
  92. <input type="hidden" name="seccio" value="">
  93. <table cellspacing="0" cellpadding="1" border="0">
  94.     <tr>
  95.         <td align="left">
  96.             <table cellspacing="1" cellpadding="1" border="0">
  97.                 <tr>
  98.                     <td align="left" colspan="2">
  99.                         &nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="            <%=texte(session("idioma"),"modtit")%>            " name="bAccept" OnClick="javascript:envia(document.<%=idioma%>form,'updateinfo.asp');">
  100.                         &nbsp;&nbsp;<input type="button" value="<%=texte(session("idioma"),"configpag")%>" name="bAccept" OnClick="javascript:envia(document.<%=idioma%>form,'ordre.asp');">&nbsp;&nbsp;&nbsp;&nbsp;<br>
  101.                     </td>
  102.                 </tr>
  103.             </table>
  104.         </td>
  105.     </tr>
  106. </table><br><br>
  107. <input type="button" value="            <?php echo texte($_SESSION["idioma"],"novapart")?>            " name="bAccept" OnClick="javascript:envia(document.<?php echo idioma?>form,'alta.php');">
  108. </form><br>
  109. </center>
  110. </body>
  111. </html>
  112. <?php
  113. }
  114. ?>