...

View Full Version : PHP help, image problems



Mafty
03-28-2004, 01:59 AM
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. if codes are needed i can post all the php codes used on the image page and on the popup window page

Mafty
03-28-2004, 02:21 AM
well i figure youll need the php code to help me at all so heres the code im using for the popup window

<!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>

Mafty
03-28-2004, 02:26 AM
and the two php codes im using in my image gallery are:


<?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 = "javascript: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'>&nbsp;&nbsp; $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 inbetween the two codes)


<?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 = "javascript: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'>&nbsp;&nbsp; $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>";
}
?>

Mafty
03-28-2004, 04:48 PM
*bump* anyone :eek:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum