Ir para conteúdo
Fórum Script Brasil
  • 0

PHP não Funciona no meu Servidor.


Visage

Pergunta

Amigos

Estou com o seguinte problema.

Instalei um script de imobiliaria no meu servidor e funcionou perfeitamente:

http://www.visageproducoes.com.br/sites/va...p?id=33&i=2

Porém no servidor do cliente não funciona, isto que são exatamente os mesmos arquivos:

http://varandasimobiliaria.com.br/exibe_fo...p?id=33&i=2

Scripts dos arquivos:

=============================================================================

ANUNCIO.PHP

<?
require_once("configuracao_mysql.php");
require_once("includes.php");
if(empty($_GET[id]))
{
    header("location:index.php");
    exit();
}
$q1 = "select * from re2_agents, re2_listings where re2_listings.ListingID = '$_GET[id]' and re2_listings.AgentID = re2_agents.AgentID ";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);
if(empty($i) || $i == '1')
{
    $Image1 = "ver_anuncio2.gif";
    $desc = nl2br($a1[DetailedDesc]);
    $MyPrice = number_format($a1[Price], 2, ",", ".");
    $ShowInfo = "<table border=0 align=center width=\"100%\">\n\t<tr>\n\t<td width=\"60%\" valign=top><font size=3 face=verdana color=black><b>$a1[city], $a1[state], $a1[country]</b></font><br><font size=2 face=verdana color=black>$a1[address]</font></td>\n\t<td width=\"40%\" valign=top align=center><font size=2 face=verdana><B>Preço: R$ $MyPrice</td>\n</tr>\n\n<tr>\n\t<td valign=top><br><b>Imóvel ID: $a1[ListingID]</b><br><br>$desc<br><br><font size=2 face=verdana color=black><b>$a1[rooms] quarto(s), $a1[bathrooms] banheiro(s), $a1[garage] garagem(ns)</font><br><br>Vizinhança:</b> $a1[neighbourhood]<br><br><b>Tamanho da residência: $a1[SquareMeters] m2<br>Tamanho do lote: $a1[LotSize] m2<br>Idade: $a1[HomeAge] anos<br>";
    if($a1[fireplace] == 'y')
    {
        $ShowInfo .= ">>Tem lareira ou churrasqueira<br>\n";
    }
    if($a1[NearSchool] == 'y')
    {
        $ShowInfo .= ">>Pr&oacute;ximo a escola<br>\n";
    }
    if($a1[NearTransit] == 'y')
    {
        $ShowInfo .= ">>Pr&oacute;ximo do tr&acirc;nsito<br>\n";
    }
    if($a1[NearPark] == 'y')
    {
        $ShowInfo .= ">>Pr&oacute;ximo a parque ou pra&ccedil;a<br>\n";
    }
    if($a1[OceanView] == 'y')
    {
        $ShowInfo .= ">>Vista para o mar<br>\n";
    }
    if($a1[LakeView] == 'y')
    {
        $ShowInfo .= ">>Vista para um lago<br>\n";
    }
    if($a1[MountainView] == 'y')
    {
        $ShowInfo .= ">>Vista para uma montanha<br>\n";
    }
    if($a1[OceanWaterfront] == 'y')
    {
        $ShowInfo .= ">>De frente para o mar<br>\n";
    }
    if($a1[LakeWaterfront] == 'y')
    {
        $ShowInfo .= ">>De frente para um lago<br>\n";
    }
    if($a1[RiverWaterfront] == 'y')
    {
        $ShowInfo .= ">>De frente para um rio<br>\n";
    }

    if(!empty($a1[image]))
    {
        $im_array = explode("|", $a1[image]);

        $FirstImage = "<img src=\"fotos_anuncios/$im_array[0]\" width=100 height=100>";
    }
    if($a1[TipodeConta] == '2')
    {
        if(!empty($a1[cellular]))
        {
            $int[] = "Celular: $a1[cellular]";
        }
        if(!empty($a1[pager]))
        {
            $int[] = "Pager: $a1[pager]";
        }
        if(!empty($int))
        {
            $int2 = implode("<br>", $int);
            $int2 = "<br>".$int2;
        }
    }
    $ShowInfo .= "</td>\n\t<td align=center valign=top>$FirstImage<br><br>Para Maiores informações ligue para<br><b> $a1[FirstName] $a1[LastName]<br>Telefone: $a1[phone]$int2</b><br>ou clique <a class=RedLink target=_blank href=\"contato.php?AgentID=$a1[AgentID]&ListingID=$a1[ListingID]\">AQUI</a> para enviar-lhe um e-mail.<br><br>";
    
    if($a1[TipodeConta] == '1')
    {
    }
    
    if($a1[TipodeConta] == '1')
    {
        if(!empty($a1[logo]))
        {
            $ShowInfo .= "<a href=\"sobre_mim.php?id=$a1[AgentID]\" title=\"Ver informações deste agente!\"><img src=\"fotos_anuncios/$a1[logo]\" border=0></a>";
        }
        else
        {
            $ShowInfo .= "<a class=BlackLink href=\"sobre_mim.php?id=$a1[AgentID]\" title=\"Ver informações deste agente!\">$a1[FirstName] $a1[LastName]: Ver perfil</a>";
        }
    }

    $ShowInfo .= "</center></td>\n</tr>";
    
    if($a1[AgentID] == $_SESSION[AgentID])
    {
        $ShowInfo .= "<tr>\n\t<td colspan=3 align=center><a class=RedLink href=\"editar.php?id=$a1[ListingID]\">EDITAR</a> | <a class=RedLink href=\"deletar.php?id=$a1[ListingID]\">DELETAR</a></td>\n</tr>\n\n";
    }
    
    $ShowInfo .= "\n</table>";

}
else
{
    $Image1 = "ver_anuncio.gif";
}

