salve...
ho implementatato in una pagina php questo script che visualizza immagini random:
--------------------------------------------------------------------------------------
<?php
////////////////////////////////////////////////////////////////////////////////
// Max Power Random Image Script //
// ShiftedPhase.com //
// Free for personal use, $15 for corporate license //
// Leave Header Intact //
////////////////////////////////////////////////////////////////////////////////
//////DECLARATIONS//////////////////////////////////////////////////////////////
// $path is your full path where the images are stored e.g."/var/www/html/images"
// If you don't know what it is, create a simple php script with phpinfo(); as
// the only command. Then you will be able to see all the server variables as
// PHP reports. You may also use relative paths, yet this may not work across
// an entire site e.g. "./images"
$path = "images";
// $baseurl is your website URL where the images are stored e.g."http://www.yourdomain.com/images"
$baseurl="http://localhost/images";
// $prefix is the prefix to the names of the images you would like to include e.g. "image"
$prefix = "projectn";
// $ext is the extension of the images you are including e.g. "jpg"
$ext = "jpg";
// $extra is space for any extra attributes you would like to include in the <img src> tag.
// With PHP, adding quotation marks will throw off the programming and will most likely
// introduce errors. To circumvent this, use \" rather than " and \' rather than '
$extra = "border=0";
//////INSTRUCTIONS//////////////////////////////////////////////////////////////
// Put images in the folder you chose above, then name the images in that //
// folder as $prefix0.$ext. (image0.jpg) then name the next $prefix1.$ext //
// and keep going until you are out of images. //
// //
// To call from your PHP document, just add include("randimg.php"); //
// where you want the image to appear. //
////////////////////////////////////////////////////////////////////////////////
// The coding below does not need to be altered, please leave it alone unless //
// you know what you are doing. //
////////////////////////////////////////////////////////////////////////////////
$i = 0;
echo $mushed;
// Finds how many files there are matching criteria
while(@file($path."/".$prefix.$i.".".$ext)) {
$i++;
}
$h = ($i - 1);
// Generates random number
$rand = rand(0,$h);
// Returns image
echo "
<img src=\"".$baseurl."/".$prefix.$rand.".".$ext."\" $extra>";
?>
-----------------------------------------------------------------------------------
nello script ho fissato l immagine con width="100" per motivi estetici e vorrei che cliccando sull immagine stessa o sul un link testuale al di sotto di essa, mi si aprisse un pop-up della stessa immagine con le dimensioni originali...
ho provato a implementare un javascript popup tipo questo:
--------------------------------------------------------------------------------
<script language="javascript">
function pop_window(url) {
var popit = window.open(url,'console','menubar,toolbar,locatio n,directories,status,scrollbars,resizable,width=64 0,height=480');
}
</script>
<A href="javascript:pop_window('url.html')">Open Window</A>
----------------------------------------------------------------------------
ma mi da parse error...sono un po troppo newbie col php
sapete darmi una mano??
ringrazio anticipatamente
PS: questo è il link per una demo: http://sliver.altervista.org/album_machinex/
lo script visualizza l immagine che sta sulla destra nel box curiosities
Ciao,
scusa ma non vedo link e/o msg di errore del php...
...hai gia' risolto o rimosso il tutto e lasciato solo il codice che visualizza l'img in modo random?!