Jump to content


webmastermichael

Member Since 12/09/2008
Offline Last Active 16/09/2009, 16:51
-----

Topics I've Started

Erro Fast Cgi

22/01/2009, 10:31

estou usando um sistema de envio de e-mail e agora ele apresentou esse erro

FastCGI Error

The FastCGI Handler was unable to process the request.
Error Details:

The FastCGI process exceeded configured request timeout
Error Number: 258 (0x80070102).
Error Description: The wait operation timed out.
HTTP Error 500 - Server Error.
Internet Information Services (IIS)

O código q esta enviando email e esse

[codebox]<?
/* WEB - TOOLS - www.web-tools.kit.net [ Caso essa linha seja apagada
o sistema irá parar de funcionar] */
ini_set("max_execution_time",0);
$username = $_COOKIE['username'];
if ($username){
$autor = $_COOKIE['username'];
include "config.php";

$soma = mysql_query("SELECT * FROM $tb2 where autor='$autor' ORDER BY posts DESC");
if (!$soma){
echo "Não foi possivel a consulta";
}
else{
while ($reg = mysql_fetch_array($soma)){
$numero = $reg['posts'];
}
global $numero;
$maisum=1;
$novonumero= $numero + $maisum;
$novosql = mysql_query("UPDATE $tb2 SET posts='$novonumero' where autor='$autor'");

$assunto = $_POST['titulo'];
$formatacao = $_POST['formatacao'];
$msg = $_POST['msg'];


if ($formatacao==html){

include "config.php";

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: $email_admin<$autor_email>";
$sql = mysql_query("SELECT * FROM $tb3");

while ($reg = mysql_fetch_array($sql)){
global $assunto;
$emails = $reg['email'];

$msg = stripslashes($msg);
$msg = str_replace('"',"", $msg);

mail("$emails","$assunto","$msg","$headers");
flush();

}
echo "<script>alert(\"Sua Mensagem foi enviada com sucesso.\")</script>";
echo "<meta http-equiv='refresh' content='0;URL=Msg_form.php'>";
}
if ($formatacao==texto){
include "config.php";
$headers = "From: $email_admin<$autor_email>";
$sql2 = mysql_query("SELECT * FROM $tb3");
global $assunto;
while ($reg1 = mysql_fetch_array($sql2)){

$emails = $reg1['email'];
mail("$emails","$assunto","$msg","$headers");
}
echo "<script>alert(\"Sua Mensagem foi enviada com sucesso.\")</script>";
echo "<meta http-equiv='refresh' content='0;URL=Msg_form.php'>";
}

}
}
?>
[/codebox]

Socorro ae galera

Meu Código Não Está Efetuando Cadastro?

27/10/2008, 14:21

meu código e esse aqui [codebox]<?php
mb_http_input("utf-8");
mb_http_output("utf-8");
?>
<?php require_once('Connections/data.php'); ?><?php require_once('Connections/data.php'); ?><?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;

// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}

$MM_restrictGoTo = "index.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$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;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO add_conta_receber (campo_fim) VALUES (%s)",
GetSQLValueString($_POST['campo_fim'], "text"));
mysql_select_db($database_data, $data);
$Result1 = mysql_query($insertSQL, $data) or die(mysql_error());

$insertGoTo = "visualiza_receber.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$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;
}
}

$maxRows_DetailRS1 = 10;
$pageNum_DetailRS1 = 0;
if (isset($_GET['pageNum_DetailRS1'])) {
$pageNum_DetailRS1 = $_GET['pageNum_DetailRS1'];
}
$startRow_DetailRS1 = $pageNum_DetailRS1 * $maxRows_DetailRS1;

$colname_DetailRS1 = "-1";
if (isset($_GET['recordID'])) {
$colname_DetailRS1 = $_GET['recordID'];
}
mysql_select_db($database_data, $data);
$query_DetailRS1 = sprintf("SELECT * FROM anunciante WHERE codigo = %s", GetSQLValueString($colname_DetailRS1, "int"));
$query_limit_DetailRS1 = sprintf("%s LIMIT %d, %d", $query_DetailRS1, $startRow_DetailRS1, $maxRows_DetailRS1);
$DetailRS1 = mysql_query($query_limit_DetailRS1, $data) or die(mysql_error());
$row_DetailRS1 = mysql_fetch_assoc($DetailRS1);

