Alguem sabe como resolver isso? Eu já dei uma pesquisada no Google parece q tenho q usar variaveis mas não entendir direito como fazer isso. Alguem me ajuda ai por-favor!
valeu!
Edição feita por: 2Shady, 17/03/2010, 00:31.
Posted 17/03/2010, 00:29
Edição feita por: 2Shady, 17/03/2010, 00:31.
Posted 17/03/2010, 07:18
Posted 17/03/2010, 09:10
Posted 17/03/2010, 12:01
Ai vai o código da página que fica em outra pasta e que da problema...Bom dia, tudo bem?
Poste o seu código.
Um abraço, tudo de bom.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Titulo</title> <style type="text/css"> <!-- body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; font-size: 11px; } body { background-color: #000000; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } a { font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; } a:link { text-decoration: none; } a:visited { text-decoration: none; color: #FFFFFF; } a:hover { text-decoration: none; color: #FF0000; } a:active { text-decoration: none; color: #FFFFFF; } .style3 { font-size: 14px; font-weight: bold; color: #FF0000; } .style6 {font-size: 14px; font-weight: bold; color: #FFFFFF; } .style7 {color: #FFFFFF} .style8 { font-size: 14px; font-weight: bold; } --> </style></head> <body> <table width="955" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="200"><?php include "../topo.php"; ?></td> </tr> </table> <table width="955" align="center"> <tr> <td width="200" valign="top" bgcolor="#111111"><table width="100%" cellpadding="0" cellspacing="0"> <tr> <td valign="top" bgcolor="#222222"><?php include "../menu.php"; ?></td> </tr> </table></td> <td valign="top" bgcolor="#222222"><table width="100%"> <tr> <td align="center" bgcolor="#000000"><img src="../images/layout/noticias.jpg" /></td> </tr> <tr> <td bgcolor="#000000"> </td> </tr> <tr> <td align="center" bgcolor="#000000"><?php include "../copyright.php"; ?></td> </tr> </table> </td> <td width="200" valign="top" bgcolor="#111111"><table width="100%" cellpadding="0" cellspacing="0"> <tr> <td valign="top" bgcolor="#222222"><?php include "../publicidade.php"; ?></td> </tr> </table></td> </tr> </table> </body> </html>
Eu já mexi nas pastas de todo jeito, botei pra la e pra cá mas nada adiantou. Como exatamente eu faço pra usar essa variável? Também não sei oq é var_dump, sou bem novato nessa área de php.Amigo, bom dia.
Tudo bom?
Primeiramente, bem vindo ao fórum.
Você pode resolver seu problema usando sempre os caminhos fixos com o uso da variável global $_SERVER. (Se não conhecer dê um var_dump).
Eu recomendo que você antes de pensar na parte técnica, tente estruturar seus diretórios...
Se tiver algum problema com isso, volte aqui com sua estrutura de pastas que podemos lhe ajudar
Abraços
Mateus Antunes
Posted 17/03/2010, 14:18
echo "<pre>"; var_dump($_SERVER);
<?php // prepend.php - autoprepended at the top of your tree define('MAINDIR',dirname(__FILE__) . '/'); define('DL_DIR',MAINDIR . 'downloads/'); define('LIB_DIR',MAINDIR . 'lib/'); ?>Retirado do www.php.net/include
Posted 17/03/2010, 14:27
Posted 17/03/2010, 14:34
<?php include $_SERVER["DOCUMENT_ROOT"]."/menu.php"; ?>
<?php include $_SERVER["DOCUMENT_ROOT"]."menu.php"; ?>
Edição feita por: Max William, 17/03/2010, 14:36.
Posted 17/03/2010, 15:56
<IFRAME src="../menu.php" frameBorder=0 width=# height=# scrolling=auto></IFRAME>ele vai reconhecer normalmente sem mudar o link de nada.
Edição feita por: 2Shady, 17/03/2010, 16:04.
Posted 17/03/2010, 16:04
$_SERVER['DOCUMENT_ROOT']
Posted 17/03/2010, 16:23
Eu to colocando o código assimAmigo, boa tarde.
Olha só:$_SERVER['DOCUMENT_ROOT']
Com essa var, você acessa o endereço do código na rais.
Com isso, basta fixas todos os seus includes usando isso!
Você está testando as coisas que estamos lhe mostrando?
Antes de injetar qualquer coisa em seu código, sempre procure o que está fazendo...
Dê um echo $_SERVER['DOCUMENT_ROOT'];
Se não der certo, poste o que você testou e também a sua estrutura de diretórios.
Vale lembrar para evitar problemas, apenas o que testou! O resto do seu formulário não é importante!
Abraços e até a próxima.
Mateus Antunes
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Titulo</title> <style type="text/css"> <!-- body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; font-size: 11px; } body { background-color: #000000; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } a { font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; } a:link { text-decoration: none; } a:visited { text-decoration: none; color: #FFFFFF; } a:hover { text-decoration: none; color: #FF0000; } a:active { text-decoration: none; color: #FFFFFF; } .style3 { font-size: 14px; font-weight: bold; color: #FF0000; } .style6 {font-size: 14px; font-weight: bold; color: #FFFFFF; } .style7 {color: #FFFFFF} .style8 { font-size: 14px; font-weight: bold; } --> </style></head> <body> <table width="955" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="200"><?php include $_SERVER['DOCUMENT_ROOT'] "/topo.php"; ?></td> </tr> </table> <table width="955" align="center"> <tr> <td width="200" valign="top" bgcolor="#111111"><table width="100%" cellpadding="0" cellspacing="0"> <tr> <td valign="top" bgcolor="#222222"><?php include $_SERVER['DOCUMENT_ROOT'] "/menu.php"; ?></td> </tr> </table></td> <td valign="top" bgcolor="#222222"><table width="100%"> <tr> <td align="center" bgcolor="#000000"> </td> </tr> <tr> <td bgcolor="#000000"> </td> </tr> <tr> <td align="center" bgcolor="#000000"><?php include $_SERVER['DOCUMENT_ROOT'] "/copyright.php"; ?></td> </tr> </table> </td> <td width="200" valign="top" bgcolor="#111111"><table width="100%" cellpadding="0" cellspacing="0"> <tr> <td valign="top" bgcolor="#222222"><?php include $_SERVER['DOCUMENT_ROOT'] "/menu.php"; ?></td> </tr> </table></td> </tr> </table> </body> </html>
Posted 17/03/2010, 16:47
Posted 17/03/2010, 16:59
Foi mal, eh q eu postei com pressa... a estrutura de diretórios eh essaPrimeiro. Como eu disse, tente adicionar apenas o código importante para a leitura!
Eu sei que é mais fácil adicionar o código todo mas o código focado ajudará muito quem se dispõe a lhe ajudar.
Segundo, está faltando o "." para concatenação.
Além disso, recomendo que baixe alguns tutoriais de PHP para ir se habituando com a sintaxe.
Isso é super importante no início...
Abraços
Mateus Antunes
Posted 17/03/2010, 17:16
Então eu tenho q colocar<?php include $_SERVER['DOCUMENT_ROOT']."/menu.php"; ?>O "." entra ligando o $_SERVER no "/menu.php"
Qualquer coisa vamos continuando!
Abraços
<?php include $_SERVER['DOCUMENT_ROOT']."/menu.php"; ?>
<table width="955" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="200"><?php include $_SERVER['DOCUMENT_ROOT']."/topo.php"; ?></td> </tr> </table> <table width="955" align="center"> <tr> <td width="200" valign="top" bgcolor="#111111"><table width="100%" cellpadding="0" cellspacing="0"> <tr> <td valign="top" bgcolor="#222222"><?php include $_SERVER['DOCUMENT_ROOT']."/menu.php"; ?></td> </tr> </table></td> <td valign="top" bgcolor="#222222"><table width="100%"> <tr> <td align="center" bgcolor="#000000"> </td> </tr> <tr> <td bgcolor="#000000"> </td> </tr> <tr> <td align="center" bgcolor="#000000"><?php include $_SERVER['DOCUMENT_ROOT']."/copyright.php"; ?></td> </tr> </table> </td> <td width="200" valign="top" bgcolor="#111111"><table width="100%" cellpadding="0" cellspacing="0"> <tr> <td valign="top" bgcolor="#222222"><?php include $_SERVER['DOCUMENT_ROOT']."/publicidade.php"; ?></td> </tr> </table></td> </tr> </table>
Edição feita por: 2Shady, 17/03/2010, 17:16.
Posted 17/03/2010, 18:56
<!--#include file="menu.html" --> ou <!--#include file="../menu.html" -->
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)