Thank you. Here’s one. I’m trying to figure out how I can add more than more than one image at a time. I’m having trouble figuring out where to start to alter this. As it is now, when you add an image you can only select one at a time. I can’t think of a way to add multiple images at one time. This one gives me a headache. I’m thinking it’s a script someplace.
[php]<?php
include “…/sql.php”;
if ($_SESSION[‘admin’] != 1)
{
header(“Location: /admin”);
die();
}
$title = “Manage Images”;
$showSide = false;
include “…/header.php”;
include “…/carpreview.php”;
$car_id = intval($_GET[‘id’]);
$x = mysql_query(“select * from cars where id=” . $car_id);
$car = mysql_fetch_array($x, MYSQL_ASSOC);
if (!$car) die(“This vehicle no longer exists.”);
if (intval($_GET[‘main’]) > 0)
{
mysql_query(“update images set main=0 where car_id=” . $car_id);
mysql_query(“update images set main=1 where car_id=” . $car_id . " and id=" . intval($_GET[‘main’]));
}
elseif (intval($_GET[‘delete’]) > 0)
{
$del = intval($_GET[‘delete’]);
mysql_query(“delete from images where id=” . $del);
@unlink("…/images/vehicles/" . $car_id . “-” . $del . “.jpg”);
@unlink("…/images/vehicles/" . $car_id . “-” . $del . “t.jpg”);
}
showCarPreview($car);
$x = mysql_query(“select id,main from images where car_id=” . $car_id);
while ($y = mysql_fetch_array($x, MYSQL_ASSOC))
{
?>
<?=$y['main'] == "1" ? "MAIN " : ""?><input type=“radio” name=“main” value="<?=$y['id']?>" <?=$y['main'] == "1" ? "checked" : ""?> onclick=“javascript:location=‘carpics.php?id=<?=$car_id?>&main=<?=$y['id']?>’;”>
<?php if ($y['main'] != "1") { ?>
X
<?php } ?>
<?php
}
?>