if (isset($_GET['totalRows_DetailRS1'])) {
$totalRows_DetailRS1 = $_GET['totalRows_DetailRS1'];
} else {
$all_DetailRS1 = mysql_query($query_DetailRS1);
$totalRows_DetailRS1 = mysql_num_rows($all_DetailRS1);
}
$totalPages_DetailRS1 = ceil($totalRows_DetailRS1/$maxRows_DetailRS1)-1;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Lançamentos de contas a receber</title>
<script src="SpryAssets/SpryEffects.js" type="text/javascript"></script>
<script type=text/javascript>
function copia(nome,campo_fim) {
if(nome.checked)
{
campo_fim.value += nome.value + '\r\n';
}
else
{
campo_fim.value = campo_fim.value.toString().replace(nome.value,"");
campo_fim.value = campo_fim.value.toString().replace("\r\n","");
}
}
</script></script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<table width="84%" border="0" cellpadding="0" cellspacing=" 0">
<tr>
<td width="48"><div align="center"><img src="Imagens/1551_128x128.png" alt="" width="48" height="48" /></div></td>
<td width="640"><strong>ADICIONE OS PREDIOS </strong></td>
<td width="450"><b><b><b> <img src="Imagens/4435_128x128.png" width="48" height="48" /><a href="fechar.php" target="_self">Fechar Janela</a></b></b></b></td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="2"><table border="0" cellspacing="3" cellpadding="0" class="verdana" width="1218" >
<form action="<?php echo $editFormAction; ?>" method="POST" name="form1" id="form1">

<tr align="right">
<td width="233" height="5"><div align="center">Usuário que está cadastrando:<br />
<input name="Funcionario" type="text" id="Funcionario" value="<?php echo $_SESSION['MM_Username']; ?>" />

</div>
<div align="left"></div></td>
<td width="234"><div align="center">Anunciante:</b><br />
<input name="Cliente" type="text" id="Cliente" value="<?php echo $row_DetailRS1['Cliente']; ?>" onkeyup="muda(this)"/>
&nbsp;</div></td>
<td width="736" height="6">
<div align="left"><?php
//Conectando com o banco de dados MysQL e selecionando a base de dados.
$con=mysql_connect('xxxxxxxxx','xxxxxxx','xxxxxxxxxxxx')or die('Erro na conexção, verifique os dados'.mysql_error($con));
mysql_select_db('ubccriative1',$con)or die('Erro ao selecionar a tabela'.mysql_error($con));
//Varrendo a tabela dados, para pegar todos os dados.
$selecao=mysql_query("SELECT codigo,nome FROM cliente")or die('Erro na consulta SQL'.mysql_error($con));

if (mysql_num_rows($selecao) != 0)
{
echo "<form name='nome'>";

while($ver = mysql_fetch_array($selecao))
{
echo "$ver[1]<input type=\"checkbox\" value=\"$ver[1]\" onClick=\"copia(this,campo_fim);\">";
}

echo "<textarea name='campo_fim' rows='3' cols='20'></textarea></form>";




//Libramos a memória ocupada pela consulta com o free_result.
mysql_free_result($selecao);
//Fechamos a conexão com a base de dados após as operações.
mysql_close($con);
}
?>
</div></td>
</tr>
<tr align="right">
<td width="470" height="18" colspan="2">&nbsp;</td>
<td height="18">&nbsp;</td>
</tr>
<tr align="right">
<td height="3" colspan="2"><input type="submit" name="button" id="button" value=" Efetuar Cadastror") />
<input type="reset" name="button2" id="button2" value="Limpar Cadastro" /></td>
<td height="3"><?
setlocale(LC_TIME,"portuguese");
echo strftime("Hoje é %A, %d de %B de %Y");
?></td>
</tr>

