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

Ajuda iniciante PHP


Clon

Pergunta

Bom pessoal sou novo na linguagem PHP, o por esse motivo venho aqui para solicitar uma ajuda de voce mais experientes...

Meu problema é o seguinte....

Desenvolvi(com muita luta) um micro sisteminha que possui algumas funçoes, resumidamente o sitema faz o seguinte:

Salva alguns produtos no banco usando Ajax, apos visualiza uma lista onde aparece os produtos salvos e e salva o pedido todo.

Bom no meu computador funciona corretamente, porem qando eu coloco na hospedagem ele salva duplo os produtos no banco, e da erro na hora de salvar o pedido.

Não sei se me entenderam bem... mas preciso da ajuda de voces para ver se consigo dar + um passo nesse negocio...

Qualqer informaçao que faltar ou que voces não entenderem postem que eu respondo...

Obrigado desde já...

Anderson N. Isotton

Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0

Bom... como não obtive nenhuma resposta resolvi refazer todo o codigo...

Porem não houve muita mudança continuo não conseguindo salvar no banco no site postado, porem no mesmo site aqui em casa consigo sem problema...

e agora aparece esse erro:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home2/isotton/public_html/Admin/index.php:1) in /home2/isotton/public_html/Admin/index.php on line 2

Verifiquei no google esse erro, e dizem q é por startar 2 sessions.... mas verifiquei isso não emnem um momento eu abro 2 sessions na mesma pagina...

Bom vou postar o cod da pagina que da essse erro... se poderem me dar uma luz agradeço....

<?php require_once('../Connections/isotton.php'); ?>
<?php session_start(); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($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;
}
}

$colname_vendedor = "-1";
if (isset($_SESSION['vend_id'])) {
  $colname_vendedor = $_SESSION['vend_id'];
}
mysql_select_db($database_isotton, $isotton);
$query_vendedor = sprintf("SELECT * FROM vendedores WHERE usu_id = %s", GetSQLValueString($colname_vendedor, "int"));
$vendedor = mysql_query($query_vendedor, $isotton) or die(mysql_error());
$row_vendedor = mysql_fetch_assoc($vendedor);
$totalRows_vendedor = mysql_num_rows($vendedor);
?>
<!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"><!-- InstanceBegin template="/Templates/tmpIsotton.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Isotton Estilo &amp; Design</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.menu {
    position:absolute;
    left:168px;
    top:155px;
    width:131px;
    height:334px;
    z-index:1;
    background-color: #EEEEEE;
    visibility: inherit;
}
</style>
<!-- InstanceEndEditable -->
</head>

<body>
<table width="780" border="0" align="center">
  <tr>
    <td><img src="../Img/Isotton_MarcReg.jpg" alt="IsottonEstilo&amp;Desing" width="780" height="120" /></td>
  </tr>
  <tr>
    <td><div align="center"></div></td>
  </tr>
  <tr>
    <td><!-- InstanceBeginEditable name="Conteudo" -->
      <div  id="central">
      <table width="100%" height="176">
        <tr>
          <td width="17%" height="170" align="top" bgcolor="#EEEEEE" ><ul id="MenuBar1" class="MenuBarVertical">
            <li><a class="MenuBarItemSubmenu" href="#">Painel</a>
              <ul>
                <li><a href="novo_pedido.php">Novo Pedido</a></li>
                <li><a href="mod_pedido.php">Editar Pedidos</a></li>
                <li><a href="bus_pedido.php">Buscar Pedido</a></li>
              </ul>
            </li>
            
            
            <li><a class="MenuBarItemSubmenu" href="#">Cadastros</a>
              <ul>
                <li><a href="atu_dados.php">Atualizar dados</a>                  </li>
                <li><a href="cad_cliente.php">Cliente</a></li>
</ul>
            </li>
            <li><a href="logout.php">Logout</a></li>            
          </ul><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></td>
          <td width="70%"><table width="100%" height="341">
            <tr>
              <td width="23%">Olá, Seja Bem Vindo</td>
              <td width="57%"><?php echo $row_vendedor['usu_nome']; ?></td>
              <td width="20%">&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
          </table></td>
          <td width="13%">&nbsp;</td>
        </tr>
      </table>
      </div>
      <script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
      </script>
    <!-- InstanceEndEditable --></td>
  </tr>
  <tr>
    <td><div style="background-image:url(../Img/rodape.jpg); background-position:bottom; background-repeat:no-repeat; width:780px; height:15px">        
        <div align="center" style="padding-top:15px">&nbsp;Home Page | Administração</div>
    </div> </td>
  </tr>
</table>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($vendedor);
?>

Link para o comentário
Compartilhar em outros sites

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
      652k
×
×
  • Criar Novo...