Gå til innhold

hvordan includere en fil i en include?


Anbefalte innlegg

hei på alle!

 

mitt problem er dette:

 

i index.php så includerer jeg alt innholdet. der igjen, på gallery-siden, så bruker jeg include igjen, men bare i photo.php, og da selfølgelig åpnes jo alle bildene ikke i index, men i photo. noe som skjønner hva jeg spør om, og som kan hjelpe meg? :dontgetit: Razz

Lenke til kommentar
Videoannonse
Annonse

\index.php

<?php
include("hoho.php");
?>

 

\bilder\photos.php

<?php
include("bilder/blablabla");
?>

 

Siden det blir includert i index må man ha bilder i photos.php og

 

EDIT: slik du mente!?

Endret av goggen90
Lenke til kommentar

hehe, ja.

 

skal prøve å forklare igjen:

 

DETTE ER INDEX.PHP

 

<head>

 

<title>X</title>

 

<link rel="shortcut icon" href="favicon.ico" >

 

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link rel="stylesheet" type="text/css" href="style.css">

</head>

<body>

<div id="container">

<div id="header">

<?php include("meny.php"); ?>

</div>

<?php

error_reporting(0);

$filnavn = $_GET['s'];

$tillatt = array("front", "bio", "disco", "visuals", "guest", "contact");

$filendelse = '.php';

if (in_array($filnavn, $tillatt))

{

include $filnavn . $filendelse;

}

else if (!$filnavn)

{

include 'front.php';

}

else

{

include '404.php';

}

?>

</div>

</body>

</html>

 

DETTE ER VISUALS.PHP

 

<div id="left">

<div class="mainphoto">

<?php

$filnavn = $_GET['photo'];

$filendelse = '.php';

if ($filnavn)

{

include 'images/photo/' . $filnavn . $filendelse;

}

else if (!$filnavn)

{

include 'images/photo/marthe1.php';

}

else

{

include 'finsikke.php';

}

?>

</div>

</div>

 

<div id="mid">

</div>

 

<div id="right">

<img src="images/photo.gif" class="right" alt="photo">

<div class="blogtxt">

<div id="thumbs">

<a href="photo.php?photo=marthe1"><img src="images/thumb/marthe1.png" title="Marthe" alt="Marthe"></a>

<a href="photo.php?photo=marthe2"><img src="images/thumb/marthe2.png" title="Marthe" alt="Marthe"></a>

<a href="photo.php?photo=marthe3"><img src="images/thumb/marthe3.png" title="Marthe" alt="Marthe"></a>

<a href="photo.php?photo=marthe1"><img src="images/thumb/marthe1.png" title="Marthe" alt="Marthe"></a>

<a href="photo.php?photo=marthe1"><img src="images/thumb/marthe1.png" title="Marthe" alt="Marthe"></a>

<a href="photo.php?photo=marthe1"><img src="images/thumb/marthe1.png" title="Marthe" alt="Marthe"></a>

<a href="photo.php?photo=marthe1"><img src="images/thumb/marthe1.png" title="Marthe" alt="Marthe"></a>

<a href="photo.php?photo=marthe1"><img src="images/thumb/marthe1.png" title="Marthe" alt="Marthe"></a>

<a href="photo.php?photo=marthe1"><img src="images/thumb/marthe1.png" title="Marthe" alt="Marthe"></a>

<a href="photo.php?photo=marthe1"><img src="images/thumb/marthe1.png" title="Marthe" alt="Marthe"></a>

<a href="photo.php?photo=marthe1"><img src="images/thumb/marthe1.png" title="Marthe" alt="Marthe"></a>

</div>

<img src="images/line_blog.gif" alt="blogline">

<br /><br />

<img src="images/high.gif" class="hi-res" alt="hi-res"><br /><br />

<div id="thumbs">

<a href="photo.php?photo=marthe1"><img src="images/thumb/marthe1.png" title="Marthe" alt="Marthe"></a>

<a href="photo.php?photo=marthe2"><img src="images/thumb/marthe2.png" title="Marthe" alt="Marthe"></a>

<a href="photo.php?photo=marthe3"><img src="images/thumb/marthe3.png" title="Marthe" alt="Marthe"></a>

<a href="photo.php?photo=marthe1"><img src="images/thumb/marthe1.png" title="Marthe" alt="Marthe"></a>

</div>

<img src="images/line_blog.gif" alt="blogline"><br /><br />

<img src="images/video.gif" class="video" alt="video"><br /><br />

<p>X</p>

</div>

 

 

Ble noen smartere på det nå?

Lenke til kommentar

Først prøv å bruk CODE tagen...

 

Hmm.. det er denne du vil ha forandret:

<a href="photo.php?photo=marthe1"><img src="images/thumb/marthe1.png" title="Marthe" alt="Marthe"></a>

 

Slik at den også går via index.php filen ?

 

:hmm:

Lenke til kommentar

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
  • Hvem er aktive   0 medlemmer

    • Ingen innloggede medlemmer aktive
×
×
  • Opprett ny...