Get ready for BLACK FRIDAY shopping starting in

Forums

PHP

This topic is locked

Updating File Upload - No images

Posted 06 Nov 2007 05:09:14
1
has voted
06 Nov 2007 05:09:14 Desiree Villota posted:
hi, i'm new here and i'm also new in doing file uploads in php. my insert is working but when i edit it, it doesn't work. im not familiar in oop so here's my code.

this file is my update.php
<?php
include ("cn.php";
$id = $_POST["id"];
$resort = $_POST["resort"];
$rating = $_POST["rating"];
$location = $_POST["location"];
$stations = $_POST["stations"];
$resorType = $_POST["resorType"];
$trooms = $_POST["trooms"];
$standard = $_POST["standard"];
$deluxe = $_POST["deluxe"];
$superior = $_POST["superior"];
$suites = $_POST["suites"];
$family = $_POST["family"];
$sview = $_POST["seaview"];
$gview = $_POST["gview"];
$fan = $_POST["fan"];
$fAircon = $_POST["fanAircon"];
$clifftype = $_POST["cliff"];
$restaurant = $_POST["restaurant"];
$spool = $_POST["pool"];
$diving = $_POST["diving"];
$gym = $_POST["gym"];
$spa = $_POST["spa"];
$golf = $_POST["golf"];
$bc = $_POST["bc"];
$wifi = $_POST["wifi"];
$wclimbing = $_POST["wclimbing"];
$cFacilities = $_POST["child"];
$coldwater = $_POST["coldwater"];
$snote = $_POST["snote"];
$lseason = $_POST["lseason"];
$lseasonprice = $_POST["lseasonprice"];
$hseason = $_POST["hseason"];
$hseasonprice = $_POST["hseasonprice"];
$pseason = $_POST["pseason"];
$pseasonprice = $_POST["pseasonprice"];
$bookingStatus = $_POST["bookingStatus"];
$dateResortCreated = $_POST["dateResortCreated"];
$restoNear = $_POST["restoNear"];
$resortNear = $_POST["resortNear"];
$divingNear = $_POST["divingNear"];
$shopping = $_POST["shopping"];
$resortInfo = $_POST["resortInfo"];
$resorTesti = $_POST["resorTesti"];
$contact = $_POST["contact"];
$dateResortUpdated = $_POST["dateResortUpdated"];
$email = $_POST["email"];
$website = $_POST["website"];
$agent = $_POST["agent"];
$agentEdited = $_POST["agentEdited"];
$resortPackage = $_POST["resortPackage"];
$priceRange = $_POST["priceRange"];

$pictures = $HTTP_POST_FILES["pictures"];
$picturesTwo = $HTTP_POST_FILES["picturesTwo"];
$picturesThree = $HTTP_POST_FILES["picturesThree"];
$picturesFour = $HTTP_POST_FILES["picturesFour"];
$picturesFive = $HTTP_POST_FILES["picturesFive"];

//$fileToRemove = "UploadedImages/$row_Recordeset1['pictures']";
//unlink($fileToRemove) or die("Could not delete file";


//size limit
$limit_size=500000;

//path where to upload
$file_name= "UploadedImages/" . $HTTP_POST_FILES['pictures']['name'];
$file_nameTwo= "UploadedImages/" . $HTTP_POST_FILES['picturesTwo']['name'];
$file_nameThree= "UploadedImages/" . $HTTP_POST_FILES['picturesThree']['name'];
$file_nameFour= "UploadedImages/" . $HTTP_POST_FILES['picturesFour']['name'];
$file_nameFive= "UploadedImages/" . $HTTP_POST_FILES['picturesFive']['name'];
//file size
$f_size = $HTTP_POST_FILES['pictures']['size'];
$f_sizeTwo = $HTTP_POST_FILES['picturesTwo']['size'];
$f_sizeThree = $HTTP_POST_FILES['picturesThree']['size'];
$f_sizeFour = $HTTP_POST_FILES['picturesFour']['size'];
$f_sizeFive = $HTTP_POST_FILES['picturesFive']['size'];

$f_sizes = ($f_size + $f_sizeTwo + $f_sizeThree + $f_sizeFour + $f_sizeFive);
$f_names = array($pictures,$picturesTwo,$picturesThree,$picturesFour,$picturesFive);

if ($pictures == '')
{
$pictures = 'noimages.jpg';
}
if ($picturesTwo == '')
{
$picturesTwo = 'noimages.jpg';
}
if ($picturesThree == '')
{
$picturesThree = 'noimages.jpg';
}
if ($picturesFour == '')
{
$picturesFour = 'noimages.jpg';}
if ($picturesFive == '' )
{
$picturesFive = 'noimages.jpg';
}

if($f_names != '')
{
if($f_sizes <= $limit_size)
{
copy($HTTP_POST_FILES['pictures']['tmp_name'],$file_name);
copy($HTTP_POST_FILES['picturesTwo']['tmp_name'],$file_nameTwo);
copy($HTTP_POST_FILES['picturesThree']['tmp_name'],$file_nameThree);
copy($HTTP_POST_FILES['picturesFour']['tmp_name'],$file_nameFour);
copy($HTTP_POST_FILES['picturesFive']['tmp_name'],$file_nameFive);


$update = "Update hotels set resort = '$resort', rating = '$rating', location = '$location', stations = '$stations', resorType = '$resorType', total = '$trooms', standard = '$standard', deluxe = '$deluxe', superior = '$superior', suites = '$suites', family = '$family', sview = '$sview', gview = '$gview', fan = '$fan', fAircon = '$fAircon', clifftype = '$clifftype', restaurant = '$restaurant', spool = '$spool', diving = '$diving', gym = '$gym', spa = '$spa', golf = '$golf', bsnesCenter = '$bc', wifi = '$wifi', climbing = '$wclimbing', cFacilities = '$cFacilities', coldwater = '$coldwater', sNote = '$snote', lseasonDate = '$lseason', lseasonPrice = '$lseasonprice' , hseasonDate = '$hseason', hseasonPrice = '$hseasonprice', pseasonDate = '$pseason', pseasonPrice = '$pseasonprice' , bookingStatus = '$bookingStatus', dateCreated = '$dateResortCreated', restoNear = '$restoNear', resortNear = '$resortNear', divingNear = '$divingNear', shoppingNear = '$shopping', resortInfo = '$resortInfo', resortTesti = '$resorTesti', contact = '$contact', dateUpdated = '$dateResortUpdated', email = '$email', website = '$website', agent = '$agent', agentEdited = '$agentEdited', resortPackage = '$resortPackage', pictures = '$pictures', picturesTwo = '$picturesTwo', picturesThree = '$picturesThree', picturesFour = '$picturesFour', picturesFive = '$picturesFive', priceRange = '$priceRange' where id = '$id'";
$query = mysql_query($update) or die(mysql_error());
$row = mysql_affected_rows();
{
header("location:allresorts.php?msg=1";
}
}
else
{
header("location:viewDetails.php?msg=1";
}

}
?>

this is my viewDetails.php
<?php
session_start();
include("cn.php";
if (!isset($_SESSION["name"])) {
header("Location<img src=../images/dmxzone/forum/icon_smile_tongue.gif border=0 align=middle>leaselogin.php";
}
else {
echo "&lt;span class=\"style8\"&gt;"."Welcome ". $_SESSION["name"] ."&lt;/span&gt;" . " &lt;br&gt;";
echo "&lt;span class=\"style1\"&gt;"."&lt;a href=\"index.php?msg=2\"&gt;Logout&lt;/a&gt;"."&lt;/span&gt;" . " &lt;hr&gt;" . "&lt;/div&gt;";
echo "&lt;span class=\"style1\"&gt;"."&lt;a href=\"allresorts.php\"&gt;Back&lt;/a&gt;"."&lt;/span&gt;" . " &lt;hr&gt;" . "&lt;/div&gt;" . "&lt;br&gt;";
}
?&gt;

&lt;!--
.style3 {font-size: 12px}
--&gt;
&lt;/style&gt;
&lt;style type="text/css"&gt;
&lt;!--
.style1 {
font-size: 10;
font-weight: bold;
color: #FFFF00;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style7 {font-size: 12px; font-weight: bold; color: #FFFF00; font-family: Verdana, Arial, Helvetica, sans-serif; }
.style8 {font-size: 10px}
.style9 {
font-family: Verdana, Arial, Helvetica, sans-serif;
color: #FFFF00;
font-weight: bold;
}
.style12 {
font-size: 9px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
color: #FFFF00;
}
.style13 {font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFF00; }
.style14 {font-size: 16px}
.style16 {
color: #FF6600;
font-weight: bold;
font-size: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style17 {font-size: 8px}
.style20 {color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;}
--&gt;
&lt;/style&gt;
&lt;?php
include ("cn.php";
$id = $_GET["id"];
$select = "select c.id, c.resort, c.rating, c.location, c.stations, c.resorType, c.total, c.standard, c.deluxe, c.superior, c.suites, c.family, c.sview, c.gview, c.fan, c.fAircon, c.clifftype, c.restaurant, c.spool, c.diving, c.gym, c.spa, c.golf, c.bsnesCenter, c.wifi, c.climbing, c.cFacilities, c.coldwater, c.snote, c.lseasonDate, c.lseasonPrice, c.hseasonDate, c.hseasonPrice, c.pseasonDate, c.pseasonPrice, c.bookingStatus, c.dateCreated, c.restoNear, c.resortNear, c.divingNear, c.shoppingNear, c.resortInfo, c.resortTesti, c.contact, c.dateUpdated, c.email, c.website, c.agent, c.agentEdited, c.resortPackage, c.pictures, c.picturesTwo, c.picturesThree, c.picturesFour, c.picturesFive, c.priceRange from hotels c where id='$id'";
$query = mysql_query($select) or die(mysql_error());
$rows = mysql_num_rows($query);
$rs = mysql_fetch_array($query);
$id = $rs[0];
$resort = $rs[1];
$rating = $rs[2];
$location = $rs[3];
$stations = $rs[4];
$resorType = $rs[5];
$trooms = $rs[6];
$standard = $rs[7];
$deluxe = $rs<img src=../images/dmxzone/forum/icon_smile_8ball.gif border=0 align=middle>;
$superior = $rs[9];
$suites = $rs[10];
$family = $rs[11];
$sview = $rs[12];
$gview = $rs[13];
$fan = $rs[14];
$fAircon = $rs[15];
$clifftype = $rs[16];
$restaurant = $rs[17];
$spool = $rs[18];
$diving = $rs[19];
$gym = $rs[20];
$spa = $rs[21];
$golf = $rs[22];
$bsnesCenter = $rs[23];
$wifi = $rs[24];
$wclimbing = $rs[25];
$cFacilities = $rs[26];
$coldwater = $rs[27];
$snote = $rs[28];
$lseason = $rs[29];
$lseasonprice = $rs[30];
$hseason = $rs[31];
$hseasonprice = $rs[32];
$pseason = $rs[33];
$pseasonprice = $rs[34];
$bookingStatus = $rs[35];
$dateResortCreated = $rs[36];
$restoNear = $rs[37];
$resortNear = $rs[38];
$divingNear = $rs[39];
$shoppingNear = $rs[40];
$resortInfo = $rs[41];
$resortTesti = $rs[42];
$contact = $rs[43];
$dateResortUpdated = $rs[44];
$email = $rs[45];
$website = $rs[46];
$agent = $rs[47];
$agentEdited = $rs[48];
$resortPackage = $rs[49];
$pictures = $rs[50];
$picturesTwo = $rs[51];
$picturesThree = $rs[52];
$picturesFour = $rs[53];
$picturesFive = $rs[54];
$priceRange = $rs[55];
?&gt;
&lt;?php
include ("cn.php";
$query_Recordset1 = "SELECT * FROM hotels WHERE id = '$id' ";
$Recordset1 = mysql_query($query_Recordset1, $cn) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?&gt;
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"www.w3.org/TR/html4/loose.dtd"&gt;
&lt;head&gt;
&lt;title&gt;View Details&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;/head&gt;
&lt;script language="javascript" src="cal2.js"&gt;
/*
Xin's Popup calendar script- Xin Yang (www.yxscripts.com/)
Script featured on/available at www.dynamicdrive.com/
This notice must stay intact for use
*/
&lt;/script&gt;
&lt;script language="javascript" src="cal_conf2.js"&gt;&lt;/script&gt;
&lt;body&gt;
&lt;form action="updateResort.php" name="viewDetails" method="post"&gt;&lt;br&gt;&lt;br/&gt;
&lt;table width="819" border="1" align="center" bordercolor="#000000" bgcolor="#336699"&gt;
&lt;tr&gt;
&lt;td width="809" &gt;&lt;div align="center" class="style1 style14"&gt;
Resort Details
&lt;input type="hidden" name="id" value="&lt;?php echo $id; ?&gt;" &gt;
&lt;input name="dateResortUpdated" type="hidden" value="&lt;?php $date = date("Y/m/d"; echo $date; ?&gt;" /&gt;
&lt;input name="agent" type="hidden" value="&lt;?php echo $agent; ?&gt;" /&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;?php
if($_GET["msg"] == 1) {
echo "&lt;div class=\"style7\"&gt;&lt;b&gt;&lt;center&gt;Resort has been Updated!&lt;/center&gt;&lt;/b&gt;";
}
if($_GET["msg"] == 2) {
echo "&lt;div class=\"style7\"&gt;&lt;b&gt;&lt;center&gt;File size is over the limit&lt;/center&gt;&lt;/b&gt;";
}

?&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td &gt;&lt;div align="center" class="style1"&gt;
&lt;table width="790" border="0"&gt;
&lt;tr&gt;
&lt;td width="101" valign="bottom"&gt;&lt;div align="left"&gt;&lt;span class="style7"&gt;Resort Name:&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="375"&gt;&lt;input name="resort" type="text" class="style20" value="&lt;?php echo $resort; ?&gt;" size="65" maxlength="80" /&gt;&lt;/td&gt;
&lt;td width="107" valign="bottom" class="style7"&gt;Date Created:&lt;/td&gt;
&lt;td width="189"&gt;&lt;div align="left"&gt;
&lt;input name="dateResortCreated" type="text" class="style20" value="&lt;?php echo $dateResortCreated; ?&gt;" size="8" maxlength="10" readonly="readonly"/&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td valign="top"&gt;&lt;table width="802" border="0"&gt;
&lt;tr&gt;
&lt;td width="50" valign="bottom" class="style7"&gt;Contact&lt;/td&gt;
&lt;td width="144"&gt;&lt;input name="contact" type="text" class="style20" value="&lt;?php echo $contact; ?&gt;"/&gt;&lt;/td&gt;
&lt;td width="36" valign="bottom" class="style7"&gt;Email&lt;/td&gt;
&lt;td width="145"&gt;&lt;input name="email" type="text" class="style20" value="&lt;?php echo $email; ?&gt;"/&gt;&lt;/td&gt;
&lt;td width="54" valign="bottom" class="style7"&gt;Website&lt;/td&gt;
&lt;td width="144"&gt;&lt;input name="website" type="text" class="style20" value="&lt;?php echo $website; ?&gt;" /&gt;&lt;/td&gt;
&lt;td width="45" valign="bottom" class="style7"&gt;Agent&lt;/td&gt;
&lt;td width="150"&gt;&lt;input name="agentEdited" type="text" readonly="readonly"class="style20" value="&lt;?php echo $_SESSION["name"]; ?&gt;"/&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td &gt;&lt;table width="802" border="0"&gt;
&lt;tr&gt;
&lt;td width="151" valign="bottom"&gt;&lt;div align="left"&gt;&lt;span class="style7"&gt;Resort location:&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
&lt;td width="77"&gt; &lt;?php
$select = "select * from rlocation";
$query = mysql_query($select);
$rows = mysql_num_rows($query);
echo "&lt;select name = \"location\"&gt;";
for ($i=0; $i&lt;$rows; $i++) {
$rs = mysql_fetch_array($query);
if ($rs["location"] == $location) {
echo "&lt;option value = \"".$rs["location"]. "\" selected = \"selected\"&gt;" .$rs["location"]."&lt;/option&gt;";
}
else {
echo "&lt;option value = \"".$rs["location"]. "\"&gt;" .$rs["location"]."&lt;/option&gt;";
}
}
?&gt;&lt;/td&gt;
&lt;td width="139" valign="bottom" class="style7"&gt;Island Location:&lt;/td&gt;
&lt;td width="37"&gt;&lt;?php
$select = "select * from istations";
$query = mysql_query($select);
$rows = mysql_num_rows($query);
echo "&lt;select name = \"stations\"&gt;";
for ($i=0; $i&lt;$rows; $i++) {
$rs = mysql_fetch_array($query);
if ($rs["stations"] == $stations) {
echo "&lt;option value = \"".$rs["stations"]. "\" selected = \"selected\"&gt;" .$rs["stations"]."&lt;/option&gt;";
}
else {
echo "&lt;option value = \"".$rs["stations"]. "\"&gt;" .$rs["stations"]."&lt;/option&gt;";
}
}
?&gt;&lt;/td&gt;
&lt;td width="124" valign="bottom" class="style7"&gt;Resort Type:&lt;/td&gt;
&lt;td width="41"&gt;&lt;?php
$select = "select * from rtype";
$query = mysql_query($select);
$rows = mysql_num_rows($query);
echo "&lt;select name = \"resorType\"&gt;";
for ($i=0; $i&lt;$rows; $i++) {
$rs = mysql_fetch_array($query);
if ($rs["resorType"] == $resorType) {
echo "&lt;option value = \"".$rs["resorType"]. "\" selected = \"selected\"&gt;" .$rs["resorType"]."&lt;/option&gt;";
}
else {
echo "&lt;option value = \"".$rs["resorType"]. "\"&gt;" .$rs["resorType"]."&lt;/option&gt;";
}
}
?&gt;&lt;/td&gt;
&lt;td width="55" valign="bottom" class="style7"&gt;Rating:&lt;/td&gt;
&lt;td width="134"&gt;&lt;?php
$select = "select * from ratings";
$query = mysql_query($select);
$rows = mysql_num_rows($query);
echo "&lt;select name = \"rating\"&gt;";
for ($i=0; $i&lt;$rows; $i++) {
$rs = mysql_fetch_array($query);
if ($rs["rating"] == $rating) {
echo "&lt;option value = \"".$rs["rating"]. "\" selected = \"selected\"&gt;" .$rs["rating"]."&lt;/option&gt;";
}
else {
echo "&lt;option value = \"".$rs["rating"]. "\"&gt;" .$rs["rating"]."&lt;/option&gt;";
}
}
?&gt;&lt;/td&gt;
&lt;td width="6"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td &gt;&lt;table width="798" border="0"&gt;
&lt;tr&gt;
&lt;td width="122" valign="bottom" class="style13"&gt;Total Rooms
&lt;input name="trooms" type="text" class="style20" value="&lt;?php echo $trooms; ?&gt;" size="3" maxlength="2" /&gt;&lt;/td&gt;
&lt;td width="109" valign="bottom" class="style13"&gt;Standard
&lt;input name="standard" type="text" class="style20" value="&lt;?php echo $standard; ?&gt;" size="3" maxlength="2"/&gt;&lt;/td&gt;
&lt;td width="95" valign="bottom" class="style13"&gt;Deluxe
&lt;input name="deluxe" type="text" class="style20" value="&lt;?php echo $deluxe; ?&gt;" size="3" maxlength="2"/&gt;&lt;/td&gt;
&lt;td width="104" valign="bottom"&gt;&lt;span class="style13"&gt;Superior&lt;/span&gt;
&lt;input name="superior" type="text" class="style20" value="&lt;?php echo $superior; ?&gt;" size="3" maxlength="2"/&gt;&lt;/td&gt;
&lt;td width="93" valign="bottom"&gt;&lt;span class="style13"&gt;Suites&lt;/span&gt;
&lt;input name="suites" type="text" class="style20" value="&lt;?php echo $suites; ?&gt;" size="3" maxlength="2"/&gt;&lt;/td&gt;
&lt;td width="235" valign="bottom" class="style13"&gt;Family
&lt;input name="family" type="text" class="style20" value="&lt;?php echo $family; ?&gt;" size="3" maxlength="2"/&gt;&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="style7" &gt;&lt;table width="797" border="0"&gt;
&lt;tr&gt;
&lt;td width="80"&gt;&lt;span class="style13"&gt;Sea View&lt;/span&gt;
&lt;input name="seaview" type="checkbox" value="Y"&lt;?php if($sview == "Y"{echo" CHECKED";} else { echo" UNCHECKED";} ?&gt;/&gt;
&lt;/td&gt;

&lt;td width="97" class="style13"&gt;Garden View
&lt;input name="gview" type="checkbox" value="Y" &lt;?php if($gview == "Y"{echo" CHECKED";} else { echo" UNCHECKED";} ?&gt; /&gt;
&lt;/td&gt;

&lt;td width="72" class="style13"&gt;Fan only
&lt;input type="checkbox" name="fan" &lt;?php if($fan == "Y"{echo" CHECKED";} else { echo" UNCHECKED";} ?&gt; /&gt;
&lt;/td&gt;

&lt;td width="113" class="style13"&gt;Fan and Aircon
&lt;input name="fanAircon" type="checkbox" value="Y"
&lt;?php if($fAircon == "Y"{echo" CHECKED";} else { echo" UNCHECKED";} ?&gt; /&gt;
&lt;/td&gt;

&lt;td width="80" class="style13"&gt;Cliff Type
&lt;input type="checkbox" name="cliff" value="Y" &lt;?php if($clifftype == "Y"{echo" CHECKED";} else { echo" UNCHECKED";} ?&gt;/&gt;
&lt;/td&gt;

&lt;td width="88" class="style13"&gt;Restaurant
&lt;input type="checkbox" name="restaurant" value="Y" &lt;?php if($restaurant == "Y"{echo" CHECKED";} else { echo" UNCHECKED";} ?&gt; /&gt;&lt;/td&gt;

&lt;td width="111" class="style13"&gt;Swimming Pool
&lt;input type="checkbox" name="pool" value="Y" &lt;?php if($spool == "Y"{echo" CHECKED";} else { echo" UNCHECKED";} ?&gt; /&gt;
&lt;/td&gt;

&lt;td width="52"&gt;&lt;span class="style13"&gt;Spa&lt;/span&gt;
&lt;input type="checkbox" name="spa" value="Y" &lt;?php if($spa == "Y"{echo" CHECKED";} else { echo" UNCHECKED";} ?&gt;/&gt;
&lt;/td&gt;

&lt;td width="66" class="style13"&gt;Gym
&lt;input type="checkbox" name="gym" value="Y" &lt;?php if($gym == "Y"{echo" CHECKED";} else { echo" UNCHECKED";} ?&gt; /&gt;
&lt;/td&gt;

&lt;/tr&gt;
&lt;/table&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td &gt;&lt;table width="798" border="0"&gt;
&lt;tr&gt;

&lt;td width="60" class="style8 style9"&gt;Diving
&lt;input name="diving" type="checkbox" value="Y" &lt;?php if($diving == "Y"{echo" CHECKED";} else { echo" UNCHECKED";} ?&gt;/&gt;
&lt;/td&gt;

&lt;td width="52"&gt;&lt;span class="style13"&gt;Golf&lt;/span&gt;
&lt;input name="golf" type="checkbox" value="Y" &lt;?php if($golf == "Y"{echo" CHECKED";} else { echo" UNCHECKED";} ?&gt; /&gt;
&lt;/td&gt;

&lt;td width="118" class="style12"&gt;&lt;span class="style8"&gt;Business Center&lt;/span&gt;
&lt;input type="checkbox" name="bc" value="Y" &lt;?php if($bsnsCenter == "Y"{echo" CHECKED";} else { echo" UNCHECKED";} ?&gt;/&gt;
&lt;/td&gt;

&lt;td width="63" class="style13"&gt;Wi-Fi
&lt;input type="checkbox" name="wifi" value="Y" &lt;?php if($wifi == "Y"{echo" CHECKED";} else { echo" UNCHECKED";} ?&gt;/&gt;
&lt;/td&gt;

&lt;td width="106" class="style13"&gt;Wall Climbing
&lt;input type="checkbox" name="wclimbing" value="Y" &lt;?php if($wclimbing == "Y"{echo" CHECKED";} else { echo" UNCHECKED";} ?&gt;/&gt;
&lt;/td&gt;

&lt;td width="107" class="style13"&gt;Child Facilities
&lt;input type="checkbox" name="child" value="Y" &lt;?php if($cFacilities == "Y"{echo" CHECKED";} else { echo" UNCHECKED";} ?&gt; /&gt;
&lt;/td&gt;

&lt;td width="117" class="style13"&gt;Cold Water Only
&lt;input name="coldwater" type="checkbox" value="Y"&lt;?php if($coldwater == "Y"{echo" CHECKED";} else { echo" UNCHECKED";} ?&gt;/&gt;
&lt;/td&gt;
&lt;td width="141"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td &gt;&lt;table width="799" border="0"&gt;
&lt;tr&gt;
&lt;td width="88" valign="bottom" class="style13"&gt;Price Range&lt;/td&gt;
&lt;td width="293"&gt;&lt;?php
$select = "select * from price";
$query = mysql_query($select);
$rows = mysql_num_rows($query);
echo "&lt;select name = \"priceRange\"&gt;";
for ($i=0; $i&lt;$rows; $i++) {
$rs = mysql_fetch_array($query);
if ($rs["priceRange"] == $priceRange) {
echo "&lt;option value = \"".$rs["priceRange"]. "\" selected = \"selected\"&gt;" .$rs["priceRange"]."&lt;/option&gt;";
}
else {
echo "&lt;option value = \"".$rs["priceRange"]. "\"&gt;" .$rs["priceRange"]."&lt;/option&gt;";
}
}
?&gt; &lt;/td&gt;
&lt;td width="101" valign="bottom" class="style13"&gt;Booking Status&lt;/td&gt;
&lt;td width="299"&gt;&lt;?php
$select = "select * from booking";
$query = mysql_query($select);
$rows = mysql_num_rows($query);
echo "&lt;select name = \"bookingStatus\"&gt;";
for ($i=0; $i&lt;$rows; $i++) {
$rs = mysql_fetch_array($query);
if ($rs["bookingStatus"] == $bookingStatus) {
echo "&lt;option value = \"".$rs["bookingStatus"]. "\" selected = \"selected\"&gt;" .$rs["bookingStatus"]."&lt;/option&gt;";
}
else {
echo "&lt;option value = \"".$rs["bookingStatus"]. "\"&gt;" .$rs["bookingStatus"]."&lt;/option&gt;";
}
}
?&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td &gt;&lt;table width="799" border="0"&gt;
&lt;tr&gt;
&lt;td width="88" valign="bottom"&gt;&lt;span class="style16"&gt;Special Note:&lt;/span&gt;&lt;/td&gt;
&lt;td width="389"&gt;&lt;input name="snote" type="text" class="style20" value="&lt;?php echo $snote; ?&gt;" size="100" maxlength="100" /&gt;&lt;/td&gt;

&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td &gt;&lt;table width="799" border="0"&gt;
&lt;tr&gt;
&lt;td width="78" valign="bottom"&gt;&lt;span class="style13"&gt;Low Season&lt;/span&gt;&lt;/td&gt;
&lt;td width="136"&gt;&lt;input name="lseason" type="text" class="style20" value="&lt;?php echo $lseason; ?&gt;" size="8" maxlength="10" /&gt;
&lt;a href="javascript:showCal('Calendar7')" class="style13 style17"&gt;Select Date&lt;/a&gt;&lt;/td&gt;
&lt;td width="24"&gt;&lt;input name="lseasonprice" type="text" class="style20" value="&lt;?php echo $lseasonprice; ?&gt;" size="4" /&gt;&lt;/td&gt;
&lt;td width="88" valign="bottom" class="style13"&gt;High Season &lt;/td&gt;
&lt;td width="123"&gt;&lt;input name="hseason" type="text" class="style20" value="&lt;?php echo $hseason; ?&gt;" size="5" maxlength="10" /&gt;
&lt;a href="javascript:showCal('Calendar8')" class="style13 style17"&gt;Select Date&lt;/a&gt;&lt;/td&gt;
&lt;td width="24"&gt;&lt;input name="hseasonprice" type="text" class="style20" value="&lt;?php echo $hseasonprice; ?&gt;" size="4" /&gt;&lt;/td&gt;
&lt;td width="80" valign="bottom" class="style13"&gt;Peak Season&lt;/td&gt;
&lt;td width="124"&gt;&lt;input name="pseason" type="text" class="style20" value="&lt;?php echo $pseason; ?&gt;" size="5" maxlength="10" /&gt;
&lt;a href="javascript:showCal('Calendar9')" class="style13 style17"&gt;Select Date&lt;/a&gt;&lt;/td&gt;
&lt;td width="84"&gt;&lt;input name="pseasonprice" type="text" class="style20" value="&lt;?php echo $pseasonprice; ?&gt;" size="4" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td height="47" &gt;&lt;table width="799" border="0"&gt;
&lt;tr&gt;
&lt;td width="156" valign="bottom"&gt;&lt;span class="style13"&gt;Restaurants Located Near&lt;/span&gt;&lt;/td&gt;
&lt;td width="180"&gt; &lt;textarea name="restoNear" class="style20"&gt;&lt;?php echo $restoNear; ?&gt;&lt;/textarea&gt;&lt;/td&gt;
&lt;td width="137" valign="bottom" class="style13"&gt;Resorts Located Near:&lt;/td&gt;
&lt;td width="285" valign="top"&gt;&lt;textarea name="resortNear" class="style20"&gt;&lt;?php echo $resortNear; ?&gt;&lt;/textarea&gt;&lt;/td&gt;
&lt;td width="19"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td &gt;&lt;table width="798" border="0"&gt;
&lt;tr&gt;
&lt;td width="176" valign="bottom" class="style13"&gt;Diving Facilities Located Near&lt;/td&gt;
&lt;td width="164"&gt;&lt;textarea name="divingNear" class="style20"&gt;&lt;?php echo $divingNear; ?&gt;&lt;/textarea&gt;&lt;/td&gt;
&lt;td width="155" valign="bottom" class="style13"&gt;Shopping Located Near&lt;/td&gt;
&lt;td width="206"&gt;&lt;textarea name="shopping" class="style20"&gt;&lt;?php echo $shoppingNear; ?&gt;&lt;/textarea&gt;&lt;/td&gt;
&lt;td width="63"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td &gt;&lt;table width="802" border="0"&gt;
&lt;tr&gt;
&lt;td width="111" valign="bottom" class="style13"&gt;Resort Information&lt;/td&gt;
&lt;td width="161"&gt;&lt;textarea name="resortInfo" rows="3" class="style20"&gt;&lt;?php echo $resortInfo; ?&gt;&lt;/textarea&gt;&lt;/td&gt;
&lt;td width="117" valign="bottom" class="style13"&gt;Resort Testimonials&lt;/td&gt;
&lt;td width="233"&gt;&lt;textarea name="resorTesti" rows="3" class="style20"&gt;&lt;?php echo $resortTesti; ?&gt;&lt;/textarea&gt;&lt;/td&gt;
&lt;td width="158" valign="bottom" class="style13"&gt;Resort&lt;br&gt;
Package Deal&lt;/td&gt;
&lt;td&gt;&lt;textarea name="resortPackage" rows="3" class="style20"&gt;&lt;?php echo $resortPackage; ?&gt;&lt;/textarea&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td &gt;
&lt;table width="809" border="0"&gt;
&lt;tr&gt;
&lt;td width="17"&gt; &lt;?php include("css/ajax.css"; echo '&lt;a class="thumbnail" href="#thumb"&gt;&lt;img src="UploadedImages/'. $row_Recordset1['pictures'] . '" width="85px" height="66px" border="0" /&gt;&lt;span&gt;&lt;img src="UploadedImages/'. $row_Recordset1['pictures'] . '" width="285px" height="266px" /&gt;&lt;/span&gt;&lt;/a&gt;' ?&gt;&lt;/td&gt;
&lt;td width="199" valign="middle"&gt;&lt;input name="pictures" type="file" class="style20" size="15" value="&lt;?php echo $row_Recordset1['pictures'] ?&gt;"/&gt; &lt;?php echo $row_Recordset1['pictures'] ?&gt;&lt;/td&gt;
&lt;td width="21"&gt;
&lt;?php include("css/ajax.css"; echo '&lt;a class="thumbnail" href="#thumb"&gt;&lt;img src="UploadedImages/'. $row_Recordset1['picturesTwo'] . '" width="85px" height="66px" border="0" /&gt;&lt;span&gt;&lt;img src="UploadedImages/'. $row_Recordset1['picturesTwo'] . '" width="285px" height="266px" /&gt;&lt;/span&gt;&lt;/a&gt;' ?&gt;&lt;/td&gt;
&lt;td width="199"&gt;&lt;input name="picturesTwo" type="file" class="style20" size="15" value="&lt;?php echo $picturesTwo; ?&gt;"/&gt; &lt;?php echo $row_Recordset1['picturesTwo'] ?&gt;&lt;/td&gt;

&lt;td width="22"&gt;&lt;?php include("css/ajax.css"; echo '&lt;a class="thumbnail" href="#thumb"&gt;&lt;img src="UploadedImages/'. $row_Recordset1['picturesThree'] . '" width="85px" height="66px" border="0" /&gt;&lt;span&gt;&lt;img src="UploadedImages/'. $row_Recordset1['picturesThree'] . '" width="285px" height="266px" /&gt;&lt;/span&gt;&lt;/a&gt;' ?&gt;&lt;/td&gt;
&lt;td width="264"&gt;&lt;input name="picturesThree" type="file" class="style20" size="15" value="&lt;?php echo $picturesThree; ?&gt;"/&gt;
&lt;?php echo $row_Recordset1['picturesThree'] ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;table width="809" border="0"&gt;
&lt;tr&gt;
&lt;td width="232" align="right"&gt;&lt;?php include("css/ajax.css"; echo '&lt;a class="thumbnail" href="#thumb"&gt;&lt;img src="UploadedImages/'. $row_Recordset1['picturesFour'] . '" width="85px" height="66px" border="0" /&gt;&lt;span&gt;&lt;img src="UploadedImages/'. $row_Recordset1['picturesFour'] . '" width="285px" height="266px" /&gt;&lt;/span&gt;&lt;/a&gt;' ?&gt;&lt;/td&gt;
&lt;td width="223"&gt;&lt;input name="picturesFour" type="file" class="style20" value="&lt;?php echo $picturesFour; ?&gt;"/&gt;
&lt;?php echo $row_Recordset1['picturesFour'] ?&gt;&lt;/td&gt;

&lt;td width="21"&gt;&lt;?php include("css/ajax.css"; echo '&lt;a class="thumbnail" href="#thumb"&gt;&lt;img src="UploadedImages/'. $row_Recordset1['picturesFive'] . '" width="85px" height="66px" border="0" /&gt;&lt;span&gt;&lt;img src="UploadedImages/'. $row_Recordset1['picturesFive'] . '" width="285px" height="266px" /&gt;&lt;/span&gt;&lt;/a&gt;' ?&gt;&lt;/td&gt;
&lt;td width="315"&gt;&lt;input name="picturesFive" type="file" class="style20" value="&lt;?php echo $pictureFive; ?&gt;"/&gt;&lt;br&gt;
&lt;?php echo $row_Recordset1['picturesFive'] ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="center"&gt;&lt;input name="Submit" type="submit" value="Update" /&gt;
&lt;input name="Reset" type="reset" value="Reset" /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;/body&gt;

&lt;/html&gt;

the insert is working perfectLy,i have a noimages.jpg and if you don't upLoad anything, the noimages.jpg will be shown in the thumbnails. now, when i want to update it, for example, i want to upload an image, it won't read the image. it wouLd still be noimages.jpg

and for example, you have uploaded a picture, it works, then if you want to update it, or change the image, it won't read the image that you have uploaded, and it will be noimages.jpg, it's like it doesn't read the update of the image, but the other records or all the textfields are updating, can someone help me please.thanks..


Edited by - dhez on 06 Nov 2007 05:14:41

Edited by - dhez on 06 Nov 2007 06:09:06

Reply to this topic