Ir para conteúdo
Fórum Script Brasil

Paulo TI Rede Brasil

Membros
  • Total de itens

    7
  • Registro em

  • Última visita

Sobre Paulo TI Rede Brasil

  • Data de Nascimento 28/02/1982

Contatos

  • MSN
    digital.junior@hotmail.com
  • Website URL
    http://www.digitalwebmaster.com.br
  • ICQ
    0

Perfil

  • Gender
    Male
  • Location
    Anápolis GO

Paulo TI Rede Brasil's Achievements

0

Reputação

  1. boa tarde... estou novamente com problemas este codigo faz insert no banco de alguns campos texto e 1 foto, o problema é nem sempre a foto da certo ela até faz upload mais não mostra acho que a solução para meu problema seria renomear a foto na hora do upload ( mais não estou dando conta de fazer isso, e olha que já tentei) então gostaria mais uma vez da ajuda de voces ( se possivel ) desde já muito obrigado <? include "../conf.php"; include "valida_logar.php"; ?> <html><head> <title><?echo $titulo;?></title> <link href="../header/<?echo $pastaheaders;?>/estilo.css" rel="stylesheet" type="text/css"> </head> <body topmargin="2" leftmargin="2"> <form name="cadnot" action="inserenoticia.php" method="POST" enctype="multipart/form-data"> <div align="center"> <table align="center" cellpadding="0" cellspacing="0"> <tr><td colspan="2" class=topa align="center">&nbsp;</td></tr> <tr><td colspan="2" class=topa align="center">&nbsp;</td></tr> <tr> <td colspan="2" class=bga align="center"><b>Inserir Notícias</b></td> </tr> <tr><td colspan="2" class=topa align="center">&nbsp;</td></tr> <tr> <td align="right" class=topa>Data:</td><td> <input class=select type="text" name="txtdat" value="<?echo date("d-m-Y");?>" size="20"></td> </tr> <tr> <td align="right" class=topa>Hora:</td><td> <input class=select type="text" name="txthor" value="<?echo date("H:i:s");?>" size="20"></td> </tr> <tr> <td align="right" class=topa>Titulo:</td><td> <input class=select type="text" name="txttit" value="" size="55"></td> </tr> <tr> <td align="right" class=topa>Texto:</td><td><TEXTAREA class=select NAME="txttex" ROWS="10" COLS="55"></TEXTAREA></td> </tr> <tr> <td align="right" class=topa>Autor:</td><td> <input class=select type="text" name="txtaut" value="" size="55"></td> </tr> <tr> <td align="right" class=topa>Com foto:</td><td> <select class=select name="fot" size=1> <option value="sim" selected>Sim</option> <option value="não">Não</option> </select> </td> </tr> <tr> <td align="right" class=topa>Foto:</td><td> <input class=select type="file" name="file" value="" size="40"></td> </tr> <tr><td colspan="2" align="center"><input type="image" name="salvar" src="../images/bot_salvar.gif" onClick="java script:document.cadnot.submit()">&nbsp;&nbsp;<a href="java script:history.back(1)"><img valign=bottom border=0 src="../images/voltar.gif"></a></td></tr> </table> </center> </div> </form> <? if(getenv("REQUEST_METHOD")=="POST") { include "conexao.php"; $fotos = $_POST['fot']; if($fotos=='sim') { $paragrafo=nl2br($txttex); $_getdata = $txtdat; $data_br_dd = substr("$_getdata", 0, -8); $data_br_mm = substr("$_getdata", 3, -5); $data_br_aa = substr("$_getdata", 6, 9); $traco_bl = "-"; $dt_ini = $data_br_aa.$traco_bl.$data_br_mm.$traco_bl.$data_br_dd; $sql="insert into noticias (data,horas,titulo,texto,autor,fot,foto) values('$dt_ini','$txthor','$txttit','$paragrafo','$txtaut','$fot','$file_name')"; mysql_query($sql)or die(mysql_error()); $pasta="../fotos"; $dest = $pasta."/".$file_name; if(!move_uploaded_file($file,$dest)) { echo "Não foi possível enviar o arquivo!"; } else { echo "Arquivo enviado com sucesso!"; } } elseif($fotos=='não') { $paragrafo=nl2br($txttex); $_getdata = $txtdat; $data_br_dd = substr("$_getdata", 0, -8); $data_br_mm = substr("$_getdata", 3, -5); $data_br_aa = substr("$_getdata", 6, 9); $traco_bl = "-"; $dt_ini = $data_br_aa.$traco_bl.$data_br_mm.$traco_bl.$data_br_dd; $sql="insert into noticias (data,horas,titulo,texto,autor,fot,foto) values('$dt_ini','$txthor','$txttit','$paragrafo','$txtaut','$fot','null')"; mysql_query($sql)or die(mysql_error()); } } ?> </body> </html>
  2. cara muito obrigado!!!! show de bola... brigado d+
  3. bom dia... Preciso de uma ajuda... fiz meio nas coxas um formulario php com insert em um banco mysql e gostaria de colocar um alert em js que confirme o inserte no banco... é possivel ? alguém pode me ajudar ? segue o codigo: <?php require_once('Connections/path.php'); ?> <?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; } } $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 registros (id, carregamento, motorista, `data`, cod_venda, quantidade, mercadoria, vlr_devolucao,funcionario) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['id'], "int"), GetSQLValueString($_POST['carregamento'], "text"), GetSQLValueString($_POST['motorista'], "text"), GetSQLValueString($_POST['data'], "text"), GetSQLValueString($_POST['cod_venda'], "text"), GetSQLValueString($_POST['quantidade'], "text"), GetSQLValueString($_POST['mercadoria'], "text"), GetSQLValueString($_POST['vlr_devolucao'], "text"), GetSQLValueString($_POST['funcionario'], "text")); mysql_select_db($database_path, $path); $Result1 = mysql_query($insertSQL, $path) or die(mysql_error()); } ?> <style type=text/css"> <!-- body { background-color: #CCC; text-transform:uppercase } --> </style> &lt;script type="text/javascript"> /* Autor: Mario Costa */ function formatar_moeda(campo, separador_milhar, separador_decimal, tecla) { var sep = 0; var key = ''; var i = j = 0; var len = len2 = 0; var strCheck = '0123456789'; var aux = aux2 = ''; var whichCode = (window.Event) ? tecla.which : tecla.keyCode; if (whichCode == 13) return true; // Tecla Enter if (whichCode == 8) return true; // Tecla Delete key = String.fromCharCode(whichCode); // Pegando o valor digitado if (strCheck.indexOf(key) == -1) return false; // Valor inválido (não inteiro) len = campo.value.length; for(i = 0; i < len; i++) if ((campo.value.charAt(i) != '0') && (campo.value.charAt(i) != separador_decimal)) break; aux = ''; for(; i < len; i++) if (strCheck.indexOf(campo.value.charAt(i))!=-1) aux += campo.value.charAt(i); aux += key; len = aux.length; if (len == 0) campo.value = ''; if (len == 1) campo.value = '0'+ separador_decimal + '0' + aux; if (len == 2) campo.value = '0'+ separador_decimal + aux; if (len > 2) { aux2 = ''; for (j = 0, i = len - 3; i >= 0; i--) { if (j == 3) { aux2 += separador_milhar; j = 0; } aux2 += aux.charAt(i); j++; } campo.value = ''; len2 = aux2.length; for (i = len2 - 1; i >= 0; i--) campo.value += aux2.charAt(i); campo.value += separador_decimal + aux.substr(len - 2, len); } return false; } </script> &lt;script language="JavaScript"> if (document.all){ document.onkeydown = function (){ var key_f5 = 116; // 116 = F5 if (key_f5==event.keyCode){ event.keyCode = 27; return false; } } } function envia() { document.formulario.submitButton.disabled = true; document.formulario.submit(); } </script> &lt;script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- .style1 {font-size: 12px} --> </style> <form method="post" name="form1" action="<?php echo $editFormAction; ?>"> <table width="100%" border="0"> <tr> </tr> </table> </form> <table width="100%" border="0"> <tr> <td> </td> <td width="650" background="img/9.jpg"><form method="post" name="form1" action="<?php echo $editFormAction; ?>"> <table width="650" border="0"> <tr> <td width="51%"><p>Carregamento: <br /> <span id="sprytextfield1"> <input name="carregamento" type="text" id="carregamento" value="" size="30" /> <span class="textfieldRequiredMsg">Um carregamento é necessário.</span></span></p></td> <td width="24%">Data :<br /> <span id="sprytextfield5"> <input name="data" type="text" id="data" value="<?php echo date('d/m/Y' ); ?>" size="12" /> <span class="textfieldRequiredMsg">Uma data é necessária.</span></span></td> <td width="25%">Funcionario : <span id="sprytextfield3"> <input name="funcionario" type="text" id="funcionario" value="<?=$_SESSION['login];?>" size="20" /> <span class="textfieldRequiredMsg">Um Funcionario é necessário.</span></span></td> </tr> <tr> <td><p>Motorista: <br /> <span id="sprytextfield2"> <input name="motorista" type="text" id="motorista" value="" size="50" /> <span class="textfieldRequiredMsg">Um Motorista é necessário.</span></span></p></td> <td width="49%" colspan="2"> </td> </tr> </table> <p> </p> <table width="650" border="0"> <tr> <td>Cod. Venda:</td> <td>Quant.:</td> <td>Mercadoria:</td> <td colspan="2">Vlr. Devolução:</td> </tr> <tr> <td><span id="sprytextfield6"> <input name="cod_venda" type="text" id="cod_venda" value="" size="10" /> <span class="textfieldRequiredMsg">Um valor é necessário.</span></span></td> <td><span id="sprytextfield7"> <input name="quantidade" type="text" id="quantidade" value="" size="10" /> <span class="textfieldRequiredMsg">Digite a quantidade.</span></span></td> <td><span id="sprytextfield8"> <input name="mercadoria" type="text" id="mercadoria" value="" size="50" /> <span class="textfieldRequiredMsg">Digite a mercadoria.</span></span></td> <td colspan="2"><span id="sprytextfield4"> <input name="vlr_devolucao" size="20" length="15" /> <span class="textfieldRequiredMsg">Digite um cod. venda.</span></span></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td><label> <input type="Reset" value="Limpar " /> </label></td> <td><input type="submit" value="Inserir registro" onClick="alert('Cadastro Efetuado com Sucesso')")> </td> </tr> </table> <p> <input type="hidden" name="MM_insert" value="form1"> <span class="textfieldFlashText style1">Olá : <?=$_SESSION['login'];?> _Para voltar clique <a href="logado.php">aqui</a>.</span></p> </form></td> <td> </td> </tr> </table> <br /> <table width="100%" border="0"> <tr> <td> </td> <td> </td> <td><div align="right" class="textfieldFlashText style1"></div></td> </tr> </table> &lt;script type="text/javascript"> <!-- var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1"); var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2"); var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3"); var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4"); var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5"); var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6"); var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7"); var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8"); //--> </script>
  4. boa tarde preciso de ajuda tenho um menu de salto e queria trocar por uma caixa de texto se possivel que faça busca no select mais não sei como colocar o botao enviar para passar as informaçoes rsrsrsr a pagina atual é <?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; } } mysql_select_db($database_data, $data); $query_Recordset1 = "SELECT * FROM cliente"; $Recordset1 = mysql_query($query_Recordset1, $data) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($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>Untitled Document</title> &lt;script src="SpryAssets/SpryValidationSelect.js" type="text/javascript"></script> &lt;script 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> <link href="css/style.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" /> </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><b><span class="style1">Goiás Atacado Distribuidor</span> -<b><b><a href="fechar.php"> Fechar Janela</a></b></b></b></td> </tr> <tr> <td> </td> <td><table border="0" cellspacing="3" cellpadding="0" class="verdana" width="498" > <form action="" method="post" name="form1" id="form1"> <tr> <td width="523" height="40" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="200" valign="top"><b>Técnico:<br /> <input name="textfield" type="text" id="textfield" value="<?php echo $_SESSION['MM_Username]; ?>" /> <br /> </b></td> <td valign="top"><b>RCA:</b><br /> <span class="posted" id="spryselect2"> <select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)"> <option value="">Selecione</option> <?php do { ?> <option value="add_os1.php?recordID=<?php echo $row_Recordset1['codigo']; ?>"><?php echo $row_Recordset1['cpf']?></option> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); $rows = mysql_num_rows($Recordset1); if($rows > 0) { mysql_data_seek($Recordset1, 0); $row_Recordset1 = mysql_fetch_assoc($Recordset1); } ?> </select> <span class="selectRequiredMsg">Selecione um item.</span></span> <label></label> <span id="spryselect1"><span class="selectRequiredMsg">Selecione um item.</span></span><br /></td> </tr> </table></td> </tr> </form> </table></td> </tr> </table> <p> </p> &lt;script type="text/javascript"> <!-- var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1"); var spryselect2 = new Spry.Widget.ValidationSelect("spryselect2"); //--> </script> </body> </html> <?php mysql_free_result($Recordset1); ?>
  5. bom dia tenho o seguinte script e esta com um erro chato tem hora que sobe tem hora que da erro não sei porque tem hora que sobe pela mentade tipo 2 fotos de 5 minha internet é boa é um link dedicado da embratel de 2 mb aqui na empresa este é o script <? include("cria_imagem.php"); include "conexao.php"; $TotalImg=$_GET['quant']; $id=$_POST['idim']; $DirImg = "../fotos"; $DirThumb = "../fotos/thumb"; for($i=0;$i<$TotalImg;$i++) { if(!empty($_FILES['Imagem']['tmp_name'][$i])) { list($NomeImg,$ExtencionImg) = explode(".",$_FILES['Imagem']['name'][$i]); $NovaImg = $NomeImg.date("dHi").".jpg"; $sql=INSERT INTO fotos VALUES ('','$id','$tipo','$NovaImg')"; mysql_query($sql); move_uploaded_file($_FILES['Imagem]['tmp_name'][$i],$DirImg."/".$NovaImg); // ($_FILES['Imagem']['tmp_name'][$i],$DirImg."/".$NovaImg); CriaImg("$DirImg/$NovaImg","$DirImg/$NovaImg","400","300",S, array(R=>0,G=>0,B=>0)); CriaImg("$DirImg/$NovaImg","$DirThumb/$NovaImg","130","98",S, array(R=>0,G=>0,B=>0)); } } ?>
×
×
  • Criar Novo...