if($i == '2')
{
    $Image2 = "ver_fotos2.gif";

    if(!empty($a1[image]))
    {
        $MyImages = explode("|", $a1[image]);

        $ShowInfo .= "<table valign=top align=center width=\"500\" height=50>\n<tr>\n\t<td align=center valign=top width=\"500\" height=50>";
        
        while(list(,$v) = each($MyImages))
        {
            $ShowInfo .= "<a href=\"anuncio.php?id=$_GET[id]&i=$_GET[i]&f=$v\"><img src=\"fotos_anuncios/$v\" width=50 height=50 border=0></a>&nbsp;&nbsp;&nbsp;\n\n\t";
        }

        $ShowInfo .= "</table><hr size=1 width=\"95%\" color=#336699><br>";


        if(!empty($f))
        {
            $ShowInfo .= "<center><img src=\"fotos_anuncios/$f\"></center><br>";
        }
        else
        {
            $ShowInfo .= "<center><img src=\"fotos_anuncios/$MyImages[0]\"></center><br>";
        }

    }
    else
    {
        $ShowInfo .= "<br><center><img src=\"sem_foto.gif\"></center>";
    }

}
else
{
    $Image2 = "ver_fotos.gif";
}


$MyAddress = str_replace(" ", "+", $a1[address]);
$MyAddress = str_replace(",", "", $MyAddress);

$Image3 = "<a target=_blank  href=\"http://www.mapquest.com/maps/map.adp?city=$a1[city]&state=$a1[state]&address=$MyAddress&country=$a1[country]&zoom=5\"><img src=\"minhas_imagens/mapa.gif\" border=0></a>";

//$Image3 = "<img src=\"minhas_imagens/sem_foto.gif\">";

$ListingID = $a1[ListingID];

require_once("topo.php");    
require_once("templates/InfoTemplate.php");    
require_once("layout.php");    

//update the stats
$q1 = "update re2_listings set visits = visits + '1' where ListingID = '$_GET[id]' ";
mysql_query($q1) or die(mysql_error());

?>
============================================================================= INFOTEMPLATE.PHP
<table width=510 align=center cellpadding=0 cellspacing=0 bgcolor="#FFFFFF">
<tr>
  <td width="510" align=center><table width="310" height="36" border="0" align="right" cellpadding="0" cellspacing="0">
      <tr>
        <td background="../images/botoes.jpg"><table width="310" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="156"><div align="center"><a href="exibe_fotos.php?id=<?=$ListingID?>&amp;i=2"><img src="../images/layer.gif" width="135" height="20" border="0" /></a></div></td>
            <td width="154"><div align="center"><a href="amigo.php?id=<?=$ListingID?>"><img src="../images/layer.gif" width="144" height="24" border="0" /></a></div></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>

<tr>
    <td valign=top align=center>

    <table width=766 border=0 align=center cellpadding=0 cellspacing=0 bgcolor="#FFFFFF" rules=none>
    <tr>
        <td valign=top>
            <?=$ShowInfo?>        </td>
    </tr>
    <tr>
      <td valign=top><div align="center"><br />
        </div>
        <div align="center"><a href="imprimir.php?id=<?=$ListingID?>" target="_blank"><img src="../images/imprimir.jpg" width="37" height="34" border="0" /></a></div></td>
      </tr>
    <tr>
      <td valign=top bgcolor="#FFFFFF">&nbsp;</td>
      </tr>
    </table>    </td>
