Array
(
    [0] => stdClass Object
        (
            [Votos_Balanceados] => 1
            [id] => 520137
            [titulo] => WEB - Como trocar botão de Enviar Foto por um botão tipo imagem?
            [dataCadastro] => DateTime Object
                (
                    [date] => 2015-05-18 12:59:32
                    [timezone_type] => 3
                    [timezone] => America/Sao_Paulo
                )

            [isFirstPost] => -1
            [idUsuario] => 397347
            [status] => A
            [isExample] => 
            [NomeUsuario] => Randrade
            [Apelido] => 
            [Foto] => 397347_20150704190512.png
            [Conteudo] => Se entendi bem, você quer alterar o botão de upload da imagem. Caso seja isso mesmo, você pode fazer isso via CSS.

Digamos que você possui este form:
[code]<form action="" method="post" enctype="multipart/form-data">
<div class="upload">
<input type="file" name="upload"/>
</div>
</form>[/code]

E em seu CSS você faria isso:
[code]div.upload {
width: 127px;
height: 127px;
background: url(http://uf.pe/images/file-upload-icon.png);
overflow: hidden;
}

div.upload input {
display: block !important;
width: 127px !important;
height: 127px !important;
opacity: 0 !important;
overflow: hidden !important;
}[/code]

Pode ver um exemplo funcional [url:descricao=clicando neste link!]http://jsfiddle.net/randrade/248wmag6/[/url] ) )

WEB - Como trocar botão de Enviar Foto por um botão tipo imagem?

PHP
Cesar3m
   - 18 mai 2015

Como o exemplo do facebook, do whats´app e até mesmo deste site, como faço para substituir o botão submit padrão por uma imagem?

Post mais votado

Randrade
   - 18 mai 2015

Se entendi bem, você quer alterar o botão de upload da imagem. Caso seja isso mesmo, você pode fazer isso via CSS.

Digamos que você possui este form:
#Código

<form action="" method="post" enctype="multipart/form-data">
    <div class="upload">
        <input type="file" name="upload"/>
    </div>
</form>


E em seu CSS você faria isso:
#Código
div.upload {
    width: 127px;
    height: 127px;
    background: url(http://uf.pe/images/file-upload-icon.png);
    overflow: hidden;
}

div.upload input {
    display: block !important;
    width: 127px !important;
    height: 127px !important;
    opacity: 0 !important;
    overflow: hidden !important;
}


Pode ver um exemplo funcional clicando neste link!

Marcio Araujo
   - 18 mai 2015

Boa tarde César, explica bem esse artigo:

http://www.maujor.com/blog/2006/05/28/botao-enviar-do-formulario/

Cesar3m
   - 18 mai 2015

@Randrade vlw mano, deu certinho! Era exatamente o que eu queria, te devo essa!

Randrade
   - 18 mai 2015


Citação:
@Randrade vlw mano, deu certinho! Era exatamente o que eu queria, te devo essa!


Beleza mano, fico feliz em ajudar.

Jeandedy
   - 19 mai 2015

Buy Real Passport ,Visa,Driving License,id cards demosmiller@outlook.fr
We offer only original high-quality real and fake passports, driver's licenses, ID cards, stamps, Visa, school Diplomas and other products for a number of countries like: USA, Australia, Belgium, Brazil, Canada, Italia, Finland, France, Germany, Israel, Mexico, Netherlands, South Africa, Spain, United Kingdom. This list is not full.

BUY FAKE PASSPORT BRITISH(UK) FOR SALE DIPLOMATIC CANADIAN FALSE ID CARD ONLINE UNITED STATES(US) FAKE ID CARD SELL DRIVERS LICENSE

Contact e-mail:................. demosmiller@outlook.fr
General Support.....................demosmiller@yahoo.com
Telephone Number...........+237-51047718
whatsapp.......................+237-51047718
skype........................ demos.documents1

Mobile.................................We shall provide that only to interested inquiries by email

feel free to contact via email i will be happy to be at your service from you.
----------
Keywords:
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Australia
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Austria
Purchase High Quality Original and Fake Passports, Driver's License and Ids of USA
Purchase High Quality Original and Fake Passports, Driver's License and Ids of UK
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Canada
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Germany
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Italy
Purchase High Quality Original and Fake Passports, Driver's License and Ids of France
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Finland
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Norway
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Denmark
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Sweden
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Ireland
Purchase High Quality Original and Fake Passports, Driver's License and Ids of China
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Romania
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Hungary
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Bulgaria
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Belgium
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Switzerland
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Spain
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Brazil
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Russian Federation
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Mexico
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Greece
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Portugal
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Estonia
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Latvia
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Malta
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Iceland
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Greenland
Purchase High Quality Original and Fake Passports, Driver's License and Ids of South Africa
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Jamica
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Netherlands
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Czech Republic
Purchase High Quality Original and Fake Passports, Driver's License and Ids of South Korea
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Lithuania
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Kyrgyzstan
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Luxembourg
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Croatia
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Cyprus
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Turkey
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Panama
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Cuba
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Guatemala
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Monaco
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Slovakia
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Slovenia
Purchase High Quality Original and Fake Passports, Driver's License and Ids of Serbia & Montenegro

Cesar3m
   - 27 mai 2015

Retomando o tópico, gostaria que alguém me ajudasse a corrigir este código e acrescentar melhorias nele, seria o código:

#Código

<?php
// Conexão com o banco de dados
	include "../../bancodedadosconfig/tabelafotos.php";
	$conexaotabelafotos = new mysqli($host, $username, $password, $database);
	if (mysqli_connect_errno()) trigger_error(mysqli_connect_error());

// Se o usuário clicou no botão cadastrar efetua as alterações
if ($_POST['enviarfotoperfil']) {
	
	// Recupera os dados dos campos
	$fotoperfil = $_FILES["fotoperfil"];

	// Se a foto estiver sido selecionada
	if (!empty($fotoperfil["name"])) {
		
		// Largura máxima em pixels
		$largura = 2000;
		// Altura máxima em pixels
		$altura = 2000;
		// Tamanho máximo do arquivo em bytes
		$tamanho = 1000;
 
    	// Verifica se o arquivo é uma imagem
    	if(!preg_match("/^image\/(pjpeg|jpeg|png|gif|bmp)$/", $foto["type"])){
     	   $error[1] = "Isso não é uma imagem.";
   	 	} 
	
		// Pega as dimensões da imagem
		$dimensoes = getimagesize($fotoperfil["tmp_name"]);
	
		// Verifica se a largura da imagem é maior que a largura permitida
		if($dimensoes[0] > $largura) {
			$error[2] = "A largura da imagem não deve ultrapassar ".$largura." pixels";
		}
 
		// Verifica se a altura da imagem é maior que a altura permitida
		if($dimensoes[1] > $altura) {
			$error[3] = "Altura da imagem não deve ultrapassar ".$altura." pixels";
		}
		
		// Verifica se o tamanho da imagem é maior que o tamanho permitido
		if($foto["size"] > $tamanho) {
   		 	$error[4] = "A imagem deve ter no máximo ".$tamanho." bytes";
		}
 
		// Se não houver nenhum erro
		if (count($error) == 0) {
		
			// Pega extensão da imagem
			preg_match("/\.(gif|bmp|png|jpg|jpeg){1}$/i", $foto["name"], $ext);
 
        	// Gera um nome único para a imagem
        	$nome_imagem = md5(uniqid(time())) . "." . $ext[1];
 
        	// Caminho de onde ficará a imagem
        	$caminho_imagem = "fotosdatabase/" . $nome_imagem;
 
			// Faz o upload da imagem para seu respectivo caminho
			move_uploaded_file($foto["tmp_name"], $caminho_imagem);
		
			// Insere os dados no banco
			$sql = mysql_query("INSERT INTO usuarios VALUES ('', '".$nome_imagem."')");
		
			// Se os dados forem inseridos com sucesso
			if ($sql){
				echo "A foto foi enviada com sucesso.";
			}
		}
	
		// Se houver mensagens de erro, exibe-as
		if (count($error) != 0) {
			foreach ($error as $erro) {
				echo $erro . "<br />";
			}
		}
	}
}


?>


O trecho de código a seguir é que não está funcionando, pois mesmo fazendo upload de arquivo .jpeg acusa de não ser imagem:

#Código
// Verifica se o arquivo é uma imagem
    	if(!preg_match("/^image\/(pjpeg|jpeg|png|gif|bmp)$/", $foto["type"])){
     	   $error[1] = "Isso não é uma imagem.";
   	 	} 


Além disso, gostaria de acrescentar uma funcionalidade que redimensione a imagem para ficar com a mesma dimensão de foto de perfil, tipo uns 100x100px;

Desde já,
Muito Obrigado pelas respostas.

Cesar3m
   - 28 mai 2015

Muito bom dia!

Então, consegui resolver meu código ontem a noite, e agora só me resta mostrar as imagens levadas ao banco de dados à página, obedecendo a regra de que a foto deve ser do session... Mas acho que isso resolvo fácil.

Att
César M.

Wade
   - 10 fev 2016

Quality Novelty IDs and Passports,Marriage certificates and
Drivers license etc buy now high quality-We have the best HOLOGRAMS
AND DUPLICATING MACHINES With over 12million of out documents
circulating over the world.

-IDs Scan-yes…

-HOLOGRAMS: IDENTICAL

-BARCODES: IDS SCAN

-UV: YES

UNREGISTERED IDS WITH FAST SHIPPING - EMAIL SUPPORT

Contact Email :kimdouglas045@gmail.com

Skype :kim.douglas28

Tell:+66999705241

novelty ID's for Over 50's state drivers license cards and State ID

cards available. Includes state driver's license hologram and magnetic strip

or barcode on back. 2 business day shipping order (2.95 shipping and

handling). The BEST authentic Unregistered ID's on the web.

Same quality, high resolution that Department of Motor Vechiles use.

Send current .JPG or .GIF of current license with picture

and changes in NAME, DOB, LICENSE #, RESTRICTIONS, etc.
we produce the best Unregistered ID online we sell UK/EU Unregistered ID, Canadian
Unregistered ID, Australian Unregistered ID and Unregistered IDs for many other countries from
Unregistered passports to Unregistered driving licenses to Unregistered bank statements we
have your identification needs covered. Our Unregistered IDs include all
security features such as genuine holograms, ultraviolet watermarks,
intaglio printing, special paper, fluorescent dyes, RFID chips,
barcodes corresponding to your details and more. Our Unregistered IDs are
identical to the real thing no other site will offer you this quality
we are the best.

new identity protect your privacy and take back your freedom.

Keywords

----------------

Unregistered Spanish(Spain) passports for sell,

Unregistered Mexican(Mexico) passports for sell,

Unregistered South African passports for sell,

Unregistered Australian driver licenses for sell,

Unregistered Canadian driver licenses for sell,

Unregistered Diplomatic passports for sell,

false USA(united States) passports for sale,

false Australian passports for sell,

false Belgium passports for sell,

false Brazilian(Brazil) passports for sell,

false Canadian(Canada) passports for sell,

false Finnish(Finland) passports for sell,

false French(France) passports for sell,

false German(Germany) passports for sell,

false Dutch(Netherland/Holland) passports for sell,

false Israel passports for sell,

false UK(United Kingdom) passports for sell,

false Spanish(Spain) passports for sell,

false Mexican(Mexico) passports for sell,

false South African passports for sell,

false Australian driver licenses for sell,

Camouflage passports for sale,

passport Duplicates for sale.

order Unregistered passports,

order false passports,

order novelty passports,

order Unregistered driver license,

order false driver license,

order novelty driver license,

order Diplomatic passports,

obtain Unregistered passports,

obtain false passports,

obtain novelty passports,

obtain Unregistered driving licence,

obtain false driver license,

obtain novelty driver license,

obtain Diplomatic passports,

purchase Unregistered passports,

purchase false passports,

purchase novelty passports,

purchase Unregistered driver license,

purchase false driver license,

purchase novelty driver license,

purchase Diplomatic passports,

sell Unregistered passports,

sell false passports,

sell novelty passports,

sell Unregistered driving licence,

sell false driver license,

sell novelty driver license,

get Unregistered passports,

get false passports,

get novelty passports,

get Unregistered driving licence,

get false driving license,

get novelty driver license,

get Diplomatic passports,

make Unregistered passports,

make false passports,

make novelty passports,

make Unregistered driving license,

make false driving license,

make novelty driver license,

make Diplomatic passports,

buy, get, Unregistered, false, passport, passport, id, card, cards, uk, sell,
online, canadian, british, sale, novelty, conterfeit, bogus, american,
united, states, usa, us, italian, malaysian, australian, documents,
idetity, idetification, driver, license, licence, driving, residence,
permit, SSN Unregistered passport id, free Unregistered passport, identity theft,
Unregistered, novelty, camoflauge, passport, anonymous, private, safe, travel,
anti terrorism, international, offshore, banking, id, driver, drivers,
license, instant, online, for sale, cheap, wholesale, new identity,
second, citizenship, identity, identification, documents, diplomatic,
nationality, how to, where to, get, obtain, buy, purchase, make,
build, a, passport, i.d., british, honduras, uk, usa, us, u.s.,
canada, canadian, foreign, visa, swiss, card, ids, document, getting,
visas, cards, foriegn
Contact Email :kimdouglas045@gmail.com

Skype :kim.douglas28

Tell:+66999705241