<input type="hidden" name="MM_insert" value="form1" />
</form>
</table></td>
</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width="1362" border="0">
<tr>
<td><div align="center">
</body>
</html>
<?php
mysql_free_result($DetailRS1);
?>

[/codebox]


e o seguinte depois que adc esse código aqui
[codebox]<?php
//Conectando com o banco de dados MysQL e selecionando a base de dados.
$con=mysql_connect('xxxxxxxxxx','xxxxxxxxx','cxxxxxxxxxx')or die('Erro na conexção, verifique os dados'.mysql_error($con));
mysql_select_db('ubccriative1',$con)or die('Erro ao selecionar a tabela'.mysql_error($con));
//Varrendo a tabela dados, para pegar todos os dados.
$selecao=mysql_query("SELECT codigo,nome FROM cliente")or die('Erro na consulta SQL'.mysql_error($con));

if (mysql_num_rows($selecao) != 0)
{
echo "<form name='nome'>";

while($ver = mysql_fetch_array($selecao))
{
echo "$ver[1]<input type=\"checkbox\" value=\"$ver[1]\" onClick=\"copia(this,campo_fim);\">";
}

echo "<textarea name='campo_fim' rows='3' cols='20'></textarea></form>";




//Libramos a memória ocupada pela consulta com o free_result.
mysql_free_result($selecao);
//Fechamos a conexão com a base de dados após as operações.
mysql_close($con);
}
?>[/codebox]


juntamente com esse
[codebox]<script type=text/javascript>
function copia(nome,campo_fim) {
if(nome.checked)
{
campo_fim.value += nome.value + '\r\n';
}
else
{
campo_fim.value = campo_fim.value.toString().replace(nome.value,"");
campo_fim.value = campo_fim.value.toString().replace("\r\n","");
}
}
</script>[/codebox]


o meu botão não efetua o cadastro o código do botão e esse
[codebox]<input type="submit" name="button" id="button" value=" Efetuar Cadastror") />
<input type="reset" name="button2" id="button2" value="Limpar Cadastro" />[/codebox]


alguém sabe o que está acontecendo por favor????? :assobio: :assobio: :assobio: :assobio: :assobio: :assobio:

Dúvida Sobre Insert

03/10/2008, 13:27

BOM GALERA A MINHA DÚVIDA E TEM COMO EU FAZER ESSE CÓDIGO FAZER UM INSERT E Não um delete por que esse código deleta mas eu queria que ele fizesse um insert e um campo chamado predio obrigadoss

<?php
//Conectando com o banco de dados MysQL e selecionando a base de dados.
$con=mysql_connect('xxxxxxx','xxxxxxxx','xxxxxxxxx')or die('Erro na conexção, verifique os dados'.mysql_error($con));
mysql_select_db('xxxxxxxx',$con)or die('Erro ao selecionar a tabela'.mysql_error($con));
//Varrendo a tabela dados, para pegar todos os dados.
$selecao=mysql_query("SELECT codigo,nome,cidade FROM cliente")or die('Erro na consulta SQL'.mysql_error($con));

/*Veremos se a consulta retornou algum registro com a função, mysql_num_rows...
se sim, ou seja, se for diferente de 0 o número de registros, ele tras os dados encontrados, através de um loop WHILE.
*/
if(mysql_num_rows($selecao) != 0){
/* Buscamos os dados e jogamos na função mysql_fetch_row, em que. $ver[0] o 0 reprezenta o
primeiro campo da tabela dados e o $ver[1] o 1 reprezenta o segundo campo da tabela dados
pois o PHP começa as contagens do 0... */
   echo "<form name=\"exclusao\" method=\"POST\" action=\"excluir.php\">";

   while($ver=mysql_fetch_row($selecao)){
   echo "Prédio: $ver[1]<input type=\"checkbox\" name=\"excluir[]\" value=\"$ver[0]\" /><br />";
   }

   echo "<input type=\"submit\" name=\"ok\" value=\"Escolher\" /></form>";
//Libramos a memória ocupada pela consulta com o free_result.
mysql_free_result($selecao);
//Fechamos a conexão com a base de dados após as operações.
mysql_close($con);
}
?>
	  <p><?php
