Jump to content

GrahamBoyd

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

GrahamBoyd's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I forgot to add the php code for uploading the image to the db - $preimage1=$_POST['imagefilesame1'];
  2. Hi everyone, I have a site where people can upload images and data. They can also edit the data and are supposed to be able to delete photos by unticking a checkbox, but it doesn't work - replacing the image works fine, but removing doesn't. Some help would be appreciated. Here is the image code complete - <? if($row_perdtl['imgfile1']!=0){?> <img src="images/thumbs/<?=$row_perdtl['imgfile1']?>" border="0"> <? }else{echo "No image available" ;}?> <input name="imagefilesame1" type="hidden" id="imagefilesame1" value="<?=$row_perdtl['imgfile1']?>"> </td> <td width="48%" height="60" rowspan="2" align="left" valign="middle"> <input name="image_no_change1" type="checkbox" class="textbox" id="image_no_change1" value="1" checked> <span class="table-text2">Select to keep this image or browse for a new image <br> </span> <br> <input name="imgfile1" type="file" class="textbox" id="imgfile1"> </td> Thanks in advance
  3. Problem solved without re-designing the page. Thanks to my friend Kai Schönefeld. Perhaps this might be of use to someone else. The problem lay in the fact that some of the checkboxes were duplicated inside two of the showhides, so the code was passing the value twice when checked and only once when unchecked. When I removed the duplicates it works perfectly.
  4. Thank you for your input jggretton, After looking through all of the code from lots of well-designed php sites I came up with the following: I broke the edit_property_advert_details.php page down into three separate pages, got rid of the showhide code and used - <? if(($propertytype=="1") || (propertytype=='2') || (propertytype=='3') ||(propertytype=='4') || (propertytype=='5') || (propertytype=='6')) include "./edit_building_advert_details.php"; else {include "./edit_land_advert_details.php";} ?> I don't know if this is good php code, but it appears to work and updates the fields .... I'm almost excited that I got something to work for a change. Perhaps you might be able to refine it a little as I am clueless.
  5. Here is the page with all irrelevant stuff and paths to includes removed - most of it is visible from the site using 'view page source' anyway. Hope it helps [attachment deleted by admin]
  6. Hi jggretton, Thank you for your response. It is 'b' unselecting checkboxes does not unselect them in the db They are always visible unless the advertiser changes the property type - hmmm, I can see problems arising in that eventuality.
  7. I should add that the data is sent to the db via php and mySql. The site offers people the ability to upload their own 'property for sale' adverts and then to edit them if they require. The edit page is a clone of the upload page, with the exception that the edit page calls the data from the db into the relevant fields. This all works perfectly, except for deleting discarded data fields via the edit page. Both pages have the same showhides, etc.
  8. I'm having a problem with checkbox data not updating from within javascript showhide tables. The data is incremented not updated. I have multiple options and when the page content is edited, the new values are added but the old ones are still present in the db. If I disable the showhide divisions then the data is updated correctly, but this is not an option as the page becomes very confusing for visitors. Below is the javascript for the showhides - the tags for the showhide tables are - <div id="showhide1" style="display:none"> If anyone can help with this I'll be very grateful, as it has been driving me nuts for days and I've tried everything to make it work. My site was created by a php programmer in Nepal who either can't or won't put it right. I know very little about php myself. <script language=JavaScript> function display(val) { if(val=='') { var value=frmeditpropertyadvert.property_type.options[frmeditpropertyadvert.property_type.options.selectedIndex].value; alert(value); } if(val=='1' || val=='2' || val=='3' || val=='4' || val=='5' || val=='6') { document.getElementById('showhide1').style.display="block"; document.getElementById('showhide3').style.display="block"; } else { document.getElementById('showhide1').style.display="none"; document.getElementById('showhide3').style.display="none"; } if(val=='7') { document.getElementById('showhide2').style.display="block"; } else { document.getElementById('showhide2').style.display="none"; } if(val=='8') { document.getElementById('showhide2b').style.display="block"; } else { document.getElementById('showhide2b').style.display="none"; } if(val=='7' || val=='8') { document.getElementById('showhide4').style.display="block"; } else { document.getElementById('showhide4').style.display="none"; } } </script>
  9. Hi Thorpe, Thanks for your prompt reply. I guessed that the problem lays in the file:///C:/localweb/ URL. Have you any idea about what to do to prevent it happening - where the problem is located? I've compared HTML and PHP files on my various sites and can find no immediate differences that would compel the pages to load as file:///C:/localweb/ instead of http://localhost I'm not a php coder, but understand some of it .. I employed a coder to write the php for me. Any help would be appreciated
  10. I don't know if this is the right forum for this topic. Other places I have searched seem to point to Apache as the problem, but no solutions there. I have seen that other people are also having the same problem. The problem seems to relate to files opening as — file:///C:/localweb/ .... when sent from Dreamweaver 8.0 The first html/php page loads correctly from dreamweaver as processed HTML, a second page linked from either an HTML or php page also loads correctly, but selecting any link from that or subsequent pages displays the full php code instead of processed html layout - so this appears to be a third level or greater problem. If I manually substitute - http://localhost/ — the problem does not arise. This is a problem with version 3 of firefox, all previous versions I used worked fine with both — file:///C:/localweb/ and http://localhost/ Both prefixes also appear with pure HTML sites, but they load and function correctly. Not every php site I have loads with file:///C:/localweb/, so I am wondering if this relates to something in the php code? I use winxp and have xampp installed - everything worked fine until I installed Firefox 3
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.