Jump to content
Fórum Script Brasil

Henrique Flausino

Membros
  • Posts

    67
  • Joined

  • Last visited

About Henrique Flausino

Perfil

  • Gender
    Male

Henrique Flausino's Achievements

0

Reputation

  1. Foi dai que tirei este script, porém não estou conseguindo alterar. Ele não funciona como mencionei no meu post original.
  2. Pessoal estou com uma duvida. Tenho o seguinte código, mas quero que ele calcule diretamente da seleção de uma combo. <?php function calcular_idade( $ano_de_nasc ){ $ano_de_hoje = date("Y"); $idade = $ano_de_hoje - $ano_de_nasc; echo $idade; } calcular_idade("1996"); ?> Como posso fazer isso? Alguém me ajuda? Nome da combo é propertyyearbuilt2 Tentei assim e não funcionou. <?php function calcular_idade( $ano_de_nasc ){ $ano_de_hoje = date("Y"); $idade = $ano_de_hoje - $ano_de_nasc; echo $idade; } calcular_idade($propertyyearbuilt2); ?>
  3. Detalhe, já existe uma sistema parecido, porém é gratuito e apenas envia as mensagens. No site de cada operadora existe a opção de enviar mensagem sms gratuitamente, porém somente para a mesma operadora. Até a nextel tem este sistema gratuito. Não seria um investimento desnecessário montar algo assim?
  4. Boa tarde. Estou com um problema em uma busca dinamica entre duas tabelas. Preciso que seja mostrado resultados dinamicos e que alterem a cada atualização da página e a cada acesso. abaixo o código funciona normalmente, porém preciso que seja mostrado apenas a cidade, que esta em uma tabela separada. Se colocar o endereço aparece corretamente, porém a cidade está alternando com o estado. Segue código. <?php { require ( "includes/config.php" ); require ( "includes/CGI.php" ); require ( "includes/SQL.php" ); $cgi = new CGI (); $sql = new SQL ( $DBusername, $DBpassword, $server, $database ); if ( ! $sql->isConnected () ) { die ( $DatabaseError ); } require ( "includes/CSQL.php" ); $rows = $sql->execute ( "SELECT * FROM $property_table, $cidade_table WHERE propertyshow = '1' ORDER BY RAND() LIMIT 1", SQL_RETURN_ASSOC ); $row = $rows [ 0 ]; { print "<p><a href=\"index.php?op=mi&id=$row[id]\">"; if ($row [ 'propertyphoto1' ] ){ print "<IMG SRC=\"".$ImageURL."$row[propertyphoto1]\" BORDER=\"0\" WIDTH=\"$max_thumb_image_width\" HEIGHT=\"$max_thumb_image_height\">";} else { print "<IMG SRC=\"".$ImageURL."nopropertyimage.jpg\" BORDER=\"0\" WIDTH=\"$max_thumb_image_width\" HEIGHT=\"$max_thumb_image_height\">";} print "</a><br>$row[descricao] </p>"; { } print "<p><a href=\"index.php?op=mi&id=$row[id]\">"; if ($row [ 'propertyphoto2' ] ){ print "<IMG SRC=\"".$ImageURL."$row[propertyphoto2]\" BORDER=\"0\" WIDTH=\"$max_thumb_image_width\" HEIGHT=\"$max_thumb_image_height\">";} else { print "<IMG SRC=\"".$ImageURL."nopropertyimage.jpg\" BORDER=\"0\" WIDTH=\"$max_thumb_image_width\" HEIGHT=\"$max_thumb_image_height\">";} print "</a><br>$row[descricao]</p>"; } } ?> Estrutura do banco. Banco properties. id agentref propertyoption propertyref propertytype propertyprice propertybedrooms propertybathrooms propertyyearbuilt propertylivingarea propertyplotsize propertyaddress propertyestado propertycidade propertybairro propertypostcode propertycountry shortdescription longdescription propertystatus propertyphoto1 propertyphoto2 propertyphoto3 propertyphoto4 propertyphoto5 propertyphoto6 propertyphoto7 propertyphoto8 propertyphoto9 propertyphoto10 propertyviews propertyshow featuredproperty virtualtour propertyowner dateadded 30 S 1002 2 46000 1 2 1890 1300 1400 Av. Sapopemba 4 5 5 03374-000 Breve descrição do Imóvel Descrição do Imóvel 2 1002-32-1143225528_offer_27_e.jpg 0 1 N Esta informação não é exibida no site. É para sua ... 11/10/2011 14:20 29 S 1002 2 46000 1 2 1890 1300 1400 Av. Sapopemba 4 5 5 03374-000 Breve descrição do Imóvel Descrição do Imóvel 2 1002-32-1143225528_offer_27_e.jpg 0 1 N Esta informação não é exibida no site. É para sua ... 11/10/2011 14:20 Banco cidade. codigo cod_estado descricao 4 5 Rio de Janeiro 5 4 São Paulo
  5. O problema não é erro e sim que não funciona. Estou tantando alterar mas não consigo. Estou tentando puxar Estado, Cidade e bairro, porém só vem a informação de localização que é a antiga tabela.
  6. Boa noite. Caros. Tenho um código que estou tentando alterar mas não consigo. Alterei a tabela do MYSQL para poder cadastrar Estado, Cidade e Bairro, porém não consigo ajustar o código para pesquisar. Será que alguém poderia me ajudar? Segue tabela: admin, bairro, cidade, configure, estado, features, properties, propertyfeatures, propertylocations, propertystatus, propertytypes Sendo que o propertylocations é o original e eu vou excluir. Estrutura das tabelas. Estado: Id, Descricao Cidade: codigo, cod_estado, descricao Bairro: codigo, cod_cidade, descricao properties: id, agentref, propertyoption, propertyref, propertytype, propertyprice, propertybedrooms, propertybathrooms, propertyyearbuilt, propertylivingarea, propertyplotsize, propertyaddress, propertylocationestado, propertylocationcidade, propertylocationbairro, propertypostcode, propertycountry, shortdescription, longdescription, propertystatus, propertyphoto1, propertyphoto2, propertyphoto3, propertyphoto4, propertyphoto5, propertyphoto6, propertyphoto7, propertyphoto8, propertyphoto9, propertyphoto10, propertyviews, propertyshow, featuredproperty, virtualtour, propertyowner, dateadded Código fonte. index.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>SGM Imóveis</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="images/style.css" rel="stylesheet" type="text/css"> <style type="text/css"> <!-- .style1 {color: #000000} .style3 {font-size: 14px} .style12 { font-size: 11px; color: #000; } .style10 {font-size: 12px} body { background-image: url(images/bg.gif); } --> </style> &lt;script src="Scripts/swfobject_modified.js" type="text/javascript"></script> &lt;script language="JavaScript" type="text/JavaScript"> <!-- function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } //--> </script> </head> <body> <table width="980" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <tr> <td width="750" height="250" align="center"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center"><img src="images/logo.jpg" width="990" height="250" class="logo" /></td> </tr> </table></td> </tr> <tr> <td valign="top"> <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#F2F2F2"> <tr> <td width="150" rowspan="2" valign="top"><table width="192" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="middle"> <div class="menu-imob"><br /> <ul> <li class="bullets"><a href="index.php">Principal</a></li> <li class="bullets"><a href="#" target="_top" onClick="MM_openBrWindow('cadastro/index.php','Cadastro','scrollbars=yes,width=650,height=480')"> Cadastre seu Imóvel</a></li> <li class="bullets"><a href="index.php?op=search&po=S" target="_top"> Imóveis para Venda</a></li> <li class="bullets"><a href="index.php?op=search&po=R" target="_top"> Imóveis para Aluguel</a></li> <li class="bullets"><a href="#" onClick="window.open('contato.php','Janela','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=461,height=260'); return false;">Fale Conosco</a><br></li> </ul> </div> <br><strong><span class="style12"> Busca Avançada</span></strong><br><?php include ("includes/templates/inc-searchbox.php"); ?></td> </tr> <td align="left" valign="middle"> <!-- start of searchbox include --> <!-- end of searchbox include --> <strong> </strong> <strong> </strong><!-- end of price box include --></td> </tr> <tr> <td align="center" valign="middle"><img src="images/white-dot.gif" width="192" height="1"></td> </tr> <tr> <td align="left" valign="middle"> </td> </tr> <tr> <td align="center" valign="middle"><table width="90%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="middle"><p><strong><span class="style12">Busca por Cidade do Imóvel</span></strong><span class="style10"> <!-- start of location box include --> </span> </p> <blockquote> <?php include ("includes/templates/inc-locations2.php"); ?> </blockquote> <p><strong><span class="style12">Busca por Bairro do Imóvel</span></strong><span class="style10"> <!-- start of location box include --> </span> </p> <blockquote> <?php include ("includes/templates/inc-locations.php"); ?> </blockquote></td> </tr> </table> <!-- end of location box include --></td> </tr> <tr> <td align="left" valign="middle"> </td> </tr> <tr> <td align="center" valign="middle"><img src="images/white-dot.gif" width="192" height="1"></td> </tr> <tr> <td align="left" valign="middle"> </td> </tr> <tr> <td align="center" valign="middle"><table width="90%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="middle"><strong><span class="style12">Busca por Valor do Imóvel</span> </strong> <blockquote> <?php include ("includes/templates/inc-pricesearch.php"); ?> </blockquote></td> </tr> </table></td> </tr> <tr> <td align="center" valign="middle"> </td> </tr> <tr> <td align="center" valign="middle"> </td> </tr> </table></td> <td valign="top" bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td> </td> <td align="left" valign="top"> </td> <td> </td> </tr> <tr> <td width="20"> </td> <td width="800" align="left" valign="top"><?php if ( $cgi->getValue ( "op" ) == "search" || $cgi->getValue ( "op" ) == "mi" || $cgi->getValue ( "sp" ) == "y"|| $cgi->getValue ( "op" ) == "SendInformationRequest" ) { include "search_.php"; } else { ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> <tr> <td><div align="justify"> <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="500" height="300"> <param name="movie" value="images/teste2.swf"> <param name="quality" value="high"> <param name="wmode" value="opaque"> <param name="swfversion" value="9.0.45.0"> <!-- Esta tag param solicita que os usuários com o Flash Player 6.0 r65 e versões posteriores baixem a versão mais recente do Flash Player. Exclua-o se você não deseja que os usuários vejam o prompt. --> <param name="expressinstall" value="Scripts/expressInstall.swf"> <!-- A tag object a seguir aplica-se a navegadores que não sejam o IE. Portanto, oculte-a do IE usando o IECC. --> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="images/teste2.swf" width="500" height="300"> <!--<![endif]--> <param name="quality" value="high"> <param name="wmode" value="opaque"> <param name="swfversion" value="9.0.45.0"> <param name="expressinstall" value="Scripts/expressInstall.swf"> <!-- O navegador exibe o seguinte conteúdo alternativo para usuários que tenham o Flash Player 6.0 e versões anteriores. --> <div> <h4>O conteúdo desta página requer uma versão mais recente do Adobe Flash Player.</h4> <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Obter Adobe Flash player" width="112" height="33" /></a></p> </div> <!--[if !IE]>--> </object> <!--<![endif]--> </object> </div></td> </tr> <tr> <td> </td> </tr> <tr> <td height="1" background="images/lista_im.gif"></td> </tr> <tr> <td> </td> </tr> <tr> <td height="30" align="left" valign="middle" bgcolor="#0058A9"><img src="includes/images/destaque.gif" width="189" height="30"></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="center" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr align="center" valign="middle"> <td><?PHP include "includes/tools/random-property.php"; ?></td> <td><?PHP include "includes/tools/random-property.php"; ?></td> <td><?PHP include "includes/tools/random-property.php"; ?></td> </tr> </table></td> </tr> </table> <p> <?php } ?> </p> </td><td width="10"> </td> </tr> </table></td> </tr> <tr> <td bgcolor="#FFFFFF"> </td> </tr> </table></td> </tr> <tr> <td height="35" align="center" valign="middle" bgcolor="#0058A9"> <table width="980" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="218"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="right" valign="middle"><img src="includes/images/contato.gif" width="189" height="35"></td> </tr> <tr> <td align="left" valign="middle"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="26%"> </td> <td width="74%" align="left" valign="middle"><span class="style12" style="color:#fff">Fone: <br> (11) 0000-0000</span></td> </tr> </table></td> </tr> <tr> <td align="left" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="26%"> </td> <td width="74%" align="left" valign="middle"><span class="style12" style="color:#fff">Fax: <br> (11) 0000-0000</span></td> </tr> </table></td> </tr> <tr> <td align="left" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="26%"> </td> <td width="74%" align="left" valign="middle"> </td> </tr> </table></td> </tr> <tr> <td align="left" valign="middle"> </td> </tr> </table></td> <td width="762" align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="25"> </td> </tr> <tr> <td align="center" valign="middle"><p><span class="baseline">© Copyright <?php echo date("Y"); ?> M&F Design.</span> </p> <p> </p></td> </tr> </table></td> </tr> </table></td> </tr> </table> &lt;script type="text/javascript"> swfobject.registerObject("FlashID"); </script> </body> </html> inc-searchbox.php <link href="../../images/style.css" rel="stylesheet" type="text/css"> <?php require ( "includes/config.php" ); require ( "includes/CGI.php" ); require ( "includes/SQL.php" ); $cgi = new CGI (); $sql = new SQL ( $DBusername, $DBpassword, $server, $database ); if ( ! $sql->isConnected () ) { die ( $DatabaseError ); } require ( "includes/CSQL.php" ); require ( "includes/lang/" . $language_pack . "/index.php" ); ?> <style type="text/css"> <!-- .style1 { color: #FFFFFF; font-weight: bold; } .style2 {color: #FFFFFF} --> </style> <form method="get" action="<?php echo "$template_page_name"; ?>"> <input name="op" type="hidden" value="search" /> <table width="233" height="297" border="0" align="center" cellpadding="2" cellspacing="2"> <?php if($display_search_types == "Y") { ?> <tr> <td width="87" height="25"><p align="right" class="menu style1" style="color:#000">Tipo:</p></td> <td width="128"><p> <select name="pt" size="1" style="height: 18px; width:125px;"> <option value="" selected="selected"><?php echo FORM_SELECT_ALL_TYPES; ?></option> <?PHP $rows = $sql->execute ( "SELECT * FROM " . $propertytypes_table . " ORDER BY propertytype ASC", SQL_RETURN_ASSOC ); for ( $i = 0; $i < sizeof ( $rows ); ++$i ) { $row = $rows [ $i ]; ?> <option value="<?php echo $cgi->htmlEncode ( $row [ "id" ] ); ?>"> <?php echo $cgi->htmlEncode ( $row [ "propertytype" ] ); ?> </option> <?php } ?> </select> </p></td> </tr> <?php } if($display_search_max_price == "Y") { ?> <tr> <td class="b2" height="25"><p align="right" class="style1" style="color:#000">Menor Valor:</p></td> <td><p> <select name="pp_max" style="height: 18px; width:125px;"> <?php if (($display_sale) == "Y"){ ?> <option value="45000" selected="selected"><?php echo CURRENCY; ?> 45.000,00</option> <option value="65000"><?php echo CURRENCY; ?> 65.000,00</option> <option value="75000"><?php echo CURRENCY; ?> 75.000,00</option> <option value="100000"><?php echo CURRENCY; ?> 100.000,00</option> <option value="125000"><?php echo CURRENCY; ?> 125.000,00</option> <option value="150000"><?php echo CURRENCY; ?> 150.000,00</option> <option value="175000"><?php echo CURRENCY; ?> 175.000,00</option> <option value="200000"><?php echo CURRENCY; ?> 200.000,00</option> <option value="300000"><?php echo CURRENCY; ?> 300.000,00</option> <option value="400000"><?php echo CURRENCY; ?> 400.000,00</option> <option value="500000"><?php echo CURRENCY; ?> 500.000,00</option> <option value="600000"><?php echo CURRENCY; ?> 600.000,00</option> <option value="700000"><?php echo CURRENCY; ?> 700.000,00</option> <option value="800000"><?php echo CURRENCY; ?> 800.000,00</option> <option value="900000"><?php echo CURRENCY; ?> 900.000,00</option> <option value="1000000"><?php echo CURRENCY; ?> 1.000,000,00</option> <option value="2000000"><?php echo CURRENCY; ?> 2.000,000,00</option> <?php } if (($display_rental) == "Y"){ ?> <option value=""><?php echo FORM_DISPLAY_RENTAL_SELECT; ?></option> <option value="200"><?php echo CURRENCY; ?> 200,00</option> <option value="300"><?php echo CURRENCY; ?> 300,00</option> <option value="400"><?php echo CURRENCY; ?> 400,00</option> <option value="500"><?php echo CURRENCY; ?> 500,00</option> <option value="750"><?php echo CURRENCY; ?> 750,00</option> <?php } ?> </select> </p></td> </tr> <tr> <td height="25"><p align="right" class="copyright style2"><strong style="color:#000">Maior Valor:</strong></p></td> <td><p> <select name="pp_min" style="height: 18px; width:125px;"> <?php if (($display_sale) == "Y"){ ?> <option value="100"><?php echo CURRENCY; ?> 100,00</option> <option value="125"><?php echo CURRENCY; ?> 125,00</option> <option value="150"><?php echo CURRENCY; ?> 150,00</option> <option value="175"><?php echo CURRENCY; ?> 175,00</option> <option value="200"><?php echo CURRENCY; ?> 200,00</option> <option value="300"><?php echo CURRENCY; ?> 300,00</option> <option value="400"><?php echo CURRENCY; ?> 400,00</option> <option value="500"><?php echo CURRENCY; ?> 500,00</option> <option value="600"><?php echo CURRENCY; ?> 600,00</option> <option value="700"><?php echo CURRENCY; ?> 700,00</option> <option value="800"><?php echo CURRENCY; ?> 800,00</option> <option value="900"><?php echo CURRENCY; ?> 900,00</option> <option value="1000"><?php echo CURRENCY; ?> 1.000,00</option> <option value="2000" selected="selected"><?php echo CURRENCY; ?> 2.000,00</option> <?php } if (($display_rental) == "Y"){ ?> <option value=""><?php echo FORM_DISPLAY_RENTAL_SELECT; ?></option> <option value="200"><?php echo CURRENCY; ?> 200,00</option> <option value="300"><?php echo CURRENCY; ?> 300,00</option> <option value="400"><?php echo CURRENCY; ?> 400,00</option> <option value="500"><?php echo CURRENCY; ?> 500,00</option> <option value="750"><?php echo CURRENCY; ?> 750,00</option> <option value="1000"><?php echo CURRENCY; ?> 1.000,00</option> <option value="1500"><?php echo CURRENCY; ?> 1.500,00</option> <?php } ?> </select> </p></td> </tr> <?php } if($display_search_bedrooms == "Y") { ?> <tr> <td height="25"><p align="right" class="style2 copyright"><strong style="color:#000"> Quartos:</strong></p></td> <td><p> <select name="pb" style="height: 18px; width:125px;"> <option value="0" selected="selected"><?php echo FORM_NO_PREFERENCE; ?></option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> </p></td> </tr> <?php } if($display_search_locations == "Y") { ?> <tr> <td height="25"><b>Estado:</b>:</strong></td> <td>&lt;script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> &lt;script type="text/javascript" src="js/cbox.js"></script><p> <select name="categoria"> <option value="0">Escolha um Estado</option> <?php include("include/connect_data_base.php"); $sql_cat=mysql_query("SELECT * FROM estado ORDER BY descricao ASC") or die(mysql_error()); while($result_sql_cat = mysql_fetch_object($sql_cat)){ echo '<option value="'.$result_sql_cat->id.'">'.$result_sql_cat->descricao.'</option>'; } ?> <!-- --> </select> </p> </td> </tr> <?php } ?> <?php if (($display_rental & $display_sale) == "Y"){ echo "<TR><TD></TD><TD><p><input name=\"po\" type=\"radio\" value=\"S\"><font color=\"#000000\" face=\"Arial\" size=\"2\">Vendas</font><br> <input name=\"po\" type=\"radio\" value=\"R\"><font color=\"#000000\" face=\"Arial\" size=\"2\">Aluguel</font><br></p></TD></TR>"; } elseif (($display_rental) == "Y"){ echo "<TR><TD></TD><TD><p> <input name=\"po\" type=\"hidden\" value=\"R\"></p></TD></TR>"; } elseif (($display_sale) == "Y"){ echo "<TR><TD></TD><TD><p> <input name=\"po\" type=\"hidden\" value=\"S\"></p></TD></TR>"; } ?> <tr> <td height="38"><b>Cidade:</b></td> <td> <select name="cidade"> <option value="0" disabled="disabled">Escolha um Estado Primeiro</option> </select> </td> </tr> <tr> <td height="38"><b>Bairro</b></td> <td><select name="bairro"> <option value="0" disabled="disabled">Escolha uma Cidade Primeiro</option> </select></td> </tr> <tr> <td height="38"></td> <td> </td> </tr> <tr> <td height="38"></td> <td><input name="input" type="image" src="<?php print "$LanguageFolder/$language_pack"; ?>/buttons/button-search.gif" /></td> </tr> </table> </form> inc-locations.php <?php require ( "includes/config.php" ); require ( "includes/CGI.php" ); require ( "includes/SQL.php" ); $cgi = new CGI (); $sql = new SQL ( $DBusername, $DBpassword, $server, $database ); if ( ! $sql->isConnected () ) { die ( $DatabaseError ); } require ( "includes/CSQL.php" ); require ( "includes/lang/" . $language_pack . "/index.php" ); // Get the property locations from the database and display them in alpha order { $rows = $sql->execute ( "SELECT * FROM " . $bairro_table . " ORDER BY descricao ASC", SQL_RETURN_ASSOC ); $num = sizeof ( $rows ); for ( $i = 0; $i < $num; ++$i ) { $id = $rows [ $i ] [ "codigo" ]; $propertylocation = $rows [ $i ] [ "descricao" ]; echo "<img src=\"includes/images/arrow_blue.gif\" width=\"10\" height=\"13\"> <a href=\"$template_page_name?op=search&pl=$id\" style=\"color:#000\">$propertylocation</a><br>"; } } ?> inc-locations2.php <?php require ( "includes/config.php" ); require ( "includes/CGI.php" ); require ( "includes/SQL.php" ); $cgi = new CGI (); $sql = new SQL ( $DBusername, $DBpassword, $server, $database ); if ( ! $sql->isConnected () ) { die ( $DatabaseError ); } require ( "includes/CSQL.php" ); require ( "includes/lang/" . $language_pack . "/index.php" ); // Get the property locations from the database and display them in alpha order { $rows = $sql->execute ( "SELECT * FROM " . $cidade_table . " ORDER BY descricao ASC", SQL_RETURN_ASSOC ); $num = sizeof ( $rows ); for ( $i = 0; $i < $num; ++$i ) { $id = $rows [ $i ] [ "codigo" ]; $propertylocation = $rows [ $i ] [ "descricao" ]; echo "<img src=\"includes/images/arrow_blue.gif\" width=\"10\" height=\"13\"> <a href=\"$template_page_name?op=search&pl=$id\" style=\"color:#000\">$propertylocation</a><br>"; } } ?> layout_view.php <?php $layoutId = $cgi->getValue ( "id" ); $rows = $sql->execute ( "SELECT * FROM " . $property_table . " WHERE id=" . $sql->quote ( $layoutId ) . " AND propertyshow=1 LIMIT 1", SQL_RETURN_ASSOC ); $row = $rows [ 0 ]; $Price = number_format ( $row [ 'propertyprice' ], 2, ",", "." ); $sql->execute ( "UPDATE " . $property_table . " SET propertyviews=(propertyviews + 1) WHERE id=" . $sql->quote ( $layoutId ) . " LIMIT 1" ); $ThumbPhotoWidth = "100"; $ThumbPhotoHeight = "80"; ?> <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0"> <tr valign="top"> <td colspan="2" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="lvp_top_nav_menu_bg"> <tr valign="middle"> <td> <?php echo LV_PROPERTY_REF; ?> <strong><?php echo $row [ "propertyref" ]; ?></strong> - <?php echo $row [ "propertyaddress" ]; ?> - <?php echo $_GET [ "pl" ]; ?> - Cep: <?php echo $row [ "propertypostcode" ]; ?></td> <td align="right"> <a href="?sp=y&id=<?php echo $row [ "id" ]; ?>"><img src="includes/lang/<?php print "$language_pack"; ?>/buttons/button-view-photos.gif" title="Ver Fotos" border="0" /></a> <a href="java script:history.go(-1)"><img src="includes/lang/<?php print "$language_pack"; ?>/buttons/button-back.gif" title="Voltar" border="0" /></a></td> </tr> </table></td> </tr> <tr valign="top"> <td width="48%" valign="top"><?php if ( ! $row [ 'propertyphoto1' ] ) { ?> <img src="<?php echo $ImageURL; ?>nopropertyimage.jpg" border="0" /> <?php } else { ?> <table cellpadding="0" cellspacing="1"> <tr> <td width="300" height="300" align="center" valign="top"><img src="<?php echo $ImageURL; ?><?php echo $row [ "propertyphoto1" ]; ?>" name="large" hspace="10" border="0" align="left" id="large" /> </td> </tr> <tr> <td width="300" align="center" valign="top"><table cellpadding="0" cellspacing="2"> <tr> <td valign="middle" align="center"><?php if ($row [ 'propertyphoto1' ] ) { echo "<img src=\"$ImageURL$row[propertyphoto1]\" width=\"$ThumbPhotoWidth\" height=\"$ThumbPhotoHeight\" border=\"0\" onmousedown=\"document.images['large'].src='$ImageURL$row[propertyphoto1]'\">";} ?> </td> <td valign="middle" align="center"><?php if ($row [ 'propertyphoto2' ] ) { echo "<img src=\"$ImageURL$row[propertyphoto2]\" width=\"$ThumbPhotoWidth\" height=\"$ThumbPhotoHeight\" border=\"0\" onmousedown=\"document.images['large'].src='$ImageURL$row[propertyphoto2]'\">";} ?></td> <td valign="middle" align="center"><?php if ($row [ 'propertyphoto3' ] ) { echo "<img src=\"$ImageURL$row[propertyphoto3]\" width=\"$ThumbPhotoWidth\" height=\"$ThumbPhotoHeight\" border=\"0\" onmousedown=\"document.images['large'].src='$ImageURL$row[propertyphoto3]'\">";} ?></td> </tr> <tr> <td valign="middle" align="center"><?php if ($row [ 'propertyphoto4' ] ) { echo "<img src=\"$ImageURL$row[propertyphoto4]\" width=\"$ThumbPhotoWidth\" height=\"$ThumbPhotoHeight\" border=\"0\" onmousedown=\"document.images['large'].src='$ImageURL$row[propertyphoto4]'\">";} ?> </td> <td valign="middle" align="center"><?php if ($row [ 'propertyphoto5' ] ) { echo "<img src=\"$ImageURL$row[propertyphoto5]\" width=\"$ThumbPhotoWidth\" height=\"$ThumbPhotoHeight\" border=\"0\" onmousedown=\"document.images['large'].src='$ImageURL$row[propertyphoto5]'\">";} ?> </td> <td valign="middle" align="center"><?php if ($row [ 'propertyphoto6' ] ) { echo "<img src=\"$ImageURL$row[propertyphoto6]\" width=\"$ThumbPhotoWidth\" height=\"$ThumbPhotoHeight\" border=\"0\" onmousedown=\"document.images['large'].src='$ImageURL$row[propertyphoto6]'\">";} ?> </td> </tr> <tr> <td valign="middle" align="center"><?php if ($row [ 'propertyphoto7' ] ) { echo "<img src=\"$ImageURL$row[propertyphoto7]\" width=\"$ThumbPhotoWidth\" height=\"$ThumbPhotoHeight\" border=\"0\" onmousedown=\"document.images['large'].src='$ImageURL$row[propertyphoto7]'\">";} ?> </td> <td valign="middle" align="center"><?php if ($row [ 'propertyphoto8' ] ) { echo "<img src=\"$ImageURL$row[propertyphoto8]\" width=\"$ThumbPhotoWidth\" height=\"$ThumbPhotoHeight\" border=\"0\" onmousedown=\"document.images['large'].src='$ImageURL$row[propertyphoto8]'\">";} ?> </td> <td valign="middle" align="center"><?php if ($row [ 'propertyphoto9' ] ) { echo "<img src=\"$ImageURL$row[propertyphoto9]\" width=\"$ThumbPhotoWidth\" height=\"$ThumbPhotoHeight\" border=\"0\" onmousedown=\"document.images['large'].src='$ImageURL$row[propertyphoto9]'\">";} ?> </td> </tr> <tr> <td valign="middle" align="center"><?php if ($row [ 'propertyphoto10' ] ) { echo "<img src=\"$ImageURL$row[propertyphoto10]\" width=\"$ThumbPhotoWidth\" height=\"$ThumbPhotoHeight\" border=\"0\" onmousedown=\"document.images['large'].src='$ImageURL$row[propertyphoto10]'\">";} ?> </td> <td valign="middle" align="center"></td> <td valign="middle" align="center"></td> </tr> </table></td> </tr> </table> <?php } ?> </td> <td width="52%" align="left" valign="top"><p><?php echo $row [ "shortdescription" ]; ?></p> <table width="100%" border="0" cellspacing="0" cellpadding="5"> <tr> <td align="left" valign="top"> <p><strong>Valor:</strong> <strong><?php echo CURRENCY; ?> <?php echo "$Price"; ?></strong></p> <p> <?php if ( $row [ 'propertybedrooms' ] ) { echo " $row[propertybedrooms] - Quartos<br>"; } if ( $row [ 'propertybathrooms' ] ) { echo "$row[propertybathrooms] - Banheiros"; } ?> </p> <?php $_features = $sql->execute ( "SELECT description FROM " . $features_table . " INNER JOIN " . $propertyfeatures_table . " ON (id=feature_id) WHERE property_id=" . $sql->quote ( $layoutId ), SQL_RETURN_ASSOC ); $features = array (); if ( $row [ 'propertyyearbuilt' ] ) { $features [] = "Construído em $row[propertyyearbuilt]"; } if ( $row [ 'propertylivingarea' ] ) { $features [] = "$row[propertylivingarea] Área Construída"; } if ( $row [ 'propertyplotsize' ] ) { $features [] = "$row[propertyplotsize] Área Total"; } for ( $i = 0; $i < sizeof ( $_features ); ++$i ) { $features [] = $cgi->htmlEncode ( $_features [ $i ] [ "description" ] ); } for ( $i = 0; $i < sizeof ( $features ); ++$i ) { ?> <p><?php echo $cgi->htmlEncode ( $features [ $i ] ); ?></p> <?php } ?></td> </tr> </table></td> </tr> <tr valign="top"> <td colspan="2" valign="top"> <p align="left"><?php echo nl2br($row [ "longdescription" ]); ?></p></td> </tr> </table> <table width="540" border="0" align="center" cellpadding="0" cellspacing="0"> <tr align="center" valign="middle"> <td width="150"><a href="#CONTACT"><img src="includes/images/link-requestinformation.gif" width="150" height="40" border="0"></a></td> <td width="20"> </td> <td width="174"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="middle"><?php $MapLinkUrl = str_replace("XXXXXX", "$row[propertypostcode]", "$property_map_url"); if ($row [ 'propertypostcode' ] ) { print "<td></td><td><a href=\"$MapLinkUrl\" target=\"new\"><img src=\"includes/images/link-map.gif\" border=\"0\"/></a></td>";} ?></td> </tr> </table></td> <td width="20"> </td> <td width="176"><a href="includes/templates/printfactsheet.php?id=<?php echo $row [ "id" ]; ?>" target="_blank"><img src="includes/images/link-print.gif" width="176" height="40" border="0"></a></td> </tr> </table> <p> </p> layout_results.php <?php $Price = number_format ($row [ 'propertyprice' ], 2, ",", "."); ?> <table width="100%" align="center" class="lrp_bg"> <tr valign="middle"> <td colspan="2" valign="middle" align="left"> <p> <font size="-1"><b><?php echo $row [ "propertyaddress" ]; ?> - <?php echo $cgi->htmlEncode ( $row [ "codigo" ] ); ?></b></font></p></td> <td valign="middle" align="right"><p class="propertystatus"><?php echo strtoupper ( $cgi->htmlEncode ( $row [ "propertystatus" ] ) ); ?> </p></td> </tr> <tr> <td colspan="3" bgcolor="#FFFFFF"> <table width="100%" cellpadding="3" cellspacing="1"> <tr> <td><p align="center"> <?php if ( ! $row [ "propertyphoto1" ] ) { ?><img src="<?php echo $ImageURL; ?>nopropertyimage.jpg" height="<?php echo $max_thumb_image_height; ?>" width="<?php echo $max_thumb_image_width; ?>" border="0" /><?php } else { ?><a href="?op=mi&id=<?php echo $row [ "id" ]; ?>&pl=<?php echo $row [ "propertylocation" ]; ?>"><img src="<?php echo $ImageURL; ?><?php echo $row [ "propertyphoto1" ]; ?>" height="<?php echo $max_thumb_image_height; ?>" width="<?php echo $max_thumb_image_width; ?>" border="0" alt="<?php echo $row [ "propertyaddress" ]; ?>, <?php echo $row [ "propertylocation" ]; ?>" title="<?php echo $row [ "propertyaddress" ]; ?>, <?php echo $row [ "propertylocation" ]; ?>" /></a><?php } ?></p></td> <td valign="top" align="left" width="100%"> <table width="100%" cellpadding="1" cellspacing="1"> <tr> <td> <p><?php echo LR_PROPERTY_TYPE; ?> <b><?php echo $row [ "propertytype" ]; ?></b></p></td> <td> <p><?php echo LR_PROPERTY_PRICE; ?> <b><?php echo CURRENCY, $Price; ?></b></p></td> </tr> <tr> <td> <p><?php echo LR_PROPERTY_REF; ?> <b><?php echo $row [ "propertyref" ]; ?></b></p></td> <td> <p> <?php if ($row [ "propertybedrooms" ] == "0") { echo "";} else { ?> <?php echo LR_NUMBER_OF_BEDROOMS; ?> <b><?php echo $row [ "propertybedrooms" ]; ?></b> <?php } ?></p></td> </tr> </table> <p> <?php echo $row [ "shortdescription" ]; ?></p> <p align="right"><a href="?op=mi&id=<?php echo $row [ "id" ]; ?>&pl=<?php echo $row [ "propertylocation" ]; ?>"><img src="<?php print "$LanguageFolder/$language_pack"; ?>/buttons/button-moreinformation.gif" title="Veja mais detalhes" border="0" /></a></p></td> </tr> </table></td> </tr> </table> <br /> <br /> search_.php <?php require ( "includes/config.php" ); require ( "includes/CGI.php" ); require ( "includes/SQL.php" ); $cgi = new CGI (); $sql = new SQL ( $DBusername, $DBpassword, $server, $database ); if ( ! $sql->isConnected () ) { die ( $DatabaseError ); } require ( "includes/CSQL.php" ); require ( "includes/lang/" . $language_pack . "/index.php" ); ?> <!-- // comment this out, allows you to use your own stylesheet with propertymax pro <link rel="stylesheet" href="includes/lang/<?php print "$language_pack"; ?>/style.css" /> --> &lt;script language="JavaScript" type="text/javascript"> <!-- Begin var submitcount=0; function reset() { document.emailform.name.value=""; document.emailform.email.value=""; document.emailform.address.value=""; } function checkFields() { if ( (document.emailform.name.value=="") || (document.emailform.email.value=="") || (document.emailform.address.value=="")) { alert("<?php echo GENERAL_FORM_POPUP_ERROR_MESSAGE; ?>"); return false; } } // End --></script> <?php if ( $cgi->getValue ( "op" ) == "SendInformationRequest" ) { // Contact Form Spam Check for Website URl's which should not be there $SpamErrorMessage = "<p align=\"center\"><font color=\"red\">Website URLs are not permitted in the request form.</font></b></p>"; if (preg_match("/http/", "" . $cgi->getValue ( "name" ) . "")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/", "" . $cgi->getValue ( "email" ) . "")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/", "" . $cgi->getValue ( "telephone" ) . "")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/", "" . $cgi->getValue ( "address" ) . "")) {echo "$SpamErrorMessage"; exit();} $yoursubject = "".EMAIL_SUBJECT." Cod. " . $cgi->getValue ( "propertyref" ); $emailtext = " ----------------------------------------------------------------------------- ".EMAIL_TEXT_TITLE." ----------------------------------------------------------------------------- ".EMAIL_TEXT_BODY." ".EMAIL_PD." ".EMAIL_PROEPRTY_REF." " . $cgi->getValue ( "propertyref" ) . " ".EMAIL_PROPERTY_ADDRESS." " . $cgi->getValue ( "propertyaddress" ) . " ".EMAIL_PROPERTY_PRICE." ".CURRENCY."" . $cgi->getValue ( "propertyprice" ) . " ".EMAIL_RD." ".EMAIL_NAME." " . $cgi->getValue ( "name" ) . " ".EMAIL_EMAIL_ADDRESS." " . $cgi->getValue ( "email" ) . " ".EMAIL_TELEPHONE." " . $cgi->getValue ( "telephone" ) . " " . $cgi->getValue ( "address" ) . " ________________________________ ".EMAIL_FOOTER." "; $yoursubject = stripslashes ( $yoursubject ); $emailtext = stripslashes ( $emailtext ); @mail ( $cgi->getValue ( "adminemailaddress" ), $yoursubject, $emailtext, "From: " . $cgi->getValue ( "email" ) ); ?> <br /> <br /> <br /> <p align="center"><?php echo EMAIL_SUCCESS_MESSAGE; ?></p> <br /> <p align="center">[<a href="?op=search&po=S"><?php echo FORM_VIEW_ALL_SALE_PROPERTIES; ?></a>]</p> <br /> <br /> <?php } // view more information about the property if requested if ( $cgi->getValue ( "op" ) == "mi" ) { // Start of Display Output require ( "includes/templates/layout_view.php" ); // End of Display output $arows = $sql->execute ( "SELECT * FROM " . $admin_table . " LIMIT 1", SQL_RETURN_ASSOC ); $arow = $arows [ 0 ]; ?> <table width="100%" align="center" class="lvp_top_nav_menu_bg"> <tr valign="top"> <td><p><?php echo LV_MORE_INFORMATION_TITLE; ?></p></td> </tr> </table> <a name="CONTACT" id="CONTACT"></a> <p align="center"><?php echo LV_MORE_INFORMATION_TEXT; ?></p> <br /> <table width="85%" align="center" cellpadding="10"> <tr> <td valign="top"><p><strong><?php echo $cgi->htmlEncode ( $arow [ "adminbusinessname" ] ); ?></strong><br /> <?php echo $cgi->htmlEncode ( $arow [ "adminaddress" ] ); ?><br /> <?php echo $cgi->htmlEncode ( $arow [ "admintown" ] ); ?><br /> <?php echo $cgi->htmlEncode ( $arow [ "admincounty" ] ); ?><br /> <?php echo $cgi->htmlEncode ( $arow [ "adminpostcode" ] ); ?></p> <p>Tel: <?php echo $cgi->htmlEncode ( $arow [ "admintelephone" ] ); ?><br /> Fax: <?php echo $cgi->htmlEncode ( $arow [ "adminfax" ] ); ?></p></td> <td><form method="post" name="emailform" id="emailform" onsubmit="return checkFields()"> <input name="op" type="hidden" value="SendInformationRequest" /> <input name="propertyref" type="hidden" value="<?php echo $cgi->htmlEncode ( $row [ "propertyref" ] ); ?>" /> <input name="propertyaddress" type="hidden" value="<?php echo $cgi->htmlEncode ( $row [ "propertyaddress" ] ); ?>" /> <input name="propertylocation" type="hidden" value="<?php echo $cgi->htmlEncode ( $row [ "propertylocation" ] ); ?>" /> <input name="propertyprice" type="hidden" value="<?php echo $cgi->htmlEncode ( $row [ "propertyprice" ] ); ?>" /> <input name="adminemailaddress" type="hidden" value="<?php echo $cgi->htmlEncode ( $arow [ "adminemailaddress" ] ); ?>" /> <table cellpadding="1" cellspacing="1"> <tr> <td align="right"><p><?php echo LV_NAME; ?> </p></td> <td><input type="text" name="name" size="35" maxlength="100" /></td> </tr> <tr> <td align="right"><p><?php echo LV_EMAIL; ?> </p></td> <td><input type="text" name="email" size="35" maxlength="100" /></td> </tr> <tr> <td align="right"><p><?php echo LV_TELEPHONE; ?> </p></td> <td><input type="text" name="telephone" size="35" maxlength="100" /></td> </tr> <tr> <td align="right" valign="top"><p><?php echo LV_ADDRESS; ?> </p></td> <td><textarea name="address" rows="5" cols="35"></textarea></td> </tr> <tr> <td align="right" valign="top"> </td> <td><input name="" type="image" src="<?php print "$LanguageFolder/$language_pack"; ?>/buttons/button-send-request.gif" /></td> </tr> </table> <p> </p> </form></td> </tr> </table> <?php } else if ( $cgi->getValue ( "op" ) == "search" ) { $pt = $cgi->getValue ( "pt" ); $pp = $cgi->getValue ( "pp" ); $pb = $cgi->getValue ( "pb" ); $pl = $cgi->getValue ( "pl" ); $po = $cgi->getValue ( "po" ); $pp_min = $cgi->getValue ( "pp_min" ); $pp_max = $cgi->getValue ( "pp_max" ); $query = " SELECT p.id AS id, p.propertyoption AS propertyoption, p.propertyprice AS propertyprice, p.propertyaddress AS propertyaddress, pl.propertylocation AS propertylocation, ps.propertystatus AS propertystatus, pt.propertytype AS propertytype, p.propertyref AS propertyref, p.propertybedrooms AS propertybedrooms, p.propertyphoto1 AS propertyphoto1, p.propertyphoto2 AS propertyphoto2, p.propertyphoto3 AS propertyphoto3, p.propertyphoto4 AS propertyphoto4, p.shortdescription AS shortdescription, p.longdescription AS longdescription, p.virtualtour AS virtualtour FROM " . $property_table . " p INNER JOIN " . $propertytypes_table . " pt ON (p.propertytype=pt.id) INNER JOIN " . $propertylocations_table . " pl ON (p.propertylocation=pl.id) INNER JOIN " . $propertystatus_table . " ps ON (p.propertystatus=ps.id) WHERE p.propertyshow=1 "; if ( $pt != "" ) $query .= " AND p.propertytype=" . $sql->quote ( $pt ); if ( $pp_min != "" ) $query .= " AND p.propertyprice>=" . $sql->quote ( $pp_min ); if ( $pp_max != "" ) $query .= " AND p.propertyprice<=" . $sql->quote ( $pp_max ); if ( $pb != "" ) $query .= " AND p.propertybedrooms>=" . $sql->quote ( $pb ); if ( $pl != "" ) $query .= " AND p.propertylocation=" . $sql->quote ( $pl ); if ( $po != "" ) $query .= " AND p.propertyoption=" . $sql->quote ( $po ); // set the query ordering if ( isset ( $property_search_order ) && $property_search_order != "" ) $query .= "ORDER BY p." . $property_search_order . " " . ( "a" == strtolower ( substr ( $property_search_ordering, 0, 1 ) ) ? "ASC" : "DESC" ); $results = $sql->execute ( $query, SQL_RETURN_ASSOC ); $total_results = sizeof ( $results ); if ( $total_results == 0 ) { ?> <br /> <br /> <p align="center"><?php echo GENERAL_NO_PROPERTIES_FOUND; ?></p> <br /> <br /> <br /> <?php } if ( $total_results >0 ) { $total_pages = ceil ( $total_results / $property_search_limit ); //total number of pages $page = $cgi->getValue ( "page" ); if ( ! $page ) $page = 1; $offset = ( $page - 1 ) * $property_search_limit; //starting number for displaying results out of DB $max = $offset + $property_search_limit; $max = ( $max > $total_results ? $total_results : $max ); ?> <p align="center"><?php echo GENERAL_PROPERTIES_FOUND; ?></p> <br /> <?php for ( $l = $offset; $l < $max; ++$l ) { $row = $results [ $l ]; // Start of Display Output require ( "includes/templates/layout_results.php" ); // End of Display output } ?> <div align="center"> <p><?php echo GENERAL_PAGE; ?> - <?php if ( $page != 1 ) { ?> <a href="<?php echo $_SERVER [ 'PHP_SELF' ]; ?>?op=search&page=1&po=<?php echo $po; ?>&pt=<?php echo $pt; ?>&pp=<?php echo $pp; ?>&pb=<?php echo $pb; ?>&pl=<?php echo $pl; ?>&pp_min=<?php echo $pp_min; ?>&pp_max=<?php echo $pp_max; ?>"><< Voltar </a> - <?php $prevpage = $page - 1; } $to = ( $page < $total_pages - 2 ? $page + 3 : $total_pages ); $from = ( $page >= 1 && $page <= 3 ? 1 : $page - 3 ); for ( $i = $from; $i <= $to; ++$i ) { if ( $i == $total_results ) $to = $total_results; if ( $i != $page ) { ?> <a href="?op=search&showold=yes&page=<?php echo $i; ?>&po=<?php echo $po; ?>&pt=<?php echo $pt; ?>&pp=<?php echo $pp; ?>&pb=<?php echo $pb; ?>&pl=<?php echo $pl; ?>&pp_min=<?php echo $pp_min; ?>&pp_max=<?php echo $pp_max; ?>"><?php echo $i; ?></a> <?php } else { ?> <b>[<?php echo $i; ?>]</b> <?php } if ( $i != $total_pages ) ?> <?php } if ( $page != $total_pages ) { $nextpage = $page + 1; ?> - <a href="?op=search&page=<?php echo $total_pages; ?>&po=<?php echo $po; ?>&pt=<?php echo $pt; ?>&pp=<?php echo $pp; ?>&pb=<?php echo $pb; ?>&pl=<?php echo $pl; ?>&pp_min=<?php echo $pp_min; ?>&pp_max=<?php echo $pp_max; ?>">Próximo>></a> <?php } ?> </p> </div> <br /> <br /> <?php } } else if ( $cgi->getValue ( "sp" ) == "y" ) { // Start of Display Output require ( "includes/templates/layout_view_photos.php" ); // End of Display output } else { if ( !$cgi->getValue ( "op" ) == "SendInformationRequest" ) { ?> <br /> <br /> <h2 align="center"><?php echo FORM_TITLE; ?></h2> <p align="center"><?php echo FORM_SEARCH_TEXT; ?></p> <?php // Start of Search Box Output require ( "includes/templates/inc-searchbox.php" ); // End of Search Box Output } } ?> <br /> <p></p>
  7. Fiz uma perquisa e pode ser uma solução você comentar a linha que verifica este limite. if (current_user_can ('manage_options')) @ ini_set ('memory_limit', apply_filters ('admin_memory_limit, WP_MAX_MEMORY_LIMIT)); Caso consiga logar, retire os plugins e restaure o arquivo editado. Outra solução é restaurar um backup anterior do servidor.
  8. Não sei te dizer onde está o erro, mas pode ser que a pasta destinada as imagens esteja bloqueada, teste alterar para gravação também. Aparece somente este erro?
  9. Pessoal, resolvi o problema com a ajuda do André Manoel. Foi simples, bastou fazer uma comparação com IF. Abaixo código caso alguém tenha uma duvida parecida, já tem uma solução. <input name="bar" type="text" disabled="disabled" id="bar" value="<?php $bar = $cgi->htmlEncode ( $row [ "property_search_order" ] ); if($bar === "propertyprice") echo "Valor do Im&oacute;vel"; if($bar === "propertytype") echo "Tipo do Im&oacute;vel"; if($bar === "propertylocation") echo "Localiza&ccedil;&atilde;o do Im&oacute;vel"; ?>" size="20" maxlength="4" readonly="readonly" /> Att. Henrique Flausino
  10. Pessoal, vou ser mais claro. Já consegui puxar os dados do banco, mas preciso que o resultados seja mostrado assim: Quando o resultado for "propertyprice" deverá ser mostrado "Valor do Imóvel" e assim por diante, para mais 2 outros resoltados. Att. Henrique Flausino
  11. Já puxei os dados, mas preciso de uma função que ao mostrar um dos 3 resultados ele altere para o seu respectivo valor. propertyprice = Valor do Imóvel propertytype = Tipo do Imóvel propertylocation = Localização do Imóvel Segue código: <?php require ( "../includes/config.php" ); require ( "../includes/CGI.php" ); require ( "../includes/SQL.php" ); $cgi = new CGI (); $sql = new SQL ( $DBusername, $DBpassword, $server, $database ); if ( ! $sql->isConnected () ) { die ( $DatabaseError ); } require ( "includes/Auth.php" ); $auth = new Auth ( $cgi, $sql, $admin_table ); $auth->checkAuth ( "index.php" ); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Administração Geral de Imóveis</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="style.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- .style1 {color: #FF0000} --> </style> </head> <body> <table border="0" cellpadding="1" cellspacing="0" width="100%"> <tbody> <tr> <td bgcolor="#333333"> <?PHP include "header.php"; ?> <table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td colspan="4"> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <td align="left" valign="top" class="leftbg"> <?PHP include "leftmenu.php"; ?></td> <td valign="top"> <h2 align="left"><img src="images/spacer.gif" height="10" width="15" />Configura&ccedil;&otilde;es</h2> <table width="95%" align="center" cellpadding="0" cellspacing="1"> <tr> <td> As defini&ccedil;&otilde;es nesta p&aacute;gina precisa ser configurada corretamente para permitir o bom funcionamento de suas propriedades em seu site. Certifique-se de que todas as informa&ccedil;&otilde;es inseridas est&atilde;o corretas.</td> </tr> </table><br /> <?php if ( $cgi->getValue ( "op" ) == "UpdateConfigure" ) { $sql->execute ( "UPDATE " . $configure_table . " SET websiteurl=" . $sql->quote ( $cgi->getValue ( "websiteurl" ) ) . ", imagepath=" . $sql->quote ( $cgi->getValue ( "imagepath" ) ) . ", imageurl=" . $sql->quote ( $cgi->getValue ( "imageurl" ) ) . ", language_pack=" . $sql->quote ( $cgi->getValue ( "language_pack" ) ) . ", display_rental=" . $sql->quote ( $cgi->getValue ( "display_rental" ) ) . ", display_sale=" . $sql->quote ( $cgi->getValue ( "display_sale" ) ) . ", display_search_types=" . $sql->quote ( $cgi->getValue ( "display_search_types" ) ) . ", display_search_locations=" . $sql->quote ( $cgi->getValue ( "display_search_locations" ) ) . ", display_search_bedrooms=" . $sql->quote ( $cgi->getValue ( "display_search_bedrooms" ) ) . ", display_search_max_price=" . $sql->quote ( $cgi->getValue ( "display_search_max_price" ) ) . ", property_search_order=" . $sql->quote ( $cgi->getValue ( "property_search_order" ) ) . ", property_search_ordering=" . $sql->quote ( $cgi->getValue ( "property_search_ordering" ) ) . ", property_search_limit=" . $sql->quote ( $cgi->getValue ( "property_search_limit" ) ) . ", property_map_url=" . $sql->quote ( $cgi->getValue ( "property_map_url" ) ) . ", max_image_resize_width=" . $sql->quote ( $cgi->getValue ( "max_image_resize_width" ) ) . ", max_thumb_image_height=" . $sql->quote ( $cgi->getValue ( "max_thumb_image_height" ) ) . ", max_thumb_image_width=" . $sql->quote ( $cgi->getValue ( "max_thumb_image_width" ) ) . ", template_page_name=" . $sql->quote ( $cgi->getValue ( "template_page_name" ) ) . " " ); ?> <br /> <p align="center"><font color="red">As configura&ccedil;&otilde;es foram atualizadas com sucesso! </font></p> <?php } $rows = $sql->execute ( "SELECT * FROM " . $configure_table . " LIMIT 1", SQL_RETURN_ASSOC ); $row = $rows [ 0 ]; ?> <form method="post"> <input name="op" type="hidden" value="UpdateConfigure" /> <p align="center"></p> <table width="85%" align="center" cellpadding="2" cellspacing="1"> <tr> <td height="32" colspan="2" align="left" valign="middle" background="images/top-menubg.gif" class="leftbg"> <b>Configura&ccedil;&otilde;es e Logotipo</b></td> </tr> <tr> <td align="right" bgcolor="#F3F3F3">Website URL:</td> <td><input type="text" name="websiteurl" size="45" maxlength="125" value="<?php echo $cgi->htmlEncode ( $row [ "websiteurl" ] ); ?>" /></td> </tr> <tr> <td align="right" bgcolor="#F3F3F3"> Path. Local da pasta das Imagens:</td> <td><input type="text" name="imagepath" size="45" maxlength="125" value="<?php echo $cgi->htmlEncode ( $row [ "imagepath" ] ); ?>" /> <span class="style1">n&atilde;o mexer sem conhecimento</span> </td> </tr> <tr> <td align="right" valign="top" bgcolor="#F3F3F3">URL da pasta das Imagens:</td> <td valign="top"><input type="text" name="imageurl" size="45" maxlength="125" value="<?php echo $cgi->htmlEncode ( $row [ "imageurl" ] ); ?>" /> <span class="style1">n&atilde;o mexer sem conhecimento</span> <br /> <br /></td> </tr> <tr> <td height="32" colspan="2" align="left" valign="middle" background="images/top-menubg.gif" class="leftbg"> <b>Nome do arquivo principal</b></td> </tr> <tr> <td align="right" bgcolor="#F3F3F3">Nome do arquivo:</td> <td><input type="text" name="template_page_name" size="45" maxlength="125" value="<?php echo $cgi->htmlEncode ( $row [ "template_page_name" ] ); ?>" /> <span class="style1">n&atilde;o mexer sem conhecimento</span> </td> </tr> <tr> <td height="32" colspan="2" align="left" valign="middle" background="images/top-menubg.gif" class="leftbg"> <b>Defini&ccedil;&atilde;o de Idiomas </b></td> </tr><tr> <td align="right" valign="top" bgcolor="#F3F3F3">Idioma:</td> <td valign="top"> <select name="language_pack"><?php $dirname = "../$LanguageFolder"; $dh = opendir( $dirname ) or die("Could not find Language Director"); while ( ! ( ( $langpack = readdir( $dh ) ) === false ) ) { if ($langpack != "." && $langpack != "..") { echo "<option value=\"$langpack\""; if ( $row [ "language_pack" ] == "$langpack" ) { echo " selected"; } echo ">$langpack</option>"; } } closedir( $dh ); ?> </select> <br /> <br /></td> </tr> <tr> <td height="32" colspan="2" align="left" valign="middle" background="images/top-menubg.gif" class="leftbg"> <b>Op&ccedil;&otilde;es de Pesquisa/Busca</b></td> </tr> <tr> <td align="right" bgcolor="#F3F3F3"> Mostrar Aluguel:</td> <td><input name="display_rental" type="radio" value="Y"<?php if ( $row [ "display_rental" ] == "Y" ) { echo " checked"; } ?> /> Sim &nbsp; <input name="display_rental" type="radio" value="N"<?php if ( $row [ "display_rental" ] == "N" ) { echo " checked"; } ?> /> N&atilde;o</td> </tr> <tr> <td align="right" bgcolor="#F3F3F3">Mostrar Vendas:</td> <td><input name="display_sale" type="radio" value="Y"<?php if ( $row [ "display_sale" ] == "Y" ) { echo " checked"; } ?> /> Sim&nbsp;&nbsp; <input name="display_sale" type="radio" value="N"<?php if ( $row [ "display_sale" ] == "N" ) { echo " checked"; } ?> /> N&atilde;o</td> </tr> <tr> <td align="right" bgcolor="#F3F3F3">Mostrar Busca por Im&oacute;veis:</td> <td><input name="display_search_types" type="radio" value="Y"<?php if ( $row [ "display_search_types" ] == "Y" ) { echo " checked"; } ?> /> Sim&nbsp;&nbsp; <input name="display_search_types" type="radio" value="N"<?php if ( $row [ "display_search_types" ] == "N" ) { echo " checked"; } ?> /> N&atilde;o</td> </tr> <tr> <td align="right" bgcolor="#F3F3F3">Mostrar Busca por Localiza&ccedil;&atilde;o:</td> <td><input name="display_search_locations" type="radio" value="Y"<?php if ( $row [ "display_search_locations" ] == "Y" ) { echo " checked"; } ?> /> Sim&nbsp;&nbsp; <input name="display_search_locations" type="radio" value="N"<?php if ( $row [ "display_search_locations" ] == "N" ) { echo " checked"; } ?> /> N&atilde;o</td> </tr> <tr> <td align="right" bgcolor="#F3F3F3">Mostrar Busca por Quartos:</td> <td><input name="display_search_bedrooms" type="radio" value="Y"<?php if ( $row [ "display_search_bedrooms" ] == "Y" ) { echo " checked"; } ?> /> Sim&nbsp;&nbsp; <input name="display_search_bedrooms" type="radio" value="N"<?php if ( $row [ "display_search_bedrooms" ] == "N" ) { echo " checked"; } ?> /> N&atilde;o</td> </tr> <tr> <td align="right" bgcolor="#F3F3F3">Mostrar Busca por Pre&ccedil;o:</td> <td><input name="display_search_max_price" type="radio" value="Y"<?php if ( $row [ "display_search_max_price" ] == "Y" ) { echo " checked"; } ?> /> Sim&nbsp;&nbsp; <input name="display_search_max_price" type="radio" value="N"<?php if ( $row [ "display_search_max_price" ] == "N" ) { echo " checked"; } ?> /> N&atilde;o</td> </tr> <tr> <td align="right" bgcolor="#F3F3F3"> Resultados por ordem da pesquisa:</td> <td><select name="property_search_order"> <option value="propertyprice">Valor do Im&oacute;vel</option> <option value="propertytype">Tipo do Im&oacute;vel</option> <option value="propertylocation">Localiza&ccedil;&atilde;o do Im&oacute;vel</option> </select> Atual: <input name="Atual2" type="text" disabled="disabled" value="<?php echo $cgi->htmlEncode ( $row [ "property_search_order" ] ); ?>" size="15" maxlength="4" readonly="readonly" /></td> </tr> <tr> <td align="right" bgcolor="#F3F3F3">Mostrar Resultados da busca por:</td> <td><select name="property_search_ordering"> <option value="Ascendente">Ascendente</option> <option value="Descendente">Descendente</option> </select> Atual: <input name="Atual" type="text" disabled="disabled" value="<?php echo $cgi->htmlEncode ( $row [ "property_search_ordering" ] ); ?>" size="15" maxlength="4" readonly="readonly" /></td> </tr> <tr> <td align="right" valign="top" bgcolor="#F3F3F3">M&aacute;x. de Resultados por P&aacute;gina:</td> <td valign="top"><input type="text" name="property_search_limit" size="10" maxlength="4" value="<?php echo $cgi->htmlEncode ( $row [ "property_search_limit" ] ); ?>" /> <br /> <br /></td> </tr> <tr> <td height="32" colspan="2" align="left" valign="middle" background="images/top-menubg.gif" class="leftbg"> <b>Localiza&ccedil;&atilde;o de Im&oacute;veis por Cep e Mapa</b></td> </tr> <tr> <td align="right" valign="top" bgcolor="#F3F3F3"> Pesquisar por Cep ou Mapa - URL:</td> <td><input type="text" name="property_map_url" size="55" maxlength="200" value="<?php echo $cgi->htmlEncode ( $row [ "property_map_url" ] ); ?>" /> <br /> (Isso permitir&aacute; que voc&ecirc; exiba um mapa para procurar um imovel pelo cep autamaticamente.<br /> Deixamos como padr&atilde;o o Google, mas pode ser alterado caso tenha conhecimento e outra URL confi&aacute;vel. Temos <strong>3</strong> op&ccedil;&otilde;es abaixo.)<br /> <b>Google Maps:</b> http://local.google.com/local?f=q&amp;hl=en&amp;q=XXXXXX<br /> <b>Street Map:</b> http://www.streetmap.co.uk/streetmap.dll?postcode2map?XXXXXX<br /> <b>Multimap:</b> http://www.multimap.com/map/browse.cgi?local=h&amp;scale=10000&amp;pc=XXXXXX<br /> <br /></td> </tr> <tr> <td height="32" colspan="2" align="left" valign="middle" background="images/top-menubg.gif" class="leftbg"> <b>Configura&ccedil;&atilde;o do Tamanho da Imagem de Exibi&ccedil;&atilde;o </b></td> </tr> <tr> <td colspan="2" bgcolor="#F3F3F3"> Isso se aplica aos retratos e paisagens das fotografias. Largura e Altura das imagens exibidas no site <br /> <br /></td> </tr> <tr> <td align="right" bgcolor="#F3F3F3">Tamanho da Imagem:</td> <td><input type="text" name="max_image_resize_width" size="5" maxlength="4" value="<?php echo $cgi->htmlEncode ( $row [ "max_image_resize_width" ] ); ?>" /> px </td> </tr> <tr> <td align="right" bgcolor="#F3F3F3">&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td align="right" bgcolor="#F3F3F3">Altura da Imagem:</td> <td><input type="text" name="max_thumb_image_height" size="5" maxlength="4" value="<?php echo $cgi->htmlEncode ( $row [ "max_thumb_image_height" ] ); ?>" /> px - Esta &eacute; para a p&aacute;gina de resultados da pesquisa</td> </tr> <tr> <td align="right" bgcolor="#F3F3F3">Largura da Imagem:</td> <td><input type="text" name="max_thumb_image_width" size="5" maxlength="4" value="<?php echo $cgi->htmlEncode ( $row [ "max_thumb_image_width" ] ); ?>" /> px - Esta &eacute; para a p&aacute;gina de resultados da pesquisa</td> </tr> <tr><td height="20" align="left" valign="middle" class="leftbg" colspan="2">&nbsp; </td> </tr> </table> <p align="center"> <input type="submit" class="submit" value="Atualizar" onclick="return confirm('Tem certeza de que deseja atualizar?');" /> </p> </form> <br /></td> </tr> </table> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <?PHP include "footer.php"; ?> </body> </html>
  12. Vamos por parte, $headers .= "Content-type: text/html; charset=iso-8859-1" é o correto e no seu código está $headers = "Content-type: text/html; charset=iso-8859-1rn"; Sua página (form) deve conter o mesmo formato "iso-8859-1" Não olhei todo o seu código mas o que mais me chamou a atenção foi isso. Att. Henrique Flausino
  13. Por não se tratar de um servidor de qualidade, não desmerecendo você ou a empresa, mas nem toda programação funciona igual em servidores diferentes. Estou postando o código abaixo para você usar no seu servidor, não edite nada, apenas coloque e teste. Link para o meu servidor para que você possa testar <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Contato</title> <meta name="keywords" content="" /> <meta name="description" content="" /> &lt;script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> &lt;script src="SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script> <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="latest-post" class="wide-post"> <h1 class="title">Contato</h1> <div class="entry"> <form id="form1" name="form1" method="post" action="form.php"> <table width="100%" border="0" class="links"> <tr> <th width="17%" scope="col">* Nome:</th> <th width="83%" align="left"><span id="sprytextfield1"> <input name="nome" type="text" id="nome" size="50" /> <span class="textfieldRequiredMsg">Informe seu Nome.</span></span></th> </tr> <tr> <th scope="row">* E-mail:</th> <td><span id="sprytextfield2"> <input name="Form_Email_Remetente" type="text" id="Form_Email_Remetente" size="50" /> <span class="textfieldRequiredMsg">Informe seu e-mail.</span><span class="textfieldInvalidFormatMsg">Formato inválido.</span></span></td> </tr> <tr> <th scope="row">Telefone:</th> <td><input name="fone" type="text" id="fone" size="50" /></td> </tr> <tr> <th scope="row">CEP:</th> <td><input type="text" name="CEP" id="CEP" /></td> </tr> <tr> <th scope="row">Descrição do Contato:</th> <td><span id="sprytextarea1"> <textarea name="Mensagem" id="Mensagem" cols="48" rows="7"></textarea> <br /><span class="textareaRequiredMsg">Favor deixar a descrição do contato.</span></span></td> </tr> <tr> <th scope="row"> </th> <td> <input type="submit" name="Enviar" id="Enviar" value="Enviar" /> <input type="reset" name="Limpar" id="Limpar" value="Limpar" /> <input name="Form_Email_Destinatario" type="hidden" id="Form_Email_Destinatario" value="[email protected]" style="visibility:hidden"/> <input name="Form_Email_Comcopia" type="hidden" id="Form_Email_Comcopia" style="visibility:hidden" value="[email protected]"/> <input name="Form_Email_Comcopiaoculta" type="hidden" id="Form_Email_Comcopiaoculta" value="" style="visibility:hidden"/> <input name="Assunto" type="hidden" id="Assunto" value="Form de Contato Online" style="visibility:hidden"/> <input name="Form_Email_Titulo" type="hidden" id="Form_Email_Titulo" value="Form de Contato Online" style="visibility:hidden"/> <input type="hidden" name="IP_do_Visitante" id="IP_do_Visitante" value="<?php echo "$_SERVER[REMOTE_ADDR]";?>" /></td> </tr> </table> </form> &lt;script type="text/javascript"> <!-- var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["change"]}); var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "email", {validateOn:["blur"]}); var sprytextarea1 = new Spry.Widget.ValidationTextarea("sprytextarea1", {validateOn:["blur"]}); //--> </script> </body> </html> <?php /* Verifica qual é o sistema operacional do servidor para ajustar o cabeçalho de forma correta. Não alterar */ if(PHP_OS == "Linux") $quebra_linha = "\n"; //Se for Linux elseif(PHP_OS == "WINNT") $quebra_linha = "\r\n"; // Se for Windows else die("Este script não esta preparado para funcionar com o sistema operacional de seu servidor"); // Passando os dados obtidos pelo formulário para as variáveis abaixo $IP = $_POST['IP_do_Visitante']; $Nome = $_POST['nome']; $Fone = $_POST['fone']; $CEP = $_POST['CEP']; $Form_Email_Remetente = $_POST['Form_Email_Remetente']; $Form_Email_Destinatario = $_POST['Form_Email_Destinatario']; $Form_Email_Comcopia = $_POST['Form_Email_Comcopia']; $Form_Email_Comcopiaoculta = $_POST['Form_Email_Comcopiaoculta']; $Titulo = $_POST['Form_Email_Titulo']; $Assunto = $_POST['Assunto']; $Comentarios = $_POST['Mensagem']; /* Montando a mensagem a ser enviada no corpo do e-mail. */ $mensagemHTML = ' <font face="Verdana, Geneva, sans-serif", size="2"> <table width="806" border="0" cellpadding="0"> <tr> <td width="186"><b>• IP do Visitante:</b></td> <td width="614">'.$IP.'</td> </tr> <tr> <td><b>• Nome:</b></td> <td>'.$Nome.'</td> </tr> <tr> <td><b>• Telefone:</b></td> <td>'.$Fone.'</td> </tr> <tr> <td><b>• CEP:</b></td> <td>'.$CEP.'</td> </tr> <tr> <td><b>• Assunto:</b></td> <td>'.$Assunto .'</td> </tr> <tr> <td><b>• Mensagem:</b></td> <td>'.nl2br($Comentarios).'</td> </tr> </table> </font>'; /* Montando o cabeçalho da mensagem */ $headers = "MIME-Version: 1.1".$quebra_linha; $headers .= "Content-type: text/html; charset=iso-8859-1".$quebra_linha; // Perceba que a linha acima contém "text/html", sem essa linha, a mensagem não chegará formatada. $headers .= "From: ".$Nome."<$Form_Email_Remetente>".$quebra_linha; $headers .= "Cc: ".$Form_Email_Comcopia.$quebra_linha; $headers .= "Bcc: ".$Form_Email_Comcopiaoculta.$quebra_linha; $headers .= "Reply-To: ".$Form_Email_Remetente.$quebra_linha; $headers .= "Return-Path: ".$Form_Email_Remetente.$quebra_linha; // Note que o e-mail do remetente será usado no campo Reply-To (Responder Para) /* Enviando a mensagem */ //Verificando qual é o MTA que está instalado no servidor e efetuamos o ajuste colocando o paramentro -r caso seja Postfix mail($Form_Email_Destinatario, $Titulo, $mensagemHTML, $headers ); echo "<meta http-equiv='refresh' content='1; url=contato.php'>" ?>
  14. Qual servidor de Hospedagem você está usando? Está olhando a mensagem recebida no Webmail ou no outlook?
  15. Henrique Flausino

    FUNÇÃO MAIL

    Funciona em alguns servidores, porém não em todos. <?php /* Verifica qual é o sistema operacional do servidor para ajustar o cabeçalho de forma correta. Não alterar */ if(PHP_OS == "Linux") $quebra_linha = "\n"; //Se for Linux elseif(PHP_OS == "WINNT") $quebra_linha = "\r\n"; // Se for Windows else die("Este script não esta preparado para funcionar com o sistema operacional de seu servidor"); // Passando os dados obtidos pelo formulário para as variáveis abaixo $IP = $_POST['IP_do_Visitante']; $Nome = $_POST['nome']; $Fone = $_POST['fone']; $CEP = $_POST['CEP']; $Form_Email_Remetente = $_POST['Form_Email_Remetente']; $Form_Email_Destinatario = $_POST['Form_Email_Destinatario']; $Form_Email_Comcopia = $_POST['Form_Email_Comcopia']; $Form_Email_Comcopiaoculta = $_POST['Form_Email_Comoculta']; $Titulo = $_POST['Form_Email_Titulo']; $Assunto = $_POST['Assunto']; $Comentarios = $_POST['Mensagem']; /* Montando a mensagem a ser enviada no corpo do e-mail. */ $mensagemHTML = ' <font face="Verdana, Geneva, sans-serif", size="2"> <table width="806" border="0" cellpadding="0"> <tr> <td width="186"><b>• IP do Visitante:</b></td> <td width="614">'.$IP.'</td> </tr> <tr> <td><b>• Nome:</b></td> <td>'.$Nome.'</td> </tr> <tr> <td><b>• Telefone:</b></td> <td>'.$Fone.'</td> </tr> <tr> <td><b>• CEP:</b></td> <td>'.$CEP.'</td> </tr> <tr> <td><b>• Assunto:</b></td> <td>'.$Assunto .'</td> </tr> <tr> <td><b>• Mensagem:</b></td> <td>'.nl2br($Comentarios).'</td> </tr> </table> </font>'; /* Montando o cabeçalho da mensagem */ $headers = "MIME-Version: 1.1".$quebra_linha; $headers .= "Content-type: text/html; charset=iso-8859-1".$quebra_linha; // Perceba que a linha acima contém "text/html", sem essa linha, a mensagem não chegará formatada. $headers .= "From: ".$Nome."<$Form_Email_Remetente>".$quebra_linha; $headers .= "Cc: ".$Form_Email_Comcopia.$quebra_linha; $headers .= "Bcc: ".$Form_Email_Comcopiaoculta.$quebra_linha; $headers .= "Reply-To: ".$Form_Email_Remetente.$quebra_linha; $headers .= "Return-Path: ".$Form_Email_Remetente.$quebra_linha; // Note que o e-mail do remetente será usado no campo Reply-To (Responder Para) assim evita erros de envio na maioria dos servidores (sistema de segurança) mail($Form_Email_Destinatario, $Titulo, $mensagemHTML, $headers ); echo "<meta http-equiv='refresh' content='1; url=contato-ok.php'>" ?> Este funciona em 99%, agora é só fazer o form em html. Obs.: servidor local (localhost) não envia mensagens, somente executa o código e mostra se existe erro, para enviar mensagens você deve instalar um servidor de e-mail em sua máquina o que não garante 100% o envio ou recebimento, pois a maioria dos servidores (hotmail, gmail, ig) estão barrando mensagens de server's desconhecidos (não homologados). Att. Henrique Flausino
×
×
  • Create New...