Ir para conteúdo
Fórum Script Brasil
  • 0

Help Aqui No Meu Site....


RaFaMp

Pergunta

Olá pessoal, estou editando um script que achei na net, mas como nunca tinha editado nada em perl fiquei meio confuso....

http://n00bz.grctecnologia.com.br/jogos_online/

esse é o site, abram o index, tem lá a categoria acção, aventura, etc... que era A, B,C

http://n00bz.grctecnologia.com.br/cheats

script funcionando perfeitamente

se possivel deixem seus msnS ou me adicionem para falar melhor, vlw

http://www.n00bz.grctecnologia.com.br/jogos_online/

quando entro na categoria ação por exemplo, aparece o seguinte:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@n00bz.grctecnologia.com.br and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
index.cgi:
#!/usr/bin/perl -w
use strict;
use CGI;
use CGI::Carp 'fatalsToBrowser';
use Fcntl qw/:flock/;
use DBI;
use Configs;
require "memset.pl";

#################################################################################
# This script is for displaying specific pages of game cheats (ie: A, B, C etc) #
#################################################################################

my $q = new CGI;
print $q->header();

my $index = $q->param('index');
my $dbh = DBI->connect("dbi:mysql:$dbname", $dbuser, $dbpass) or ddie("Unable to connect to database: $DBI::errstr");

ShowPage("results.shtml",
   "%index%" => $index,
   "%results%" => GetListing($dbh, $index));

$dbh->disconnect();

#################################################
sub GetListing {
   my $dbh = shift;
   my $index = shift;
   my $retval = '';

   my $sth;
   if($index =~ /^[A-Z]$/) { # It's a letter
      $sth = $dbh->prepare("SELECT * FROM pccheat WHERE name LIKE \"$index%\"");
      $sth->execute();
      while(my $data = $sth->fetchrow_hashref()) {
         $retval .= qualquer(<a href="view.cgi?id=$data->{'id'}">$data->{'name'}</a><br>\n);
      }
   $sth->finish();
   return $retval;
   } else { # It's 0-9
      for(0..9) {
         $sth = $dbh->prepare("SELECT * FROM pccheat WHERE name LIKE \"$_%\"");
         $sth->execute();

         while(my $data = $sth->fetchrow_hashref()) {
            $retval .= qualquer(<a href="view.cgi?id=$data->{'id'}">$data->{'name'}</a><br>\n);
         }
         $sth->finish();
      }
      return $retval;
   }
} 
eu mexi nos botões ação, aventura, corrida, etc, eles eram um alfabeto, creio que tem q mudar aki:
   return $retval;
   } else { # It's 0-9
      for(0..9) {
         $sth = $dbh->prepare("SELECT * FROM pccheat WHERE name LIKE \"$_%\"");
         $sth->execute();

         while(my $data = $sth->fetchrow_hashref()) {
            $retval .= qualquer(<a href="view.cgi?id=$data->{'id'}">$data->{'name'}</a><br>\n);
         }
         $sth->finish();

Link para o comentário
Compartilhar em outros sites

5 respostass a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      652,1k
×
×
  • Criar Novo...