alright ive got two php codes, one after another on the same page, one of the codes has all the images showing, but the other only shows the text. check here to see what i mean:
http://www.maftystudios.com/portfolio.php
ok so now another problem arises, i want the images to open up in a small pop up window, so i created a popup.php file with a code to for the images. but onyl some work, and i need to know how to get a scroll bar on one.
ok heres the code im using on the popup window for my images once they ahve been clicked
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><?php
$user = "USERNAME";
$password = "PASSWORD";
$db = "DATABASE";
$table = "portfolio";
$id = $_GET['id'];
$con = mysql_connect("localhost",$user,$password);
mysql_select_db($db,$con);
$sql = "SELECT * FROM $table WHERE `id` = '$id' LIMIT 1";
$result = mysql_query($sql) or die("Error: ".mysql_error());
while($row = mysql_fetch_array($result)){
echo $row[0];
}
?> </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="imagetoolbar" content="no" />
<STYLE type="text/css">
<!--
body {
scrollbar-face-color:00314E;
scrollbar-highlight-color:06456A;
scrollbar-3dlight-color:06456A;
scrollbar-darkshadow-color:06253C;
scrollbar-shadow-color:06253C;
scrollbar-arrow-color:76B0D0;
scrollbar-track-color:071E2F;
}
-->
</STYLE>
</head>
<body bgcolor="#000000" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
<?php
$user = "USERNAME";
$password = "PASSWORD";
$db = "DATABASE";
$table = "portfolio";
$id = $_GET['id'];
$con = mysql_connect("localhost",$user,$password);
mysql_select_db($db,$con);
$sql = "SELECT * FROM $table WHERE `id` = '$id' LIMIT 1";
$result = mysql_query($sql) or die("Error: ".mysql_error());
while($row = mysql_fetch_array($result)){
echo "<img src='jpegs/$row[2].jpg' width='$row[5]' height='$row[4]' scrollbar='$row[6]'>";
}
?>
</body>
</html>
and the two php codes im using in my image gallery are(in the order they appear in dreamweaver and on my site):
<?php
$con = mysql_connect("localhost","USERNAME","PASSWORD");
$db = mysql_select_db("DATABASE",$con);
$sql = "SELECT * FROM `portfolio` ORDER BY `id` DESC";
$result = mysql_query($sql) or die("Error: ".mysql_error());
while($row = mysql_fetch_array($result)){
$ree = "popup.php?id=$row[3]";
$title = $row[0];
$width = $row[5];
$height = $row[4];
$scrollbar = $row[6];
$javascript = " java script:MM_openBrWindow('$ree','$title','width=
$width,height=$height,scrollbar=$scrollbar')";
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td><font color='#FFFFFF' size='2' face='Geneva, Arial, Helvetica,
sans-serif'> $row[0]</font></td>";
echo "</tr>";
echo "<tr>";
echo "<td><a href=$javascript><img src='jpegs/$row[1].jpg' width='250'
height='70' hspace='4' border='0'></a></td>";
echo "</tr>";
echo "</table><br>";
}
?>
<br> (i use a break in between the two codes to seperate them)
and then the second code, exactly the same except getting images from a differnt spot on phpmyadmin and this code wont show any images for some reason.
<?php
$con = mysql_connect("localhost","USERNAME","PASSWORD");
$db = mysql_select_db("DATABASE",$con);
$sql = "SELECT * FROM `portfolio2` ORDER BY `id` DESC";
$result = mysql_query($sql) or die("Error: ".mysql_error());
while($row = mysql_fetch_array($result)){
$ree = "popup.php?id=$row[3]";
$title = $row[0];
$width = $row[5];
$height = $row[4];
$scrollbar = $row[6];
$javascript = " java script:MM_openBrWindow('$ree','$title','width=
$width,height=$height,scrollbar=$scrollbar')";
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td><font color='#FFFFFF' size='2' face='Geneva, Arial, Helvetica,
sans-serif'> $row[0]</font></td>";
echo "</tr>";
echo "<tr>";
echo "<td><a href=$javascript><img src='jpegs/$row[1].jpg' width='250' height='70' hspace='4' border='0'></a></td>";
echo "</tr>";
echo "</table><br>";
}
?>