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

Por Q Q Quando Eu Clico No Botao "ok" Ele Me Retor


Digowarta51

Pergunta

por q q quando eu clico no botao "ok" ele me retorna o erro:

<input name="id_tec_de" type="text" id="id_tec_de" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF" title="Nome do tecnico que informará o recado" value="

Warning: pg_query() query failed: ERRO: syntax error no fim da entrada at character 61 in /var/www/html/sistema/cadastro.php on line 52

Erro na pesquisa: select id_tecnico, login from jcs.tecnicos where id_tecnico=. ERRO: syntax error no fim da entrada at character 61

O CÓDIGO TA AI EMBAIXO:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Cadastrar tarefa</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="JavaScript" type="text/JavaScript">

<!--

function MM_jumpMenu(targ,selObj,restore){ //v3.0

eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

if (restore) selObj.selectedIndex=0;

}

//-->

</script>

</head>

<body>

<table width=497" border="0" cellpadding="0" cellspacing="0">

<!--DWLayoutTable-->

<tr>

<td width="497" height="141" valign="top"><form name="form1" method="post" action="cadastro.php?acao=ok">

<p>

<table width="497" border="0" cellpadding="0" cellspacing="0" bordercolor="#000000" frame="box" style="border-collapse:collapse">

<!--DWLayoutTable-->

<tr>

<td width="83" height="4"></td>

<td width="4"></td>

<td width="120"></td>

<td width="15"></td>

<td width="47"></td>

<td width="104"></td>

<td width="4"></td>

<td width="120"></td>

</tr>

<tr>

<td height="20" valign="middle"> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Recado

de:</strong></font></td>

<td></td>

