Jump to content
Fórum Script Brasil
  • 0



meu codigo

preciso que so abra os submenu quando clique na categoria.

esse e meu script atual


include "configuracao_mysql.php";

$query = mysql_query('SELECT * FROM categorias'); // Seleciona todas as categorias

while ( $categorias = mysql_fetch_array( $query ) ) // Laço das categorias


echo('<b>'.$categorias['titulo'].'</b><br>'); // Imprime título da categoria

$queryMenu = mysql_query('SELECT * FROM menu WHERE categoria=.$categorias['id].'');

// Pesquisa na tabela menu todos os links que pertencem a esta categoria

while ( $link = mysql_fetch_array($queryMenu) ) // Laço dos links da categoria


$complemento = strstr($link['url'],'http://') ? ' target=_blank"' : '' ;

// Verifica se a URL é um link para outro site, se for, adiciona 'target=blank' para

// abrir a página em outra janela


echo(' - <a href="'.$idlink.''.$link['id].'" '.$complemento.'>'.$link['titulo'].'</a><br>');

// Imprime o link





Link to post
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...