</tr>

</table>
============================================================================== EXIBE_FOTOS.PHP
<?
require_once("configuracao_mysql.php");
require_once("includes.php");

if(empty($_GET[id]))
{
    header("location:index.php");
    exit();
}

$q1 = "select * from re2_agents, re2_listings where re2_listings.ListingID = '$_GET[id]' and re2_listings.AgentID = re2_agents.AgentID ";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);


if(empty($i) || $i == '1')
{
    $Image1 = "ver_anuncio2.gif";

    $desc = nl2br($a1[DetailedDesc]);

    $MyPrice = number_format($a1[Price], 2, ",", ".");

    $ShowInfo = "<table border=0 align=center width=\"100%\">\n\t<tr>\n\t<td width=\"60%\" valign=top><font size=3 face=verdana color=black><b>$a1[city], $a1[state], $a1[country]</b></font><br><font size=2 face=verdana color=black>$a1[address]</font></td>\n\t<td width=\"40%\" valign=top align=center><font size=2 face=verdana><B>Preço: R$ $MyPrice</td>\n</tr>\n\n<tr>\n\t<td valign=top><br><b>Imóvel ID: $a1[ListingID]</b><br><br>$desc<br><br><font size=2 face=verdana color=black><b>$a1[rooms] quarto(s), $a1[bathrooms] banheiro(s), $a1[garage] garagem(ns)</font><br><br>Vizinhança:</b> $a1[neighbourhood]<br><br><b>Tamanho da residência: $a1[SquareMeters] m2<br>Tamanho do lote: $a1[LotSize] m2<br>Idade: $a1[HomeAge] anos<br>";

    if($a1[fireplace] == 'y')
    {
        $ShowInfo .= ">>Tem lareira ou churrasqueira<br>\n";
    }

    if($a1[NearSchool] == 'y')
    {
        $ShowInfo .= ">>Pr&oacute;ximo a escola<br>\n";
    }

    if($a1[NearTransit] == 'y')
    {
        $ShowInfo .= ">>Pr&oacute;ximo do tr&acirc;nsito<br>\n";
    }

    if($a1[NearPark] == 'y')
    {
        $ShowInfo .= ">>Pr&oacute;ximo a parque ou pra&ccedil;a<br>\n";
    }

    if($a1[OceanView] == 'y')
    {
        $ShowInfo .= ">>Vista para o mar<br>\n";
    }

    if($a1[LakeView] == 'y')
    {
        $ShowInfo .= ">>Vista para um lago<br>\n";
    }

    if($a1[MountainView] == 'y')
    {
        $ShowInfo .= ">>Vista para uma montanha<br>\n";
    }

    if($a1[OceanWaterfront] == 'y')
    {
        $ShowInfo .= ">>De frente para o mar<br>\n";
    }

    if($a1[LakeWaterfront] == 'y')
    {
        $ShowInfo .= ">>De frente para um lago<br>\n";
    }

    if($a1[RiverWaterfront] == 'y')
    {
        $ShowInfo .= ">>De frente para um rio<br>\n";
    }

    if(!empty($a1[image]))
    {
        $im_array = explode("|", $a1[image]);

        $FirstImage = "<img src=\"fotos_anuncios/$im_array[0]\" width=100 height=100>";
    }

    if($a1[TipodeConta] == '2')
    {
        if(!empty($a1[cellular]))
        {
            $int[] = "Celular: $a1[cellular]";
        }

        if(!empty($a1[pager]))
        {
            $int[] = "Pager: $a1[pager]";
        }

        if(!empty($int))
        {
            $int2 = implode("<br>", $int);

            $int2 = "<br>".$int2;
        }

    }

    $ShowInfo .= "</td>\n\t<td align=center valign=top>$FirstImage<br><br>Para Maiores informações ligue para<br><b> $a1[FirstName] $a1[LastName]<br>Telefone: $a1[phone]$int2</b><br>ou clique <a class=RedLink target=_blank href=\"contato.php?AgentID=$a1[AgentID]&ListingID=$a1[ListingID]\">AQUI</a> para enviar-lhe um e-mail.<br><br>";
    
    if($a1[TipodeConta] == '1')
    {
        $ShowInfo .= "<a class=BlueLink href=\"buscador.php?AgentID=$a1[AgentID]\" title=\"Mais propriedades deste agente\">Mais propriedades deste agente</a><br><br><center>";
    }
    else
    {
        $ShowInfo .= "<a class=BlueLink href=\"buscador.php?AgentID=$a1[AgentID]\" title=\"Mais propriedades de $a1[FirstName] $a1[LastName]\">Mais propriedades de $a1[FirstName] $a1[LastName]</a><br><br><center>";
    }
    
    if($a1[TipodeConta] == '1')
    {
        if(!empty($a1[logo]))
        {
            $ShowInfo .= "<a href=\"sobre_mim.php?id=$a1[AgentID]\" title=\"Ver informações deste agente!\"><img src=\"fotos_anuncios/$a1[logo]\" border=0></a>";
        }
        else
        {
            $ShowInfo .= "<a class=BlackLink href=\"sobre_mim.php?id=$a1[AgentID]\" title=\"Ver informações deste agente!\">$a1[FirstName] $a1[LastName]: Ver perfil</a>";
        }
    }

    $ShowInfo .= "</center></td>\n</tr>";
    
    if($a1[AgentID] == $_SESSION[AgentID])
    {
        $ShowInfo .= "<tr>\n\t<td colspan=3 align=center><a class=RedLink href=\"editar.php?id=$a1[ListingID]\">EDITAR</a> | <a class=RedLink href=\"deletar.php?id=$a1[ListingID]\">DELETAR</a></td>\n</tr>\n\n";
    }
    
    $ShowInfo .= "\n</table>";

}
else
{
    $Image1 = "ver_anuncio.gif";
}