<td valign="top"><input name="id_tec_de" type="text" id="id_tec_de" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF" title="Nome do tecnico que informar&aacute; o recado" value="<? $id_login = $_GET["id_login]; $query="select id_tecnico, login from jcs.tecnicos where id_tecnico=$id_login"; $result= pg_query($connection, $query) or die("Erro na pesquisa: $query. " .pg_last_error($connection)); $rows = pg_num_rows($result); $row = pg_fetch_row($result, 0); echo $row[1] ; ?>" readonly=true"></td>

<td></td>

<td valign="middle"><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Para:</font></strong></td>

<td valign="top"> <div align="center">

<select name="id_tec_para" id="id_tec_para" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF" onChange="MM_jumpMenu('parent',this,0)">

<option value="todos">Todos</option>

<?php

$query = "select id_tecnico, login from jcs.tecnicos";

$result= pg_query($connection, $query) or die("Erro na pesquisa: $query. " .pg_last_error($connection));

$rows = pg_num_rows($result);

for ($i=0; $i<$rows; $i++)

{

$row = pg_fetch_row($result, $i);

echo"<option value='$row[0]'>$row[1]</option>";

}

?>

</select>

</div></td>

<td>&nbsp;</td>

<td>&nbsp;</td>

</tr>

<tr>

<td height="65" valign="middle"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Recado:</strong></font></td>

<td>&nbsp;</td>

<td colspan="5" valign="top"><textarea name="recado" cols="50" rows="5" id="recado" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF"></textarea></td>

<td>&nbsp;</td>

</tr>

<tr>

<td height="16"></td>

<td colspan="5" valign="top"><div align="center">

<input type="submit" name="Submit" value="Ok" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #e9e9e9">

<input type="reset" name="Submit2" value="Limpar" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #e9e9e9">

</div></td>

<td></td>

<td></td>

</tr>

</table>

</form></td>

</tr>

</table>

<?Php

$acao = $_GET["acao];

$id_login = $_GET["id_login"];

if ($acao == "ok") {

echo $acao;

//$insere = "INSERT INTO jcs.recados (id_tec_de, id_tec_para, recado) values ($id_tec_de, '$id_tec_para', '$recado') ";

}

?>

</body>

</html>

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

Tenta ai não testei

<?

$id_login = $_GET["id_login"];

$query=select id_tecnico, login from jcs.tecnicos where id_tecnico = '$id_login'";

$result= pg_query($connection, $query) or die("Erro na pesquisa: $query. " .pg_last_error($connection));

$rows = pg_num_rows($result);

$row = pg_fetch_row($result, 0);

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Cadastrar tarefa</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="JavaScript" type="text/JavaScript">

<!--

function MM_jumpMenu(targ,selObj,restore){ //v3.0

eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

if (restore) selObj.selectedIndex=0;

}

//-->

</script>

</head>

<body>

<table width="497" border="0" cellpadding="0" cellspacing="0">

<!--DWLayoutTable-->

<tr>

<td width="497" height="141" valign="top"><form name="form1" method="post" action="cadastro.php?acao=ok">

<p>

<table width="497" border="0" cellpadding="0" cellspacing="0" bordercolor="#000000" frame="box" style="border-collapse:collapse">

<!--DWLayoutTable-->

<tr>

<td width="83" height="4"></td>

<td width="4"></td>

<td width="120"></td>

<td width="15"></td>

<td width="47"></td>

<td width="104"></td>

<td width="4"></td>

<td width="120"></td>

</tr>

<tr>

<td height="20" valign="middle"> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Recado

de:</strong></font></td>

<td></td>

<td valign="top"><input name="id_tec_de" type="text" id="id_tec_de" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF" title="Nome do tecnico que informar&aacute; o recado" value="<?= $row[1]?>" readonly="true"></td>

<td></td>

<td valign="middle"><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Para:</font></strong></td>

<td valign="top"> <div align="center">

<select name="id_tec_para" id="id_tec_para" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF" onChange="MM_jumpMenu('parent',this,0)">

<option value="todos">Todos</option>

<?php

$query = "select id_tecnico, login from jcs.tecnicos";

$result= pg_query($connection, $query) or die("Erro na pesquisa: $query. " .pg_last_error($connection));

$rows = pg_num_rows($result);

for ($i=0; $i<$rows; $i++)

{

$row = pg_fetch_row($result, $i);

echo"<option value='$row[0]'>$row[1]</option>";

}

?>

</select>

</div></td>

<td>&nbsp;</td>

<td>&nbsp;</td>

</tr>

<tr>

<td height="65" valign="middle"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Recado:</strong></font></td>

<td>&nbsp;</td>

<td colspan="5" valign="top"><textarea name="recado" cols="50" rows="5" id="recado" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #FFFFFF"></textarea></td>

<td>&nbsp;</td>

</tr>

<tr>

<td height="16"></td>

<td colspan="5" valign="top"><div align="center">

<input type="submit" name="Submit" value="Ok" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #e9e9e9">

<input type="reset" name="Submit2" value="Limpar" style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 7pt; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: Verdana; BACKGROUND-COLOR: #e9e9e9">

</div></td>

<td></td>

<td></td>

</tr>

</table>

</form></td>

</tr>

</table>

<?Php

$acao = $_GET["acao];

$id_login = $_GET["id_login"];

if ($acao == "ok") {

echo $acao;

//$insere = "INSERT INTO jcs.recados (id_tec_de, id_tec_para, recado) values ($id_tec_de, '$id_tec_para', '$recado') ";

}

?>

</body>

</html>

Link para o comentário
Compartilhar em outros sites

  • 0

Cara primeiro organiza seu script fazendo uma folha de stilo ! exemplo !

<style>

.CAXA{

BORDER-RIGHT: #000000 1px solid;

BORDER-TOP: #000000 1px solid;

FONT-SIZE: 7pt;

BORDER-LEFT: #000000 1px solid;

COLOR: #000000;

BORDER-BOTTOM: #000000 1px solid;

FONT-FAMILY: Verdana;

BACKGROUND-COLOR: #FFFFFF";

</style>

<input name="id_tec_de" type="text" id="id_tec_de" class="CAIXA" value="<?= $row[1]?>" readonly="true">

ai voce não precisa ficar colocando todo este codigo no input !

basta coloca um tag "(CLASS)" fica mauis bonito o script e bem mais facil de entender "

ATT:KADU

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,3k
    • Posts
      652,5k
×
×
  • Criar Novo...