php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2005-2

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 23.07.2005, 18:37  
Gast
 
Beiträge: n/a
Standard Include Problem! Links inerhalb eines Includes ...

Moin Leute!

Ich bin "leider" ein PHP Noob. Ich habe mit Hilfe dieses Tutorials -> http://www.gfx-world.net/index.php?p...tpos=Tutorials
Mehrere Seiten in ein Template eingebunden.
So weit so gut, es läuft auch echt super! Doch auf mehreren Seiten die ich Includet habe (php Seiten) sind Links vorhanden und wenn ich dann einen Link benutze geht er aus dem Include raus und öffnet die PHP Datei direckt und geht aus dem Template raus.
Das soll er aber nicht er soll im Template bleiben und dort wo ich ihn Includet habe!

Aber wie mache ich das?
 
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 23.07.2005, 18:41  
Gast
 
Beiträge: n/a
Standard

Keine Ahnung wie dein Script aussieht, jedoch könntest du vorerst mal versuchen, die Links zu "kontrolieren" indem du einen <base href=""> setzt.
einfach vor <body>
Code:
<base href="URLMEINERSEITE">
setzen. Vielleicht klappts dann.
 
Alt 23.07.2005, 18:41  
Erfahrener Benutzer
 
Registriert seit: 05.04.2005
Beiträge: 1.333
Freeaak ist zur Zeit noch ein unbeschriebenes Blatt
Standard

Includes != Frames. Wenn du einen Link klickst, wird die ganze Seite neu geladen"
__________________
"Wenn du nicht weißt, was du tust: Machs mit Eleganz!"

