Jump to content

Encontrar o problema no meu formulário de código PHP


rocknrolla

Recommended Posts

Meu formulário sempre funcionou e agora dá-me um erro. Nunca mudei o código. Estou a usar isso há anos. É muito estranho. Estes são os 2 arquivos, se alguém pudesse ajudar eu realmente apreciaria

Main Code

<!DOCTYPE html> 
<html>
	<head>
		<title>João Queirós - Formulário - Design Logo</title>
		
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0" />
		
		<link rel="stylesheet" href="css/demo.css" />
		<link rel="stylesheet" href="css/sky-forms.css" />
		<link rel="stylesheet" href="css/sky-forms-orange.css" />
		<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">
		<link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
		<script src="SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script>
	</head>
	<body>
		<div class="body">			
        <?
								if( $_GET["sucesso"] == "email")
								{ 
?>
									<p style="color: green;">Thank you! I will initiate the creative process of your brand! Until now!</p>
<? 
								}
								else
								{
?>
       
		  <!-- Orange color scheme -->
			<form id="form_588606" class="sky-form" action="send_form_email.php" method="post"/>
		    <img src="logo_jq.png" width="600">            
            
            
            <header><font color="#FFFFFF">Client data</font></br>
            <font size="-1" color="#FFFFFF">Required fields</font>
            </header>

<fieldset>
	<section>
	  <label class="label">Full Name</label>
	  <span id="sprytextfield3">
						<label class="input">
						  <input type="text" name="nomecompleto"/>
					    </label>
						<span class="textfieldRequiredMsg">Escreva o seu Nome completo.</span></span></section>
                    
    <section>
	  <label class="label">E-mail</label>
						<span id="sprytextfield4">
                        <label class="input">
                          <input type="text" name="email"/>
                        </label>
                        <span class="textfieldRequiredMsg">Write your e-mail.</span><span class="textfieldInvalidFormatMsg">Invalid Format.</span></span></section>
					</section>
          </fieldset>

		  <header><font color="#FFFFFF"> Brief Logo</font>
                </br>
            <font size="-1" color="#FFFFFF">Campos de preenchimento obrigatório</font>
          </header>
				
				<fieldset>
					<section>
						<label class="label">Company Name</label>
					  <span id="sprytextfield1">
						<label class="input">
						  <input type="text" name="nome"/>
					    </label>
					  <span class="textfieldRequiredMsg">Write your company name.</span></span></section>
                    
                    <section>
						<label class="label">Slogan:</label>
					  <span id="sprytextfield2">
						<label class="input">
						  <input type="text" name="slogan"/>
					    </label>
						<span class="textfieldRequiredMsg">Write your slogan.</span></span></section>
                    
                    <section>
						<label class="label">What We Do:</label>
						<span id="sprytextarea1">
						<label class="textarea textarea-resizable">
						  <textarea rows="3" name="oqfazemos"></textarea>
					    </label>
						<span class="textareaRequiredMsg">Write what your company do.</span></span>
					<!--	<div class="note"><strong>Example:</strong> We train dogs for mili</div>-->
					</section>
                    
                    <section>
						<label class="label">Our Industry:</label>
						<span id="sprytextarea2">
						<label class="textarea textarea-expandable">
						  <textarea rows="3" name="areanegocios"></textarea>
					    </label>
						<span class="textareaRequiredMsg">Write your industry.</span></span>
						<!--<div class="note"><strong>Ex:</strong> Marketing. Vendas. Design.</div>-->
					</section>
                    
                    <section>
						<label class="label">Top Three Things to Communicate through our Logo:
</label>
						<span id="sprytextarea3">
						<label class="textarea textarea-expandable">
						  <textarea rows="3" name="items"></textarea>
					    </label>
						<span class="textareaRequiredMsg">Write your top 3 things.</span></span>
						<!--<div class="note"><strong>Exemplo:</strong> 1. Experiência e dedicação | 2. Simple, mensagem direta, fácil, classico | 3. Seguro e Confiável</div>-->
					</section>
                    
                    
                    <section>
						<label class="label">Our Target Audience: </label>
						<span id="sprytextarea4">
						<label class="textarea">
						  <textarea rows="3" name="publicoalvo"></textarea>
					    </label>
						<span class="textareaRequiredMsg">Write your target Audience.</span></span>
						<!--<div class="note"><strong>Ex:</strong> raparigas dos 25 - 35, que gostam de.. </div>-->
					</section>
                    
                    
          </fieldset>
                    
                    
                    <fieldset>
					<section>
                    <div class="row">
                    
						

					  <section class="col col-5">				
						<label class="label">Styles that we are interested in:
:</label>
                        
                        
                        <table width="500" border="0" cellpadding="3" cellspacing="3">
  <tr>
    <td width="402" bgcolor="#FFFFFF"><span class="col col-5"><img src="tipos_logos/wordmark.gif" width="336" height="40"></span></td>
    <td width="82" bgcolor="#FFFFFF">
						<label class="toggle">
						  <input type="checkbox" name="wordmark" checked="" />
      <i></i>Wordmark</br></br>
      
              </label></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><span class="col col-5"><img src="tipos_logos/letterform.gif" width="336" height="40"></span></td>
    
   
    
    <td bgcolor="#FFFFFF"> <label class="toggle">
						  <input type="checkbox" name="letterform" checked="" />
      <i></i>Letterform Mark</br></br></label></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><span class="col col-5"><img src="tipos_logos/abstract.gif" width="336" height="40"></span></td>
    <td bgcolor="#FFFFFF">
    <label class="toggle">
						  <input type="checkbox" name="abstracto" checked="" />
      <i></i>Abstract Mark</br></br></label>
      
      </td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><span class="col col-5"><img src="tipos_logos/pictoral.gif" width="336" height="40"></span></td>
    <td bgcolor="#FFFFFF">
    
    <label class="toggle">
						  <input type="checkbox" name="figurativo" checked="" />
      <i></i>Pictorial Mark</br></br></label>
    
    </td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><span class="col col-5"><img src="tipos_logos/emblem.gif" width="336" height="40"></span></td>
    <td bgcolor="#FFFFFF">
    
    <label class="toggle">
						  <input type="checkbox" name="emblemas" checked="" />
      <i></i>Emblem</br></br></label>
    
    </td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><span class="col col-5"><img src="tipos_logos/character.gif" width="336" height="40"></span></td>
    <td bgcolor="#FFFFFF">
    
    <label class="toggle"><input type="checkbox" name="mascote" />
                <i></i>Character</br></br></label>
    
    </td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF"><span class="col col-5"><img src="tipos_logos/web2.gif" width="336" height="40"></span></td>
    <td bgcolor="#FFFFFF">
    
    <label class="toggle"><input type="checkbox" name="web2" />
			    <i></i>Web 2.0</br></br></label>
    
    </td>
  </tr>
</table>
						
						
						
						
						
					  </section>
					</div>
                    
                    </section>
                    
                    
                    
                    
                     <section>
						<label class="label">
Color Preferences:
</label>
						<span id="sprytextarea5">
						<label class="textarea textarea-expandable">
						  <textarea rows="3" name="cor"></textarea>
					    </label>
						<span class="textareaRequiredMsg">Write your color preferences.</span></span>

					</section>                    
          </fieldset>
                     <fieldset>
                    </fieldset>
                    
                    <fieldset>
                    
                      <section>
						<label class="label">Our Ideas and Additional Information:</label>
						<span id="sprytextarea6">
						<label class="textarea textarea-resizable">
						  <textarea rows="3" name="ideias"></textarea>
					    </label>
						<span class="textareaRequiredMsg">Write your ideias.</span></span>
					<!--	<div class="note"><strong>Ex:</strong> Ando a procura de algo icónico que as pessoas possam reconhecer sem o texto. Tradicional. Que identifique a nossa cidade. Que transpareça seriedade respeito, feito para um público chique.</div>-->
                        
					</section>
                    
                    
                       <section>
						<label class="label">Where we will use the Logo:</label>
						<span id="sprytextarea7">
						<label class="textarea textarea-expandable">
						  <textarea rows="3" name="ondeeusado"></textarea>
					    </label>
						<span class="textareaRequiredMsg">Write where your logo will be used.</span></span>
						<!--<div class="note"><strong>Exemplo:</strong> Impressão, Tshirts, Canecas, Televisão, Sinalética, Veículos... </div>-->
					</section>
                    </fieldset>
                    				
						
				
				
		  <fieldset>
            <label class="label">Logo Styles:</label>
<table width="415" border="0" cellpadding="11" cellspacing="11">
  <tr>
    <td width="101">&nbsp;</td>
    <td width="13" bgcolor="#FFFFFF" align="center">1</td>
    <td width="13" bgcolor="#FFFFFF" align="center">2</td>
    <td width="14" bgcolor="#FFFFFF" align="center">3</td>
    <td width="13" bgcolor="#FFFFFF" align="center">4</td>
    <td width="13" bgcolor="#FFFFFF" align="center">5</td>
    <td width="112">&nbsp;</td>
    <td width="102">&nbsp;</td>
  </tr>
  <tr>
    <td align="center"><font>Feminine</font></td>
    <td bgcolor="#EC8A00">&nbsp;</td>
    <td bgcolor="#ED7D09">&nbsp;</td>
    <td bgcolor="#EE7012">&nbsp;</td>
    <td bgcolor="#EF631A">&nbsp;</td>
    <td bgcolor="#F05623">&nbsp;</td>
    <td align="center">Masculine</td>
    <td><section>
						<label class="label">Select</label>
						<label class="select">
							<select name="1">
							    <option value="1" />1
								<option value="2" />2
								<option value="3" />3
								<option value="4" />4
								<option value="5" />5
							</select>
							<i></i>
						</label>
		</section></td>
  </tr>
  <tr>
    <td align="center">Modern</td>
     <td bgcolor="#EC8A00">&nbsp;</td>
    <td bgcolor="#ED7D09">&nbsp;</td>
    <td bgcolor="#EE7012">&nbsp;</td>
    <td bgcolor="#EF631A">&nbsp;</td>
    <td bgcolor="#F05623">&nbsp;</td>
    <td align="center">Classic</td>
    <td><section>
						<label class="label">Select</label>
						<label class="select">
							<select name="2">
								<option value="1" />1
								<option value="2" />2
								<option value="3" />3
								<option value="4" />4
								<option value="5" />5
							</select>
							<i></i>
						</label>
		</section></td>
  </tr>
  <tr>
    <td align="center">Exotic</td>
     <td bgcolor="#EC8A00">&nbsp;</td>
    <td bgcolor="#ED7D09">&nbsp;</td>
    <td bgcolor="#EE7012">&nbsp;</td>
    <td bgcolor="#EF631A">&nbsp;</td>
    <td bgcolor="#F05623">&nbsp;</td>
    <td align="center">Commonplace</td>
    <td><section>
						<label class="label">Select</label>
						<label class="select">
							<select name="3">
								<option value="1" />1
								<option value="2" />2
								<option value="3" />3
								<option value="4" />4
								<option value="5" />5
							</select>
							<i></i>
						</label>
		</section></td>
  </tr>
  <tr>
    <td align="center">Sporty</td>
     <td bgcolor="#EC8A00">&nbsp;</td>
    <td bgcolor="#ED7D09">&nbsp;</td>
    <td bgcolor="#EE7012">&nbsp;</td>
    <td bgcolor="#EF631A">&nbsp;</td>
    <td bgcolor="#F05623">&nbsp;</td>
    <td align="center">Elegante</td>
    <td><section>
						<label class="label">Select</label>
						<label class="select">
							<select name="4">
								<option value="1" />1
								<option value="2" />2
								<option value="3" />3
								<option value="4" />4
								<option value="5" />5
							</select>
							<i></i>
						</label>
		</section></td>
  </tr>
  <tr>
    <td align="center">Aventure</td>
     <td bgcolor="#EC8A00">&nbsp;</td>
    <td bgcolor="#ED7D09">&nbsp;</td>
    <td bgcolor="#EE7012">&nbsp;</td>
    <td bgcolor="#EF631A">&nbsp;</td>
    <td bgcolor="#F05623">&nbsp;</td>
    <td align="center">Secure</td>
    <td><section>
						<label class="label">Select</label>
						<label class="select">
							<select name="5">
								<option value="1" />1
								<option value="2" />2
								<option value="3" />3
								<option value="4" />4
								<option value="5" />5
							</select>
							<i></i>
						</label>
		</section></td>
  </tr>
  <tr>
    <td align="center">Quiet</td>
     <td bgcolor="#EC8A00">&nbsp;</td>
    <td bgcolor="#ED7D09">&nbsp;</td>
    <td bgcolor="#EE7012">&nbsp;</td>
    <td bgcolor="#EF631A">&nbsp;</td>
    <td bgcolor="#F05623">&nbsp;</td>
    <td align="center">Loud</td>
    <td><section>
						<label class="label">Select</label>
						<label class="select">
							<select name="6">
								<option value="1" />1
								<option value="2" />2
								<option value="3" />3
								<option value="4" />4
								<option value="5" />5
							</select>
							<i></i>
						</label>
		</section></td>
  </tr>
  <tr>
    <td align="center">Subtle</td>
     <td bgcolor="#EC8A00">&nbsp;</td>
    <td bgcolor="#ED7D09">&nbsp;</td>
    <td bgcolor="#EE7012">&nbsp;</td>
    <td bgcolor="#EF631A">&nbsp;</td>
    <td bgcolor="#F05623">&nbsp;</td>
    <td align="center">Bright</td>
    <td><section>
						<label class="label">Select</label>
						<label class="select">
							<select name="7">
								<option value="1" />1
								<option value="2" />2
								<option value="3" />3
								<option value="4" />4
								<option value="5" />5
							</select>
							<i></i>
						</label>
		</section></td>
  </tr>
  <tr>
    <td align="center">Gray</td>
     <td bgcolor="#EC8A00">&nbsp;</td>
    <td bgcolor="#ED7D09">&nbsp;</td>
    <td bgcolor="#EE7012">&nbsp;</td>
    <td bgcolor="#EF631A">&nbsp;</td>
    <td bgcolor="#F05623">&nbsp;</td>
    <td align="center">Colorful</td>
    <td><section>
						<label class="label">Select</label>
						<label class="select">
							<select name="8">
								<option value="1" />1
								<option value="2" />2
								<option value="3" />3
								<option value="4" />4
								<option value="5" />5
							</select>
							<i></i>
						</label>
		</section></td>
  </tr>
  <tr>
    <td align="center">Subtle</td>
     <td bgcolor="#EC8A00">&nbsp;</td>
    <td bgcolor="#ED7D09">&nbsp;</td>
    <td bgcolor="#EE7012">&nbsp;</td>
    <td bgcolor="#EF631A">&nbsp;</td>
    <td bgcolor="#F05623">&nbsp;</td>
    <td align="center">Bright</td>
    <td><section>
						<label class="label">Select</label>
						<label class="select">
							<select name="9">
								<option value="1" />1
								<option value="2" />2
								<option value="3" />3
								<option value="4" />4
								<option value="5" />5
							</select>
							<i></i>
						</label>
		</section></td>
  </tr>
  <tr>
    <td align="center">Raw</td>
     <td bgcolor="#EC8A00">&nbsp;</td>
    <td bgcolor="#ED7D09">&nbsp;</td>
    <td bgcolor="#EE7012">&nbsp;</td>
    <td bgcolor="#EF631A">&nbsp;</td>
    <td bgcolor="#F05623">&nbsp;</td>
    <td align="center">Refined</td>
    <td><section>
						<label class="label">Select</label>
						<label class="select">
							<select name="10">
								<option value="1" />1
								<option value="2" />2
								<option value="3" />3
								<option value="4" />4
								<option value="5" />5
							</select>
							<i></i>
						</label>
		</section></td>
  </tr>
  <tr>
    <td align="center">Playful</td>
     <td bgcolor="#EC8A00">&nbsp;</td>
    <td bgcolor="#ED7D09">&nbsp;</td>
    <td bgcolor="#EE7012">&nbsp;</td>
    <td bgcolor="#EF631A">&nbsp;</td>
    <td bgcolor="#F05623">&nbsp;</td>
    <td align="center">Serious</td>
    <td><section>
						<label class="label">Select</label>
						<label class="select">
							<select name="11">
								<option value="1" />1
								<option value="2" />2
								<option value="3" />3
								<option value="4" />4
								<option value="5" />5
							</select>
							<i></i>
						</label>
		</section></td>
  </tr>
  <tr>
    <td align="center">Necessity</td>
     <td bgcolor="#EC8A00">&nbsp;</td>
    <td bgcolor="#ED7D09">&nbsp;</td>
    <td bgcolor="#EE7012">&nbsp;</td>
    <td bgcolor="#EF631A">&nbsp;</td>
    <td bgcolor="#F05623">&nbsp;</td>
    <td align="center">Luxury</td>
    <td><section>
						<label class="label">Select</label>
						<label class="select">
							<select name="12">
								<option value="1" />1
								<option value="2" />2
								<option value="3" />3
								<option value="4" />4
								<option value="5" />5
							</select>
							<i></i>
						</label>
		</section></td>
  </tr>
</table>
			</fieldset>
                <header><font size="-1" color="#FFFFFF">note: complete all required information in order to send the form.</font></header>
		  <footer>
					<button type="submit" class="button">Send</button>
					<button type="button" class="button button-secondary" onclick="window.history.back();">Clean</button>
		  </footer>
			</form>
            
            
            <br/>            
            
                       <table width="500" border="0" align="center">
  <tr>
    <td align="center"> <font size="-1" color="#666666"> João Queirós 2014</font></td>
     <td align="center"> <a href="http://www.joaoqueiros.com" style="text-decoration:none"><font size="-1" color="#666666">www.joaoqueiros.com</font></a></td>
  </tr>
</table>
            
             <? } ?>
             
  

		  <!--/ Orange color scheme -->			
		</div>
    <script type="text/javascript">
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2");
var sprytextarea1 = new Spry.Widget.ValidationTextarea("sprytextarea1");
var sprytextarea2 = new Spry.Widget.ValidationTextarea("sprytextarea2");
var sprytextarea3 = new Spry.Widget.ValidationTextarea("sprytextarea3");
var sprytextarea4 = new Spry.Widget.ValidationTextarea("sprytextarea4");
var sprytextarea5 = new Spry.Widget.ValidationTextarea("sprytextarea5");
var sprytextarea6 = new Spry.Widget.ValidationTextarea("sprytextarea6");
var sprytextarea7 = new Spry.Widget.ValidationTextarea("sprytextarea7");
var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3");
var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "email");
    </script>
	</body>
