Hi.

I have done a php form inside a Block. It is a simple form with 4 options that shows a table when the user click the submit button.

My problem is that with Admin users and with no registered users the form works perfect, but when the user register, the submit doesnt work.

I dont understand why this happens. Thanks.

Here is the code:

<?php

global $user;   
$uid = $user->uid;

// DATOS EXTRA DE LA CUENTA DEL USUARIO REGISTRADO EN LA PÁGINA - BLOQUES  *****************************************************
$myuser = user_load(array('uid' =>$uid));

profile_load_profile($myuser);

// saco el usuario y el pass del freekick 

$idfkuser = $myuser->profile_idteam;

$idlastuser = $_POST["idteam"];

if ($idlastuser != "") { $idteam = $idlastuser; }
 elseif ($idfkuser != "") { $idteam = $idfkuser;}
 else { $idteam = "IDTeam del Freekick";}

	

?>
<!-- FORM -->
<table>
<form method="POST" action="<?php echo $PHP_SELF;?>">
                    <tr>
<td>ID de tu Equipo</td>
<td>Equipo</td>
<td>Mi proximo rival en ... </td>
<td>Sus Últimos Partidos</td>
<td>Sus partidos de ...</td>
<td></td>


</tr>

          <tr>
            <td width="20%" style="padding-right: 5">
            <INPUT type="text" name="idteam" value="<?php echo $idteam;?>">
          	</td>
          	
          	
            <td width="10%">
           
            <select size="1" name="squad">
            <option value="senior">senior</option>

            <option value="youth">youth</option>
            </select></td>
            
            
      
             <td width="20%" style="padding-right: 5">
            <font face="Arial" color="#FFFFFF"><b>
            <select size="1" name="type">
             <option value="">General</option>
           <!-- <option value="worldcup">Mundial</option>
            <option value="ntfriendly">Amistoso</option> -->
             <option value="league" selected>Liga</option> 
            <option value="internationalcup">Copa Internacional</option> 
            <option value="leaguecup">Copa Nacional</option> 
            <option value="friendly">Amistoso</option> 
            <option value="customizedcompetition">Copa Privada</option> 
           
		</select></b></font></td>
          
 


         <td width="30%" style="padding-right: 5">
            <input type="submit" value="Enviar" name="enviar" style="font-family: Arial; font-size: 10pt"></td>    
          
          
   </tr>       
   
          
</form>
</table>
<!-- End of form --> 

<?php
// Compruebo que se ha enviado  *******************
$enviar = $_POST["enviar"];

if ($enviar) {


// Valores por defecto  **************
$type = "league";
$squad = "senior";
$country = "ESP";
$startdate = $datenow;
$stopdate = $datenext;
$games = "all";
$jornada = "";
$temporada = "";
$xml5 = "";


// DATOS DEL FORMULARIO  *****************************************************
$idteam = $_POST["idteam"];
$type = $_POST["type"];
$type2 = $_POST["type2"];
$squad = $_POST["squad"];
$country = $_POST["country"];
$games2 = $_POST["games2"];
$jornada = $_POST["jornada"];
$temporada = $_POST["temp"];

?>

<!-- TABLE WITH RESULTS. I HAVE REMOVE A LOT OF STUFF HERE.-->
</br></br>

<table style="text-align: center; width: 100%;" border="1" cellpadding="2" cellspacing="1"><tbody>
 <tr>
 <td>Fecha</td>
 <td>Temporada</td>
 <td>Jornada</td>
 <td>Tipo</td>
 <td>Local</td>
 <td>Visitante</td>
 <td colspan = 2 >Resultado</td>
 </tr>

</tbody></table>
 <?php



} else { 
print "PRESS SEND. THANKS";
}

?>

Comments

darkpollo’s picture

Any ideas?
Thanks

darkpollo’s picture

it cannot be so dificult...

I have read all the forum and never found somthing like that, works for non registered and admin, and not for registered... :O:O

Thanks

eemc78’s picture

entra por el menu a admisnistrar gestion de usuarios reglas de acceso
Agrega una regla de acceso permitir con la opcion permitir activa y tiop de regla nombre de usuario coloca la mascara para el filtro que desees permitir.

a mi me funcionó en drupal 5.X