(Murphy's Gesetze)
Freeaak ist offline  
Alt 23.07.2005, 18:55  
Gast
 
Beiträge: n/a
Standard

Ich arbeite mit zwei Dateien:

vars.php :
Code:
<?
//[...]
$mainsite['home'] = 'include/home.php';
$mainsite['news'] = 'include/news.php';
$mainsite['downloads'] = 'include/downloads.php';
//[...]
?>
index.php :
Code:
<?
  require_once("vars.php");        // hier ein Beispiel für die funktion require_once();. Funktioniert wie include();
  //[...]
  if(isset($_GET['site']))
      (isset($mainsite[$_GET['site']])) ? include($mainsite[$_GET['site']]) : include('errorsite.php');
  else
      include($mainsite['news']);
  //[...]
?>
Und denn Teil aus der index.php habe ich in meinem Temlate eingefügt wo ich denn Inhalt haben will.
Ich habe in meine Seite das vWar System eingebunden ( www.vwar.de ) und wenn ich nun die News Seite include und dort noch ein Link zum Archiv ist und man dort drauf klick verläst er die index.php und geht zur archiv.php aber das soll er nicht er soll das Archiv dort öffnen wo der Include ist!
 
Alt 23.07.2005, 19:00  
Erfahrener Benutzer
 
Registriert seit: 05.04.2005
Beiträge: 1.333
Freeaak ist zur Zeit noch ein unbeschriebenes Blatt
Standard

Zeig mal den Link
__________________
"Wenn du nicht weißt, was du tust: Machs mit Eleganz!"

(Murphy's Gesetze)
Freeaak ist offline  
Alt 23.07.2005, 19:02  
Gast
 
Beiträge: n/a
Standard

Bitte.

http://www.aao-tactics.de/mw_page/index.php
 
Alt 23.07.2005, 19:06  
Erfahrener Benutzer
 
Registriert seit: 05.04.2005
Beiträge: 1.333
Freeaak ist zur Zeit noch ein unbeschriebenes Blatt
Standard

Nein, ich meine den
Zitat:
Link zum Archiv
EDIT: Quelltext
__________________
"Wenn du nicht weißt, was du tust: Machs mit Eleganz!"

(Murphy's Gesetze)
Freeaak ist offline  
Alt 23.07.2005, 19:11  
Gast
 
Beiträge: n/a
Standard

http://www.aao-tactics.de/mw_page/ne...action=archive

Quellcode der index.php :
Code:
<html>
<head>
<title>Mallorca Warriors Clan Page</title>

</head>
<body bgcolor="#FFFFFF" background="bg.png" leftmargin="0" topmargin="0" rightmargin="0" marginwidth="0" marginheight="0">
<center>


[img]images/banner.png[/img]
<table id="Tabelle_01" width="837" border="0" cellpadding="0" cellspacing="0">
        <tr>
                <td colspan="28">
                        [img]images/index_01.png[/img]</td>
        </tr>
        <tr>
                <td colspan="4" rowspan="2">
                        [img]images/index_02.png[/img]</td>
                <td>
                        [img]images/index_03.png[/img]</td>
                <td rowspan="2">
                        [img]images/index_04.png[/img]</td>
                <td>
                        [img]images/index_05.png[/img]</td>
                <td rowspan="2">
                        [img]images/index_06.png[/img]</td>
                <td>
                        [img]images/index_07.png[/img]</td>
                <td rowspan="2">
                        [img]images/index_08.png[/img]</td>
                <td colspan="2">
                        [img]images/index_09.png[/img]</td>
                <td rowspan="2">
                        [img]images/index_10.png[/img]</td>
                <td>
                        [img]images/index_11.png[/img]</td>
                <td rowspan="2">
                        [img]images/index_12.png[/img]</td>
                <td>
                        [img]images/index_13.png[/img]</td>
                <td rowspan="2">
                        [img]images/index_14.png[/img]</td>
                <td>
                        [img]images/index_15.png[/img]</td>
                <td colspan="3" rowspan="2">
                        [img]images/index_16.png[/img]</td>
                <td>
                        [img]images/index_17.png[/img]</td>
                <td rowspan="2">
                        [img]images/index_18.png[/img]</td>
                <td>
                        [img]images/index_19.png[/img]</td>
                <td colspan="4" rowspan="2">
                        [img]images/index_20.png[/img]</td>
        </tr>
        <tr>
                <td>
                        [img]images/index_21.png[/img]</td>
                <td>
                        [img]images/index_22.png[/img]</td>
                <td>
                        [img]images/index_23.png[/img]</td>
                <td colspan="2">
                        [img]images/index_24.png[/img]</td>
                <td>
                        [img]images/index_25.png[/img]</td>
                <td>
                        [img]images/index_26.png[/img]</td>
                <td>
                        [img]images/index_27.png[/img]</td>
                <td>
                        [img]images/index_28.png[/img]</td>
                <td>
                        [img]images/index_29.png[/img]</td>
        </tr>
        <tr>
                <td colspan="3" rowspan="3">
                        [img]images/index_30.png[/img]</td>
                <td width="740" height="17" colspan="22" align="center" background="images/index_31.png">
                        <font size="-2" face="Verdana, Arial, Helvetica, sans-serif">Es ist <?php  $uhrzeit=date("H:i"); echo $uhrzeit; ?> am <?php  $datum=date("d.m.Y"); echo $datum; ?></font></td>
                <td colspan="3" rowspan="3">
                        [img]images/index_32.png[/img]</td>
        </tr>
        <tr>
                <td colspan="22">
                        [img]images/index_33.png[/img]</td>
        </tr>
        <tr>
                <td colspan="8">
                        [img]images/index_34.png[/img]</td>
                <td width="340" height="194" colspan="8" rowspan="2" background="images/ca_bg.png">
              
              <?php
              include('http://www.aao-tactics.de/mw_page/extra/calendar_include.php');
              ?>
              </td>
                <td colspan="6">
                        [img]images/index_36.png[/img]</td>
        </tr>
        <tr>
                <td colspan="2" rowspan="2">
                        [img]images/index_37.png[/img]</td>
                <td width="200" height="179" colspan="8" bgcolor="#FFFFFF">
              
              <?php
              include('http://www.aao-tactics.de/mw_page/extra/nextactions.php');
              ?>
              </td>
                <td rowspan="2">
                        [img]images/index_39.png[/img]</td>
                <td rowspan="2">
                        [img]images/index_40.png[/img]</td>
                <td width="200" height="179" colspan="6" bgcolor="#FFFFFF">
              
              <?php
              include('http://www.aao-tactics.de/mw_page/extra/lastactions.php');
              ?>
              </td>
                <td colspan="2" rowspan="2">
                        [img]images/index_42.png[/img]</td>
        </tr>
        <tr>
                <td colspan="8">
                        [img]images/index_43.png[/img]</td>
                <td colspan="8">
                        [img]images/index_44.png[/img]</td>
                <td colspan="6">
                        [img]images/index_45.png[/img]</td>
        </tr>
        <tr>
                <td rowspan="2">
                        </td>
                <td width="7" background="images/index_47.png">
                        </td>
                <td width="750" colspan="24" bgcolor="#FFFFFF">
                
<?
  require_once("vars.php");        // hier ein Beispiel f�r die funktion require_once();. Funktioniert wie include();
  //[...]
  if(isset($_GET['site']))
      (isset($mainsite[$_GET['site']])) ? include($mainsite[$_GET['site']]) : include('errorsite.php');
  else
      include($mainsite['news']);
  //[...]
?>
                </td>
                <td width="7" background="images/index_49.png">
                        </td>
                <td rowspan="2">
                        </td>
        </tr>
        <tr>
                <td colspan="26">
                        [img]images/index_51.png[/img]</td>
        </tr>
        <tr>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
                <td>
                        [img]images/spacer.gif[/img]</td>
        </tr>
</table>
</center>
</body>
</html>
 
Alt 23.07.2005, 19:13  
Erfahrener Benutzer
 
Registriert seit: 05.04.2005
Beiträge: 1.333
Freeaak ist zur Zeit noch ein unbeschriebenes Blatt
Standard

Wenn ich das richtig sehe, wird $_GET['site'] und nicht action includet.
__________________
"Wenn du nicht weißt, was du tust: Machs mit Eleganz!"

(Murphy's Gesetze)
Freeaak ist offline  
Alt 23.07.2005, 19:15  
Gast
 
Beiträge: n/a
Standard

Zitat:
Zitat von Freeaak
Wenn ich das richtig sehe, wird $_GET['site'] und nicht action includet.
Ich habe denn Quelltext hinzugef�gt! (siehe oben)

Quelltext der vars.php :
Code:
<?
// In dieser Datei sind alle Variablen f�r die Seite abgelegt
//[...]
$mainsite['news'] = 'http://www.aao-tactics.de/mw_page/news.php';
$mainsite['member'] = 'http://www.aao-tactics.de/mw_page/member.php';
$mainsite['forum'] = '';
$mainsite['kontakt'] = 'http://www.aao-tactics.de/mw_page/page.php?id=1';
$mainsite['wars'] = 'http://www.aao-tactics.de/mw_page/warteam.php';
$mainsite['downloads'] = 'http://www.aao-tactics.de/mw_page/downloads.php';
$mainsite['history'] = 'http://www.aao-tactics.de/mw_page/page.php?id=2';
$mainsite['fightus'] = 'http://www.aao-tactics.de/mw_page/challenge.php';
$mainsite['joinus'] = 'http://www.aao-tactics.de/mw_page/joinus.php';
$mainsite['rules'] = 'http://www.aao-tactics.de/mw_page/rules.php';
//[...]
?>
 
 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
[Erledigt] Problem mit Include pck1983 PHP Tipps 2008 7 15.07.2008 19:13
Problem mit Links DJ Nuno HTML, Usability und Barrierefreiheit 0 17.10.2007 07:24
include problem Canni PHP Tipps 2006 26 14.11.2006 14:24
Problem mit Links PHP Tipps 2006 2 02.02.2006 17:24
include problem: Tic Rederon PHP Tipps 2005-2 10 10.08.2005 08:20
include problem N°2 PHP Tipps 2005-2 11 06.08.2005 16:36
Problem mit links in Schleife web2 PHP Tipps 2004-2 2 23.11.2004 12:58
[Erledigt] Problem mit Include PHP Tipps 2004 17 22.09.2004 15:59
include problem PHP Tipps 2004 3 17.09.2004 21:17
Include Problem PHP Tipps 2004 4 14.09.2004 14:08
include Problem andrew22 PHP Tipps 2004 26 10.09.2004 16:04
Gästebuch / Include Problem PHP Tipps 2004 9 14.07.2004 18:48
Links mit PHP und include PHP Tipps 2004 6 13.07.2004 16:36
problem mit relativen includes in php PHP Tipps 2004 6 30.06.2004 13:36
Problem mit Include Script PHP Tipps 2004 2 15.06.2004 14:26

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
mehrere include php probleme mit links, php include guestbook challenge image, png per php include, php in td include, vwar included joinus, php include links, link include geht nicht, problem php include links in body

Alle Zeitangaben in WEZ +2. Es ist jetzt 05:33 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.