http://www.mikeglaz.com/wujek/manage.php?location=art
When you click on 'View' it displays the enlarged image in a popup window.
In the database for these pics I have the following columns: id, name, description.
What I want to be able to do is display a popup window with a textarea and the description of the pic within it when I click on 'Edit'. I want to be able to modify the text and save it.
Here's the code for 'View' within manage.php:
Code: Select all
echo "<a href=\"javascript:create_window('$path',$image_size[0],$image_size[1])\">
<span class=\"imageText\">View</span></a>";
where $path is the path to the picture
then create_window looks like this:
Code: Select all
function create_window (image, width, height)
{
// Add some pixels to the width and height:
width = width + 20;
height = height + 20;
// If the window is already open,
// resize it to the new dimensions:
if (window.popup && !window.popup.closed) {
window.popup.resizeTo(width, height);
}
// Set the window properties:
var specs = "location=no, scrollbars=no, menubars=no, toolbars=no, resizable=yes, left=0, top=0, width=" + width + ", height=" + height;
// Set the URL:
var url = "show_image.php?image=" + image;
// Create the pop-up window:
popup = window.open(url, "ImageWindow", specs);
popup.focus();
} // End of function.
Code: Select all
<?php # Script 10.5 - show_image.php
// This page displays an image.
$name = FALSE; // Flag variable:
// Check for an image name in the URL:
if (isset($_GET['image'])) {
// Full image path:
$image = "{$_GET['image']}";
// Check that the image exists and is a file:
if (file_exists ($image) && (is_file($image)))
{
// Set the name as this image:
$name = $_GET['image'];
} // End of file_exists() IF.
} // End of isset($_GET['image']) IF.
// Get the image information:
$info = getimagesize($image);
$fs = filesize($image);
// Send the content information:
header ("Content-Type: {$info['mime']}\n");
header ("Content-Disposition: inline; filename=\"$name\"\n");
header ("Content-Length: $fs\n");
// Send the file:
readfile ($image);
?>