</html>

Send form

<?php
if( $_POST )
{
	 $to = "test@hotmail.com"; 
	 $line = "\r\n\r\n";
	 

	  $message .= " DADOS CLIENTE: " . $line . $line;

$message .= " Nome Completo: " . $_POST['nomecompleto'] . $line;
$message .= " E-mail: " . $_POST['email'] . $line ;
$message .= " Telefone: " . $_POST['telefone'] . $line ;
$message .= " Observações: " . $_POST['observacoes'] . $line;


	  $message .= " BRIEF LOGO: " . $line . $line;
	 
	 
	 $message .= " Nome da Empresa: " . $_POST['nome'] . $line . $line;
	 
	  $message .= " Slogan da Empresa: " . $_POST['slogan'] . $line . $line;
	  
	    $message .= " Área de negócio: " . $_POST['areanegocios'] . $line . $line;
	 
	 $message .= " 3 Items a Comunicar no logo: " . $line . $_POST['items'] . $line . $line; 
	 
	 
	 
	 	 $message .= " Escolha o tipos(s) de logo que pretende ver: " . $line; 
	  $message .= " Wormark: " . $_POST['wordmark'] . $line; 
	  	  $message .= " Letterform Mark: " . $_POST['letterform'] . $line; 
		  $message .= " Logo Abstracto: " . $_POST['abstracto'] . $line; 
		   $message .= " Logo Figurativo: " . $_POST['figurativo'] . $line; 
		   		   $message .= " Emblemas: " . $_POST['emblemas'] . $line; 
				    $message .= " Mascote: " . $_POST['mascote'] . $line; 
					  $message .= " Web 2.0: " . $_POST['web2'] . $line . $line; 
	 
	 
	  $message .= " Preferências de Cor: " . $_POST['cor'] . $line; 
	  
	   $message .= " As nossas ideias e informações adicionais: " . $_POST['ideias'] . $line; 
	   
	   $message .= " Onde vai ser usado o logo: " . $_POST['ondeeusado'] . $line; 
	   
	   
	   
	    $message .= " Estilos de logo: " . $line;
		$message .= " 1 2 3 4 5 : " . $line;
	    $message .= " Feminino - Masculino: " . $_POST['1'] . $line;
	    $message .= " Moderno - Clássico: " . $_POST['2'] . $line;
		$message .= " Exótico - Comum: " . $_POST['3'] . $line;
		$message .= " Desportivo - Elegante: " . $_POST['4'] . $line;
		$message .= " Aventureiro - Seguro: " . $_POST['5'] . $line;
		$message .= " Calmo - Forte: " . $_POST['6'] . $line;
		$message .= " Subtil - Brilhante: " . $_POST['7'] . $line;
		$message .= " Cinzento - Colorido: " . $_POST['8'] . $line;
		$message .= " Simples - Complexo: " . $_POST['9'] . $line;
		/*$message .= " Rude - Definido: " . $_POST['10'] . $line;*/
		$message .= " Brincalhão - Sério: " . $_POST['11'] . $line;
		$message .= " Necessidade - Luxúria: " . $_POST['12'] . $line;
 
	 $subject = " Logo Design Brief - Formulário: " . $_POST['nome']; 
	 $headers = "From: ".$_POST['email']; 
	 $sent = mail($to, $subject, $message, $headers) ; 
	 if($sent) 
		header("Location: ".$_SERVER["HTTP_REFERER"]."?sucesso=email");
	 else 
		header("Location: ".$_SERVER["HTTP_REFERER"]."?erro=email");
} 
 exit;
?> 
 

Quando clico no botão enviar me dá esse erro no topo da página no final da url? Erro = email. Tentei editar o formulário, eu não trabalho com php há muito tempo e ainda não está a funcionar. Não consigo resolver 😞 Agradeço antecipadamente.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.