Ir para conteúdo
Fórum Script Brasil

Evandro Araujo

Membros
  • Total de itens

    32
  • Registro em

  • Última visita

Tudo que Evandro Araujo postou

  1. esta dando erro na linha : name = r.parentNode.parentNode.id; esqueci do javascript name = r.parentNode.parentNode.id; i=codigo.parentNode.parentNode.rowIndex; var vlinha = trim(name);
  2. echo "<table id='tabela' name='tabela' width='800' border='0' cellpadding='4' cellspacing='1' bgcolor='#eeeeee' align='center'>"; echo "<tr>"; echo "<span><label><strong>Pesquisa(Nome):</strong></label>"; echo "<input lang='pt' type='text' style='font-family:arial;font-size:11px;color:#0000FF'"; echo " value='' maxlength='30' id='nome' name='nome' onkeyup ='filtro_colab(this.value,event);'/>"; echo "</span> "; echo "<td colspan=3> <a href='index.php'>Home </a> || <a href=\"java script:adicionar_data_colab();\">Adicionar </a> || <a href=\"java script:requestInfo('tablecolaboradores.php?mode=list','tablecolaboradores','')\">Atualizar</a> || <a href=\"java script:deleta_data_colab($id,this.value);\">Apagar </a> </td>"; echo "</span>"; echo "</tr>"; echo "<tr>"; echo "<th> Cod. "; echo "<th> Nome"; echo "<th> E-mail"; echo "</tr>"; $sql ="SELECT * FROM [ProjFitasW].[dbo].[colaboradores]"; $result = mssql_query($sql); //EXECUTA A QUERY $num = mssql_num_rows($result); while($row = mssql_fetch_array($result)){ //ENQUANTO EXISTIR LINHAS FAÇA $id=$row['Recno']; $name=$row['nome']; $email=$row['email']; echo "<tr bgcolor='#ffffff'>"; echo "<td><INPUT type='checkbox' name='chk'></td>"; echo "<td id='codigo' >$id</td>"; echo "<td>$name</td>"; echo "<td>$email</td>"; echo "<td> <a href=\"java script:altera_data_colab($id);\">Alterar</a></td> "; echo "<td> <input type='button' Value='Excluir' id='excluir_7' onclick='deleta_data_colab(this);' ></td> "; } echo "</tr>"; echo "</table>"; ?>
  3. ---------------------------start session <?php session_start(); include("conexao/config.php"); if (isset($_GET['acao'])) { if ($_GET['acao']== "add") { if (isset($_GET['id'])) { if (is_numeric($_GET['id'])) { $id_prod = addslashes(htmlentities($_GET['id'])); $sql = "SELECT COUNT(*) AS n_prod FROM carrinho where id_produto=$id_prod' and sessao='".session_id()."'"; $resultado = mysql_query($sql) or die ("1Não foi possível realizar a consulta"); if (@mysql_num_rows($resultado) == 0) die('Nenhum registro encontrado'); $linha=mysql_fetch_array($resultado); if ($linha['n_prod]==0) { $sql1 = "SELECT * FROM produtos WHERE id='$id_prod'"; $resultado1 = mysql_query($sql1) or die ("2Não foi possível realizar a consulta"); if (@mysql_num_rows($resultado1) == 0) die('Nenhum registro encontrado'); $linha1=mysql_fetch_array($resultado1); if ($linha1['id']>0) { ///echo $linha1['id']; //echo $linha1['produto']; //echo $linha1['valor']; //echo session_id(); $sql_add = "INSERT INTO carrinho(id_produto, nome_produto, preco_produto, qtd_produto, sessao) VALUES ('".$linha1['id']."', '".$linha1['produto']."', '".$linha1['valor']."',1,'".session_id()."')"; $sql=mysql_query($sql_add) or die("erro de gravacao"); } } } } } } if ($_GET['acao']== "del") { if (isset($_GET['id'])) { if (is_numeric($_GET['id'])) { $id_prod = addslashes(htmlentities($_GET['id'])); $sql_add = "DELETE FROM carrinho WHERE id_produto=$id_prod' AND sessao='".session_id()."'"; $sql=mysql_query($sql_add) or die("erro de gravacao"); } } } if ($_GET['acao]== "altera_qtd") { if(isset($_POST['qtd'])) { if (is_array($_POST['qtd'])) { foreach($_POST['qtd'] as $id_produto =>$qtd) { if (is_numeric($id_produto)&& is_numeric($qtd)) { $sql_add = "UPDATE carrinho set qtd_produto=$qtd' WHERE id_produto='$id_produto' AND SESSAO='".session_id()."'"; $sql=mysql_query($sql_add) or die("erro de gravacao"); /// $sql_alt = "UPDATE carrinho set qtd_produto='$qtd' WHERE /// id_produto='$id_produto' AND SESSAO='".session_id()."'"; /// $exe_alt =mysql_query($sql_alt,$base) or die(mysql_error()); /// $reg_alt = mysql_fetch_array($exe_alt, MYSQL_ASSOC); } } } } } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="csssite.css" rel="stylesheet" type="text/css"> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <table width="80%" height="709" border="1" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="211" bgcolor="#FFFFFF"> <table width="80%" height="332" border="0" align="center" cellpadding="0" cellspacing="0"> <tr valign="top" bgcolor="#FFFFFF"> <td height="58" colspan="3"></td> </tr> <tr bgcolor="#FFFFFF"> <td width="18%" valign="top" ><table width="84%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td bordercolor="1" class="menu">Categorias</td> </tr> <tr> <td border="1" class="conteudo_menu"></td> </tr> </table> <table width="84%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="23"> <!-- --> <?php ///include("config/menu_novo.php"); ?> </td> </tr> <tr> <td border="1" bordercolor="1" class="menu">Novidades</td> </tr> <tr> <td ></td> </tr> </table> <table width="84%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="23"><?php ///include("novidades.php"); ?> </td> </tr> <tr> <td border="1" bordercolor="1" class="menu">Contato</td> </tr> <tr> <td ><?php ///include("contato.php"); ?></td> </tr> </table> </td> <td width="75%" valign="top">Conteudo1 <!--aqui 100% --> <table width="447" height="257" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="413" valign="top"> <table width="100%" border="0" cellspacing="2" cellpadding="0"> <tr> <td><!-- <form action="carrinho.php?acao=altera_qtd" method="post">--> <form action="carrinho_auto.php?acao=altera_qtd" method="post"> <table border="0" width="100"> <tr> <td width="10%"><strong>id</strong></td> <td width="30%"> <strong>produto</strong></td> <td width="15%"> <strong>remover</strong></td> <td width="15%"><strong>preço</strong></td> <td width="15%"><strong>Qtd</strong></td> <td width="15%"><strong>SubTotal</strong></td> </tr> <? $sql ="SELECT * FROM carrinho WHERE sessao='".session_id()."'ORDER BY nome_produto ASC"; $resultado = mysql_query($sql) or die ("Não foi possível realizar a consulta"); if (@mysql_num_rows($resultado) == 0) die('Nenhum registro encontrado'); $total_carrinho=0; while ($linha=mysql_fetch_array($resultado)) { $total_carrinho+=($linha['preco_produto]*$linha['qtd_produto']); ?> <tr> <td width=10%"><?=$linha['id_produto]?></td> <td width="30%"><?=$linha['nome_produto']?></td> <td width=15%"><a href="carrinho_auto.php?acao=del&id=<?=$linha['id_produto]?>">X</a></td> <td width="15%"><?=number_format($linha['preco_produto'],2,",",".")?></td> <td width=15%"><input type="text" size="3" name="qtd[<?=$linha['id_produto]?>]" value="<?=$linha['qtd_produto']?>" </td> <td width=15%"><?=number_format($linha['preco_produto]*$linha['qtd_produto'],2,",",".")?></td> </tr> <? } ?> <tr> <td colspan="5"><div align="right">Total</div></td> <td><?=number_format($total_carrinho,2,",",".")?></td> </tr> </table> <input type="submit" value="Atualizar"> </form> <a href="categorias.php"> continuar comprando </a><a href="finalizar.php"> Finalizar compra </a></td> </tr> </table> <p>&nbsp;</p></td> </tr> </table> <td width="7%">&nbsp;</td> </tr> <tr valign="top" bgcolor="#FFFFFF"> <td height="126" colspan="3"></td> </tr> </table> </td> </tr> </table> </body> </html> ---------------------------start session ---------------------------destroy session <?php session_start(); session_destroy(); header("Location:index.php"); ?> ---------------------------destroy session so que ele não esta destroindo a sessao. o que sera que acontece??
  4. Segue abaixo o meu php.ini [codebox] engine = On zend.ze1_compatibility_mode = Off short_open_tag = Off asp_tags = Off precision = 14 y2k_compliance = On output_buffering = 4096 zlib.output_compression = Off implicit_flush = Off unserialize_callback_func= serialize_precision = 100 allow_call_time_pass_reference = Off safe_mode = Off safe_mode_gid = Off safe_mode_include_dir = safe_mode_exec_dir = safe_mode_allowed_env_vars = PHP_ safe_mode_protected_env_vars = LD_LIBRARY_PATH disable_functions = disable_classes = expose_php = On max_execution_time = 30 ; Maximum execution time of each script, in seconds max_input_time = 60 ; Maximum amount of time each script may spend parsing request data memory_limit = 16M ; Maximum amount of memory a script may consume (16MB) error_reporting = E_ALL & ~E_NOTICE display_errors = On display_startup_errors = Off log_errors = On log_errors_max_len = 1024 ignore_repeated_errors = Off ignore_repeated_source = Off report_memleaks = On track_errors = Off variables_order = "GPCS" register_globals = on register_long_arrays = Off register_argc_argv = Off auto_globals_jit = On post_max_size = 8M magic_quotes_gpc = Off magic_quotes_runtime = Off magic_quotes_sybase = Off auto_prepend_file = auto_append_file = default_mimetype = "text/html" include_path = ".;${path}\php5\pear\" doc_root = user_dir = extension_dir = "${path}\php5\ext\" enable_dl = On file_uploads = On upload_tmp_dir = "${path}\tmp\" upload_max_filesize = 2M allow_url_fopen = On allow_url_include = Off default_socket_timeout = 60 define_syslog_variables = Off SMTP = localhost smtp_port = 25 [SQL] sql.safe_mode = Off [ODBC] odbc.allow_persistent = On odbc.check_persistent = On odbc.max_persistent = -1 odbc.max_links = -1 odbc.defaultlrl = 4096 odbc.defaultbinmode = 1 [MySQL] ; Allow or prevent persistent links. mysql.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. mysql.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. mysql.max_links = -1 mysql.default_port = mysql.default_socket = mysql.default_host = mysql.default_user = mysql.default_password = mysql.connect_timeout = 60 mysql.trace_mode = Off [MySQLi] mysqli.max_links = -1 mysqli.default_port = 3306 mysqli.default_socket = mysqli.default_host = mysqli.default_user = mysqli.default_pw = mysqli.reconnect = Off [mSQL] msql.allow_persistent = On msql.max_persistent = -1 msql.max_links = -1 [PostgresSQL] pgsql.allow_persistent = On pgsql.auto_reset_persistent = Off pgsql.max_persistent = -1 pgsql.max_links = -1 pgsql.ignore_notice = 0 pgsql.log_notice = 0 [Sybase] sybase.allow_persistent = On sybase.max_persistent = -1 sybase.max_links = -1 sybase.min_error_severity = 10 sybase.min_message_severity = 10 sybase.compatability_mode = Off [Sybase-CT] sybct.allow_persistent = On sybct.max_persistent = -1 sybct.max_links = -1 sybct.min_server_severity = 10 sybct.min_client_severity = 10 [bcmath] bcmath.scale = 0 [browscap] ;browscap = extra/browscap.ini [Informix] ; Default host for ifx_connect() (doesn't apply in safe mode). ifx.default_host = ; Default user for ifx_connect() (doesn't apply in safe mode). ifx.default_user = ; Default password for ifx_connect() (doesn't apply in safe mode). ifx.default_password = ; Allow or prevent persistent links. ifx.allow_persistent = On ; Maximum number of persistent links. -1 means no limit. ifx.max_persistent = -1 ; Maximum number of links (persistent + non-persistent). -1 means no limit. ifx.max_links = -1 ; If on, select statements return the contents of a text blob instead of its id. ifx.textasvarchar = 0 ; If on, select statements return the contents of a byte blob instead of its id. ifx.byteasvarchar = 0 ; Trailing blanks are stripped from fixed-length char columns. May help the ; life of Informix SE users. ifx.charasvarchar = 0 ; If on, the contents of text and byte blobs are dumped to a file instead of ; keeping them in memory. ifx.blobinfile = 0 ifx.nullformat = 0 [Session] session.save_handler = files session.save_path = "${path}\tmp\" session.use_cookies = 1 ;session.cookie_secure = session.name = PHPSESSID session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.cookie_httponly = session.serialize_handler = php session.gc_probability = 1 session.gc_divisor = 1000 session.bug_compat_42 = 0 session.bug_compat_warn = 1 session.referer_check = session.entropy_length = 0 session.entropy_file = session.cache_limiter = nocache session.cache_expire = 180 session.use_trans_sid = 0 session.hash_function = 0 session.hash_bits_per_character = 5 url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" [MSSQL] mssql.allow_persistent = On mssql.max_persistent = -1 mssql.max_links = -1 mssql.min_error_severity = 10 mssql.min_message_severity = 10 mssql.compatability_mode = Off mssql.secure_connection = Off [Tidy] tidy.clean_output = Off [soap] ; Enables or disables WSDL caching feature. soap.wsdl_cache_enabled=1 ; Sets the directory name where SOAP extension will put cache files. soap.wsdl_cache_dir="/tmp" ; (time to live) Sets the number of second while cached file will be used ; instead of original one. soap.wsdl_cache_ttl=86400 ; Windows Extensions extension=php_gd2.dll extension=php_mbstring.dll extension=php_mysql.dll extension=php_mysqli.dll extension=php_pdo.dll extension=php_pdo_sqlite.dll [/codebox]
  5. sERA QUE PODE SER ALGUMA CONFIGURACAO DO MEU EASY PHP
  6. php-pt@yahoogrupos.com.br listaphp@googlegroups.com Pessoal, estou usando este script mas esta saindo zerado o valor do frete: mas porem se uso a url http://www.correios.com.br/encomendas/prec...mp;resposta=xml, aparece o xml. <?php function getSEDEX($cepOrigem = "88818-520", $cepDestino = "88818-400", $peso = 0.5) { $urlCorreios = "http://www.correios.com.br/encomendas/precos/calculo.cfm?resposta=xml&servico=40010&cepOrigem=%s&cepDestino=%s&peso=%s"; $urlCorreios = sprintf($urlCorreios, $cepOrigem, $cepDestino, $peso); //carregando url dos correios... //caso o seu servidor não permita o uso da função file para url's externas //recomenda-se a utilização de CURL - [url=http://www.php.net/manual/en/ref.curl.php]http://www.php.net/manual/en/ref.curl.php[/url] $carrega = file($urlCorreios) or die("Problemas em obter os dados dos correios"); //tratando string xml obtida. Removendo espaços e linhas para facilitar... $conteudo = trim(str_replace(array("\n", chr(13)), "", implode($carrega, ""))); if(strlen($conteudo) <1) return false; //informações de origem tratadas com RegExp... preg_match_all("/<uf_origem>(.+)<\/uf_origem>/", $conteudo, $uf_origem); preg_match_all("/<local_origem>(.+)<\/local_origem>/", $conteudo, $local_origem); preg_match_all("/<cep_origem>(.+)<\/cep_origem>/", $conteudo, $cep_origem); //informações de destino tratadas com RegExp... preg_match_all("/<uf_destino>(.+)<\/uf_destino>/", $conteudo, $uf_destino); preg_match_all("/<local_destino>(.+)<\/local_destino>/", $conteudo, $local_destino); preg_match_all("/<cep_destino>(.+)<\/cep_destino>/", $conteudo, $cep_destino); //informações sobre a encomenda tratadas com RegExp... preg_match_all("/<peso>(.+)<\/peso>/", $conteudo, $peso); preg_match_all("/<preco_postal>(.+)<\/preco_postal>/", $conteudo, $preco_postal); //objeto contendo as informações sobre o frete... $sedex = array( "uf_origem" => $uf_origem[1][0], "local_origem" => $local_origem[1][0], "cep_origem" => $cep_origem[1][0], "uf_destino" => $uf_destino[1][0], "local_destino" => $local_destino[1][0], "cep_destino" => $cep_destino[1][0], "peso" => floatval($peso[1][0]), "valor" => floatval($preco_postal[1][0]) ); return $sedex; } //informações processadas. Cep de Origem, Cep destino, Peso... $sedex = getSEDEX("88818-520", "88818-400", 0.750); //enfim exibimos o valor de nossa encomenda... echo "R$ " . number_format($sedex["valor"], 2, ",", ","); //valor do sedex, já formatado em reais... ?> mas quando utilizo o script acima, aparece R$ 0,00
  7. Evandro Araujo

    PHP MYSQL N SEI O ERRO

    tente usar o comando echo <variavel> , para pegar o conteudo da variavel
  8. Gostaria de fazer o seguinte, Quando clicasse no checkbox do meu site, preencheria uma variavel como 1 else 0, como eu posso fazer isso segue abaixo o script <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> <link href="css.css" rel="stylesheet" type="text/css" /> <script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <link href="../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> <link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" /></head> <body> <table width="710" height="375" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="80" colspan="2" valign="top" bgcolor="#CCCCCC"><div align="left"><img src="imagens/logo.png" width="233" height="87" /></div></td> </tr> <tr> <td width="94" valign="top"><ul id="MenuBar1" class="MenuBarVertical"> <li><a href="#">Home</a></li> <li><a class="MenuBarItemSubmenu" href="#">Produtos</a> <ul> <li><a href="inc_produtos.php">Inclusao</a></li> <li><a href="manut_produtos.php">Manuten&ccedil;&atilde;o</a></li> </ul> </li> <li><a href="#" class="MenuBarItemSubmenu">Categoria</a> <ul> <li><a href="#">Untitled Item</a></li> <li><a href="#">Untitled Item</a></li> </ul> </li> <li><a class="MenuBarItemSubmenu" href="#">Config</a> <ul> <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a> <ul> <li><a href="#">Item 3.1.1</a></li> <li><a href="#">Item 3.1.2</a></li> </ul> </li> <li><a href="#">Item 3.2</a></li> <li><a href="#">Item 3.3</a></li> </ul> </li> <li><a href="#">Usuario</a></li> </ul></td> <td width="1338" valign="top"><table width="580" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="580">&nbsp;</td> </tr> </table> <script language="Javascript"> function teste(){ if (document.forms[0].exibir.checked) document.forms[0].edit1.text=1; else{ document.forms[0].edit1.text=0; } } </script> <table width="358" border="0" align="center" cellpadding="0" cellspacing="0"> <form name="form1" action="alterar_db_new.php?id=<?php echo $_GET['id'] ?>" method="post"> <tr> <td width="134">Categoria</td> <td width="416"><?php //conecta ao servidor mysql $link = mysql_connect("localhost","root","") or die ("Não foi possível conectar ao servidor"); //seleciona a base de dados mysql_select_db("lojavirtual", $link)or die("Não foi possível selecionar a base de dados!"); //clausula sql $sql = "SELECT * FROM categorias"; //executa a clausula sql $result = mysql_query($sql)or die("Falha na execução da instrução SQL!"); //imprimir um campo select echo "<select name=\"id_categ\" id=\"Id\">"; //faz o loop para preencher o campo criado com os valores retornados na consulta while($dados = mysql_fetch_array($result)) { $id_categ=$dados['id']; echo "<option value='".$id_categ."'>".$dados['nome']."</option>"; } //fecha o campo select e o formulário echo "</select>"; //fecha a conexão com o mysql mysql_close($link); ?></td> </tr> <?php /* * faz a conexao ao banco * e seleciona a base de dados */ $conexao = mysql_connect("localhost", "root", "") or die ("Erro na conexão ao banco de dados."); $db = mysql_select_db("lojavirtual") or die ("Erro ao selecionar a base de dados."); /* * monta e executa consulta em SQL */ $sql = "SELECT * FROM produtos WHERE id = ".$_GET['id']; $resultado = mysql_query($sql) or die ("Não foi possível realizar a consulta."); $linha=mysql_fetch_array($resultado); ?> <tr> <td>Produto</td> <td><input type="text" name="produto" value="<?php echo $linha['produto'] ?>" size="32" /></td> </tr> <tr> <td>Descricao</td> <td> <script type="text/javascript" src="../nicEdit.js"></script> <script type="text/javascript"> bkLib.onDomLoaded(function() { nicEditors.allTextAreas() }); </script> <textarea name="descricao" cols="35" ><?php echo $linha['descricao'] ?> </textarea> </td> </tr> <tr> <td>Imagem</td> <td> <input type="text" name="img" value="<?php echo $linha['imagem'] ?>" size="32" /> <input type="file" name="imagem" size="32" /></td> </tr> <tr> <td>Valor</td> <td><input type="text" name="valor" value="<?php echo $linha['valor'] ?>" size="32" /></td> </tr> <tr> <td>Frete</td> <td><input type="text" name="frete" value="<?php echo $linha['valor'] ?>" size="32" /></td> </tr> <tr> <td>Promocao</td> <td><input type="checkbox" name="promocao" value="<?php echo $linha['promocao'] ?>" /></td> </tr> <tr> <td>Exibir</td> <td> <?php if ($linha['exibir'] == "1") {?> <input type="checkbox" name="exibir" value="checked" checked="checked"/> <?php $v_exibir = "0"; echo $v_exibir; } ?> <?php if ($linha['exibir'] == "0"){ ?> <input type="checkbox" name="exibir" value="1"/> <?php $v_exibir = "0"; echo $v_exibir; } ?> </td> </tr> <tr> <td>&nbsp;</td> <td><input type="submit" value="alterar registro" /> <input name="edit1" type="hidden" ></td> </tr> </form> </table> <p>&nbsp;</p></td> </tr> <tr> <td colspan="2">rodape</td> </tr> </table> <script type="text/javascript"> <!-- var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"}); //--> </script> </body> </html> [/codebox]
  9. a url é : manut_produtos_pesq.php?nome_produto=<?php echo $_GET['nome_produto'] ?>
  10. Criei um form no php manut_produtos.php, criei a tag form onde pega uma variavel do form...so que esta variavels esta indo vazia. segue abaixo o scritp -------manut_produtos.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> <link href="css.css" rel="stylesheet" type="text/css" /> <script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <link href="../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> <link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" /></head> <body> <table width="710" height="375" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="80" colspan="2" valign="top" bgcolor="#CCCCCC"><div align="left"><img src="imagens/logo.png" width="233" height="87" /></div></td> </tr> <tr> <td width="94" valign="top"><ul id="MenuBar1" class="MenuBarVertical"> <li><a href="#">Home</a></li> <li><a class="MenuBarItemSubmenu" href="#">Produtos</a> <ul> <li><a href="inc_produtos.php">Inclusao</a></li> <li><a href="manut_produtos.php">Manuten&ccedil;&atilde;o</a></li> </ul> </li> <li><a href="#" class="MenuBarItemSubmenu">Categoria</a> <ul> <li><a href="#">Untitled Item</a></li> <li><a href="#">Untitled Item</a></li> </ul> </li> <li><a class="MenuBarItemSubmenu" href="#">Config</a> <ul> <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a> <ul> <li><a href="#">Item 3.1.1</a></li> <li><a href="#">Item 3.1.2</a></li> </ul> </li> <li><a href="#">Item 3.2</a></li> <li><a href="#">Item 3.3</a></li> </ul> </li> <li><a href="#">Usuario</a></li> </ul></td> <td width="1338" valign="top"><table width="580" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="580">&nbsp;</td> </tr> </table> <form action="manut_produtos_pesq.php?nome_produto=<?php echo $_GET['nome_produto'] ?>" method=post"> Nome do produto : <input type="text" name="nome_produto" value="" size="32" /> <input type="submit" value="Pesquisar Produto" /> </form>> <?php /* * faz a conexao ao banco * e seleciona a base de dados */ $conexao = mysql_connect("localhost", "root", "") or die ("Erro na conexão ao banco de dados."); $db = mysql_select_db("lojavirtual") or die ("Erro ao selecionar a base de dados."); /* * monta e executa consulta em SQL */ $sql = "SELECT * FROM produtos ORDER BY id DESC"; $resultado = mysql_query($sql) or die ("Não foi possível realizar a consulta."); ?> <a href='inc_produtos.php'>Incluir</a> <table width="700" border="0" cellspacing="0"> <tr> <td>ID:</td> <td>id categoria:</td> <td>produto:</td> <td>descricao:</td> <td>imagem:</td> <td>valor:</td> <td>frete:</td> <td>promocao:</td> <td>frete:</td> <td>exibir?</td> </tr> <tr> <?php /* * mostra os dados na tela */ while ($linha=mysql_fetch_array($resultado)) { echo "<tr>"; echo "<td>{$linha['id]}</td>"; echo "<td>{$linha['id_categ']}</td>"; echo "<td>{$linha['produto']}</td>"; echo "<td>{$linha['descricao']}</td>"; echo "<td>{$linha['imagem']}</td>"; echo "<td>{$linha['valor']}</td>"; echo "<td>{$linha['frete']}</td>"; echo "<td>{$linha['promocao']}</td>"; echo "<td>{$linha['frete']}</td>"; echo "<td>{$linha['exibir']}</td>"; echo "<td><a href=inc_produtos.php'>Incluir</a> / "; echo "<a href='alt_produtos.php?id={$linha['id]}'>Alterar</a> / "; echo "<a href='excluir.php?id={$linha['id']}'>Excluir</a></td>"; echo "</tr>"; } ?> </tr> </table> </td> </tr> <tr> <td colspan=2">rodape</td> </tr> </table> <script type="text/javascript"> <!-- var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"}); //--> </script> </body> </html> -------manut_produtos.php -----manut_produtos_pesq.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> <link href="css.css" rel="stylesheet" type="text/css" /> <script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <link href="../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> <link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" /></head> <body> <table width="710" height="375" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="80" colspan="2" valign="top" bgcolor="#CCCCCC"><div align="left"><img src="imagens/logo.png" width="233" height="87" /></div></td> </tr> <tr> <td width="94" valign="top"><ul id="MenuBar1" class="MenuBarVertical"> <li><a href="#">Home</a></li> <li><a class="MenuBarItemSubmenu" href="#">Produtos</a> <ul> <li><a href="inc_produtos.php">Inclusao</a></li> <li><a href="manut_produtos.php">Manuten&ccedil;&atilde;o</a></li> </ul> </li> <li><a href="#" class="MenuBarItemSubmenu">Categoria</a> <ul> <li><a href="#">Untitled Item</a></li> <li><a href="#">Untitled Item</a></li> </ul> </li> <li><a class="MenuBarItemSubmenu" href="#">Config</a> <ul> <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a> <ul> <li><a href="#">Item 3.1.1</a></li> <li><a href="#">Item 3.1.2</a></li> </ul> </li> <li><a href="#">Item 3.2</a></li> <li><a href="#">Item 3.3</a></li> </ul> </li> <li><a href="#">Usuario</a></li> </ul></td> <td width="1338" valign="top"><table width="580" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="580">&nbsp;</td> </tr> </table> <?php /* * faz a conexao ao banco * e seleciona a base de dados */ $conexao = mysql_connect("localhost", "root", "") or die ("Erro na conexão ao banco de dados."); $db = mysql_select_db("lojavirtual") or die ("Erro ao selecionar a base de dados."); /* * monta e executa consulta em SQL */ echo $_GET['nome_produto]; $sql = "SELECT * FROM produtos WHERE produto like '".$_GET['nome_produto']."' ORDER BY id DESC"; $resultado = mysql_query($sql) or die ("Não foi possível realizar a consulta."); ?> <a href=inc_produtos.php'>Incluir</a> <table width="700" border="0" cellspacing="0"> <tr> <td>ID:</td> <td>id categoria:</td> <td>produto:</td> <td>descricao:</td> <td>imagem:</td> <td>valor:</td> <td>frete:</td> <td>promocao:</td> <td>frete:</td> <td>exibir?</td> </tr> <tr> <?php /* * mostra os dados na tela */ while ($linha=mysql_fetch_array($resultado)) { echo "<tr>"; echo "<td>{$linha['id]}</td>"; echo "<td>{$linha['id_categ']}</td>"; echo "<td>{$linha['produto']}</td>"; echo "<td>{$linha['descricao']}</td>"; echo "<td>{$linha['imagem']}</td>"; echo "<td>{$linha['valor']}</td>"; echo "<td>{$linha['frete']}</td>"; echo "<td>{$linha['promocao']}</td>"; echo "<td>{$linha['frete']}</td>"; echo "<td>{$linha['exibir']}</td>"; echo "<td><a href=inc_produtos.php'>Incluir</a> / "; echo "<a href='alt_produtos.php?id={$linha['id]}'>Alterar</a> / "; echo "<a href='excluir.php?id={$linha['id']}'>Excluir</a></td>"; echo "</tr>"; } ?> </tr> </table> </td> </tr> <tr> <td colspan="2">rodape</td> </tr> </table> <script type="text/javascript"> <!-- var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"}); //--> </script> </body> </html>
  11. <?php require_once('../Connections/loja.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $HTTP_SERVER_VARS['PHP_SELF']; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING']; } if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO produtos (id, id_categ, produto, descricao, imagem, valor, frete, promocao, exibir) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($HTTP_POST_VARS['id'], "int"), GetSQLValueString($HTTP_POST_VARS['id_categ'], "int"), GetSQLValueString($HTTP_POST_VARS['produto'], "text"), GetSQLValueString($HTTP_POST_VARS['descricao'], "text"), GetSQLValueString($HTTP_POST_VARS['imagem'], "text"), GetSQLValueString($HTTP_POST_VARS['valor'], "text"), GetSQLValueString($HTTP_POST_VARS['frete'], "text"), GetSQLValueString(isset($HTTP_POST_VARS['promocao']) ? "true" : "", "defined","1","0"), GetSQLValueString(isset($HTTP_POST_VARS['exibir']) ? "true" : "", "defined","1","0")); mysql_select_db($database_loja, $loja); $Result1 = mysql_query($insertSQL, $loja) or die(mysql_error()); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns=http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #FFFFFF; } --> </style> <link href="css.css" rel="stylesheet" type="text/css" /> <script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <link href="../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> <link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" /></head> <body> <table width="710" height="375" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="80" colspan="2" valign="top" bgcolor="#CCCCCC"><div align="left"><img src="imagens/logo.png" width="233" height="87" /></div></td> </tr> <tr> <td width="94" valign="top"><ul id="MenuBar1" class="MenuBarVertical"> <li><a href="#">Home</a></li> <li><a class="MenuBarItemSubmenu" href="#">Produtos</a> <ul> <li><a href="inc_produtos.php">Inclusao</a></li> <li><a href="eproduto.php">Manuten&ccedil;&atilde;o</a></li> </ul> </li> <li><a href="#" class="MenuBarItemSubmenu">Categoria</a> <ul> <li><a href="#">Untitled Item</a></li> <li><a href="#">Untitled Item</a></li> </ul> </li> <li><a class="MenuBarItemSubmenu" href="#">Config</a> <ul> <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a> <ul> <li><a href="#">Item 3.1.1</a></li> <li><a href="#">Item 3.1.2</a></li> </ul> </li> <li><a href="#">Item 3.2</a></li> <li><a href="#">Item 3.3</a></li> </ul> </li> <li><a href="#">Usuario</a></li> </ul></td> <td width="1338" valign="top"><table width="580" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="580">&nbsp;</td> </tr> </table> <form method="post" name="form1" action="<?php echo $editFormAction; ?>"> <table width="286" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="78">Categoria</td> <td width="472"><?php //conecta ao servidor mysql $link = mysql_connect("localhost","root","") or die ("Não foi possível conectar ao servidor"); //seleciona a base de dados mysql_select_db("lojavirtual", $link)or die("Não foi possível selecionar a base de dados!"); //clausula sql $sql = "SELECT * FROM categorias"; //executa a clausula sql $result = mysql_query($sql)or die("Falha na execução da instrução SQL!"); //imprimir um campo select echo "<select name=\"id_categ\" id=\"Id\">"; //faz o loop para preencher o campo criado com os valores retornados na consulta while($dados = mysql_fetch_array($result)) { $id_categ=$dados['id]; echo "<option value='".$id_categ."'>".$dados['nome']."</option>"; } //fecha o campo select e o formulário echo "</select>"; //fecha a conexão com o mysql mysql_close($link); ?></td> </tr> <tr> <td>Produto:</td> <td><input type="text" name="produto" value="" size="32" /></td> </tr> <tr> <td>Descricao</td> <td> <script type="text/javascript" src="../nicEdit.js"></script> <script type="text/javascript"> bkLib.onDomLoaded(function() { nicEditors.allTextAreas() }); </script> <textarea name="descricao" cols="35"></textarea> </td> </tr> <tr> <td>Imagem</td> <td><input type="file" name="imagem" id="imagem" size="32" /></td> </tr> <tr> <td>Valor</td> <td><input type="text" name="valor" value="" size="32" /></td> </tr> <tr> <td>Frete</td> <td><input type="text" name="frete" value="" size="32" /></td> </tr> <tr> <td>Promocao</td> <td><input type="checkbox" name="promocao" value="" /></td> </tr> <tr> <td>Exibir</td> <td><input type="checkbox" name="exibir" value="" /></td> </tr> <tr> <td>&nbsp;</td> <td><input type="submit" value="Inserir registro" /></td> </tr> </table> </td> <input type="hidden" name="id" value=""> <input type="hidden" name="MM_insert" value="form1"> </form> </tr> <tr> <td colspan="2">rodape</td> </tr> </table> <script type="text/javascript"> <!-- var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"}); //--> </script> </body> </html>
  12. Evandro Araujo

    Path da Imagem

    Fiz um campo no meu formulario de inclusao <input type="file" name="imagem" id="imagem" size="32" /> e salvou assim no meu banco de dados. C:\Arquivos de programas\EasyPHP1-8\www\lojavirtual\imagens\btn4_red.gif e gostaria que salvasse assim: imagens\btn4_red.gif como fazer isso???
  13. pessoal, achei no site http://www.nicedit.com/download.php acessem www.apostilaweb.com.br
  14. Pessoal, como eu posso fazer um campo, da minha tela, um texto de formatacao, igual por exemplo do yahoo, quando vamos escrever uma nova mensagem. ou por exemplo neste proprio forum. no aguardo Evandro
  15. Pessoal, coloquei no meu index.php, uma figura, onde o usuario clicando nesta figura, vai para uma outra pagina para tocar um mp3. Tem como fazer um poup up para tocar este som? no aguardo Evandro acessem www.apostilaweb.com.br
  16. Evandro Araujo

    Frete

    Pessoal, Gostaria que me enviasse algum formulario referente ao frete, alguém pode me ajuda?? no aguardo Evandro
  17. $id_prod = addslashes(htmlentities($_GET['id'])); $sql = "SELECT COUNT(*) AS n_prod FROM carrinho where id_produto=$id_prod' and sessao='".session_id()."'"; $resultado = mysql_query($sql) or die ("Não foi possível realizar a consulta"); if (@mysql_num_rows($resultado) == 0) die('Nenhum registro encontrado'); $linha=mysql_fetch_array($resultado); if ($linha['n_prod]==0) { echo $id_prod; Cara vem daqui, a variavel $id_prod, esta sendo preenchida corretamente, so que não consigo pegar o conteudo dos campos. consegui resolver....pessoal
  18. era isso mesmo que queria.....obrigado acessem www.apostilaweb.com.br
  19. Evandro Araujo

    erro de select

    Estou fazendo o seguinte select: $sql1 = "SELECT * FROM produtos WHERE id_produto='$id_prod'"; $resultado1 = mysql_query($sql1) or die ("Não foi possível realizar a consulta"); if (@mysql_num_rows($resultado1) == 0) die('Nenhum registro encontrado'); $linha1=mysql_fetch_array($resultado1); if ($linha1['id_produto']==0) { echo $linha1['id_produto']; echo $linha1['nome_produto']; $sql_add = "INSERT INTO carrinho(id_produto, nome_produto, preco_produto, qtd_produto, sessao) VALUES ('".$linha1['id_produto']."', '".$linha1['nome_produto']."', '".$linha1['preco_produto']."',1,'".session_id()."')"; $sql=mysql_query($sql_add) or die("erro de gravacao"); } no mysql, esta retornando registro com o $sq1, so que com o echo $linha1['id_produto']; echo $linha1['nome_produto'];, retorna em branco. o que estou fazendo de errado. Evandro
  20. ara, deu certinho, mas para ficar mais legal ainda, Esta saindo assim: Janeiro 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Fevereiro 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Março 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 gostaria que ficasse assim: Janeiro 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Fevereiro 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Março 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Segue abaixo o scritp <html> <head> <style type="text/css"> .a{ border-collapse: collapse; } </style> </head> </html> <?php $mes = array("Janeiro","Fevereiro","Março","Abril","Maio","junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"); ?> <? for($i=0;$i<12;$i++){ ?> <table width="200" border="1" class="a"><tr><td><?=$mes[$i];?></td></tr></table> <table width="200" border="1" class="a"><tr> <? for($j=0;$j<40;$j++){ if($j==10 || $j==20 || $j==30){ ?> </tr><tr><td onmouseover="light(this)" onmouseout="dark(this)"><?=$j;?></td> <? } if($j<31 AND $j<>10 AND $j<>20 AND $j<>30){ ?> <td onmouseover="light(this)" onmouseout="dark(this)"><?=$j;?></td> <? } if($j>31){ ?> <td>&nbsp;</td> <? } if($j==39){ ?> </tr></table><br> <? } } } ?> <script type="text/javascript"> function light(a){ a.style.background ="red"; } function dark({ b.style.background ="white"; } </script>
  21. Pessoal , como eu faco para fazer um calendario em php? exemplo Janeiro 1 2 3 4 5 6 7 8 10 11 12 13 ate dia 31 Fevereiro 1 2 3 4 5 6 7 8 10 11 12 13 ate dia 28 ate Dezembro 1 2 3 4 5 6 7 8 10 11 12 13 ate dia 31 no aguardo Evandro
  22. Codigo: <?php session_start(); include("config.php"); if (isset($_GET['acao'])) { if ($_GET['acao']== "add") { if (isset($_GET['id'])) { if (is_numeric($_GET['id'])) { $id_prod = addslashes(htmlentities($_GET['id'])); $sql_cont = "SELECT COUNT(*) AS n_prod FROM carrinho where id_produto=$id_prod' and sessao='".session_id()."'"; $exe_cont = mysql_query($sql_cont,$base) or die(mysql_error()); $reg_cont = mysql_fetch_array($exe_cont, MYSQL_ASSOC); if ($reg_cont['n_prod]==0) { $sql_prod = "SELECT * FROM produtos WHERE id_produto='$id_prod'"; $exe_prod = mysql_query($sql_prod,$base) or die(mysql_error()); $num_prod = mysql_num_rows($exe_prod); echo $num_prod; if ($num_prod > 0) { echo "teste"; $reg_prod = mysql_fetch_array($exe_prod, MYSQL_ASSOC); $sql_add = "INSERT INTO carrinho(id_produto, nome_produto, preco_produto, qtd_produto, sessao) VALUES ('".$reg_prod['id_produto']."', '".$reg_prod['nome_produto']."', '".$reg_prod['preco_produto']."',1,'".session_id()."')"; $exe_add = mysql_query($sql_add,$base) or die(mysql_error()); $reg_add = mysql_fetch_array($exe_add, MYSQL_ASSOC); } } } } } if ($_GET['acao']== "del") { if (isset($_GET['id'])) { if (is_numeric($_GET['id'])) { $id_prod = addslashes(htmlentities($_GET['id'])); $sql_del = "DELETE FROM carrinho WHERE id_produto=$id_prod' AND sessao='".session_id()."'"; $exe_del =mysql_query($sql_del,$base) or die(mysql_error()); $reg_del = mysql_fetch_array($exe_del, MYSQL_ASSOC); } } } if ($_GET['acao]== "altera_qtd") { if(isset($_POST['qtd'])) { if (is_array($_POST['qtd'])) { foreach($_POST['qtd'] as $id_produto =>$qtd) { if (is_numeric($id_produto)&& is_numeric($qtd)) { $sql_alt = "UPDATE carrinho set qtd_produto=$qtd' WHERE id_produto='$id_produto' AND SESSAO='".session_id()."'"; $exe_alt =mysql_query($sql_alt,$base) or die(mysql_error()); $reg_alt = mysql_fetch_array($exe_alt, MYSQL_ASSOC); } } } } } } ?> <html> <head> <title>Carrinho de compras</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form action="cart.php?acao=altera_qtd" method="post"> <table border="1" width="100"> <tr> <td width="10%"><strong>id</strong></td> <td width="30%"> <strong>produto</strong></td> <td width="15%"> <strong>remover</strong></td> <td width="15%"><strong>preço</strong></td> <td width="15%"><strong>Qtd</strong></td> <td width="15%"><strong>SubTotal</strong></td> </tr> <? $sql_lista = "SELECT * FROM carrinho WHERE sessao='".session_id()."'ORDER BY nome_produto ASC"; $exec_lista = mysql_query($sql_lista, $base) or die(mysql_error()); $num_lista = mysql_num_rows($exec_lista); if ($num_lista > 0) { $total_carrinho=0; while ($reg_lista = mysql_fetch_array($exec_lista,MYSQL_ASSOC)) { $total_carrinho+=($reg_lista['preco_produto]*$reg_lista['qtd_produto']); ?> <tr> <td width=10%"><?=$reg_lista['id_produto]?></td> <td width="30%"><?=$reg_lista['nome_produto']?></td> <td width=15%"><a href="cart.php?acao=del&id=<?=$reg_lista['id_produto]?>">X</a></td> <td width="15%"><?=number_format($reg_lista['preco_produto'],2,",",".")?></td> <td width=15%"><input type="text" size="3" name="qtd[<?=$reg_lista['id_produto]?>]" value="<?=$reg_lista['qtd_produto']?>" </td> <td width=15%"><?=number_format($reg_lista['preco_produto]*$reg_lista['qtd_produto'],2,",",".")?></td> </tr> <? } } ?> <tr> <td colspan="5"><div align="right">Total</div></td> <td><?=number_format($total_carrinho,2,",",".")?></td> </tr> </table> <input type="submit" value="Alterar Quantidade"> </form> <a href="produtos.php"> continuar comprando </a> </body> </html> O erro que esta dando é: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\arquivos de programas\easyphp1-8\www\carrinho\cart.php on line 28
  23. Pessoal, Desenvolvi um layout no fireworks, e no fireworks dividi em fatias cabecalho meio rodape no dreamweaver adicionei 4 camadas 1 - camada principal(criei 3 camadas dentro da principal) 2 - cabecalho 3 - meio 4 - rodape, Obs. deixei o meio a camada como automatico. Esta 'e a melhor forma de fazer uma layout?? no aguardo Evandro
  24. pessoal, consegui usando o comando wordwrap <?php $text = "The quick brown fox jumped over the lazy dog."; $newtext = wordwrap($text, 20, "<br />"); echo "$newtext\n"; ?> tb..tive que mexer no Div, deixando automatico um abraco acessem www.apostilaweb.com.br
×
×
  • Criar Novo...