is there a php code to put an image gif over a jpg as a laye

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
enzo
Forum Newbie
Posts: 1
Joined: Wed Mar 02, 2011 2:14 pm

is there a php code to put an image gif over a jpg as a laye

Post by enzo »

Hi to everyone!

i am doing a web page where i want to show a pieces of map based on the 4 corner of the image ' they are like the coordinates' also i have created some layer which i want to show if the check button is checked but i have no idea how to do that as i am so new in php and with no experience,

can someone help me please

here is the entire code:



<html>
<head>
<title>Harta ime</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body,td,th {
color: #000;
}
.tb {
background-color: #55BEFF;
height: 510px;
width: 800px;
}
.tb td {
background-color: #FFF;
height: 510px;
width: 500px;
border: 1px dashed #F00;
}
.tb td1 {
width: 300px;
}
.koka {
background-color: #FFF;
width: 998px;
border: 1px solid #F00;
background-image: url(im/wm.jpg);
height: 240px;
color: #FF0;
font-size: xx-large;
text-align: right;
}
.koka p {
color: #F00;
}
.tb {
background-color: #FFF;
}
.tb td table tr td {
background-color: #4FBCFF;
}
.tb td form label {
color: #FFF;
}
.shkrim {
color: #000;
}
-->
</style></head>
<body bgcolor="#0F3065">

<p>&nbsp;</p>
<p>&nbsp;</p>
<table width="997" align="center">
<tr>
<td width="989" class="koka"><p>&nbsp;</p>
<p>&nbsp;</p>
<p>Welcome to my map</p></td>
</tr>
</table>
<table width="1001" align="center">
<tr class="tb">
<td width="298" height="441" align="center" valign="baseline" style="background-color: #4FBCFF;"><p><br>
</p>

<p>&nbsp;</p>
<table align="center">
<tr><form name="form1" method="post" action="index.php">
<label><span class="shkrim">
road
<input type="checkbox" name="check" id="check">
. </span></label>
<span class="shkrim">

lake
<input type="checkbox" name="check2" id="check2">
.river
<input type="checkbox" name="check3" id="check3">
. streams</span>
<input type="checkbox" name="check4" id="check4">
</form>
<td width="494" height="510"><FORM action="index.php" method="post">

<p>&nbsp;</p>

<p>&nbsp;</p>
<p>
<LABEL for="emer">Kordinata 1: </LABEL>
<INPUT name="cord1" type="text" value="1"/>
</p>
<p>
<LABEL for="emer">Kordinata 2: </LABEL>
<INPUT name="cord2" type="text" value="2"/>
</p>
<p>
<LABEL for="emer">Kordinata 3: </LABEL>
<INPUT name="cord3" type="text" value="3"/>
</p>
<p>
<LABEL for="emer">Kordinata 4: </LABEL>
<INPUT name="cord4" type="text" value="4"/>
</p>
<p>
<LABEL for="emer">
Zmadhimi:
<select name="zmadhimi">
<option value="0" SELECTED>Origjinale</option>
<option value="11">Zmadhimi Poshte Majtas</option>
<option value="12">Zmadhimi Poshte Djathtas</option>
<option value="21">Zmadhimi Larte Majtas</option>
<option value="22">Zmadhimi Larte Djathtas</option>
</select>
</p>
<p>
<INPUT type="submit" value="Send"/>
<INPUT type="reset" value="Fshije"/>
</p>
</FORM></td>
</tr>
</table>
<br>
<br></td>
<td width="691">

<?php
$ccord1 = $_POST['cord1'];
$ccord2 = $_POST['cord2'];
$ccord3 = $_POST['cord3'];
$ccord4 = $_POST['cord4'];
$zmadhimi = $_POST['zmadhimi'];

include 'open.db.php';

$sql_select_table = ("SELECT * FROM Slot1 ;");

$result_select_table = mysql_query($sql_select_table) or die("E pamundur hyrja ne tabele");