//Conectando com o banco de dados MysQL e selecionando a base de dados.
$con=mysql_connect('xxxxxx','xxxxxxxxx','xxxxxxxxxxxx')or die('Erro na conexção, verifique os dados'.mysql_error($con));
mysql_select_db('xxxxxxxxxxxx',$con)or die('Erro ao selecionar a tabela'.mysql_error($con));

//Verificamos se o método enviado pelo formulário é realmente o POST.
if($_SERVER['REQUEST_METHOD']=='POST'){
//Se sim, pegamos os dados em forma de vetor (array) e passamos para a variável $apagar.
  $apagar=$_POST['excluir'];
  /*Dou um loop para pegar os arrays e comparar com o valor de $i
  Aqui que está o segredo da coisam se a variável $i que inicia em 0 for menor que os dados contidos
  no array $apagar, ele vai incrementar até chegar ao valor, repetindo dentro do laço a função para deletar
  a quantidade correta de dados selecionados...
  */
  for($i=0; $i<count($apagar); $i++){
   $sql=mysql_query("INSERT INTO add_conta_pagar WHERE codigo='$apagar[$i]'")or die('Erro ao apagar os dados'.mysql_error($con));
  }
  /* verificamos com um IF simplificado se os dados foram excluídos. */
  ($sql) ? (print('Dados excluídos com êxito !')) : die('Erro ao excluir os dados.');
}
?>
<_< <_< <_< <_< <_< <_< <_< <_<

Problema Com Insert

01/10/2008, 13:05

Meu problema e tenho uma tabela no meu banco e nessa tabela eu tenho um campo chamado arquivo e nele quando coloco s nesse campo meu código entrepreta de um modo e faz com que mande para outra página mas quando está em n fica armazenado o problema e o seguinte o código está funfando mandando tupo beleza o problema e que todos os campos ficam null mas grava o id o que esta acontecendo?????



código da página que faz um insert

