Ir para conteúdo
Fórum Script Brasil

shelter

Membros
  • Total de itens

    429
  • Registro em

  • Última visita

Tudo que shelter postou

  1. shelter

    Acentuação

    Boa galera, recentemente migrei me db local para um servidor web, e aí todas as palavras que estavam com acentos ficaram disconfiguradas ( ex. Missões ). As mesmas em meu servidor local aparecem normais. alguém saberia como me ajudar. Grato valmir Lopes
  2. $valor = 1,000.00 number_format ($Valor, 2, ',', '.') usa assim e me fala
  3. shelter

    upload

    Boa galera aqui mudei a permisão para 777 , agora tenho permisão para efetuar o upload , mais o programa não envia nem cadastra o anuncio, fica a pagina congelada com a seguinte mensagem na barra de end.: http://www.tonobairro.com.br/g/galeria/adm...;GP_upload=true boa galera E desdee já obrigado pela ajuda. Valmir Lopes há desculpa o codigo para inserir os dados: <?php session_start(); include "functions.php"; session_checker(); ?> <?php require_once('../../../Connections/conection.php'); ?> <?php $con = mysql_connect("localhost", "valmir", "1272"); mysql_select_db("valmir_cadastro"); ?> <?php require_once('../../../ScriptLibrary/incPureUpload.php'); ?> <?php require_once('../../../ScriptLibrary/incResize.php'); ?> <?php require_once('../../../ScriptLibrary/incPUAddOn.php'); ?> <?php // Pure PHP Upload 2.1.2 if (isset($HTTP_GET_VARS['GP_upload'])) { $ppu = new pureFileUpload(); $ppu->path = "../../imagens/capa"; $ppu->extensions = "GIF,JPG,JPEG,BMP,PNG"; $ppu->formName = "fm_criaalbum"; $ppu->storeType = "file"; $ppu->sizeLimit = "2000"; $ppu->nameConflict = "uniq"; $ppu->requireUpload = "true"; $ppu->minWidth = ""; $ppu->minHeight = ""; $ppu->maxWidth = ""; $ppu->maxHeight = ""; $ppu->saveWidth = ""; $ppu->saveHeight = ""; $ppu->timeout = "6600"; $ppu->progressBar = "fileCopyProgress.htm"; $ppu->progressWidth = "300"; $ppu->progressHeight = "100"; $ppu->checkVersion("2.1.2"); $ppu->doUpload(); } $GP_uploadAction = $HTTP_SERVER_VARS['PHP_SELF']; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) { $GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING']."&GP_upload=true"; } else { $GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING']; } } else { $GP_uploadAction .= "?"."GP_upload=true"; } // Rename Uploaded Files Addon 1.0.3 if (isset($HTTP_GET_VARS['GP_upload'])) { $ruf = new renameUploadedFiles($ppu); $ruf->renameMask = "capa_album.jpg"; $ruf->checkVersion("1.0.3"); $ruf->doRename(); } // Smart Image Processor 1.0.3 if (isset($HTTP_GET_VARS['GP_upload'])) { $sip = new resizeUploadedFiles($ppu); $sip->component = "GD"; $sip->resizeImages = "true"; $sip->aspectImages = "true"; $sip->maxWidth = "300"; $sip->maxHeight = "300"; $sip->quality = "300"; $sip->makeThumb = "false"; $sip->pathThumb = ""; $sip->aspectThumb = "true"; $sip->naming = "suffix"; $sip->suffix = "_small"; $sip->maxWidthThumb = ""; $sip->maxHeightThumb = ""; $sip->qualityThumb = "70"; $sip->checkVersion("1.0.3"); $sip->doResize(); } 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($editFormAction)) { if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "&GP_upload=true"; } } else { $editFormAction .= "?GP_upload=true"; } } if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "fm_criaalbum")) { $insertSQL = sprintf("INSERT INTO Anuncio_Autos (Data_anuncio, IDUsuario, Capa, Fabricante, Fabricante_modelo, Modelo, Ano, Combustivel, Bairro, Valor, Parcelamento, Telefone_Fixo, Telefone_Celular, Site, Email, Contato, `Descricao`) VALUES (now(), $IDUsuario, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )", GetSQLValueString($HTTP_POST_VARS['Capa'], "text"), GetSQLValueString($HTTP_POST_VARS['categoria'], "text"), GetSqlValueString($HTTP_POST_VARS['subcategoria'],"text"), GetSqlValueString($HTTP_POST_VARS['Modelo'],"text"), GetSqlValueString($HTTP_POST_VARS['Ano'],"text"), GetSqlValueString($HTTP_POST_VARS['Combustivel'],"text"), GetSqlValueString($HTTP_POST_VARS['Bairro'],"text"), GetSqlValueString($HTTP_POST_VARS['Valor'],"text"), GetSqlValueString($HTTP_POST_VARS['Parcelamento'],"text"), GetSqlValueString($HTTP_POST_VARS['Telefone_Fixo'],"text"), GetSqlValueString($HTTP_POST_VARS['Telefone_Celular'],"text"), GetSqlValueString($HTTP_POST_VARS['Site'],"text"), GetSqlValueString($HTTP_POST_VARS['Email'],"text"), GetSqlValueString($HTTP_POST_VARS['Contato'],"text"), GetSqlValueString($HTTP_POST_VARS['Descricao'],"text")); $IDUsuario = $_GET[IDUsuario]; mysql_select_db($database_conection, $conection); $Result1 = mysql_query($insertSQL, $conection) or die(mysql_error()); if ($insertSQL) { //aqui recupero o id do cadastro $IAn = mysql_insert_id($conection); //echo "<meta http-equiv='Refresh' content='0; url=recebe_strg.php?IdAnuncio=$IAn'>"; echo "<meta http-equiv='Refresh' content='0; url=incluir_foto2.php?IdAnuncio=$IAn'>"; /* Passando toString echo "<meta http-equiv='Refresh' content='0; url=acompanhar_validar.php?translate=$pid&session=$passw'>"; */ } } //antigo /*local que direciona pagina apos insert $insertGoTo = "editar_albuns.php"; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } */ ?> <!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>Cadastro de anuncio:</title> <style type="text/css"> <!-- .style5 { font-family: Arial, Helvetica, sans-serif; font-size: 12px; } .style6 { font-family: Arial, Helvetica, sans-serif; color:#999999; font-size: 11px; } .TituloFieldset { font-family:Arial, Helvetica, sans-serif; font-size: 16px; color:#FF0000; } .fieldset { border: solid #CCCCCC 1px; width: 600px; } --> </style> <script language='javascript' src='../../../ScriptLibrary/incPureUpload.js'></script> <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> <script src="SpryAssets/SpryValidationSelect.js" type="text/javascript"></script> <script src="SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script> <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" /> <!-- script ajax--> <script language="javascript">function list_dados( valor ) { http.open("GET", "result_passeio.php?id=" + valor, true); http.onreadystatechange = handleHttpResponse; http.send(null); } function handleHttpResponse() { campo_select = document.forms[0].subcategoria; if (http.readyState == 4) { campo_select.options.length = 0; results = http.responseText.split(","); for( i = 0; i < results.length; i++ ) { string = results[i].split( "|" ); campo_select.options[i] = new Option( string[0], string[1] ); } } } function getHTTPObject() {var req; try { if (window.XMLHttpRequest) { req = new XMLHttpRequest(); if (req.readyState == null) { req.readyState = 1; req.addEventListener("load", function () { req.readyState = 4; if (typeof req.onReadyStateChange == "function") req.onReadyStateChange(); }, false); } return req; } if (window.ActiveXObject) { var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"]; for (var i = 0; i < prefixes.length; i++) { try { req = new ActiveXObject(prefixes[i] + ".XmlHttp"); return req; } catch (ex) {}; } }} catch (ex) {} alert("XmlHttp Objects not supported by client browser");}var http = getHTTPObject();// Logo aps fazer a verificao, chamada a funo e passada // o valor varivel global http. </script> </head> <body> <fieldset class="fieldset"> <legend class="TituloFieldset">Cadastrar anúncio de autos</legend> <form action="<?php echo $editFormAction; ?>" method="post" enctype="multipart/form-data" name="fm_criaalbum" id="fm_criaalbum" > <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="right">&nbsp;</td> <td>&nbsp;</td> <td><span class="style6">* Arquivo de fotos suportados: .gif, .jpg e png tamanho maximo 1000Kb</span></td> </tr> <tr> <td width="140" align="right"><span class="style5">Foto Capa do Anúncio:</span></td> <td width="10">&nbsp;</td> <td><input name="Capa" type="file" id="Capa" onChange="checkOneFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',true,2000,'','','','','','')" size="40" /></td> </tr> <!-- menu TIPO --> <tr> <td width="140" align="right"><span class="style5">Fabricante:</span></td> <td width="10">&nbsp;</td> <td><span id="spryselect3"> <label> <select name="categoria" style="width:150px" onChange="list_dados( this.value )"> <?php $consulta = mysql_query("SELECT * FROM tbl_categorias where tipo = 'Passeio' ORDER BY nome ASC"); while( $row = mysql_fetch_assoc($consulta) ) { echo "<option value=\"{$row['codigo']}\">{$row['nome']}</option>\n";}?> </select> </label> <span class="selectRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- fim menu TIPO --> <!-- fabricante --> <tr> <td width="140" align="right"><span class="style5">Modelo fabricante:</span></td> <td width="10">&nbsp;</td> <td><span id="spryselect1"> <label> <select name="subcategoria" style="width:150px"> </select> </label> <span class="selectRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- Marca modelo --> <tr> <td width="140" align="right"><span class="style5">Modelo:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield2"> <input name="Modelo" type="text" id="Modelo" size="19" /> <span class="textfieldRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- Ano fabricação --> <tr> <td width="140" align="right"><span class="style5">Ano fabricação:</span></td> <td width="10">&nbsp;</td> <td><span id="spryselect2"> <select name="Ano" id="Ano" style="width:150px"> <option selected="selected"></option> <option value="1960">1960</option> <option value="1961">1961</option> <option value="1962">1962</option> <option value="1963">1963</option> <option value="1964">1964</option> <option value="1965">1965</option> <option value="1966">1966</option> <option value="1967">1967</option> <option value="1968">1968</option> <option value="1969">1969</option> <option value="1970">1970</option> <option value="1971">1971</option> <option value="1972">1972</option> <option value="1973">1973</option> <option value="1974">1974</option> <option value="1975">1975</option> <option value="1976">1976</option> <option value="1977">1977</option> <option value="1978">1978</option> <option value="1979">1979</option> <option value="1980">1980</option> <option value="1981">1981</option> <option value="1982">1982</option> <option value="1983">1983</option> <option value="1984">1984</option> <option value="1985">1985</option> <option value="1986">1986</option> <option value="1987">1987</option> <option value="1988">1988</option> <option value="1989">1989</option> <option value="1990">1990</option> <option value="1991">1991</option> <option value="1992">1992</option> <option value="1993">1993</option> <option value="1994">1994</option> <option value="1995">1995</option> <option value="1996">1996</option> <option value="1997">1997</option> <option value="1998">1998</option> <option value="1999">1999</option> <option value="2000">2000</option> <option value="2001">2001</option> <option value="2002">2002</option> <option value="2003">2003</option> <option value="2004">2004</option> <option value="2005">2005</option> <option value="2006">2006</option> <option value="2007">2007</option> <option value="2008">2008</option> <option value="2009">2009</option> </select> <span class="selectRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- Esta com erro --> <!-- Combustivel --> <tr> <td align="right"><span class="style5">Combustível:</span></td> <td>&nbsp;</td> <td><span id="spryselect7"> <label> <select name="Combustivel" id="Combustivel" style="width:150px"> <option selected="selected"></option> <option value="Alcool">Alcool</option> <option value="Diesel">Diesel</option> <option value="Flex">Flex</option> <option value="Gasolina">Gasolina</option> <option value="Gasolina/GNV">Gasolina/GNV</option> </select> </label> <span class="selectRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- Bairro --> <tr> <td width="140" align="right"><span class="style5">Bairro:</span></td> <td width="10">&nbsp;</td> <td><span id="spryselect4"> <select name="Bairro" id="Bairro" style="width:150px"> <option selected="selected"></option> <option value="bangu">Bangu</option> <option value="barra de guaratiba">Barra de Guaratiba</option> <option value="campo grande">Campo Grande</option> <option value="ilha de guaratiba">Ilha de Guaratiba</option> <option value="magarça">Magarça</option> <option value="padre miguel">Padre Miguel</option> <option value="pedra de guaratiba">Pedra de Guaratiba</option> <option value="realengo">Realengo</option> <option value="santa cruz">Santa Cruz</option> <option value="sulacap">Sulacap</option> </select> <span class="selectRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- Valor --> <tr> <td width="140" align="right"><span class="style5">Valor R$:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield3"> <input name="Valor" type="text" id="Valor" size="19" /> <span class="textfieldRequiredMsg">Obrigatório!</span><span class="textfieldInvalidFormatMsg">*Separar centavos por ponto Ex.:1000.30</span></span></td> </tr> <tr> <td width="140" align="right"><span class="style5">Condições & Parcelamentos:</span></td> <td width="10">&nbsp;</td> <td><span id="spryselect5"> <select name="Parcelamento" id="Parcelamento" style="width:280px"> <option selected="selected"></option> <option value="A Vista">À vista</option> <option value="Em até 12X">Parcelamos em até 12X</option> <option value="Em até 18X">Parcelamos em até 18X</option> <option value="Em até 24X">Parcelamos em até 24X</option> <option value="Em até 36X">Parcelamos em até 36X</option> <option value="Em até 48X">Parcelamos em até 48X</option> <option value="Em até 60X">Parcelamos em até 60X</option> <option value="Consulte">Consulte outros parcelamentos</option> </select> <span class="selectRequiredMsg">Obrigatório.</span></span></td> </tr> <!-- telefone --> <tr> <td width="140" align="right"><span class="style5">Telefone:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield4"> <input name="Telefone_Fixo" type="text" id="Telefone_Fixo" size="19" /> <span class="textfieldRequiredMsg">Obrigatório!</span><span class="textfieldInvalidFormatMsg">Inválido, Ex.:2222-2222!</span></span></td> </tr> <!-- Celular --> <tr> <td width="140" align="right"><span class="style5">Celular:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield7"> <input name="Telefone_Celular" type="text" id="Telefone_Celular" size="19" /> <span class="textfieldInvalidFormatMsg">Inválido, Ex.:2222-2222!</span></span></td> </tr> <!-- Site --> <tr> <td width="140" align="right"><span class="style5">Site:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield8"> <input name="Site" type="text" id="Site" size="40" /> <span class="textfieldRequiredMsg">Obrigatório!</span><span class="textfieldInvalidFormatMsg">Inválido! Ex. http://www.tonobairro.com.br</span></span></td> </tr> <!-- email --> <tr> <td width="140" align="right"><span class="style5">E-mail:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield9"> <input name="Email" type="text" id="Email" size="40" /> <span class="textfieldRequiredMsg">Obrigatório!.</span><span class="textfieldInvalidFormatMsg">E-mail inválido!</span></span></td> </tr> <!-- Contato --> <tr> <td width="140" align="right"><span class="style5">Contato:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield5"> <input name="Contato" type="text" id="Contato" size="40" /> <span class="textfieldRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- descrição --> <tr> <td align="right">&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td align="right">&nbsp;</td> <td>&nbsp;</td> <td><span class="style6">* Espaço reservado para descrição de acessórios e outros.</span></td> </tr> <tr> <td width="140" align="right"><span class="style5">Descrição:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield5"><span id="sprytextarea1"> <label> <textarea name="Descricao" id="Descricao" cols="50" rows="5"></textarea> <span id="countsprytextarea1">&nbsp;</span> <span class="textareaMinCharsMsg">Descrição mínima com 20 caracter!</span> <span class="textareaMaxCharsMsg">Máxímo de caracter 250.</span></label> </span> <span class="textfieldRequiredMsg">Obrigatório!</span></span></td> </tr> <tr> <td align="right">&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td width="140" align="right"><span class="style6"></span></td> <td width="10">&nbsp;</td> <td><input type="submit" name="btn_criaalbum" id="btn_criaalbum" value="Enviar Anúncio" /> <label></label></td> </tr> <tr> <td align="right">&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> <input type="hidden" name="MM_insert" value="fm_criaalbum"> </form> </fieldset> <script type="text/javascript"> <!-- var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["blur"]}); var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {validateOn:["blur"]}); var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {validateOn:["blur"]}); var spryselect2 = new Spry.Widget.ValidationSelect("spryselect2", {validateOn:["blur"]}); var spryselect3 = new Spry.Widget.ValidationSelect("spryselect3", {validateOn:["blur"]}); var spryselect4 = new Spry.Widget.ValidationSelect("spryselect4", {validateOn:["blur"]}); var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "currency", {validateOn:["blur"]}); var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "phone_number", {validateOn:["blur"], format:"phone_custom", pattern:"0000-0000"}); var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "none", {validateOn:["blur"]}); var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield6", "none", {validateOn:["blur"]}); var spryselect5 = new Spry.Widget.ValidationSelect("spryselect5", {validateOn:["blur"]}); var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7", "phone_number", {format:"phone_custom", pattern:"0000-0000", validateOn:["blur"], isRequired:false}); var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8", "url", {validateOn:["blur"], isRequired:false}); var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9", "email", {validateOn:["blur"], isRequired:false}); var sprytextarea1 = new Spry.Widget.ValidationTextarea("sprytextarea1", {isRequired:false, minChars:20, maxChars:250, counterId:"countsprytextarea1", counterType:"chars_count", validateOn:["blur"]}); var spryselect6 = new Spry.Widget.ValidationSelect("spryselect6", {validateOn:["blur"]}); var spryselect7 = new Spry.Widget.ValidationSelect("spryselect7", {validateOn:["blur"]}); //--> </script> </body> </html> Boa galera Vlw
  4. shelter

    mysql_num_rows()

    Boa galera aqui, tenho um aplicativo em uso esta função, legal aqui em meu servidor local tudo OK funcona na boa em meu servidor recebo este erro: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource. Algum amigo poderia me ajudar? Boa Galera
  5. shelter

    upload

    Boa grato , vou dar uma olhada no assunto ...E AQUI VLW mesmo pela informação. Abraços Shelter
  6. shelter

    upload

    desculpa a ignorancia, o que seria? o que seria: Deu o chmod nas pastas? Poderia me ajudar Grato
  7. shelter

    upload

    Boa galera, tenho um sistema de anuncio em que o cliente coloca o anuncio com figura, qual o drama , aqui em meu servidor local tudo bem TUDO FUNCIONA, mais quando coloco em meu provedor , quando tento fazer o upload de uma figura recebo a seguinte mesnsagem de erro: Not enough permissions File ../../imagens/capa/1a287752_570_235.jpg can not be created, Set the permissions of the parentmap correctly Please correct and try again Warning: unlink(../../imagens/capa/1a287752_570_235.jpg) [function.unlink]: No such file or directory in /home/valmir/public_html/g/ScriptLibrary/incPureUpload.php on line 378 <?php // --- Pure PHP File Upload ----------------------------------------------------- // Copyright 2003 (c) George Petrov, Patrick Woldberg, www.DMXzone.com // // Version: 2.1.2 // ------------------------------------------------------------------------------ class pureFileUpload { // Set version var $version = '2.1.2'; var $debugger = false; // Define variables var $path; var $extensions; var $redirectURL; var $storeType; var $sizeLimit; var $nameConflict; var $minWidth; var $minHeight; var $maxWidth; var $maxHeight; var $saveWidth; var $saveHeight; var $timeout; var $fullpath; var $uploadedFile; var $uploadedFiles; var $addOns; function pureFileUpload() { global $DMX_debug; $this->uploadedFile = new fileInfo($this); $this->uploadedFiles = array(); $this->addOns = array(); $this->debugger = $DMX_debug; $this->debug("<br/><font color=\"#009900\"><b>Pure PHP Upload version ".$this->version."</b></font><br/><br/>"); } // Check if version is uptodate function checkVersion($version) { if ($version < $this->version) { $this->error('version'); } } // Cleanup illegal characters function cleanUpFileName(&$file) { $this->debug("<b>CleanUp FileName</b><br/>"); $fileName = $file->getFileName(); $fileName = substr($fileName, strrpos($fileName, ':')); $fileName = preg_replace("/\s+|;|\+|=|\[|\]|'|,|\\|\"|\*|<|>|\/|\?|\:|\|/i", "_", $fileName); $this->debug("new filename = <font color=\"#000099\"><b>".$fileName."</b></font><br/>"); $file->setFileName($fileName); } // Check the dimensions of the image function checkImageDimension(&$file) { global $HTTP_POST_VARS; $this->debug("<b>Checking Image Dimension</b><br/>"); // Get the imageSize if ($imageSize = GetImageSize($this->path.'/'.$file->fileName)) { $this->debug("imageWidth = <font color=\"#000099\"><b>".$imageSize[0]."</b></font><br/>"); $this->debug("imageHeight = <font color=\"#000099\"><b>".$imageSize[1]."</b></font><br/>"); // Check if it isn't to small if (($this->minWidth <> '' && $imageSize[0] < $this->minWidth) || ($this->minHeight <> '' && $imageSize[1] < $this->minHeight)) { $this->error('smallSize', $file->fileName); } // Check if it isn't to big if (($this->maxWidth <> '' && $imageSize[0] > $this->maxWidth) || ($this->maxHeight <> '' && $imageSize[1] > $this->maxHeight)) { $this->error('bigSize', $file->fileName); } // Set the post vars with the imageSize $this->debug("Setting the imagesize in formfields<br/>"); $file->setImageSize($imageSize[0], $imageSize[1]); $HTTP_POST_VARS[$this->saveWidth] = $imageSize[0]; $HTTP_POST_VARS[$this->saveHeight] = $imageSize[1]; } } // Check if directory exist and create if needed function checkDir($dir) { $this->debug("<b>Check path</b><br/>"); if (!is_dir($dir)) { $this->debug("path does not exist<br/>"); // Break directory apart $dirs = explode('/', $dir); $tempDir = $dirs[0]; $check = false; for ($i = 1; $i < count($dirs); $i++) { $this->debug("Checking ".$tempDir."<br/>"); if (is_writeable($tempDir)) { $check = true; } else { $error = $tempDir; } $tempDir .= '/'.$dirs[$i]; // Check if directory exist if (!is_dir($tempDir)) { if ($check) { // Create directory $this->debug("Creating ".$tempDir."<br/>"); mkdir($tempDir, 0777); chmod($tempDir, 0777); } else { // Not enough permissions $this->error('permission', $error); } } } } } // Check the fileSize function checkFileSize(&$file) { $this->debug("<b>Checking fileSize</b><br/>"); if ($this->sizeLimit < $file->fileSize) { $this->error('size', $file->fileName); } } // Check if the extension is allowed function checkExtension(&$file) { $this->debug("<b>Checking extension</b><br/>"); $allow = false; // Loop thrue the extensions foreach (split(',', $this->extensions) as $extension) { // Check if it is allowed $this->debug("comparing <font color=\"#000099\"><b>".strtoupper($file->extension)."</b></font> with <font color=\"#000099\"><b>".strtoupper($extension)."</b></font><br/>"); if (strtoupper($file->extension) == strtoupper($extension)) { $allow = true; } } // Give error when not allowed if (!$allow && $file->fileName <> '') { $this->error('extension', $file->fileName); } } // Create an unique name if file exists function createUniqName($fileName) { $this->debug("<b>Creating a unique name</b><br/>"); $uniq = 0; $name = substr($fileName, 0, strrpos($fileName, '.')); $extension = substr($fileName, strrpos($fileName, '.')+1); while (++$uniq) { // Check if file does not exist $this->debug("Checking <font color=\"#000099\"><b>".$name.'_'.$uniq.'.'.$extension."</b></font><br/>"); if (!file_exists($this->path.'/'.$name.'_'.$uniq.'.'.$extension)) { // Return an uniq filename return ($name.'_'.$uniq.'.'.$extension); } } } // Move the file to the given location function moveFile($source, $destination) { $this->debug("<b>Moving the file to the destination</b><br/>"); // Check if you have write permissions $this->debug("Checking permissions<br/>"); if (is_writeable($this->path)) { if (move_uploaded_file($source, $destination)) { // Change file permissions chmod($destination, 0644); // Add filename to array with done files $this->done[] = $destination; $this->debug("file moved to <font color=\"#000099\"><b>".$destination."</b></font><br/>"); } else { // Give an error if no write permissions $this->error('writePerm', $destination); } } else { // Give an error if no write permissions $this->error('writePerm', $destination); } } function error($error, $extra) { switch ($error) { // Incorrect version case 'version': echo "<b>You don't have latest version of incPHPupload.php uploaded on the server.</b><br/>"; echo "This library is required for the current page.<br/>"; break; // Not enough permissions to create folder case 'permission': echo "<b>Not enough permissions</b><br/><br/>"; echo "Folder <b>".$extra."</b> can not be created,<br/>"; echo "Set the permissions of the parentmap correctly<br/>"; break; // Not enough permissions to write an file case 'writePerm': echo "<b>Not enough permissions</b><br/><br/>"; echo "File <b>".$extra."</b> can not be created,<br/>"; echo "Set the permissions of the parentmap correctly<br/>"; break; // The imagesize is to small case 'smallSize': echo "<b>Imagesize exceeds limit!</b><br/><br/>"; echo "Uploaded Image ".$extra." is too small!<br/>"; echo "Should be at least ".$this->minWidth." x ".$this->minHeight."<br/>"; break; // The imagesize is to big case 'bigSize': echo "<b>Imagesize exceeds limit!</b><br/><br/>"; echo "Uploaded Image ".$extra." is too big!<br/>"; echo "Should be max ".$this->maxWidth." x ".$this->maxHeight."<br/>"; break; // Filesize is to big case 'size': echo "<b>Size exceeds limit!</b><br/><br/>"; echo "Filename: ".$extra."<br/>"; echo "Upload size exceeds limit of ".$this->sizeLimit." kb<br/>"; break; // Extension is not allowed case 'extension': echo "<b>Extension is not allowed!</b><br/><br/>"; echo "Filename: ".$extra."<br/>"; echo "Only the following file extensions are allowed: ".$this->extensions."<br/>"; echo "Please select another file and try again.<br/>"; break; // There was an error with the uploaded file case 'empty': echo "<b>An error has occured saving uploaded file!</b><br/><br/>"; echo "Filename: ".$extra."<br/>"; echo "File is not uploaded correctly or is empty.<br/>"; break; // File exists case 'exist': echo "<b>File already exists!</b><br/><br/>"; echo "Filename: ".$extra."<br/>"; break; } // Allow to go back and stop the script echo "Please correct and <a href=\"java script:history.back(1)\">try again</a>"; $this->failUpload(); // Stop the script exit; } function doUpload() { global $HTTP_POST_VARS,$HTTP_SERVER_VARS,$HTTP_POST_FILES; // Debugger info $this->debug("PHP version(<font color=\"#990000\">".phpversion()."</font>)<br/>"); $this->debug("path(<font color=\"#990000\">".$this->path."</font>)<br/>"); $this->debug("extensions(<font color=\"#990000\">".$this->extensions."</font>)<br/>"); $this->debug("redirectURL(<font color=\"#990000\">".$this->redirectURL."</font>)<br/>"); $this->debug("storeType(<font color=\"#990000\">".$this->storeType."</font>)<br/>"); $this->debug("sizeLimit(<font color=\"#990000\">".$this->sizeLimit."</font>)<br/>"); $this->debug("nameConflict(<font color=\"#990000\">".$this->nameConflict."</font>)<br/>"); $this->debug("minWidth(<font color=\"#990000\">".$this->minWidth."</font>)<br/>"); $this->debug("minHeight(<font color=\"#990000\">".$this->minHeight."</font>)<br/>"); $this->debug("maxWidth(<font color=\"#990000\">".$this->maxWidth."</font>)<br/>"); $this->debug("maxHeight(<font color=\"#990000\">".$this->maxHeight."</font>)<br/>"); $this->debug("saveWidth(<font color=\"#990000\">".$this->saveWidth."</font>)<br/>"); $this->debug("saveHeight(<font color=\"#990000\">".$this->saveHeight."</font>)<br/>"); $this->debug("timeout(<font color=\"#990000\">".$this->timeout."</font>)<br/>"); // Set the timeout $this->debug("Setting timeout<br/>"); @set_time_limit($this->timeout); // Get the fullpath $this->fullPath = '/'.substr($HTTP_SERVER_VARS['PHP_SELF'], 1, strrpos($HTTP_SERVER_VARS['PHP_SELF'], '/')).$this->path.'/'; $this->debug("fullPath = <font color=\"#000099\"><b>".$this->fullPath."</b></font><br/>"); // Check if directory exists and create if needed $this->checkDir($this->path); // Go through all the files $this->debug("<b>Starting to progress files</b><br/>"); foreach ($HTTP_POST_FILES as $field => $value) { $file = new fileInfo($this); $file->field = $field; $file->setfileName($HTTP_POST_FILES[$field]['name'],$HTTP_POST_FILES[$field]['size']); $this->debug("field = <font color=\"#000099\"><b>".$file->field."</b></font><br/>"); $this->debug("filename = <font color=\"#000099\"><b>".$file->fileName."</b></font><br/>"); // Clean file from illegal characters $this->cleanUpFileName($file); // Check filesize if limit is given if ($this->sizeLimit <> '') { $this->checkFileSize($file); } // Check the filename extension if ($this->extensions <> '') { $this->checkExtension($file); } // Check if file is uploaded correctly if (is_uploaded_file($HTTP_POST_FILES[$field]['tmp_name'])) { // Check if filename exists if (file_exists($this->path.'/'.$file->fileName)) { // What to do if filename exists switch ($this->nameConflict) { // Overwrite the file case 'over': $this->debug("Overwrite existing file<br/>"); $this->moveFile($HTTP_POST_FILES[$field]['tmp_name'], $this->path.'/'.$file->fileName); break; // Give error message case 'error': $this->debug("Error<br/>"); $this->error('exist', $file->fileName); break; // Make an unique name case 'uniq': $file->setFileName($this->createUniqName($file->fileName)); $this->moveFile($HTTP_POST_FILES[$field]['tmp_name'], $this->path.'/'.$file->fileName); break; } } else { // If filename does not exist $this->moveFile($HTTP_POST_FILES[$field]['tmp_name'], $this->path.'/'.$file->fileName); } // Check the imagesize $this->checkImageDimension($file); // Put fileinfo in array $this->uploadedFiles[$field] = $file; } elseif ($file->fileName <> '') { // The file is 0 in size or is not uploaded correctly $this->error('empty', $file->fileName); } else { // No file is uploaded $HTTP_POST_VARS[$field] = ''; } } // Recreate the redirectURL if ($this->redirectURL <> '') { if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $this->redirectURL .= (strpos($this->redirectURL, '?')) ? '&' : '?'; $this->redirectURL .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf("Location: %s", $this->redirectURL)); } } // Debugger function debug($info) { if ($this->debugger) { echo "<font face=\"verdana\" size=\"2\">".$info."</font>"; } } // Register addons and put them in an array function registerAddOn(&$addOn) { array_push($this->addOns, $addOn); } function failUpload() { foreach ($this->addOns as $addOn) { $addOn->cleanUp(); } // Check if some files are already uploaded if (isset($this->uploadedFiles)) { if (count($this->uploadedFiles) > 0) { foreach ($this->uploadedFiles as $file) { // Delete the file unlink($this->path.'/'.$file->fileName); } } } } } class pureUploadAddon { var $upload; function pureUploadAddon(&$upload) { $this->upload = &$upload; } function cleanUp() { } } class fileInfo { var $field; var $fileName; var $fileSize; var $filePath; var $thumbFileName; var $thumbName; var $thumbExtension; var $thumbSize; var $thumbPath; var $thumbNaming; var $thumbSuffix; var $name; var $extension; var $imageWidth; var $imageHeight; var $thumbWidth; var $thumbHeight; var $upload; function fileInfo(&$upload) { $this->upload = &$upload; } function setFileName($newFileName, $fileSize = "") { global $HTTP_POST_VARS; $this->fileName = $newFileName; $this->filePath = $this->upload->path; $this->name = substr($newFileName, 0, strrpos($newFileName, '.')); $this->extension = substr($newFileName, strrpos($newFileName, '.')+1); if ($fileSize == "") { if (file_exists($this->upload->path."/".$this->fileName)) { $this->fileSize = round((filesize($this->upload->path."/".$this->fileName)/1024), 0); } } else { $this->fileSize = round(($fileSize/1024), 0); } if ($this->upload->storeType == 'path') { $HTTP_POST_VARS[$this->field] = $this->upload->fullPath.$this->fileName; } else { $HTTP_POST_VARS[$this->field] = $this->fileName; } $this->upload->uploadedFiles[$this->field] = $this; } function setThumbFileName($newFileName, $path, $naming, $suffix) { $this->thumbFileName = $newFileName; $this->thumbPath = $path; $this->thumbNaming = $naming; $this->thumbSuffix = $suffix; $this->thumbName = substr($newFileName, 0, strrpos($newFileName, '.')); $this->thumbExtension = substr($newFileName, strrpos($newFileName, '.')+1); if (file_exists($path."/".$this->thumbFileName)) { $this->thumbSize = round((filesize($path."/".$this->thumbFileName)/1024), 0); } $this->upload->uploadedFiles[$this->field] = $this; } function setThumbSize($width, $height) { $this->thumbWidth = $width; $this->thumbHeight = $height; $this->upload->uploadedFiles[$this->field] = $this; } function setImageSize($width, $height) { $this->imageWidth = $width; $this->imageHeight = $height; $this->upload->uploadedFiles[$this->field] = $this; } function getFileName() { return $this->fileName; } function getThumbFileName() { return $this->thumbFileName; } } ?> Então alguém saberia me falar o que posso fazer para coriigir este erro. Grato aos amigo. Abraços Shelter
  8. Agradeço a ajuda dos amigos, + resolvi da seguinte forma : mysql_insert_id($conection) Obrigado pela ajuda galera Abraços e fiquem com deus
  9. Então amigo agradeço a sua ajuda +, fiz e não funcionou , continua me retornando o valor como 0.
  10. Amigo boa, Não entendi, se pode me explicar melhor. Abç vlw mesmo
  11. Boa galera, Aqui estou tentando recuperar o id ( registro ) de um cadastro + não estou conseguindo, estou tentando assim $recebe = mysql_insert_id(); Ele passa o registro como 0. Segue abaixo o código inteiro.... <?php require_once('../../../Connections/conection.php'); ?> <?php $con = mysql_connect("localhost", "root", "1272"); mysql_select_db("Cadastro"); ?> <?php require_once('../../../ScriptLibrary/incPureUpload.php'); ?> <?php require_once('../../../ScriptLibrary/incResize.php'); ?> <?php require_once('../../../ScriptLibrary/incPUAddOn.php'); ?> <?php // Pure PHP Upload 2.1.2 if (isset($HTTP_GET_VARS['GP_upload'])) { $ppu = new pureFileUpload(); $ppu->path = "../../imagens/capa"; $ppu->extensions = "GIF,JPG,JPEG,BMP,PNG"; $ppu->formName = "fm_criaalbum"; $ppu->storeType = "file"; $ppu->sizeLimit = "2000"; $ppu->nameConflict = "uniq"; $ppu->requireUpload = "true"; $ppu->minWidth = ""; $ppu->minHeight = ""; $ppu->maxWidth = ""; $ppu->maxHeight = ""; $ppu->saveWidth = ""; $ppu->saveHeight = ""; $ppu->timeout = "6600"; $ppu->progressBar = "fileCopyProgress.htm"; $ppu->progressWidth = "300"; $ppu->progressHeight = "100"; $ppu->checkVersion("2.1.2"); $ppu->doUpload(); } $GP_uploadAction = $HTTP_SERVER_VARS['PHP_SELF']; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) { $GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING']."&GP_upload=true"; } else { $GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING']; } } else { $GP_uploadAction .= "?"."GP_upload=true"; } // Rename Uploaded Files Addon 1.0.3 if (isset($HTTP_GET_VARS['GP_upload'])) { $ruf = new renameUploadedFiles($ppu); $ruf->renameMask = "capa_album.jpg"; $ruf->checkVersion("1.0.3"); $ruf->doRename(); } // Smart Image Processor 1.0.3 if (isset($HTTP_GET_VARS['GP_upload'])) { $sip = new resizeUploadedFiles($ppu); $sip->component = "GD"; $sip->resizeImages = "true"; $sip->aspectImages = "true"; $sip->maxWidth = "300"; $sip->maxHeight = "300"; $sip->quality = "300"; $sip->makeThumb = "false"; $sip->pathThumb = ""; $sip->aspectThumb = "true"; $sip->naming = "suffix"; $sip->suffix = "_small"; $sip->maxWidthThumb = ""; $sip->maxHeightThumb = ""; $sip->qualityThumb = "70"; $sip->checkVersion("1.0.3"); $sip->doResize(); } 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($editFormAction)) { if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "&GP_upload=true"; } } else { $editFormAction .= "?GP_upload=true"; } } if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "fm_criaalbum")) { $insertSQL = sprintf("INSERT INTO Anuncio_Autos (Data_anuncio, Capa, Fabricante, Fabricante_modelo, Modelo, Ano, Combustivel, Bairro, Valor, Parcelamento, Telefone_Fixo, Telefone_Celular, Site, Email, Contato, `Descricao`) VALUES (now(), %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )", GetSQLValueString($HTTP_POST_VARS['Capa'], "text"), GetSQLValueString($HTTP_POST_VARS['categoria'], "text"), GetSqlValueString($HTTP_POST_VARS['subcategoria'],"text"), GetSqlValueString($HTTP_POST_VARS['Modelo'],"text"), GetSqlValueString($HTTP_POST_VARS['Ano'],"text"), GetSqlValueString($HTTP_POST_VARS['Combustivel'],"text"), GetSqlValueString($HTTP_POST_VARS['Bairro'],"text"), GetSqlValueString($HTTP_POST_VARS['Valor'],"text"), GetSqlValueString($HTTP_POST_VARS['Parcelamento'],"text"), GetSqlValueString($HTTP_POST_VARS['Telefone_Fixo'],"text"), GetSqlValueString($HTTP_POST_VARS['Telefone_Celular'],"text"), GetSqlValueString($HTTP_POST_VARS['Site'],"text"), GetSqlValueString($HTTP_POST_VARS['Email'],"text"), GetSqlValueString($HTTP_POST_VARS['Contato'],"text"), GetSqlValueString($HTTP_POST_VARS['Descricao'],"text")); mysql_select_db($database_conection, $conection); $Result1 = mysql_query($insertSQL, $conection) or die(mysql_error()); if ($insertSQL) { //aqui tento recuperar o id do cadastro $IAn = mysql_insert_id(); echo "<meta http-equiv='Refresh' content='0; url=incluir_foto.php?IdAnuncio=$IAn'>"; /* Passando toString echo "<meta http-equiv='Refresh' content='0; url=acompanhar_validar.php?translate=$pid&session=$passw'>"; */ } } //antigo /*local que direciona pagina apos insert $insertGoTo = "editar_albuns.php"; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } */ ?> <!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"> <!-- .style5 { font-family: Arial, Helvetica, sans-serif; font-size: 12px; } .style6 { font-family: Arial, Helvetica, sans-serif; color:#999999; font-size: 11px; } .TituloFieldset { font-family:Arial, Helvetica, sans-serif; font-size: 16px; color:#FF0000; } .fieldset { border: solid #CCCCCC 1px; width: 600px; } --> </style> <script language='javascript' src='../../../ScriptLibrary/incPureUpload.js'></script> <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> <script src="SpryAssets/SpryValidationSelect.js" type="text/javascript"></script> <script src="SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script> <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" /> <!-- script ajax--> <script language="javascript">function list_dados( valor ) { http.open("GET", "result_passeio.php?id=" + valor, true); http.onreadystatechange = handleHttpResponse; http.send(null); } function handleHttpResponse() { campo_select = document.forms[0].subcategoria; if (http.readyState == 4) { campo_select.options.length = 0; results = http.responseText.split(","); for( i = 0; i < results.length; i++ ) { string = results[i].split( "|" ); campo_select.options[i] = new Option( string[0], string[1] ); } } } function getHTTPObject() {var req; try { if (window.XMLHttpRequest) { req = new XMLHttpRequest(); if (req.readyState == null) { req.readyState = 1; req.addEventListener("load", function () { req.readyState = 4; if (typeof req.onReadyStateChange == "function") req.onReadyStateChange(); }, false); } return req; } if (window.ActiveXObject) { var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"]; for (var i = 0; i < prefixes.length; i++) { try { req = new ActiveXObject(prefixes[i] + ".XmlHttp"); return req; } catch (ex) {}; } }} catch (ex) {} alert("XmlHttp Objects not supported by client browser");}var http = getHTTPObject();// Logo aps fazer a verificao, chamada a funo e passada // o valor varivel global http. </script> </head> <body> <fieldset class="fieldset"> <legend class="TituloFieldset">Cadastrar anúncio de autos</legend> <form action="<?php echo $editFormAction; ?>" method="post" enctype="multipart/form-data" name="fm_criaalbum" id="fm_criaalbum" > <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="right">&nbsp;</td> <td>&nbsp;</td> <td><span class="style6">* Arquivos de fotos suportados:</span></td> </tr> <tr> <td width="140" align="right"><span class="style5">Foto Capa do Anúncio:</span></td> <td width="10">&nbsp;</td> <td><input name="Capa" type="file" id="Capa" onChange="checkOneFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',true,2000,'','','','','','')" size="40" /></td> </tr> <!-- menu TIPO --> <tr> <td width="140" align="right"><span class="style5">Fabricante:</span></td> <td width="10">&nbsp;</td> <td><span id="spryselect3"> <label> <select name="categoria" style="width:150px" onChange="list_dados( this.value )"> <?php $consulta = mysql_query("SELECT * FROM tbl_categorias where tipo = 'Passeio' ORDER BY nome ASC"); while( $row = mysql_fetch_assoc($consulta) ) { echo "<option value=\"{$row['codigo']}\">{$row['nome']}</option>\n";}?> </select> </label> <span class="selectRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- fim menu TIPO --> <!-- fabricante --> <tr> <td width="140" align="right"><span class="style5">Modelo fabricante:</span></td> <td width="10">&nbsp;</td> <td><span id="spryselect1"> <label> <select name="subcategoria" style="width:150px"> </select> </label> <span class="selectRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- Marca modelo --> <tr> <td width="140" align="right"><span class="style5">Modelo:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield2"> <input name="Modelo" type="text" id="Modelo" size="19" /> <span class="textfieldRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- Ano fabricação --> <tr> <td width="140" align="right"><span class="style5">Ano fabricação:</span></td> <td width="10">&nbsp;</td> <td><span id="spryselect2"> <select name="Ano" id="Ano" style="width:150px"> <option selected="selected"></option> <option value="1960">1960</option> <option value="1961">1961</option> <option value="1962">1962</option> <option value="1963">1963</option> <option value="1964">1964</option> <option value="1965">1965</option> <option value="1966">1966</option> <option value="1967">1967</option> <option value="1968">1968</option> <option value="1969">1969</option> <option value="1970">1970</option> <option value="1971">1971</option> <option value="1972">1972</option> <option value="1973">1973</option> <option value="1974">1974</option> <option value="1975">1975</option> <option value="1976">1976</option> <option value="1977">1977</option> <option value="1978">1978</option> <option value="1979">1979</option> <option value="1980">1980</option> <option value="1981">1981</option> <option value="1982">1982</option> <option value="1983">1983</option> <option value="1984">1984</option> <option value="1985">1985</option> <option value="1986">1986</option> <option value="1987">1987</option> <option value="1988">1988</option> <option value="1989">1989</option> <option value="1990">1990</option> <option value="1991">1991</option> <option value="1992">1992</option> <option value="1993">1993</option> <option value="1994">1994</option> <option value="1995">1995</option> <option value="1996">1996</option> <option value="1997">1997</option> <option value="1998">1998</option> <option value="1999">1999</option> <option value="2000">2000</option> <option value="2001">2001</option> <option value="2002">2002</option> <option value="2003">2003</option> <option value="2004">2004</option> <option value="2005">2005</option> <option value="2006">2006</option> <option value="2007">2007</option> <option value="2008">2008</option> <option value="2009">2009</option> </select> <span class="selectRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- Esta com erro --> <!-- Combustivel --> <tr> <td align="right"><span class="style5">Combustível:</span></td> <td>&nbsp;</td> <td><span id="spryselect7"> <label> <select name="Combustivel" id="Combustivel" style="width:150px"> <option selected="selected"></option> <option value="Alcool">Alcool</option> <option value="Diesel">Diesel</option> <option value="Flex">Flex</option> <option value="Gasolina">Gasolina</option> <option value="Gasolina/GNV">Gasolina/GNV</option> </select> </label> <span class="selectRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- Bairro --> <tr> <td width="140" align="right"><span class="style5">Bairro:</span></td> <td width="10">&nbsp;</td> <td><span id="spryselect4"> <select name="Bairro" id="Bairro" style="width:150px"> <option selected="selected"></option> <option value="bangu">Bangu</option> <option value="barra de guaratiba">Barra de Guaratiba</option> <option value="campo grande">Campo Grande</option> <option value="ilha de guaratiba">Ilha de Guaratiba</option> <option value="magarça">Magarça</option> <option value="padre miguel">Padre Miguel</option> <option value="pedra de guaratiba">Pedra de Guaratiba</option> <option value="realengo">Realengo</option> <option value="santa cruz">Santa Cruz</option> <option value="sulacap">Sulacap</option> </select> <span class="selectRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- Valor --> <tr> <td width="140" align="right"><span class="style5">Valor R$:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield3"> <input name="Valor" type="text" id="Valor" size="19" /> <span class="textfieldRequiredMsg">Obrigatório!</span><span class="textfieldInvalidFormatMsg">*Separar centavos por ponto Ex.:1000.30</span></span></td> </tr> <tr> <td width="140" align="right"><span class="style5">Condições & Parcelamentos:</span></td> <td width="10">&nbsp;</td> <td><span id="spryselect5"> <select name="Parcelamento" id="Parcelamento" style="width:280px"> <option selected="selected"></option> <option value="A Vista">À vista</option> <option value="Em até 12X">Parcelamos em até 12X</option> <option value="Em até 18X">Parcelamos em até 18X</option> <option value="Em até 24X">Parcelamos em até 24X</option> <option value="Em até 36X">Parcelamos em até 36X</option> <option value="Em até 48X">Parcelamos em até 48X</option> <option value="Em até 60X">Parcelamos em até 60X</option> <option value="Consulte">Consulte outros parcelamentos</option> </select> <span class="selectRequiredMsg">Obrigatório.</span></span></td> </tr> <!-- telefone --> <tr> <td width="140" align="right"><span class="style5">Telefone:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield4"> <input name="Telefone_Fixo" type="text" id="Telefone_Fixo" size="19" /> <span class="textfieldRequiredMsg">Obrigatório!</span><span class="textfieldInvalidFormatMsg">Inválido, Ex.:2222-2222!</span></span></td> </tr> <!-- Celular --> <tr> <td width="140" align="right"><span class="style5">Celular:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield7"> <input name="Telefone_Celular" type="text" id="Telefone_Celular" size="19" /> <span class="textfieldInvalidFormatMsg">Inválido, Ex.:2222-2222!</span></span></td> </tr> <!-- Site --> <tr> <td width="140" align="right"><span class="style5">Site:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield8"> <input name="Site" type="text" id="Site" size="40" /> <span class="textfieldRequiredMsg">Obrigatório!</span><span class="textfieldInvalidFormatMsg">Inválido! Ex. http://www.tonobairro.com.br</span></span></td> </tr> <!-- email --> <tr> <td width="140" align="right"><span class="style5">E-mail:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield9"> <input name="Email" type="text" id="Email" size="40" /> <span class="textfieldRequiredMsg">Obrigatório!.</span><span class="textfieldInvalidFormatMsg">E-mail inválido!</span></span></td> </tr> <!-- Contato --> <tr> <td width="140" align="right"><span class="style5">Contato:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield5"> <input name="Contato" type="text" id="Contato" size="40" /> <span class="textfieldRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- descrição --> <tr> <td align="right">&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td align="right">&nbsp;</td> <td>&nbsp;</td> <td><span class="style6">* Espaço reservado para descrição de acessórios e outros.</span></td> </tr> <tr> <td width="140" align="right"><span class="style5">Descrição:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield5"><span id="sprytextarea1"> <label> <textarea name="Descricao" id="Descricao" cols="50" rows="5"></textarea> <span id="countsprytextarea1">&nbsp;</span> <span class="textareaMinCharsMsg">Descrição mínima com 20 caracter!</span> <span class="textareaMaxCharsMsg">Máxímo de caracter 250.</span></label> </span> <span class="textfieldRequiredMsg">Obrigatório!</span></span></td> </tr> <tr> <td align="right">&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td width="140" align="right"><span class="style6"></span></td> <td width="10">&nbsp;</td> <td><input type="submit" name="btn_criaalbum" id="btn_criaalbum" value="Enviar Anúncio" /> <label></label></td> </tr> <tr> <td align="right">&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> <input type="hidden" name="MM_insert" value="fm_criaalbum"> </form> </fieldset> <script type="text/javascript"> <!-- var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["blur"]}); var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {validateOn:["blur"]}); var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {validateOn:["blur"]}); var spryselect2 = new Spry.Widget.ValidationSelect("spryselect2", {validateOn:["blur"]}); var spryselect3 = new Spry.Widget.ValidationSelect("spryselect3", {validateOn:["blur"]}); var spryselect4 = new Spry.Widget.ValidationSelect("spryselect4", {validateOn:["blur"]}); var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "currency", {validateOn:["blur"]}); var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "phone_number", {validateOn:["blur"], format:"phone_custom", pattern:"0000-0000"}); var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "none", {validateOn:["blur"]}); var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield6", "none", {validateOn:["blur"]}); var spryselect5 = new Spry.Widget.ValidationSelect("spryselect5", {validateOn:["blur"]}); var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7", "phone_number", {format:"phone_custom", pattern:"0000-0000", validateOn:["blur"], isRequired:false}); var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8", "url", {validateOn:["blur"], isRequired:false}); var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9", "email", {validateOn:["blur"], isRequired:false}); var sprytextarea1 = new Spry.Widget.ValidationTextarea("sprytextarea1", {isRequired:false, minChars:20, maxChars:250, counterId:"countsprytextarea1", counterType:"chars_count", validateOn:["blur"]}); var spryselect6 = new Spry.Widget.ValidationSelect("spryselect6", {validateOn:["blur"]}); var spryselect7 = new Spry.Widget.ValidationSelect("spryselect7", {validateOn:["blur"]}); //--> </script> </body> </html> Boa galera, conto com a ajuda dos amigos. Abraços
  12. o que você quer fazer na verdade... descreve abraços
  13. obrigado amigo pela ajuda + resolvi desta forma: if ($insertSQL) { echo "<meta http-equiv='Refresh' content='0; url=incluir_foto.php'>"; Boa + vlw pela força. Abraços
  14. Boa galera, Estou com um formulário de cadastro e tenho necessidade de que quando o formulário seja concluído o insert, o usuário seja direcionado para uma nova pagina. Estou fazendo assim mais estou recebendo este erro abaixo: Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\siteBairro\g\galeria\admin\albuns\criar_anuncio_autos5.php:3) in C:\AppServ\www\siteBairro\g\galeria\admin\albuns\criar_anuncio_autos5.php on line 147. <?php require_once('../../../Connections/conection.php'); ?> <?php $con = mysql_connect("localhost", "root", "1272"); mysql_select_db("Cadastro"); ?> <?php require_once('../../../ScriptLibrary/incPureUpload.php'); ?> <?php require_once('../../../ScriptLibrary/incResize.php'); ?> <?php require_once('../../../ScriptLibrary/incPUAddOn.php'); ?> <?php // Pure PHP Upload 2.1.2 if (isset($HTTP_GET_VARS['GP_upload'])) { $ppu = new pureFileUpload(); $ppu->path = "../../imagens/capa"; $ppu->extensions = "GIF,JPG,JPEG,BMP,PNG"; $ppu->formName = "fm_criaalbum"; $ppu->storeType = "file"; $ppu->sizeLimit = "1000"; $ppu->nameConflict = "uniq"; $ppu->requireUpload = "true"; $ppu->minWidth = ""; $ppu->minHeight = ""; $ppu->maxWidth = ""; $ppu->maxHeight = ""; $ppu->saveWidth = ""; $ppu->saveHeight = ""; $ppu->timeout = "600"; $ppu->progressBar = "fileCopyProgress.htm"; $ppu->progressWidth = "300"; $ppu->progressHeight = "100"; $ppu->checkVersion("2.1.2"); $ppu->doUpload(); } $GP_uploadAction = $HTTP_SERVER_VARS['PHP_SELF']; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) { $GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING']."&GP_upload=true"; } else { $GP_uploadAction .= "?".$HTTP_SERVER_VARS['QUERY_STRING']; } } else { $GP_uploadAction .= "?"."GP_upload=true"; } // Rename Uploaded Files Addon 1.0.3 if (isset($HTTP_GET_VARS['GP_upload'])) { $ruf = new renameUploadedFiles($ppu); $ruf->renameMask = "capa_album.jpg"; $ruf->checkVersion("1.0.3"); $ruf->doRename(); } // Smart Image Processor 1.0.3 if (isset($HTTP_GET_VARS['GP_upload'])) { $sip = new resizeUploadedFiles($ppu); $sip->component = "GD"; $sip->resizeImages = "true"; $sip->aspectImages = "true"; $sip->maxWidth = "300"; $sip->maxHeight = "300"; $sip->quality = "300"; $sip->makeThumb = "false"; $sip->pathThumb = ""; $sip->aspectThumb = "true"; $sip->naming = "suffix"; $sip->suffix = "_small"; $sip->maxWidthThumb = ""; $sip->maxHeightThumb = ""; $sip->qualityThumb = "70"; $sip->checkVersion("1.0.3"); $sip->doResize(); } 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($editFormAction)) { if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { if (!eregi("GP_upload=true", $HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "&GP_upload=true"; } } else { $editFormAction .= "?GP_upload=true"; } } if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "fm_criaalbum")) { $insertSQL = sprintf("INSERT INTO Anuncio_Autos (Data_anuncio, Capa, Fabricante, Fabricante_modelo, Modelo, Ano, Combustivel, Bairro, Valor, Parcelamento, Telefone_Fixo, Telefone_Celular, Site, Email, Contato, `Descricao`) VALUES (now(), %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s )", GetSQLValueString($HTTP_POST_VARS['Capa'], "text"), GetSQLValueString($HTTP_POST_VARS['categoria'], "text"), GetSqlValueString($HTTP_POST_VARS['subcategoria'],"text"), GetSqlValueString($HTTP_POST_VARS['Modelo'],"text"), GetSqlValueString($HTTP_POST_VARS['Ano'],"text"), GetSqlValueString($HTTP_POST_VARS['Combustivel'],"text"), GetSqlValueString($HTTP_POST_VARS['Bairro'],"text"), GetSqlValueString($HTTP_POST_VARS['Valor'],"text"), GetSqlValueString($HTTP_POST_VARS['Parcelamento'],"text"), GetSqlValueString($HTTP_POST_VARS['Telefone_Fixo'],"text"), GetSqlValueString($HTTP_POST_VARS['Telefone_Celular'],"text"), GetSqlValueString($HTTP_POST_VARS['Site'],"text"), GetSqlValueString($HTTP_POST_VARS['Email'],"text"), GetSqlValueString($HTTP_POST_VARS['Contato'],"text"), GetSqlValueString($HTTP_POST_VARS['Descricao'],"text")); mysql_select_db($database_conection, $conection); $Result1 = mysql_query($insertSQL, $conection) or die(mysql_error()); //local que direciona pagina apos insert $insertGoTo = "editar_albuns.php"; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } ?> <!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"> <!-- .style5 { font-family: Arial, Helvetica, sans-serif; font-size: 12px; } .style6 { font-family: Arial, Helvetica, sans-serif; color:#999999; font-size: 11px; } .TituloFieldset { font-family:Arial, Helvetica, sans-serif; font-size: 16px; color:#FF0000; } .fieldset { border: solid #CCCCCC 1px; width: 600px; } --> </style> <script language='javascript' src='../../../ScriptLibrary/incPureUpload.js'></script> <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> <script src="SpryAssets/SpryValidationSelect.js" type="text/javascript"></script> <script src="SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script> <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationSelect.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" /> <!-- script ajax--> <script language="javascript">function list_dados( valor ) { http.open("GET", "result_passeio.php?id=" + valor, true); http.onreadystatechange = handleHttpResponse; http.send(null); } function handleHttpResponse() { campo_select = document.forms[0].subcategoria; if (http.readyState == 4) { campo_select.options.length = 0; results = http.responseText.split(","); for( i = 0; i < results.length; i++ ) { string = results[i].split( "|" ); campo_select.options[i] = new Option( string[0], string[1] ); } } } function getHTTPObject() {var req; try { if (window.XMLHttpRequest) { req = new XMLHttpRequest(); if (req.readyState == null) { req.readyState = 1; req.addEventListener("load", function () { req.readyState = 4; if (typeof req.onReadyStateChange == "function") req.onReadyStateChange(); }, false); } return req; } if (window.ActiveXObject) { var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"]; for (var i = 0; i < prefixes.length; i++) { try { req = new ActiveXObject(prefixes[i] + ".XmlHttp"); return req; } catch (ex) {}; } }} catch (ex) {} alert("XmlHttp Objects not supported by client browser");}var http = getHTTPObject();// Logo aps fazer a verificao, chamada a funo e passada // o valor varivel global http. </script> </head> <body> <fieldset class="fieldset"> <legend class="TituloFieldset">Cadastrar anúncio de autos</legend> <form action="<?php echo $editFormAction; ?>" method="post" enctype="multipart/form-data" name="fm_criaalbum" id="fm_criaalbum" > <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="right">&nbsp;</td> <td>&nbsp;</td> <td><span class="style6">* Arquivos de fotos suportados:</span></td> </tr> <tr> <td width="140" align="right"><span class="style5">Foto Capa do Anúncio:</span></td> <td width="10">&nbsp;</td> <td><input name="Capa" type="file" id="Capa" onChange="checkOneFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',true,1000,'','','','','','')" size="40" /></td> </tr> <!-- menu TIPO --> <tr> <td width="140" align="right"><span class="style5">Fabricante:</span></td> <td width="10">&nbsp;</td> <td><span id="spryselect3"> <label> <select name="categoria" style="width:150px" onChange="list_dados( this.value )"> <?php $consulta = mysql_query("SELECT * FROM tbl_categorias where tipo = 'Passeio' ORDER BY nome ASC"); while( $row = mysql_fetch_assoc($consulta) ) { echo "<option value=\"{$row['codigo']}\">{$row['nome']}</option>\n";}?> </select> </label> <span class="selectRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- fim menu TIPO --> <!-- fabricante --> <tr> <td width="140" align="right"><span class="style5">Modelo fabricante:</span></td> <td width="10">&nbsp;</td> <td><span id="spryselect1"> <label> <select name="subcategoria" style="width:150px"> </select> </label> <span class="selectRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- Marca modelo --> <tr> <td width="140" align="right"><span class="style5">Modelo:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield2"> <input name="Modelo" type="text" id="Modelo" size="19" /> <span class="textfieldRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- Ano fabricação --> <tr> <td width="140" align="right"><span class="style5">Ano fabricação:</span></td> <td width="10">&nbsp;</td> <td><span id="spryselect2"> <select name="Ano" id="Ano" style="width:150px"> <option selected="selected"></option> <option value="1960">1960</option> <option value="1961">1961</option> <option value="1962">1962</option> <option value="1963">1963</option> <option value="1964">1964</option> <option value="1965">1965</option> <option value="1966">1966</option> <option value="1967">1967</option> <option value="1968">1968</option> <option value="1969">1969</option> <option value="1970">1970</option> <option value="1971">1971</option> <option value="1972">1972</option> <option value="1973">1973</option> <option value="1974">1974</option> <option value="1975">1975</option> <option value="1976">1976</option> <option value="1977">1977</option> <option value="1978">1978</option> <option value="1979">1979</option> <option value="1980">1980</option> <option value="1981">1981</option> <option value="1982">1982</option> <option value="1983">1983</option> <option value="1984">1984</option> <option value="1985">1985</option> <option value="1986">1986</option> <option value="1987">1987</option> <option value="1988">1988</option> <option value="1989">1989</option> <option value="1990">1990</option> <option value="1991">1991</option> <option value="1992">1992</option> <option value="1993">1993</option> <option value="1994">1994</option> <option value="1995">1995</option> <option value="1996">1996</option> <option value="1997">1997</option> <option value="1998">1998</option> <option value="1999">1999</option> <option value="2000">2000</option> <option value="2001">2001</option> <option value="2002">2002</option> <option value="2003">2003</option> <option value="2004">2004</option> <option value="2005">2005</option> <option value="2006">2006</option> <option value="2007">2007</option> <option value="2008">2008</option> <option value="2009">2009</option> </select> <span class="selectRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- Esta com erro --> <!-- Combustivel --> <tr> <td align="right"><span class="style5">Combustível:</span></td> <td>&nbsp;</td> <td><span id="spryselect7"> <label> <select name="Combustivel" id="Combustivel" style="width:150px"> <option selected="selected"></option> <option value="Alcool">Alcool</option> <option value="Diesel">Diesel</option> <option value="Flex">Flex</option> <option value="Gasolina">Gasolina</option> <option value="Gasolina/GNV">Gasolina/GNV</option> </select> </label> <span class="selectRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- Bairro --> <tr> <td width="140" align="right"><span class="style5">Bairro:</span></td> <td width="10">&nbsp;</td> <td><span id="spryselect4"> <select name="Bairro" id="Bairro" style="width:150px"> <option selected="selected"></option> <option value="bangu">Bangu</option> <option value="barra de guaratiba">Barra de Guaratiba</option> <option value="campo grande">Campo Grande</option> <option value="ilha de guaratiba">Ilha de Guaratiba</option> <option value="magarça">Magarça</option> <option value="padre miguel">Padre Miguel</option> <option value="pedra de guaratiba">Pedra de Guaratiba</option> <option value="realengo">Realengo</option> <option value="santa cruz">Santa Cruz</option> <option value="sulacap">Sulacap</option> </select> <span class="selectRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- Valor --> <tr> <td width="140" align="right"><span class="style5">Valor R$:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield3"> <input name="Valor" type="text" id="Valor" size="19" /> <span class="textfieldRequiredMsg">Obrigatório!</span><span class="textfieldInvalidFormatMsg">*Separar centavos por ponto Ex.:1000.30</span></span></td> </tr> <tr> <td width="140" align="right"><span class="style5">Condições & Parcelamentos:</span></td> <td width="10">&nbsp;</td> <td><span id="spryselect5"> <select name="Parcelamento" id="Parcelamento" style="width:280px"> <option selected="selected"></option> <option value="A Vista">À vista</option> <option value="Em até 12X">Parcelamos em até 12X</option> <option value="Em até 18X">Parcelamos em até 18X</option> <option value="Em até 24X">Parcelamos em até 24X</option> <option value="Em até 36X">Parcelamos em até 36X</option> <option value="Em até 48X">Parcelamos em até 48X</option> <option value="Em até 60X">Parcelamos em até 60X</option> <option value="Consulte">Consulte outros parcelamentos</option> </select> <span class="selectRequiredMsg">Obrigatório.</span></span></td> </tr> <!-- telefone --> <tr> <td width="140" align="right"><span class="style5">Telefone:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield4"> <input name="Telefone_Fixo" type="text" id="Telefone_Fixo" size="19" /> <span class="textfieldRequiredMsg">Obrigatório!</span><span class="textfieldInvalidFormatMsg">Inválido, Ex.:2222-2222!</span></span></td> </tr> <!-- Celular --> <tr> <td width="140" align="right"><span class="style5">Celular:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield7"> <input name="Telefone_Celular" type="text" id="Telefone_Celular" size="19" /> <span class="textfieldInvalidFormatMsg">Inválido, Ex.:2222-2222!</span></span></td> </tr> <!-- Site --> <tr> <td width="140" align="right"><span class="style5">Site:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield8"> <input name="Site" type="text" id="Site" size="40" /> <span class="textfieldRequiredMsg">Obrigatório!</span><span class="textfieldInvalidFormatMsg">Inválido! Ex. http://www.tonobairro.com.br</span></span></td> </tr> <!-- email --> <tr> <td width="140" align="right"><span class="style5">E-mail:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield9"> <input name="Email" type="text" id="Email" size="40" /> <span class="textfieldRequiredMsg">Obrigatório!.</span><span class="textfieldInvalidFormatMsg">E-mail inválido!</span></span></td> </tr> <!-- Contato --> <tr> <td width="140" align="right"><span class="style5">Contato:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield5"> <input name="Contato" type="text" id="Contato" size="40" /> <span class="textfieldRequiredMsg">Obrigatório!</span></span></td> </tr> <!-- descrição --> <tr> <td align="right">&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td align="right">&nbsp;</td> <td>&nbsp;</td> <td><span class="style6">* Espaço reservado para descrição de acessórios e outros.</span></td> </tr> <tr> <td width="140" align="right"><span class="style5">Descrição:</span></td> <td width="10">&nbsp;</td> <td><span id="sprytextfield5"><span id="sprytextarea1"> <label> <textarea name="Descricao" id="Descricao" cols="50" rows="5"></textarea> <span id="countsprytextarea1">&nbsp;</span> <span class="textareaMinCharsMsg">Descrição mínima com 20 caracter!</span> <span class="textareaMaxCharsMsg">Máxímo de caracter 250.</span></label> </span> <span class="textfieldRequiredMsg">Obrigatório!</span></span></td> </tr> <tr> <td align="right">&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td width="140" align="right"><span class="style6"></span></td> <td width="10">&nbsp;</td> <td><input type="submit" name="btn_criaalbum" id="btn_criaalbum" value="Enviar Anúncio" /> <label></label></td> </tr> <tr> <td align="right">&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> <input type="hidden" name="MM_insert" value="fm_criaalbum"> </form> </fieldset> <script type="text/javascript"> <!-- var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["blur"]}); var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {validateOn:["blur"]}); var spryselect1 = new Spry.Widget.ValidationSelect("spryselect1", {validateOn:["blur"]}); var spryselect2 = new Spry.Widget.ValidationSelect("spryselect2", {validateOn:["blur"]}); var spryselect3 = new Spry.Widget.ValidationSelect("spryselect3", {validateOn:["blur"]}); var spryselect4 = new Spry.Widget.ValidationSelect("spryselect4", {validateOn:["blur"]}); var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "currency", {validateOn:["blur"]}); var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "phone_number", {validateOn:["blur"], format:"phone_custom", pattern:"0000-0000"}); var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "none", {validateOn:["blur"]}); var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield6", "none", {validateOn:["blur"]}); var spryselect5 = new Spry.Widget.ValidationSelect("spryselect5", {validateOn:["blur"]}); var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7", "phone_number", {format:"phone_custom", pattern:"0000-0000", validateOn:["blur"], isRequired:false}); var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8", "url", {validateOn:["blur"], isRequired:false}); var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9", "email", {validateOn:["blur"], isRequired:false}); var sprytextarea1 = new Spry.Widget.ValidationTextarea("sprytextarea1", {isRequired:false, minChars:20, maxChars:250, counterId:"countsprytextarea1", counterType:"chars_count", validateOn:["blur"]}); var spryselect6 = new Spry.Widget.ValidationSelect("spryselect6", {validateOn:["blur"]}); var spryselect7 = new Spry.Widget.ValidationSelect("spryselect7", {validateOn:["blur"]}); //--> </script> </body> </html> Grato Abraços Valmir Lopes
  15. shelter

    If insert

    Boa galera, me ajudem por favor. Alguém teria um exemplo ou poderia me explicar como efetuar um insert a partir de um select, deixa eu explicar melhor. Quero saber antes de inserir um novo cliente saber se ele já esta cadastrado em minha tabela, e que caso esteja envie uma mensagem do tipo cliente já cadastrado , caso ele não esteja aí sim cadastro em minha tabela. Caso alguém tenha uma exemplo agradeço. Abraços amigos
  16. todas as paginas seriam php, e como seria ?
  17. Boa galera, Aqui estou enviando um formulário para uma pagina via get, teria a possibilidade de passar este mesmo dado ao invés de ser para uma pagina ser para duas ou três ao mesmo tempo. Segue formulário: <!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> </head> <body> <form id="form1" name="form1" method="get" action="recebe.php"> <table width="100%" border="0"> <tr> <td width="5%">Nome:</td> <td width="1%">&nbsp;</td> <td width="94%"><label> <input type="text" name="textfield" id="textfield" /> </label></td> </tr> <tr> <td>Idade:</td> <td>&nbsp;</td> <td><label> <input type="text" name="textfield2" id="textfield2" /> </label></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td><label> <input type="submit" name="button" id="button" value="Submit" /> </label></td> </tr> </table> <p>&nbsp;</p> </form> </body> </html> grato amigos
  18. obrigado pela ajuda, amanhã pode ser você o necessitado. Abraços e saude Valmir Lopes
  19. p**** amigo a sua resposta ajudou pacas , aqui se não tem o que fazer vai jogar e para de atrapalhar o trampo da galera vlw.
  20. Bom dia galera, e aí na boa? Então, aqui eu queria abrir uma foto em uma div em uma outra pagina e passando por to string , seria possível , se é alguém teria uma ex. grato. Abraços Valmir Lopes
  21. Boa galera, Queria saber se é possível passar uma Função ( se é este mesmo o termo ) de um Java script para outra pagina. Tenho uma função que abre uma div na mesma pagina, queria passar esta instrução para outra pagina, seria possível. Segue como estou fazendo para passar para a mesma pagina: <!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> </head> <body> <!--div que abre no click abrir javascripts --> <div id="janela" style="visibility: hidden; top: 100px; left: 250px; position: absolute; border: 2px solid #000;"> <img src="../figuras/principal.gif" /> <br /> <? include("grupoRadio.php"); ?> <img src="" /> <br /> aqui fica o conteudo da janelinha, você pode colocar imagem, textos... <br /> <a href="java script:;" onclick="document.getElementById('janela').style.visibility='hidden';"> Fechar [x] </a> </div> <table width="98%" border="0"> <tr> <td width="15%">&nbsp;</td> <td width="57%"><p><img src="../anuncio/camera/bannerSuperiro.gif" width="400" height="70" /></p> <p>&nbsp;</p> <p>&nbsp;</p> <p>bvb script:;" onclick="document.getElementById('janela').style.visibility='visible';"> Abre </a> </body> </html> Grato Abraços Valmir Lopes
  22. shelter

    (Resolvido) if select

    Sim amigo, treinei bastante segui o seu conselho. veja se desta forma não fica + claro e simples: if($Capa == NULL) { echo "<img src='../siteBairro/g/galeria/imagens/capa/auto_s_foto.png' width='80' height='80' ><br />"; } else { echo "<img src='../siteBairro/g/galeria/imagens/capa/$Capa' width='80' height='60' ><br />"; } Mais enfim agradeço a sua ajuda .... Abraços Valmir Lopes
  23. Boa noite galera, na boa? Tenho uma consulta aonde exibe uma figura, segue abaixo: echo "<img src='../siteBairro/g/galeria/imagens/capa/$Capa' width='80' height='60' ><br />"; O que eu preciso, caso esta $Capa seja null, atribua o valor de img2.jpg. Grato pela ajuda.
  24. shelter

    combobox

    Obrigado resolveu, + no meu caso tive que fazer assim: style="width:100px" Grato abraços
  25. shelter

    combobox

    Boa galera, aqui por favor alguém sabe como faço para colocar o tamanho de largura definido em um combobox? Grato galera, Abraços
×
×
  • Criar Novo...