if($i == '2')
{
    $Image2 = "ver_fotos2.gif";

    if(!empty($a1[image]))
    {
        $MyImages = explode("|", $a1[image]);

        $ShowInfo .= "<table valign=top align=center width=\"500\" height=50>\n<tr>\n\t<td align=center valign=top width=\"500\" height=50>";
        
        while(list(,$v) = each($MyImages))
        {
            $ShowInfo .= "<a href=\"exibe_fotos.php?id=$_GET[id]&i=$_GET[i]&f=$v\"><img src=\"fotos_anuncios/$v\" width=50 height=50 border=0></a>&nbsp;&nbsp;&nbsp;\n\n\t";
        }

        $ShowInfo .= "</table><hr size=1 width=\"95%\" color=#336699><br>";


        if(!empty($f))
        {
            $ShowInfo .= "<center><img src=\"fotos_anuncios/$f\"></center><br>";
        }
        else
        {
            $ShowInfo .= "<center><img src=\"fotos_anuncios/$MyImages[0]\"></center><br>";
        }

    }
    else
    {
        $ShowInfo .= "<br><center><img src=\"sem_foto.gif\"></center>";
    }

}
else
{
    $Image2 = "ver_fotos.gif";
}


$MyAddress = str_replace(" ", "+", $a1[address]);
$MyAddress = str_replace(",", "", $MyAddress);


$ListingID = $a1[ListingID];

require_once("topo.php");
require_once("templates/exibe_fotos.php");    
require_once("layout.php");

//update the stats
$q1 = "update re2_listings set visits = visits + '1' where ListingID = '$_GET[id]' ";
mysql_query($q1) or die(mysql_error());

?>
=============================================================================== templates/exibe_fotos.php
<title><?=$aset[SiteTitle]?></title><table width=766 border="0" align=center cellpadding=0 cellspacing=0 bgcolor="#FFFFFF">

<tr>
    <td colspan=3 align=center valign=top bgcolor="#FFFFFF">

    <table align=center width=510 cellspacing=0 cellpadding=0 border=0 rules=none>
    <tr>
        <td valign=top bgcolor="#FFFFFF">
            <br />
            <?=$ShowInfo?>        </td>
    </tr>
    <tr>
      <td valign=top bgcolor="#FFFFFF"><div align="center"><a href="imprimir.php?id=<?=$ListingID?>" target="_blank"><img src="../images/imprimir.jpg" width="37" height="34" border="0" /></a><br />
        <br />
      </div></td>
      </tr>
    </table>

    </td>
</tr>

</table>

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

  • 0

Grande parte dos problemas de compatibilidade acontecem porque o código foi escrito para versões mais antigas do php, onde várias regras eram diferentes.

De cara eu vi que você utiliza short tags (<?), o que nas versões mais recentes não é aceito.

Além disso podem existir variáveis que recebem seus valores do GET ou do POST e este valor não está sendo atribuído a elas, pois nas versões 4.x o register_globals era ativo.

Comece alterando suas short tags para tags completas do php (<?php) e a partir daí você conseguirá ir adequando o código.

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      652k
×
×
  • Criar Novo...