Foros del Web » Programando para Internet » Javascript »

Noi me funciona el onClick

Estas en el tema de Noi me funciona el onClick en el foro de Javascript en Foros del Web. Hola. Desde ayer y sin mas mis usuarios no pueden borrar sus cuentas. Aqui expongo los datos: Este es el archivo PHP Código PHP: <?php ...
  #1 (permalink)  
Antiguo 30/07/2010, 09:47
 
Fecha de Ingreso: julio-2010
Mensajes: 1
Antigüedad: 13 años, 8 meses
Puntos: 0
Noi me funciona el onClick

Hola.

Desde ayer y sin mas mis usuarios no pueden borrar sus cuentas. Aqui expongo los datos:

Este es el archivo PHP

Código PHP:
<?php

/* $Id: user_account_delete.php 115 2009-03-14 01:46:48Z john $ */

$page "user_account_delete";
include 
"header.php";

$task = ( isset($_POST['task']) ? $_POST['task'] : NULL );
$delete_token = ( isset($_POST['token']) ? $_POST['token'] : NULL );

if( !
$user->level_info['level_profile_delete'] )
{
  
header("Location: user_account.php");
  exit();
}

// DELETE THIS USER
if( $task == "dodelete" )
{
  if( empty(
$_SESSION['delete_token']) || $_SESSION['delete_token']!=$delete_token || time()>$_SESSION['delete_token_expires'] )
  {
    
$result FALSE;
  }
  else
  {
    
$user->user_delete();
    
$user->user_setcookies();
    
$result TRUE;
  }
  
  
header("Content-Type: application/json");
  echo 
json_encode(array('result' => $result));
  exit();
}


// Nothing wrong with being extra safe, right?
$_SESSION['delete_token'] = md5(uniqid(rand(), TRUE));
$_SESSION['delete_token_expires'] = time() + 300;


// ASSIGN SMARTY VARIABLES AND INCLUDE FOOTER
$smarty->assign('delete_token'$_SESSION['delete_token']);
include 
"footer.php";
?>
Y este el archivo TPL:

Código PHP:
{include file='header.tpl'}

{* 
$Iduser_account_delete.tpl 115 2009-03-14 01:46:48Z john $ *}

<
table class='tabs' cellpadding='0' cellspacing='0'>
  <
tr>
    <
td class='tab0'>&nbsp;</td>
    <
td class='tab2' NOWRAP><a href='user_account.php'>{lang_print id=655}</a></td>
    <
td class='tab'>&nbsp;</td>
    <
td class='tab2' NOWRAP><a href='user_account_privacy.php'>{lang_print id=1055}</a></td>
    <
td class='tab'>&nbsp;</td>
    <
td class='tab2' NOWRAP><a href='user_account_pass.php'>{lang_print id=756}</a></td>
    <
td class='tab'>&nbsp;</td>
    <
td class='tab1' NOWRAP><a href='user_account_delete.php'>{lang_print id=757}</a></td>
    <
td class='tab3'>&nbsp;</td>
  </
tr>
</
table>

<
img src='./images/icons/delete48.gif' border='0' class='icon_big' />
<
div class='page_header'>{lang_print id=759}</div>
<
div>{lang_print id=760}</div>
<
br />

<
table cellpadding='0' cellspacing='0'>
<
tr>
<
td>
  <
input type='submit' class='button' value='{lang_print id=761}' onClick='SupremeEdition.Viewer.userDelete();' />&nbsp;
</
td>
<
td>
  <
form action='user_account.php' method='post'>
  <
input type='submit' class='button' value='{lang_print id=39}' />
  </
form>
</
td>
</
tr>
</
table>


{* 
JAVASCRIPT FOR CONFIRMING DELETION *}
{
literal}
<
script type="text/javascript">
<!-- 
function 
confirmDelete() {
  
TB_show('{/literal}{lang_print id=759}{literal}''#TB_inline?height=100&width=300&inlineId=confirmdelete''''../images/trans.gif');

}

function 
deleteAccount() {
  
window.location 'user_account_delete.php?task=dodelete';
}

//-->
</script>
{/literal}


{* HIDDEN DIV TO DISPLAY CONFIRMATION MESSAGE *}
{lang_javascript id=759}
<div style='display: none;' id='confirmdelete'>
  <div style='margin-top: 10px;'>
    {lang_print id=1146}
  </div>
  <br>
  <input type='button' class='button' value='{lang_print id=175}' onClick='parent.TB_remove();parent.SupremeEdition.Viewer.userDeleteConfirm("{$delete_token}");' />
  <input type='button' class='button' value='{lang_print id=39}' onClick='parent.TB_remove();' />
</div>


{include file='footer.tpl'} 
Este es el onclick que falla:

Código PHP:
<input type='button' class='button' value='{lang_print id=175}' onClick='parent.TB_remove();parent.SupremeEdition.Viewer.userDeleteConfirm("{$delete_token}");' /> 
Le haces clic y no se abre la ventana para poder eliminar su cuenta.
Gracias y saludos.

Etiquetas: onclick
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:58.