<?php require_once('Connections/data.php'); ?><?php require_once('Connections/data.php'); ?><?php require_once('Connections/data.php'); ?><?php require_once('Connections/data.php'); ?><?phpif (!isset($_SESSION)) {  session_start();}$MM_authorizedUsers = "1";$MM_donotCheckaccess = "false";// *** Restrict Access To Page: Grant or deny access to this pagefunction isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {   // For security, start by assuming the visitor is NOT authorized.   $isValid = False;   // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.   // Therefore, we know that a user is NOT logged in if that Session variable is blank.   if (!empty($UserName)) {     // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.     // Parse the strings into arrays.     $arrUsers = Explode(",", $strUsers);     $arrGroups = Explode(",", $strGroups);     if (in_array($UserName, $arrUsers)) {       $isValid = true;     }     // Or, you may restrict access to only certain users based on their username.     if (in_array($UserGroup, $arrGroups)) {       $isValid = true;     }     if (($strUsers == "") && false) {       $isValid = true;     }   }   return $isValid; }$MM_restrictGoTo = "restrito.php";if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {     $MM_qsChar = "?";  $MM_referrer = $_SERVER['PHP_SELF'];  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";  if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)   $MM_referrer .= "?" . $QUERY_STRING;  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);  header("Location: ". $MM_restrictGoTo);   exit;}?><?phpif (!function_exists("GetSQLValueString")) {function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") {  $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;}}if (!function_exists("GetSQLValueString")) {function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") {  $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;}}$editFormAction = $_SERVER['PHP_SELF'];if (isset($_SERVER['QUERY_STRING'])) {  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);}if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {  $updateSQL = sprintf("UPDATE add_conta_pagar SET Funcionario=%s, banco=%s, Cliente=%s, Forma_pagamento=%s, descricao=%s, Data_pagamento=%s, Data_vencimento=%s, valor=%s, lancamento=%s, valor_pagamento=%s, documento=%s, Hora_Entrada=%s, Arquivo=%s WHERE Cod_Equipamento=%s",                       GetSQLValueString($_POST['Funcionario'], "text"),                       GetSQLValueString($_POST['banco'], "text"),                       GetSQLValueString($_POST['Cliente'], "text"),                       GetSQLValueString($_POST['Forma_pagamento'], "text"),                       GetSQLValueString($_POST['descricao'], "text"),                       GetSQLValueString($_POST['Data_pagamento'], "text"),                       GetSQLValueString($_POST['Data_vencimento'], "text"),                       GetSQLValueString($_POST['valor'], "text"),                       GetSQLValueString($_POST['lancamento'], "text"),                       GetSQLValueString($_POST['valor_pagamento'], "text"),                       GetSQLValueString($_POST['documento'], "text"),					   GetSQLValueString($_POST['Hora_Entrada'], "text"),					   GetSQLValueString($_POST['Arquivo'], "text"),					   GetSQLValueString($_POST['Cod_Equipamento'], "int"));  mysql_select_db($database_data, $data);  $Result1 = mysql_query($updateSQL, $data) or die(mysql_error());  $updateGoTo = "visualiza_conta.php";  if (isset($_SERVER['QUERY_STRING'])) {    $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";    $updateGoTo .= $_SERVER['QUERY_STRING'];  }  header(sprintf("Location: %s", $updateGoTo));}if (!function_exists("GetSQLValueString")) {function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") {  $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;}}if (!function_exists("GetSQLValueString")) {function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") {  $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;}}$maxRows_DetailRS1 = 10;$pageNum_DetailRS1 = 0;if (isset($_GET['pageNum_DetailRS1'])) {  $pageNum_DetailRS1 = $_GET['pageNum_DetailRS1'];}$startRow_DetailRS1 = $pageNum_DetailRS1 * $maxRows_DetailRS1;$colname_DetailRS1 = "-1";if (isset($_GET['recordID'])) {  $colname_DetailRS1 = $_GET['recordID'];}mysql_select_db($database_data, $data);$query_DetailRS1 = sprintf("SELECT * FROM add_conta_pagar WHERE Cod_Equipamento = %s", GetSQLValueString($colname_DetailRS1, "int"));$query_limit_DetailRS1 = sprintf("%s LIMIT %d, %d", $query_DetailRS1, $startRow_DetailRS1, $maxRows_DetailRS1);$DetailRS1 = mysql_query($query_limit_DetailRS1, $data) or die(mysql_error());$row_DetailRS1 = mysql_fetch_assoc($DetailRS1);if (isset($_GET['totalRows_DetailRS1'])) {  $totalRows_DetailRS1 = $_GET['totalRows_DetailRS1'];} else {  $all_DetailRS1 = mysql_query($query_DetailRS1);  $totalRows_DetailRS1 = mysql_num_rows($all_DetailRS1);}$totalPages_DetailRS1 = ceil($totalRows_DetailRS1/$maxRows_DetailRS1)-1;?><!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>::: SISTEMA UBC CRIATIVE:::</title><script type=text/javascript>documentall = document.all;/** função para formatação de valores monetários retirada de* [url="http://jonasgalvez.com/br/blog/2003-08/egocentrismo"]http://jonasgalvez.com/br/blog/2003-08/egocentrismo[/url]*/function formatamoney© {    var t = this; if(c == undefined) c = 2;    var p, d = (t=t.split("."))[1].substr(0, c);    for(p = (t=t[0]).length; (p-=3) >= 1;) {	        t = t.substr(0,p) + "." + t.substr(p);    }    return t+"."+d+Array(c+1-d.length).join(0);}String.prototype.formatCurrency=formatamoneyfunction demaskvalue(valor, currency){/** Se currency é false, retorna o valor sem apenas com os números. Se é true, os dois últimos caracteres são considerados as* casas decimais*/var val2 = '';var strCheck = '0123456789';var len = valor.length;	if (len== 0){		return 0.00;	}	if (currency ==true){		/* Elimina os zeros à esquerda		* a variável  <i> passa a ser a localização do primeiro caractere após os zeros e		* val2 contém os caracteres (descontando os zeros à esquerda)		*/		for(var i = 0; i < len; i++)			if ((valor.charAt(i) != '0') && (valor.charAt(i) != ',')) break;		for(; i < len; i++){			if (strCheck.indexOf(valor.charAt(i))!=-1) val2+= valor.charAt(i);		}		if(val2.length==0) return "0.00";		if (val2.length==1)return "0.0" + val2;		if (val2.length==2)return "0." + val2;		var parte1 = val2.substring(0,val2.length-2);		var parte2 = val2.substring(val2.length-2);		var returnvalue = parte1 + "." + parte2;		return returnvalue;	}	else{			/* currency é false: retornamos os valores COM os zeros à esquerda,			* sem considerar os últimos 2 algarismos como casas decimais			*/			val3 ="";			for(var k=0; k < len; k++){				if (strCheck.indexOf(valor.charAt(k))!=-1) val3+= valor.charAt(k);			}	return val3;	}}function reais(obj,event){var whichCode = (window.Event) ? event.which : event.keyCode;/*Executa a formatação após o backspace nos navegadores !document.all*/if (whichCode == 8 && !documentall) {/*Previne a ação padrão nos navegadores*/	if (event.preventDefault){ //standart browsers			event.preventDefault();		}else{ // internet explorer			event.returnValue = false;	}	var valor = obj.value;	var x = valor.substring(0,valor.length-1);	obj.value= demaskvalue(x,true).formatCurrency();	return false;}/*Executa o Formata Reais e faz o format currency novamente após o backspace*/FormataReais(obj,'.',',',event);} // end reaisfunction backspace(obj,event){/*Essa função basicamente altera o  backspace nos input com máscara reais para os navegadores IE e opera.O IE não detecta o keycode 8 no evento keypress, por isso, tratamos no keydown.Como o opera suporta o infame document.all, tratamos dele na mesma parte do código.*/var whichCode = (window.Event) ? event.which : event.keyCode;if (whichCode == 8 && documentall) {	var valor = obj.value;	var x = valor.substring(0,valor.length-1);	var y = demaskvalue(x,true).formatCurrency();	obj.value =""; //necessário para o opera	obj.value += y;	if (event.preventDefault){ //standart browsers			event.preventDefault();		}else{ // internet explorer			event.returnValue = false;	}	return false;	}// end if}// end backspacefunction FormataReais(fld, milSep, decSep, e) {var sep = 0;var key = '';var i = j = 0;var len = len2 = 0;var strCheck = '0123456789';var aux = aux2 = '';var whichCode = (window.Event) ? e.which : e.keyCode;//if (whichCode == 8 ) return true; //backspace - estamos tratando disso em outra função no keydownif (whichCode == 0 ) return true;if (whichCode == 9 ) return true; //tecla tabif (whichCode == 13) return true; //tecla enterif (whichCode == 16) return true; //shift internet explorerif (whichCode == 17) return true; //control no internet explorerif (whichCode == 27 ) return true; //tecla escif (whichCode == 34 ) return true; //tecla endif (whichCode == 35 ) return true;//tecla endif (whichCode == 36 ) return true; //tecla home/*O trecho abaixo previne a ação padrão nos navegadores. Não estamos inserindo o caractere normalmente, mas via script*/if (e.preventDefault){ //standart browsers		e.preventDefault()	}else{ // internet explorer		e.returnValue = false}var key = String.fromCharCode(whichCode);  // Valor para o código da Chaveif (strCheck.indexOf(key) == -1) return false;  // Chave inválida/*Concatenamos ao value o keycode de key, se esse for um número*/fld.value += key;var len = fld.value.length;var bodeaux = demaskvalue(fld.value,true).formatCurrency();fld.value=bodeaux;/*Essa parte da função tão somente move o cursor para o final no opera. Atualmente não existe como movê-lo no konqueror.*/  if (fld.createTextRange) {    var range = fld.createTextRange();    range.collapse(false);    range.select();  }  else if (fld.setSelectionRange) {    fld.focus();    var length = fld.value.length;    fld.setSelectionRange(length, length);  }  return false;}</SCRIPT><link href="css/style.css" rel="stylesheet" type="text/css" /><script>function formatar(src, mask){  var i = src.value.length;  var saida = mask.substring(0,1);  var texto = mask.substring(i)if (texto.substring(0,1) != saida)  {        src.value += texto.substring(0,1);  }}</script><script language="JavaScript"><!--function muda(qual){uCase = qual.value.toUpperCase();qual.value = uCase;}--></script></head><body><table width="100%" border="0" cellpadding="0" cellspacing=" 0">  <tr>    <td width="64"><div align="center"><img src="Imagens/administrativo.jpg" alt="" width="64" height="64" /></div></td>    <td width="201"><b><span class="style7">Baixa do sistema</span><b><b><a href="fechar.php"></a></b></b></b></td>    <td width="1114"><img src="Imagens/fecha.jpg" width="34" height="33" /><b><b><b><a href="fechar.php">Fechar Janela</a></b></b></b></td>  </tr>  <tr>    <td>&nbsp;</td>    <td colspan="2"><table border="0" cellspacing="3" cellpadding="0" class="verdana" width="745" >      <form action="<?php echo $editFormAction;?>" method="POST" name="form1" id="form1">        <tr>          <td width="739" height="40" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">            <tr>              <td width="167" valign="top"><b>T&eacute;cnico:<br />                          <input name="Funcionario" type="text" id="Funcionario" value="<?php echo $_SESSION['MM_Username']; ?>" />                          <br />              </b></td>              <td width="959" valign="top"><b>Baixa no Cliente/fornecedor:<br />              </b>              <?php echo $row_DetailRS1['Cliente']; ?><br /></td>            </tr>          </table></td>        </tr>        <tr>          <td><table width="91%" border="0" cellspacing=" 0" cellpadding="0">            <tr>              <td width="23%"><b>Data do Pagamento:<br />              </b><?php echo $row_DetailRS1['Data_pagamento']; ?><br /></td>              <td width="23%"><b>Data do Vencimento:</b><br />                <?php echo $row_DetailRS1['Data_vencimento']; ?><br /></td>              <td width="17%"><b>Descrição:</b><br />                <?php echo $row_DetailRS1['descricao']; ?><b><br />                  </b></td>              <td width="19%"><b>Documento:</b><br />                <?php echo $row_DetailRS1['documento']; ?></td>              <td width="18%"><b>Valor:</b><br />                <?php echo $row_DetailRS1['valor']; ?></td>            </tr>          </table></td>        </tr>        <tr align="right">          <td height="35"><input name="Arquivo" type="hidden" id="Arquivo" value="s" />            <input name="Cod_Equipamento" type="hidden" id="Cod_Equipamento" value="<?php echo $row_DetailRS1['Cod_Equipamento']; ?>" />            <input type="submit" name="button" id="button" value=" Efetuar Cadastror" />            <input type="reset" name="button2" id="button2" value="Limpar Cadastro" /></td>        </tr>        <input type="hidden" name="MM_update" value="form1" />      </form>    </table>      </td>  </tr></table></body></html><?phpmysql_free_result($DetailRS1);?>


