Reply
Send To The Right Arquive
Old 11-11-2004, 05:24 PM Send To The Right Arquive
Novice Talker

Posts: 8
This is my code:

PHP Code:
<?
    
include("toing_conexao.php");

    
$sql="SELECT * FROM produtos WHERE menuitem = '$menuitem' ORDER BY nomeproduto ASC";
    
$result=mysql_query($sql,$conn); 

    echo 
"<b><font face=verdana size=2>L I S T A&nbsp;&nbsp;&nbsp;D A&nbsp;&nbsp;&nbsp;C A T E G O R I A : $menuitem </B></font>";
    echo 
"<br><br>";
    echo 
"<table width=100%  border=2 align=center cellpadding=0 cellspacing=0>";
    echo 
"<tr>";    

    while (
$row mysql_fetch_array($result)) {
    
$id $row["id_prod"];
    
$menuitem  $row["menuitem"];
    
//recebe o menuitem em x e deixa tudo em minusculo
    
$dir $menuitem;
    
$dir strtolower($dir);
    
    
$nomeproduto $row["nomeproduto"];
    
$s $nomeproduto;
    
    
//ta diminuindo o nomeproduto para tudo minuscula $s e depois deixa so a 1a letra em maiuc $s1
    
$s strtolower($s);
    
$s1 $s;
    
$s1 ucfirst($s1);
    
$arq $s1;
    
    
// substitui o " " por um espaco
    
$s str_replace(" ","$&nbsp;",$s);
    
    
//recebe o nomeproduto em x e deixa tudo em minusculo
    
$arq $s;
    
$arq strtolower($arq);
       
    
$extensao $row["extensao"];
    
$imagem $row["imagem"];
        
    echo 
"<td width=200><img src=imagens\\$menuitem\\$imagem></td>  <td><a href=toing_principal?arquivo=downloads/$dir/$arq.$extensao >$s1</a></td> ";
    echo 
"</tr>";
     
    }

    echo 
"</table>";
    echo 
"<br>";
?>
  <?

    $con 
mysql_connect('localhost','admin','admin');
    
mysql_select_db('toing');
    
    
    
$arquivo $_GET['arquivo'];
    
$consulta "SELECT arquivo,hits FROM contador WHERE arquivo='$arquivo'";
    
$res mysql_query($consulta,$con);
    
/*
  certificar se o arquivo já foi clicado alguma vez. Se o arquivo ainda
  não consta em nossa tabela, vamos inserir um novo registro, caso contrário
  vamos somar um hit ao registro existente
    */

    
if ($saida mysql_fetch_array($res)) { // registro existe
        
$hit = ++$saida[1]; // some 1 (um) ao número de cliques
        
$update "UPDATE contador SET hits=$hit WHERE arquivo='$arquivo'";
        
mysql_query($update,$con); // atualize o registro
    
} else {
        
$insert "INSERT INTO contador (arquivo) VALUES ('$arquivo')";
        
mysql_query($insert,$con); // insira o novo arquivo na tabela. O valor padrão
        // de hit é 1 (um)
    
}

?>
In the toing_principal.php I have the following:

Motorola with link -> downloads/wallpapers/motorola.jpg
tim with link -> downloads/wallpapers/tim.jpg

Full LINK:
http://localhost/toing/02-menu/toing...s/motorola.jpg

The counter is working fine and add 1 if i click some link but its
NOT sending to where it should go: -> downloads/wallpapers/motorola.jpg

How can I do that??
I think its not understanding this: toing_principal?arquivo=downloads/wallpapers/motorola.jpg

Thank you!!
rogernem is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 11-12-2004, 02:20 AM
vivekar's Avatar
Webmaster Talker

Posts: 541
Shouldn't you be using the script like
PHP Code:
toing_principal.php?arquivo=downloads/wallpapers/motorola.jpg 
__________________
| Submit URL at All the Websites Directory
| Get Certified in Web Design
vivekar is offline
Reply With Quote
View Public Profile Visit vivekar's homepage!
 
Reply     « Reply to Send To The Right Arquive
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13387 seconds with 12 queries