nochmals ich
ich pack das irgendwie nicht ...
hab hier ein anderes sehr einfaches randomscript gefunden :
PHP-Code:
<?php
/*
* Name your images 1.jpg, 2.jpg etc.
*
* Add this line to your page where you want the images to
* appear: <?php include "random.php"; ?>
*/
// Change this to the total number of images in the folder
$total = "6";
// Change to the type of files to use eg. .jpg or .gif
$file_type = ".jpg";
// Change to the location of the folder containing the images
$image_folder = "./img";
// You do not need to edit below this line
$start = "1";
$random = mt_rand($start, $total);
$image_name = $random . $file_type;
echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" />";
?>
dieses hab ich nun per include in die seite1.php eingebunden.
PHP-Code:
<?php
session_start();
include "random.php";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Unbenanntes Dokument</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
[url="seite2.php"]seite 2[/url]</p>
[url="seite3.php"]seite 3[/url]</p>
</body>
</html>
beim aufrauf der seite1.php wird nun einzufälliges bild vom ordner img geholt. beim link auf seite2.php oder seite 3.php sollte dieses übergeben werden.
Wie binde ich den dieses bild nun ein ?