Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<title>Garryspillane Gaa </title>
<body style="background-color:#313131;color:#FFFFFF">
<?php
$conn = @mysql_connect("localhost", "admin", "admin2345");
if (!@mysql_select_db("temp", $conn))
die("<p>Error selecting DB-DEVEL database: <i>" . mysql_error() . "</i></p>");
$current_image;
$query = "SELECT current FROM current_image WHERE path='2005_championship'";
$result = mysql_query($query);
while ($property = mysql_fetch_array($result))
{
$current_image=($property["current"]);
}
function getImage($num){
$query = "SELECT * FROM gallery WHERE number='$num'";
$result = mysql_query($query);
while ($property = mysql_fetch_array($result))
{
$name = ($property["image_name"]);
$loc= ($property["location"]);
$description= ($property["description"]);
}
$url=$loc.'/'.$name;
return $url;
}
function getCurrent(){
$query = "SELECT current FROM current_image where path='2005_championship'";
$result = mysql_query($query);
while ($property = mysql_fetch_array($result))
{
$current = ($property["current"]);
}
return $current;
}
function total_images(){
$max_query = "SELECT MAX(number) FROM gallery";
$max_result = mysql_query($max_query);
while ($property = mysql_fetch_array($max_result))
{
$number = ($property["MAX(number)"]);
}
return $number;
}
function next_Image(){
echo("<script LANGUAGE='javascript'>temp();</script>");
$temp=total_images();
$num=getCurrent()+1;
if($num<=$temp){
$query = "update current_image set current='$num' where path='2005_championship'";
mysql_query($query);
}
}
function previous_Image(){
$temp1=1;
$num2=getCurrent()-1;
if($num2>=$temp1){
$query1 = "update current_image set current='$num2' where path='2005_championship'";
mysql_query($query1);
}
}
$image=getImage(5);
function test(){
return "hello";
}
?>
<table width="100%" height="100%">
<tr>
<td>
<div style="text-align:center">
<img src="<?php echo(getImage($current_image)); ?>" name="main_image" width="" height=""/>
</div>
</td>
</tr>
<tr>
<td>
<table width="100%" style="text-align:center">
<tr>
<td>
<script>
function temp(){
var value='<?php echo($image)?>';
alert('<?php echo($image)?>');
document.main_image.src=value;
}
</script>
<button onClick="temp()" name="next_button"> hello</button>
<button onClick="<?php next_Image();?>" style="background-color:#313131;border:0;margin:0;padding:0;"><img src="images/previous.jpg"/>
</button>
<button style="background-color:#313131;border:0;margin:0;padding:0;"><img src="images/home.jpg"/>
</button>
<button onClick="<?php next_Image();?>" style="background-color:#313131;border:0;margin:0;padding:0;"><img src="images/next.jpg"/>
</button>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%">
<tr>
<td width="15%">
</td>
<td width="70%">
<div style="white-space:nowrap; width: 700px;height:125px; overflow:auto; scrollbar-arrow-color: green; scrollbar-face-color: #e7e7e7; scrollbar-3dlight-color: #a0a0a0; scrollbar-darkshadow-color:
#888888;scrollbar-base-color:#313131;">
<table style="height:100px">
<tr>
<?php
$width="100px";
$height="80px";
for ($num=1; $num <= 13; $num++ ) {
$image_path=getImage("$num");
if ($num==3){
$width="120px";
$height="100px";
}
echo("<td><img src='$image_path' width='$width' height='$height' /></td>");
$width="100px";
$height="80px";
}
?>
</tr>
</table>
</div>
</td>
<td width="15%">
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php
mysql_close ($conn);
?>
</body>
</html>var value='gallery/2005_images
/2005_5.jpg';
As you can see the text is going the the next line. Does echo automically do a newline and if so what should i use instead of this.