while ($row = mysql_fetch_array($result_select_table)) {
$cord1 = $row['cord1'];
$cord2 = $row['cord2'];
$cord3 = $row['cord3'];
$cord4 = $row['cord4'];


if ($zmadhimi == "0") {
if ($ccord1 == $cord1 && $ccord2 == $cord2 && $ccord3 == $cord3 && $ccord4 == $cord4) {
echo '<img src="'.$row['image'].'" width="600" height="600"/>';

echo 'cord1 ="' .$row['cord1'].'"';
echo 'cord2 ="' .$row['cord2'].'"';
echo 'cord3 ="' .$row['cord3'].'"';
echo 'cord4 ="' .$row['cord4'].'"';
}
} else if ($zmadhimi == "11") {
$cord111 = $ccord1;
$cord112 = ($ccord1 + $ccord2) / 2;
$cord113 = ($ccord1 + $ccord3) / 2;
$cord114 = ($cord113 + (($ccord2+$ccord4)/2) ) / 2;
if ($cord111 == $cord1 && $cord112 == $cord2 && $cord113 == $cord3 && $cord114 == $cord4) {
echo '<img src="'.$row['image'].'" width="600" height="600"/>';

echo 'cord1 ="' .$row['cord1'].'"';
echo 'cord2 ="' .$row['cord2'].'"';
echo 'cord3 ="' .$row['cord3'].'"';
echo 'cord4 ="' .$row['cord4'].'"';
}
} else if ($zmadhimi == "12") {
$cord121 = ($ccord1 + $ccord2) / 2;
$cord122 = $ccord2;
$cord123 = ((($ccord1 + $ccord3) / 2) + (($ccord2+$ccord4)/2) ) / 2;
$cord124 = ($ccord2 + $ccord4) / 2;
if ($cord121 == $cord1 && $cord122 == $cord2 && $cord123 == $cord3 && $cord124 == $cord4) {
echo '<img src="'.$row['image'].'" width="600" height="600"/>';

echo 'cord1 ="' .$row['cord1'].'"';
echo 'cord2 ="' .$row['cord2'].'"';
echo 'cord3 ="' .$row['cord3'].'"';
echo 'cord4 ="' .$row['cord4'].'"';
}
} else if ($zmadhimi == "21") {
$cord131 = ($ccord1 + $ccord3) / 2;
$cord132 = ($cord131 + (($ccord2+$ccord4)/2) ) / 2;
$cord133 = $ccord3;
$cord134 = ($ccord3 + $ccord4) / 2;
if ($cord131 == $cord1 && $cord132 == $cord2 && $cord133 == $cord3 && $cord134 == $cord4) {
echo '<img src="'.$row['image'].'" width="600" height="600"/>';

echo 'cord1 ="' .$row['cord1'].'"';
echo 'cord2 ="' .$row['cord2'].'"';
echo 'cord3 ="' .$row['cord3'].'"';
echo 'cord4 ="' .$row['cord4'].'"';
}
} else if ($zmadhimi == "22") {
$cord141 = ((($ccord1 + $ccord3) / 2) + (($ccord2+$ccord4)/2) ) / 2;
$cord142 = ($ccord2 + $ccord4) / 2;
$cord143 = ($ccord3 + $ccord4) / 2;
$cord144 = $ccord4;
if ($cord141 == $cord1 && $cord142 == $cord2 && $cord143 == $cord3 && $cord144 == $cord4) {
echo '<img src="'.$row['image'].'" width="600" height="600"/>';


echo 'cord1 ="' .$row['cord1'].'"';
echo 'cord2 ="' .$row['cord2'].'"';
echo 'cord3 ="' .$row['cord3'].'"';
echo 'cord4 ="' .$row['cord4'].'"';;
}

}

}


?>

&nbsp;</td>
</tr>
</table>
<p class="shkrim">&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>




</body>
</html>


Maybe i have done it wrong in the check box part

many thanks in advance
Post Reply