Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP include

Empfohlene Antworten

Veröffentlicht

Hallo,

ich habe folgendes Problem:

<?php include("kopfdatei.php"); ?>
<?php include("links.php"); ?>
<div class="index" id="index">

<?php
if($_GET['x']=='home' || !$_GET['x'])include 'home.php';
if($_GET['x']=='gastronomie')include 'gastronomie.php';
if($_GET['x']=='freizeit')include 'freizeit.php';
if($_GET['x']=='geschichte')include 'geschichte.php';
if($_GET['x']=='industrie')include 'industrie.php';
if($_GET['x']=='kontakt')include 'kontakt.php';
?>[/PHP]

Jetzt zu meiner Frage: Also wenn ich jetzt auf gastronomie klicke dann wird in der Adresszeile der teil "www.meineseite.de/index.php?x=gastronomie" angezeigt. Dies mache ich ja, um in der Klasse index die Seite gastronomie.php anzuzeigen. Ich möchte innerhalb der gastronomie.php das gleiche nochmal wie in der index.php machen, aber wie? Wäre nett wenn mir wer helfen könnte. Danke :)

Am einfachsten wäre es, wenn du in der gastronomie.php einen weiteren GET Param abfrägst, der dann über den Inhalt dieser Seite entscheidet.

  • Autor

Ja, das habe ich bereits versucht, aber dann zeit dieser mir nur die eine Seinte an. So würde dies in der Adresszeite aussehen "www.meineseite.de/index.php?x=gastronomie.php?y=fitness"

Ich finde selbst, das die adresse etwas absurt klinkt, ich komme aber leider nicht darauf, wie ich das machen soll :( ich hab auch schon gegoogled... aber ich bin nicht wirklich auf hilfreiche Informationen gestoßen...

Ganz einfach, der erste GET Param muss mit ? übergeben werden und alle folgenden mit &. Sprich:


www.meineseite.de/index.php?x=gastronomie.php&y=fitness

Und laut deinem if State oben müsse sie heißen:

www.meineseite.de/index.php?x=gastronomie&y=fitness

Wie sieht denn deine gastronomie.php aus? Wenn du www.meineseite.de/index.php?x=gastronomie&y=fitness aufrufst, sollte ja die gastronomie.php included werden, wenn du den Code so verwendest wie es in deinem 1. Post steht. Nun musst du in der gastronomie.php nur noch die Variable "y" abfragen und dann den entsprechenden Bereich includen.

Edit: okay, scheint sich erledigt zu haben :P

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.