Nous sommes le Dim 13 Juil, 2025 00:57
Supprimer les cookies

[PHP] probleme avec include

Sur le logiciel libre en général ou un logiciel libre en particulier

Mar 05 Avr, 2005 12:40

Bonjour, j ai un probleme avec la fonction include.

En fait j ai mes menus a gauche et au milieu je dois importer une autre page. Je l'ai fait avec iframe mais ce n'est pas beau !

Avec include ca marche aussi sauf que quand je clique sur un lien dans cette page, elle s'ouvre sur toute la fenetre par conséquent, il ferme mes menus

Y a t il un moyen d ouvrir toutes les liens sur self sachant sur cette page en question je ne peux jouer avec target. Ou y a til un autre moyen

Voici la page : Http://hasan.karakaya.free.fr/Izi c'est fait avec iframe mais j ai deux barres de defilements

merci

[edit : ce n'est pas du pphp, mais du php ;)
Cordialement, Milouse]
fukara

Messages : 4

Mar 05 Avr, 2005 18:27

hum, pas de panique, tu as juste confondu le fonctionnement de la balise iframe ou frame html et la requète include php.
En effet, une frame (ou iframe) insère une page à l'intérieur d'une autre, mais ces deux pages sont toujours différentes, c'est à dire que ton navigateur interprète celles ci comme deux fenètre ouvertes dans une même fenêtre. Tu suis ;) ?
En revanche, avec le php, qui est un langage de programmation, et la fonction "include", tu va intégrer le contenu d'une page dans une autre. C'est à dire que le serveur prendra les deux fichier, pour n'en créer qu'un seul. Tu auras donc une seule page d'affichée dans ton navigateur.

