Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

231
Vistas
Changing style of link after sql query in php file

working on some html/css/php/js/sql project and faced the problem - i cant change style of PHP/SQL-generated links, i want to change background of link if its clicked and not changing it after page refresh. I tried different methods including ajax query, but it changes style of every link at same time and lasts on page refresh
PHP file:

if (isset($_GET['move'])) {
     $swi = $_GET['move'];
     $query = "INSERT INTO done
      SELECT * FROM tasks WHERE keycode=$swi";
     mysqli_query($sql, $query) or 
     die(mysqli_error($sql));
     }
foreach ($data as $elem) {
     $datef = explode('-', $elem['date']);
     $dayf = intval($datef[0]);
   $monthf = intval($datef[1]);
   if ($monthf==12){
     $monthf=0;
   } 
   $result .= '<div class="taskboxitem" style="color: #fff">';  
   $result .= '<div class="taskboxhead">'.$dayf.' '.$month[$monthf].'</div>';
   $result .= '<div class="taskboxcontent">' . $elem['task'];
   $result .= '<div class="taskdelete">
   <a href="?del='. $elem['keycode'] . '">
   <ion-icon class="icon" name="trash-outline"></ion-icon>
   Delete</a>
   <a href="?move='.$elem['keycode'].'" class="move" onclick=""> //need this link to change style
   <ion-icon name="checkmark-circle-outline"></ion-icon>Done</a>
   </div></div>';
   $result .= '</div>';}
   echo $result;

Need your help guys!
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda