deniseb
06-30-2007, 04:11 PM
ok.. I hope this is the right place for this request.
I have the following code someone wrote for me that loads images to a page and display a textarea under the image that contains the link to the image:
// Display image list
$arr = array();
if ($handle2 = opendir($root2folder . 'images/')) {
$cnt = 0;
while (false !== ($file = readdir($handle2))) {
if ($file != "." && $file != ".." && $file !="Thumbs.db") {
if(($cnt>=$imageListStart)&&($cnt<$imageListStop)){
array_push($arr, $file);
}
$cnt++;
}
}
closedir($handle2);
}
sort($arr, SORT_STRING);
$i = 1;
foreach($arr as $val) {
echo '<div class="showImages">' . "\n" .
'<img src="' . $pb2folder . 'images/' . $val .'" alt="' . $val . '" />' . "\n" .
'<form action=""><input type="text" name="showImage' . $i . '" class="showImageTextBox" onfocus="this.form.showImage' . $i . '.select()" onclick="this.form.showImage' . $i . '.select()" value="<a href="' . $urlBase . '"><img src="' . $pb2folder . 'images/' . $val . '" alt="' . $imgAlt . '" border="0"></a>' . $linkBack . '" onmouseover="this.style.borderColor=\'#' . $randomColors[$random10[0]] . '\'" onmouseout="this.style.borderColor=\'#555555\'" /></form>' . "\n" .
(want to add send to a friend code here)
'</div>' . "\n\n";
$i++;
}
I want to add this line of html code where I note above:
<a target="_blank" href="http://website.com/recform.php">Share with a Friend</a><br />
how would I do that? no matter what I try I get some error or another.
Thanks!
Denise
I have the following code someone wrote for me that loads images to a page and display a textarea under the image that contains the link to the image:
// Display image list
$arr = array();
if ($handle2 = opendir($root2folder . 'images/')) {
$cnt = 0;
while (false !== ($file = readdir($handle2))) {
if ($file != "." && $file != ".." && $file !="Thumbs.db") {
if(($cnt>=$imageListStart)&&($cnt<$imageListStop)){
array_push($arr, $file);
}
$cnt++;
}
}
closedir($handle2);
}
sort($arr, SORT_STRING);
$i = 1;
foreach($arr as $val) {
echo '<div class="showImages">' . "\n" .
'<img src="' . $pb2folder . 'images/' . $val .'" alt="' . $val . '" />' . "\n" .
'<form action=""><input type="text" name="showImage' . $i . '" class="showImageTextBox" onfocus="this.form.showImage' . $i . '.select()" onclick="this.form.showImage' . $i . '.select()" value="<a href="' . $urlBase . '"><img src="' . $pb2folder . 'images/' . $val . '" alt="' . $imgAlt . '" border="0"></a>' . $linkBack . '" onmouseover="this.style.borderColor=\'#' . $randomColors[$random10[0]] . '\'" onmouseout="this.style.borderColor=\'#555555\'" /></form>' . "\n" .
(want to add send to a friend code here)
'</div>' . "\n\n";
$i++;
}
I want to add this line of html code where I note above:
<a target="_blank" href="http://website.com/recform.php">Share with a Friend</a><br />
how would I do that? no matter what I try I get some error or another.
Thanks!
Denise