Ainsi, tu comprendra qu'autant avec une frame les deux page affichées sont complètement indépendante, d'où la necessité de définir une cible d'affichage d'un lien (l'attribut target), autant avec la fonction include, les deux pages sont maintenant liées et inséparable. Ainsi, la fonction include peut te servir pour afficher un unique menu, qui sera appelé par toutes les pages de ton site, ou à appeler un contenu de page, mais en cliquant sur un lien de ce contenu, effectivement toute la page sera changée. Enfin, mettre un attribut target dans une page appelée par une include est tout bonnement inutile.

Voilà, j'espère que j'ai réussi à me faire comprendre... Pour ton problème particulier, soit un peu plus précis sur les contenus à framer/includer si tu veux qu'on te donne un coup de pouce quant au code à donner.

Voilou
@++
milouse

Avatar de l’utilisateur
Messages : 637
Géo : Nantes

Mer 06 Avr, 2005 12:00

Merci pour ta réponse

En fait voic mon site : http://hasan.karakaya.free.fr/Izi. Actuellement j'utilise Iframe. Ca marche tres bien mais ce n'est pas beau a voir.

Alors je suis passé au php et j ai cree la page suivante http://hasan.karakaya.free.fr/Izi/index1.php. Jusqu ici tout va bien. Mais par exemple quand je clique sur un lien, il s ouvre sur toute la page.

Je voudrais juste insere dans mon fichier index.php l'adresse suivante http://hasan.karakaya.free.fr/wordpress/index.php mais en gardant toujours les menus.
Un ami a fait le site suivant : http://www.cojep.com/fr. Lui aussi a utiliser <php ?include... pourtant chez lui ca marche nickel. Il n a rien fait de particulier.

Voila j espere que j ai donne assez d'element

merci
fukara

Messages : 4

Mer 06 Avr, 2005 12:06

J'ai résolu le problème en utilisant un script extrêmement simple.

Le produit est compatible frames et fonctionne nickel avec les overlay inter-frames.

Tigra Menu :

http://www.softcomplex.com/products/tigra_menu/
Invité

Mer 06 Avr, 2005 12:35

Merci pour ce site mais je comprends que d al. Je dois faire quoi avec, elle me perme tde faire quoi merci
fukara

Messages : 4

Mer 06 Avr, 2005 13:22

beuh, le code de bas à rajouter à la place de ton iframe dans ta page d'index est
Code: Tout sélectionner
<?php include("http://hasan.karakaya.free.fr/wordpress/index.php"); ?>

Ceci dit, encore une fois une fois ceci fait, il te faut remodifier toutes tes autres pages en rajoutant le menu sur celle ci afin qu'il apparaisse bien sur toute les pages.... barbant !
C'est pourquoi je t'inviterai plutot à includer ton menu sur toutes tes pages.
J'explique : plutot que de vouloir insérer ton blog à l'intérieur de ta page x, insère plutôt ton menu dans ton blog, et comme ça tu n'aura pas besoin de le répeter 100 fois.
@++
milouse

Avatar de l’utilisateur
Messages : 637
Géo : Nantes

Mer 06 Avr, 2005 17:46

fukara a écrit:Merci pour ce site mais je comprends que d al. Je dois faire quoi avec, elle me perme tde faire quoi merci


Ce script te permet de positionner tes menus en dynamique, sans tenir compte des frames créés.

Ainsi, tu peux utiliser tes frames sans perdre tes menus...
Invité

Jeu 07 Avr, 2005 07:39

Une page intéressante, relative aux pseudos-frames en php.
Extraite du site phpdebutant.org !
dubdub

Messages : 870

Jeu 07 Avr, 2005 10:10

Apres plusieurs essai, j'ai reussi a insere mes menus dans le blog. Par contre comme tu peux le constater j'ai la partie (categories, link, archives, qui empietinne sur mon entete. Je n ai pas reussi a le descendre en bas. Comment est ce que je peux faire ca ?

merci
http://hasan.karakaya.free.fr/wordpress/index.php

Voici le code du page index.php


<?
/* Don't remove this line. */
require('./wp-blog-header.php');
?>
<!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 profile="http://gmpg.org/xfn/1">
<title><? bloginfo('name'); ?><? wp_title(); ?></title>

<meta http-equiv="Content-Type" content="text/html; charset=<? bloginfo('charset'); ?>" />
<meta name="generator" content="Microsoft FrontPage 5.0" /> <!-- leave this for stats -->

<style type="text/css" media="screen">
@import url( <? echo get_settings('siteurl'); ?>/wp-layout.css );
</style>

<link rel="stylesheet" type="text/css" media="print" href="<? echo get_settings('siteurl'); ?>/print.css" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<? bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="text/xml" title="RSS .92" href="<? bloginfo('rss_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<? bloginfo('atom_url'); ?>" />

<link rel="pingback" href="<? bloginfo('pingback_url'); ?>" />
<? wp_get_archives('type=monthly&format=link'); ?>
<? //comments_popup_script(); // off by default ?>
<? wp_head(); ?>

<script language='JavaScript'>
v6_curseur='';
v5_curseur="url(fichier_plugin-2144.cur)";
</script>


<script language="JavaScript" src="menu.js"></script>
<script language="JavaScript" src="language.js"></script>


<script language='JavaScript'>
function changecurseur()
{
try {
if (v6_curseur!="")
{
document.body.style.cursor=v6_curseur;
}
else
{
if (v5_curseur!="") document.body.style.cursor=v5_curseur;
}
}
catch (e)
{
if (v5_curseur!="") document.body.style.cursor=v5_curseur;
}
}
</script>
<script language="JavaScript">
<!--
function OpenWindow(URL,nom_win,parametres,largeur,hauteur)
{
var gauche = (screen.width - largeur)/2;
var haut = (screen.height - hauteur)/2;
if (screen.width - largeur<1) {gauche=0}
if (screen.height - hauteur<1) {hauteur=0}
if (hauteur!="" || largeur!="") {parametres=parametres+',left='+gauche+',top='+haut}
try
{w.close()}
catch (ex)
{
}
w=window.open(URL,nom_win,parametres);
}

function JumpMenu(cible,selectObj,restore)
{
eval(cible+".location='"+selectObj.options[selectObj.selectedIndex].value+"'");
if (restore) selectObj.selectedIndex=0;
}
//-->
</script>

<script language="javascript">
var tab=new Array();
tab[1]=5;tab[2]=3;tab[3]=3;var largeur_menu="150";
var taille_ligne_tableau=25;
var hauteur_menu="77";
var couleur_de_fond="#FCFCF9";
var couleur_de_rollover="#C1D2EE";
</script>








</head>

<body onmousemove='sourie_ie();' onload='init_menu(); initialise_traduction();changecurseur();'>


<script language='JavaScript'>
</script>
<div id="menu1" style="position:absolute; left:0; top:0; width:10; height:10; visibility: hidden;z-index:100000" onmouseover="flagActif();" onmouseout="flagInactif('1');">
<table width="150" border="0" cellpadding="0" cellspacing="1" bgcolor="#98958B" >
<tr>
<td height="25" bgcolor="#FCFCF9" id="ssmenu1" onmouseover="roll_ssmenu_over('1',this);" onmouseout="roll_ssmenu_out('1');">&nbsp;<a href="perso-23217.htm" ><font face="arial" size="2" color="#000000">Belediye</font></a></td>
</tr>
<tr>
<td height="25" bgcolor="#FCFCF9" id="ssmenu2" onmouseover="roll_ssmenu_over('2',this);" onmouseout="roll_ssmenu_out('2');">&nbsp;<a href="perso-26217.htm" ><font face="arial" size="2" color="#000000">Muhtarlar</font></a></td>
</tr>
<tr>
<td height="25" bgcolor="#FCFCF9" id="ssmenu3" onmouseover="roll_ssmenu_over('3',this);" onmouseout="roll_ssmenu_out('3');">&nbsp;<a href="perso-26317.htm" ><font face="arial" size="2" color="#000000">Baskanlar</font></a></td>
</tr>
<tr>
<td height="25" bgcolor="#FCFCF9" id="ssmenu4" onmouseover="roll_ssmenu_over('4',this);" onmouseout="roll_ssmenu_out('4');">&nbsp;<a href="perso-26417.htm" ><font face="arial" size="2" color="#000000">Secimler</font></a></td>
</tr>
<tr>
<td height="25" bgcolor="#FCFCF9" id="ssmenu5" onmouseover="roll_ssmenu_over('5',this);" onmouseout="roll_ssmenu_out('5');">&nbsp;<a href="perso-26517.htm" ><font face="arial" size="2" color="#000000">Vaatler</font></a></td>
</tr>
</table>
</div>
<div id="menu2" style="position:absolute; left:0; top:0; width:10; height:10; visibility: hidden;z-index:100000" onmouseover="flagActif();" onmouseout="flagInactif('2');">
<table width="150" border="0" cellpadding="0" cellspacing="1" bgcolor="#98958B" >
<tr>
<td height="25" bgcolor="#FCFCF9" id="ssmenu6" onmouseover="roll_ssmenu_over('6',this);" onmouseout="roll_ssmenu_out('6');">&nbsp;<a href="perso-23317.htm" ><font face="arial" size="2" color="#000000">Bizden Gelenler</font></a></td>
</tr>
<tr>
<td height="25" bgcolor="#FCFCF9" id="ssmenu7" onmouseover="roll_ssmenu_over('7',this);" onmouseout="roll_ssmenu_out('7');">&nbsp;<a href="perso-26717.htm" ><font face="arial" size="2" color="#000000">Sizden Gelenler</font></a></td>
</tr>
<tr>
<td height="25" bgcolor="#FCFCF9" id="ssmenu8" onmouseover="roll_ssmenu_over('8',this);" onmouseout="roll_ssmenu_out('8');">&nbsp;<a href="perso-26817.htm" ><font face="arial" size="2" color="#000000">Siir Gonderme Formu</font></a></td>
</tr>
</table>
</div>
<div id="menu3" style="position:absolute; left:0; top:0; width:10; height:10; visibility: hidden;z-index:100000" onmouseover="flagActif();" onmouseout="flagInactif('3');">
<table width="150" border="0" cellpadding="0" cellspacing="1" bgcolor="#98958B" >
<tr>
<td height="25" bgcolor="#FCFCF9" id="ssmenu9" onmouseover="roll_ssmenu_over('9',this);" onmouseout="roll_ssmenu_out('9');">&nbsp;<a href="perso-25117.htm" ><font face="arial" size="2" color="#000000">Turkiye</font></a></td>
</tr>
<tr>
<td height="25" bgcolor="#FCFCF9" id="ssmenu10" onmouseover="roll_ssmenu_over('10',this);" onmouseout="roll_ssmenu_out('10');">&nbsp;<a href="perso-26017.htm" ><font face="arial" size="2" color="#000000">Avrupa</font></a></td>
</tr>
<tr>
<td height="25" bgcolor="#FCFCF9" id="ssmenu11" onmouseover="roll_ssmenu_over('11',this);" onmouseout="roll_ssmenu_out('11');">&nbsp;<a href="perso-26117.htm" ><font face="arial" size="2" color="#000000">Cenaze Fonu</font></a></td>
</tr>
</table>
</div>

<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="image-91001.gif"><img src="image-91001.gif" width="24" height="13"></td>
</tr>
<tr>
<td><table width="882" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="173"><p align="center"><a target="_blank" href="http://www.cojep.com/topsite/in.php?site=1077016735">
<img ALT="Top Sites Cojep" SRC="http://www.cojep.com/topsite/images/vote.gif " BORDER="0" align="center" width="94" height="37"></a><br>
<span class='titre_rubrique'>
<a target="_blank" href="http://www.gozyasi.com.tr/yayin.php?PHPSESSID=947f81124d4c6addcf246c4c1eecdd72">
<img border="0" src="canliyayin1.jpg" width="188" height="32"></a></span></td>
<td align="center" width="709">
<img src='image-029.jpg' id='logo' width="500" height="54"></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="176" background="image-91009.gif">
<table width="176" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top" width="171"><img src="image-91003.gif" width="100%" height="3"></td>
<td width="5"><img src="image-91004.gif" width="2" height="34"></td>
</tr>
</table></td>
<td align="right" valign="top" background="image-910010.gif"><table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="image-91003.gif" width="20" height="3"></td>
</tr>
<tr>
<td><span class='titre_rubrique'>Ana Sayfa</span><img src="image-91005.gif" width="30" height="16" align="absmiddle"></td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="176" valign="top" background="image-910011.gif">


<table width="174" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<!---->
<tr>
<td height="30">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="image-91006.gif" width="16" height="16"></td>
<td><a href="index-251712.htm" ><span class='itemlink'>Anasayfa</span></a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="3"><img src="image-91007.gif" width="174" height="3"></td>
</tr>
<!---->
<tr>
<td height="30">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="image-91006.gif" width="16" height="16"></td>
<td><a href="perso-22917.htm" ><span class='itemlink'>Anilarimiz</span></a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="3"><img src="image-91007.gif" width="174" height="3"></td>
</tr>
<!---->
<tr>
<td height="30">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="image-91006.gif" width="16" height="16"></td>
<td><a href="perso-23017.htm" ><span class='itemlink'>Tarihimiz</span></a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="3"><img src="image-91007.gif" width="174" height="3"></td>
</tr>
<!---->
<tr>
<td height="30">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="image-91006.gif" width="16" height="16"></td>
<td><a href="perso-23117.htm" ><span class='itemlink'>Evliyalar</span></a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="3"><img src="image-91007.gif" width="174" height="3"></td>
</tr>
<!---->
<tr>
<td height="30">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="image-91006.gif" width="16" height="16"></td>
<td><a href="perso-23217.htm" onmouseout="pauseEfface('1');" onmouseover="AfficheMenu('1');"><span class='itemlink'>Kurumlar</span></a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="3"><img src="image-91007.gif" width="174" height="3"></td>
</tr>
<!---->
<tr>
<td height="30">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="image-91006.gif" width="16" height="16"></td>
<td><a href="perso-23317.htm" onmouseout="pauseEfface('2');" onmouseover="AfficheMenu('2');"><span class='itemlink'>Siir</span></a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="3"><img src="image-91007.gif" width="174" height="3"></td>
</tr>
<!---->
<tr>
<td height="30">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="image-91006.gif" width="16" height="16"></td>
<td><a href="perso-25117.htm" onmouseout="pauseEfface('3');" onmouseover="AfficheMenu('3');"><span class='itemlink'>Dernekler</span></a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="3"><img src="image-91007.gif" width="174" height="3"></td>
</tr>
<!---->
<tr>
<td height="30">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="image-91006.gif" width="16" height="16"></td>
<td><a href="produits-2111778.htm" ><span class='itemlink'>Rehber</span></a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="3"><img src="image-91007.gif" width="174" height="3"></td>
</tr>
<!---->
<tr>
<td height="3" vAlign="top">
<img border="0" src="../HTML/Reklam/GoldenKebap_1.gif" width="160" height="105"><p align="justify">
<i><b><font style="font-size: 9pt">D</font><span lang="tr"><font style="font-size: 9pt">?, lahmacun ve pizza gibi daha nice yemek
祦amp;#351;itlerimizle her g?metinizdeyiz. İster ailece, ister
arkadaşlarınızla rahat bir ortamda farklı damak tadıyla Golden Kebap'a
uğramadan ge筥yin.</font></span></b></i></p>
<p align="center"><span lang="tr"><i><span style="font-size: 9pt">104 route de Schirmeck<br>
Strasbourg - Montagne Verte</span></i></span><span style="font-size: 9pt">
</span>
</td>
</tr>
<tr>
<td height="3" vAlign="top">
&nbsp;</td>
</tr>
<tr>
<td height="3" vAlign="top">
<span style="font-size: 9pt">
<img src="../HTML/Reklam/logo_immo.jpg" width="160" height="67" align="left"><p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><b>karakaya.biz'den yeni bir hizmet daha !!!</b></p>
<p align="justify"><font face="Verdana" style="font-size: 9pt">Ev arayanlar ! Ev
satanlar ! Strasbourg ve 祶resinde size yardımcı oluyoruz. Ek bir ?
yok, s?yok. Sadece ajans ve noter parası. İstediğiniz şartda,
istediğiniz yerde kiralık veya satılık ev, daire arsa, d?vs.. bizi
arayın.</font></p>
<p align="center"><font face="Verdana">06 13 85 16 48</font></p>
</span></td>
</tr>
</table>


</td>
<td valign="top"><table width="100%" height="300" border="0" cellpadding="10" cellspacing="0">
<tr>
<td valign="top"><table border='0' cellpadding='0' cellspacing='0'><tr><td><img src='empty.gif' width='100%' height='1'></td></tr></table><table border='0' cellpadding='0' cellspacing='0' width='100%' align='center'><tr><td>

<!--ACTUA18||||||||||||||||||-->
<div id="rap">
<h1 id="header"><a href="<? bloginfo('url'); ?>"><? bloginfo('name'); ?></a></h1>

<div id="content">
<? if ($posts) : foreach ($posts as $post) : start_wp(); ?>

<? the_date('','<h2>','</h2>'); ?>

<div class="post">
<h3 class="storytitle" id="post-<? the_ID(); ?>"><a href="<? the_permalink() ?>" rel="bookmark" title="Permanent Link: <? the_title(); ?>"><? the_title(); ?></a></h3>
<div class="meta"><? _e("Filed under:"); ?> <? the_category() ?> — <? the_author() ?> @ <? the_time() ?> <? edit_post_link(); ?></div>

<div class="storycontent">
<? the_content(); ?>
</div>

<div class="feedback">
<? wp_link_pages(); ?>
<? comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
</div>

<!--
<? trackback_rdf(); ?>
-->

<? include(ABSPATH . 'wp-comments.php'); ?>
</div>

<? endforeach; else: ?>
<p><? _e('Sorry, no posts matched your criteria.'); ?></p>
<? endif; ?>
</div>

<div></div>
<div> </div>
XXX
<div id="menu">

<ul>
<? get_links_list(); ?>
<li id="categories">&nbsp;<? _e('Categories:'); ?><ul>
<? wp_list_cats(); ?>
</ul>
</li>
<li id="search">
<label for="s"><? _e('Search:'); ?></label>
<form id="searchform" method="get" action="<? echo $PHP_SELF; ?>">
<div>
<input type="text" name="s" id="s" size="15" /><br />
<input type="submit" name="submit" value="<? _e('Search'); ?>" />
</div>
</form>
</li>
<li id="archives">&nbsp;<? _e('Archives:'); ?><ul>
<? wp_get_archives('type=monthly'); ?>
</ul>
</li>
<li id="calendar">
<? get_calendar(); ?>
</li>
<li id="other">&nbsp;<? _e('Other:'); ?><ul>
<li><a href="<? echo get_settings('siteurl'); ?>/wp-login.php"><? _e('Login'); ?></a></li>
<li><a href="<? echo get_settings('siteurl'); ?>/wp-register.php"><? _e('Register'); ?></a></li>

</ul>
</li>

</ul>

</div>

</div>

<p class="credit"><!--<? echo $wpdb->num_queries; ?> queries. <? timer_stop(1); ?> seconds. --> <cite><? echo sprintf(__("Powered by <a href='http://wordpress.org' title='%s'><strong>WordPress</strong></a>"), __("Powered by WordPress, state-of-the-art semantic personal publishing platform")); ?></cite></p>









<BR></td></tr></table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right" background="image-91008.gif">
</td>
</tr>
</table>


<div id="Layer" style="position:absolute; left:-250px; top:0px; width:150px;z-index:10000000; ">
<h2></h2>
</div>




</body>
</html>
fukara

Messages : 4

Qui est en ligne ?

Utilisateur(s) parcourant actuellement ce forum : Aucun utilisateur inscrit