Ir para conteúdo
Fórum Script Brasil

ccgpirado

Membros
  • Total de itens

    16
  • Registro em

  • Última visita

Posts postados por ccgpirado

  1. Estou com problema nesse código, mais abaixo explicarei o problema:

    //---------------------------------------------------------------------------
    
    #pragma hdrstop
    
    //---------------------------------------------------------------------------
    
    #pragma argsused
    #include <cstdlib>
    #include <iostream>
    #define maxtam 50
    
    using namespace std;
    
    int main(int argc, char* argv[])
    {
            char nome[maxtam+1], *c1, *c2, *final;
            int contnomes = 0;
    
            cout << "Entre com seu nome:\n";
            gets(nome);
            c1 = &nome[0];
            final = &nome[0];
            cout << c1 << ", " <<  final << "\n";
            while (*final != ' ') {
                    final++;
            }
    
            do {
                    while ((*c1 == ' ') && (c1 < final)) {
                            c1++;
                    }
                    c2 = c1;
                    
                    while ((*c1 != ' ') && (c1 < final)) {
                            c1++;
                    }
                    if (c1 < final) {
                            c1 = '';
                            cout << "\nO " << contnomes << ".o nome e : " << c2;
                            contnomes++;
                    }
                    else {
                            if (c1 > c2) {
                                    cout << "\nO " << contnomes << ".o nome e : " << c2;
                                    contnomes++;
                            }
                    }
                    c1++;
            } while (c1 < final);
            cout << "\n\nForam encontrados " << contnomes << " nomes.";
            getchar();
            return 0;
    }
    //---------------------------------------------------------------------------
    Uso o compilador DEVC++ e essa parte do código, especificamente, está me dando dor de cabeça:
    c1 = &nome[0];
            final = &nome[0];

    Teoricamente, ela deveria pegar o endereço da primeira letra do nome, porém, ele pega o nome completo digitado no programa acima e faz o que deve de fazer usando o noime completo que ele pegou....

    Como posso corrigir esse erro??

  2. Qual o erro aki?:

    <!-- #include file=conect_off.asp -->

    <%

    loginu      = server.htmlencode(request.form("loginu"))

    senhau      = server.htmlencode(request.form("senhau"))

    emailu      = request.form("emailu")

    idade        = server.htmlencode(request.form("idade"))

    nome    = server.htmlencode(request.form("nome"))

    pokemon1    = request.form("pokemon1")

    lvl    = request.form("lvl")

    avataru    = request.form("avataru")

    datau = date &" - "& time

    if instr(1,loginu,"<") > 0 then

    response.redirect("erro.asp?erro=Seu login não pode conter o caracter <.")

    end if

    if avataru = "imagens/sem_avatar.gif" or trim(avataru) = "" then

    avataru = "imagens/sem_avatar.gif"

    end if

    SQL = "SELECT * FROM tusuario WHERE loginu = '"&loginu&"' and senhau = '"&senhau&"'"

    Set rs = db.execute(SQL)

    if not rs.eof then

    response.redirect("erro.asp?erro=Este login já existe, escolha outro por favor!")

    else

    SQL1 = "INSERT INTO tusuario (loginu,senhau,emailu,nome,idade,pokemon1,avataru,datau) VALUES "

    SQL1 = SQL1 & "('"&loginu&"','"&senhau&"','"&emailu&"','"&nome&"','"&idade&"','"&pokemon1&"','"&avataru&"','"&datau&"')"

    Set rs1 = db.execute(SQL1)

    response.redirect("default.asp")

    end if

    %>

    a página connect_off.asp

    <%

    Set db = Server.CreateObject("ADODB.Connection")

    db.open "DBQ="&server.mappath("pokemon.mdb")&";DRIVER={Microsoft Access Driver (*.mdb)}"

    %>

    Me ajudem plz

  3. Eu quero um script que quando você vai administrar clica em um botão e adciona mais tanto junto a um numero, tipo, ta escrito lá 100, ai eu clico em um botão na administração que vai dar mais 100 pra esse cara, ai ele vai ficar com 200, e também tipo, tipo compras on-line, você compra alguma coisa tira o seu dinheiro e coloca essa coisa que você comprou em um lugar devido, alguém pode me ajudar?

  4. O que há de errado nesse script? lha as páginas:

    cadastro.asp:

    <html>

    <head>

    <title>Cadastrar</title>

    <style type="text/css">

    input {

    font-family: Verdana, Arial, Helvetica, sans-serif;

    font-size: 9px;

    background-color: #CCCCCC;

    }

    textarea {

    font-family: Verdana, Arial, Helvetica, sans-serif;

    font-size: 9px;

    background-color: #CCCCCC;

    }

    </style>

    </head>

    <body text="#FFFFFF" bgcolor="#003399" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">

    <table border="0" width="100%">

      <tr>

        <td width="100%">

          <p align="center"><b><font size="4">Cadastro no ***Só Detonautas***</font></b></td>

      </tr>

    </table>

          <form method="POST" action="envia_cadastro.asp">

          <div align="center">

            <table border="0" width="50%" cellspacing="0" cellpadding="0" height="185">

              <tr>

                <td width="32%" align="right" height="17">

                  <p align="right"><font size="2">Titulo do Site:</font></p>

                </td>

            <center>

                <td width="68%" height="17"><input type="text" name="nome" size="20"></td>

              </tr>

                        <tr>

                <td width="32%" align="right" height="17">

                  <p align="right"><font size="2">URL do site ou blog</font></p>

                </td>

            <center>

                <td width="68%" height="17"><input type="text" name="url" size="20"></td>

              </tr>

                        <tr>

                <td width="32%" align="right" height="17">

                  <p align="right"><font size="2">MSN OU ICQ:</font></p>

                </td>

            <center>

                <td width="68%" height="17"><input type="text" name="msnicq" size="20"></td>

              </tr>

                        <tr>

                <td width="32%" align="right" height="17">

                  <p align="right"><font size="2">Sua idade:</font></p>

                </td>

            <center>

                <td width="68%" height="17"><input type="text" name="idade" size="20"></td>

              </tr>

                        <tr>

                <td width="32%" align="right" height="17">

                  <p align="right"><font size="2">Seu nome de usuário:</font></p>

                </td>

            <center>

                <td width="68%" height="17"><input type="text" name="usuario" size="20"></td>

              </tr>

                        <tr>

                <td width="32%" align="right" height="17">

                  <p align="right"><font size="2">Sua senha:</font></p>

                </td>

            <center>

                <td width="68%" height="17"><input type="text" name="senha" size="20"></td>

              </tr>

                        <tr>

                <td width="32%" align="right" height="17">

                  <p align="right"><font size="2">Seu e-mail</font></p>

                </td>

            <center>

                <td width="68%" height="17"><input type="text" name="email" size="20"></td>

              </tr>

                        <tr>

                <td width="32%" align="right" height="17">

                  <p align="right"><font size="2">Cidade, estado e país:</font></p>

                </td>

            <center>

                <td width="68%" height="17"><input type="text" name="cep" size="20"></td>

              </tr>

              <tr>

                <td width="32%" align="right" height="20"></td>

                <td width="68%" height="20"><input type="submit" value="Enviar"></td>

              </tr>

            </table>

            </center>

          </div>

          &nbsp;</form>

    </body>

    </html>

    envia_cadastro.asp

    <html>

    <head>

    <title>Cadastrado</title>

    <style type="text/css">

    input {

    font-family: Verdana, Arial, Helvetica, sans-serif;

    font-size: 9px;

    background-color: #CCCCCC;

    }

    textarea {

    font-family: Verdana, Arial, Helvetica, sans-serif;

    font-size: 9px;

    background-color: #CCCCCC;

    }

    </style>

    </head>

    <body text="#FFFFFF" bgcolor="#003399" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">

    <!--#include file="config.asp" -->

    <%

    ' Recebe e guarda os valores do formulário de cadastro

    nome = request("nome")

    url = request("url")

    email = request("email")

    msnicq = request("msnicq")

    idade = request("idade")

    usuario = request("usuario")

    senha = request("senha")

    cep = request("cep")

    ' Verifica se algum dos campos está vazio

    if titulo = "" OR nome = "" OR url = "" OR email = "" OR msnicq = "" OR idade = "" OR uduario = "" OR senha = "" OR cep = "" then

    response.write "<font face=verdana size=2>Você deixou algum dos campos em branco! <br><br><a href=""javascript:history.go(-1)"">Voltar</a></font>"

    response.end

    end if

    ' Se nenhum dos campos está vazio, efetua o cadastro no banco de dados

    strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(db)

    Set conn = Server.CreateObject("ADODB.Connection")

    conn.open strCon

    sql = "INSERT INTO dados (nome, url, email, msnicq, idade, usuario, senha, cep) VALUES('"& nome &"', '"& url &"', '"& email &"', '"& msnicq &"', '"& idade &"', '"& usuario &"', '"& senha &"', '"& cep &"')"

    Set rs = Server.CreateObject("ADODB.Recordset")

    rs.CursorType = 3

    rs.CursorLocation = 3

    rs.LockType = 3

    rs.Open sql, conn

    if not rs2.eof then

    %>

    <a href=""javascript:history.go(-1)"">Voltar</a>

    <%

    else

    response.write "Erro!"

    end if

    end if

    Set rs = nothing

    Set rs2 = nothing

    %>

    </body>

    </html>

    e config.asp

    <% '-------------Produção indepedente-----------------

    user = "*********" 'user administrativo

    senha = "******" 'senha administrativa

    db = "links" 'caminho pro db sem .mdb

    %>

    Obrigado desde já....

  5. dark

    O meu código de cadastro esta com problema, não ta funcionando, então to querendo um outro, mas acho que já sei onde conseguir,

    tenho pouco conhecimento em asp mas tenho interesse em mexer sim, o código é o chacal links, só adulterei um pouco, e aparece isso:

    Microsoft OLE DB Provider for ODBC Drivers error '80004005'

    [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x550 Thread 0x84c DBC 0x8e8f9b4 Jet'.

    /ccgpirado/area/conectar.asp, line 7

    o endereço é http://i.domaindlx.com/ccgpirado/area/cadastro.asp

    bom, fui...

  6. Tipo, pra você entrar em uma sala de bate papo do terra, você escolhe a sala, digite o seu nick, escolhe a cor e digita as letras que estão aparecendo an figura ao lado, essa função em negrito é a que eu quero, entendeu?

  7. Eu já fiz essa pergunta uma vez mas ainda estou com dúvida, ai vai, o bareta me deu esse código:

    <%

    Function GeraString(tamString, tipo, tamParte)

    tamString = Int(tamString) 'nº de caracteres em cada parte

    tipo = Int(tipo) 'tipo da String: 1 alfanumérica, 2 = só letras, 3 = números

    tamParte = Int(tamParte) 'nº de partes que será criada

    if IsNumeric(tamString) = False OR tamString = 0 then

    tamString = 5

    end if

    if IsNumeric(tipo) = False OR tipo = 0 then

    tipo = 1

    end if

    if IsNumeric(tamParte) = False OR tamParte = 0 then

    tamParte = 3

    end if

    if tipo = 1 then

    MyArr = Array("1","2","3","4","5","6","7","8","9","0","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")

    elseif tipo = 2 then

    MyArr = Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")

    else

    MyArr = Array("1","2","3","4","5","6","7","8","9","0")

    end if

    for d = 1 to tamParte

    for i = 1 to tamString

    Randomize

    StringGerada = StringGerada & MyArr(Int(Rnd*UBound(MyArr)))

    next

    varRand = StringGerada

    if tamParte = 1 then

    StringFinal = StringFinal & "{" & varRand & "}"

    else

    if d = tamParte then

    StringFinal = StringFinal & varRand & "}"

    else

    if d = 1 then

    StringFinal = StringFinal & "{" & varRand & " - "

    else

    StringFinal = StringFinal & varRand & " - "

    end if

    end if

    end if

    StringGerada = ""

    next

    GeraString = StringFinal

    End Function

    %>

    <div align='center' style="font-family:verdana; font-size:11px">

    <%=GeraString(7, 1, 1)%>

    </div>

    Bem, o bareta me deu esse código uma vez falando que esse código gerava o código e que pra funcionar era mais uns 500, minha dúvida é como fazer ele funcionar.

  8. Alguém sabe um script de cadastro bom, eu já tentei o chacal mas não deu, o meu servidor é o www.domaindlx.com, eu quero um em português, por favor, se alguém souber me fale...

  9. Já que não abre eu coloco aqui:

    #!/usr/bin/perl ################################################################################################ print"Content-type: text/html\n\n"; require"config.pl"; ############################################################################################### ############################################################################################### ############################################################################################### ############################################################################################### ############################### Gera Dados para a tabela $$#################################### ############################################################################################### ############################################################################################### ############################################################################################### if($in{'action'} eq "selos"){ &print('selos.htm'); }elsif($in{'action'} eq "premios"){ &print('premios.htm'); }elsif($in{'action'} eq "regras"){ &print('regras.htm'); }elsif($in{'action'} eq "vencedores"){ &print('vencedores.htm'); } opendir(L,$userdir)||do{&html('Erro ao abrir diretório de usuários');exit;}; @files=readdir(L); closedir(L); $t=0; $r=0; if(!$in{'categoria'} or $in{'categoria'} eq "Geral" ){ @fill=@files; $pst="Ranking Geral"; }else{ $pst="Ranking - ".$in{'categoria'}; opendir(LOC,$userdir); @arqs=readdir(LOC); closedir(LOC); foreach $arqs(@arqs){ ($a,$b)=split(/\./,$arqs); $tvar=""; if($b eq $extcadastro){ $tpm=$userdir.$a.'.'.$b; @idf[$r]=$a; $r++; open(K,$tpm); @tvar=; close(K); foreach $tv(@tvar){ $tvar=$tvar.$tv; } @campos=split(/\|+&+\|/,$tvar); $cat{$a}=@campos[5]; } } $categoria=$in{'categoria'}; $s=0; $g=0; foreach $idf(@idf){ #print"$cat{$idf}-"; if($in{'categoria'} eq $cat{$idf}){ @fill[$s]=$idf.'.'.$extvoto; $s++; } } } foreach $files(@fill){ ($arq,$ext)=split(/\./,$files); if($ext eq $extvoto){ $loc=$userdir.$arq.'.'.$extvoto; open(L,$loc); $voto=; close(L); @ids[$t]=$arq; @votos[$t]=$voto; $voto{$arq}=$voto; $t++; } } if($t==0){ &html('

    Ainda não obtivemos nenhum cadastro

    '); exit; } ############################################################################################### @cliques2=@votos; @id2=@ids; foreach $cliques2(@cliques2){ $valor=0; if($cliques>0-1){ $cont2=0; &vermaior; } } sub vermaior{ foreach $cliques2(@cliques2){ $not=1; foreach $cl(@cliques2){ if( $cliques2<$cl ){ $not=0; } } if( ($not!=0) && ($cliques2!=-1) ){ @clique[$contvar]=$cliques2; @id[$contvar]=@id2[$cont2]; $contvar++; @cliques2[$cont2]=-1; } $cont2++; } } ############################################################################################### ############################################################################################### ############################################################################################### ############################################################################################### ###############################$$$$$$$$$$$$$$$$$$$$$$$$$$$$#################################### ############################################################################################### ############################################################################################### ############################################################################################### $h=0; foreach $g(@id){ $tt=""; $rrt=$userdir.$g.'.'.$extcadastro; open(A,$rrt)||do{&html('Erro ao gerar ranking');exit;}; @re=; close(A); foreach $re(@re){ $tt=$tt.$re; } @dsd=split(/\|+&+\|/,$tt); @website[$h]=@dsd[2]; @url[$h]=@dsd[3]; $h++; } $r=0; $q=$in{'p'}*10; $u=$q+10; $tdy=0; foreach $id(@id){ $tdy++; } $outro=$tdy; $pages=0; while ($outro>10){ $outro-=10; $pages++; } $h=0; @conteudo[$h]= qualquer~

    <

  10. Bem, tem um site que tem o tutorial desse em portugues

    clique aqui: Layout shop

    Ai lá em cima tem tutoriais, ai clique em photo shop e você achará... eu não tenho, mas tenho o Gimp, quem puder me dar uma força com o Gimp eu abri um tutorial dele, clique aqui e responde: Gimp

×
×
  • Criar Novo...