E o código de visualização do insert

<?php require_once('Connections/data.php'); ?><?phpif (!isset($_SESSION)) {  session_start();}$MM_authorizedUsers = "";$MM_donotCheckaccess = "true";// *** Restrict Access To Page: Grant or deny access to this pagefunction isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {   // For security, start by assuming the visitor is NOT authorized.   $isValid = False;   // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.   // Therefore, we know that a user is NOT logged in if that Session variable is blank.   if (!empty($UserName)) {     // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.     // Parse the strings into arrays.     $arrUsers = Explode(",", $strUsers);     $arrGroups = Explode(",", $strGroups);     if (in_array($UserName, $arrUsers)) {       $isValid = true;     }     // Or, you may restrict access to only certain users based on their username.     if (in_array($UserGroup, $arrGroups)) {       $isValid = true;     }     if (($strUsers == "") && true) {       $isValid = true;     }   }   return $isValid; }$MM_restrictGoTo = "index.php";if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {     $MM_qsChar = "?";  $MM_referrer = $_SERVER['PHP_SELF'];  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";  if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)   $MM_referrer .= "?" . $QUERY_STRING;  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);  header("Location: ". $MM_restrictGoTo);   exit;}?><?phpif (!function_exists("GetSQLValueString")) {function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") {  $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;}}$maxRows_Recordset1 = 30;$pageNum_Recordset1 = 0;if (isset($_GET['pageNum_Recordset1'])) {  $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];}$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;mysql_select_db($database_data, $data);$query_Recordset1 = "SELECT * FROM add_conta_pagar WHERE Arquivo = 's'";$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);$Recordset1 = mysql_query($query_limit_Recordset1, $data) or die(mysql_error());$row_Recordset1 = mysql_fetch_assoc($Recordset1);if (isset($_GET['totalRows_Recordset1'])) {  $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];} else {  $all_Recordset1 = mysql_query($query_Recordset1);  $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);}$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;$currentPage = $_SERVER["PHP_SELF"];$queryString_Recordset1 = "";if (!empty($_SERVER['QUERY_STRING'])) {  $params = explode("&", $_SERVER['QUERY_STRING']);  $newParams = array();  foreach ($params as $param) {    if (stristr($param, "pageNum_Recordset1") == false &&         stristr($param, "totalRows_Recordset1") == false) {      array_push($newParams, $param);    }  }  if (count($newParams) != 0) {    $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));  }}$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);?><!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>Visualização</title><link href="css/style.css" rel="stylesheet" type="text/css" /><style type="text/css"><!--.style1 {color: #337B93}--></style></head><body><table width="100%" border="0" cellpadding="0" cellspacing=" 0">  <tr>    <td width="15"><div align="center"><img src="Imagens/cadeado.gif" alt="" width="30" height="30" /></div></td>    <td><strong>Contas Pagas - <b><b><a href="fechar.php">Fechar Janela</a></b></b></strong></td>  </tr>  <tr>    <td>&nbsp;</td>    <td><table width="100%" border="0" align="center">        <tr bgcolor="#f0f0f0">          <td>Número do Registro</td>          <td>Funcionario</td>          <td>Data do Pagamento</td>          <td>Data do Vencimento</td>          <td>Valor</td>        </tr>        <?php do { ?>          <tr>            <td bgcolor="dbdada"><a href="fechar.php" target="_self" class="style1"> <?php echo $row_Recordset1['Cod_Equipamento']; ?></a> </td>            <td bgcolor="dbdada"><span class="style1"><?php echo $row_Recordset1['Funcionario']; ?></span>&nbsp; </td>            <td bgcolor="dbdada"><span class="style1"><?php echo $row_Recordset1['Data_pagamento']; ?></span>&nbsp; </td>            <td bgcolor="dbdada"><span class="style1"><?php echo $row_Recordset1['Data_vencimento']; ?></span>&nbsp; </td>            <td bgcolor="dbdada"><span class="style1"><?php echo $row_Recordset1['valor_pagamento']; ?></span>&nbsp; </td>          </tr><?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>            </table>       <table border="0">        <tr>          <td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>              <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>"><img src="Imagens/First.gif" border="0" /></a>          <?php } // Show if not first page ?>          </td>      <td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>          <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>"><img src="Imagens/Previous.gif" border="0" /></a>          <?php } // Show if not first page ?>        </td>      <td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>          <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>"><img src="Imagens/Next.gif" border="0" /></a>          <?php } // Show if not last page ?>        </td>      <td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>          <a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>"><img src="Imagens/Last.gif" border="0" /></a>          <?php } // Show if not last page ?>        </td>    </tr>      </table></td>  </tr></table><p>&nbsp;</p><p>&nbsp;</p></body></html><?phpmysql_free_result($Recordset1);?>

Socorro ae gente só falta isso para eu terminar o sistema da empresa me ajudemmmmmmmmm!!!!!!!!!!! obrigado ae galera!!. :wacko: :wacko: :blink:

Pesquisa Por Data

22/09/2008, 11:08

Eu queria saber como eu faço um serch que pesquise por data exemplo do dia 01/02/2007 a 01/01/2008 e ele mostre os registros que estão entre essas datas

IPB Skin By Virteq