hey all. i have a javascript and php script and i have just been at it way to long today that my brain is starting to fart.
any who i want my javascript to open up in a iframe i have made instead of in the blank window it was built to open up in.
here is the script. (clients)
thank for the help in advancePHP Code:<tr>
<td width="400" height="384" align="center" valign="middle"><iframe name="gallery" scrolling="no" align="middle" height="350" width="350"></iframe></td>
<td width="350" align="center" valign="middle"> <script type="text/javascript">
<!--this function needs to be change to display in iframe if image clicked-->
function view(url)
{
window.open(url, 'pic', '');
return false;
}
</script>
<table cellpadding="2" class="gallery">
<tr>
<?php
$path = 'styles/images';
$path_thumbs = 'styles/thumbs';
$extensions = array('jpg', 'jpeg', 'bmp', 'gif', 'png');
################################################## #############
$dir = opendir($path_thumbs);
$images = array();
$used = array();
while (($file = readdir($dir)) !== false)
{
$ext = strtolower(substr(strrchr($file, '.'), 1));
if (in_array($ext, $extensions))
{
$images[] = $file;
}
}
function get_rand()
{
global $used, $images;
$rand = rand(0, sizeof($images) - 1);
if (in_array($rand, $used))
{
$rand = get_rand();
}
return $rand;
}
for ($i = 1; $i <= 9; $i++)
{
$rnd = get_rand();
$used[] = $rnd;
echo '<td><a href="'. $path .'/'. $images[$rnd] .'" onclick="return view(this.href);">
//this part needs to be changed to onclick="something"
<img src="'. $path_thumbs .'/'. $images[$rnd] .'" align="middle" border="0" />
</a></td>' ."\n";
if ($i == 3 OR $i == 6)
{
echo '</td><tr>';
}
}
?>
</tr>
</table></td>
</tr>



Reply With Quote

Bookmarks