Jump to content

returning value on php function and pass javascript parameter


filipelou

Recommended Posts

<a href="novidades.php?id=" onclick=" if(XXXX) this.href+=document.getElementById('dominio').value;else alert('SubDominio não encontrado!!')">Ver Novidades</a>

 

where is xxxxx i want this function on external php

 

function mostra_idDominio($nomeDominio){

 

 

 

ligarDB();

 

 

$query="select id from subdominios where nomeSub='$nomeDominio'";

$resultado=mysql_query($query);

    $row = mysql_fetch_assoc($resultado);

$num=mysql_numrows($resultado);

   

if ($num>0){

        return ($row['id']);

}

else{

 

  return -1;

 

  }

 

desligarDB();

 

}

 

to that i have to pass document.getElementbyId('Dominio').value and check if it is !=-1.

 

How to do that?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.